phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Different Edit button for MODs/Admins


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Thu Mar 19, 2009 1:06 pm 
Post subject: Different Edit button for MODs/Admins

Hello again,

On my board users have a limited edit time, but MODs don't. Sometimes a Moderator or myself, the Admin, uses by mistake the edit button instead of the quote button in another user's post. icon_confused.gif

I already moved the Edit button to the far right and the quote button to the far left of the icon row in viewtopic but this is not enough.

I would like to make a different Edit icon that is easier to distinguish from the Quote button and make this Moderator Edit button only show up to Moderators in other user's posts while normal users see the normal Edit button.

Is this very hard to do, does anyone want to help me, pointing me in the right directions to make this MOD?
Or is there an existing MOD out there that does what I ask for?

Greetings.

*A follow-up*

It looks like this is easy, I have been trying something, but, somewhere I have something wrong.

I found in viewtopic.php
Code:
   if ( ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] ) || $is_auth['auth_mod'] )
   {
      $temp_url = append_sid("posting.$phpEx?mode=editpost&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
      $edit_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>';
      $edit = '<a href="' . $temp_url . '">' . $lang['Edit_delete_post'] . '</a>';
   }
   else
   {
      $edit_img = '';
      $edit = '';
   }


I changed this into
Code:
   if (( $userdata['userlevel'] == MOD &&  $is_auth['auth_edit']) || $is_auth['auth_mod'] || $userdata['user_level'] == ADMIN )
   {
      $temp_url = append_sid("posting.$phpEx?mode=editpost&amp;" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
      $edit_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_mod_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>';
      $edit = '<a href="' . $temp_url . '">' . $lang['Edit_delete_post'] . '</a>';
   }
   elseif ( $userdata['user_id'] == $poster_id && $is_auth['auth_edit'] )
   {
      $temp_url = append_sid("posting.$phpEx?mode=editpost&amp;" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
      $edit_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_edit'] . '" alt="' . $lang['Edit_delete_post'] . '" title="' . $lang['Edit_delete_post'] . '" border="0" /></a>';
      $edit = '<a href="' . $temp_url . '">' . $lang['Edit_delete_post'] . '</a>';
   }
   else
   {
      $edit_img = '';
      $edit = '';
   }


In my_template.cfg I added
Code:
$images['icon_mod_edit'] = "$current_template_images/{LANG}/icon_mod_edit.gif";


And I added icon_mod_edit.gif to my_template/images/lang_spanish

I figured this would do the trick, but the only trick it seems to do is to remove the edit icon altogether icon_razz.gif , the alttext for the icon does show up though.

I have tried several minor variations on the same code, to no avail.

Should this work or is there something I'm missing?

*Second follow-up* I hadnt placed the image where I thought I had, now it's in place and the code above is working.

Anybody willing to check if the code I use is correct? icon_wink.gif

_________________
phpBB2 will never die, I hope!
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Thu Mar 19, 2009 7:17 pm 
Post subject: Re: Different Edit button for MODs/Admins

This MOD request has been turned into a MOD release, for further discussions/suggestions please refer to Replace icon_edit.gif for Moderators.

Greetings.

_________________
phpBB2 will never die, I hope!
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0104 seconds using 15 queries. (SQL 0.0025 Parse 0.0005 Other 0.0074)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo