Don't Show Last Edit If Updater Is Admin

Started by 127.0.0.1, September 05, 2004, 05:12:17 PM

Previous topic - Next topic

sawz

Quote from: mab on March 09, 2005, 05:24:59 PM
In post.php, I just made that :

                                                                      FIND :
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


                                                                      REPLACE WITH :
// Just add if (!$user_info['is_admin'])

if (!$user_info['is_admin'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();



and it seems working.


ex :
a post has been written by Cain (the test user)

if admin edit the post, nothing appears
if Cain edit the post :  « Last Edit: xxxxxxxx XX, 200X, HH:MM:SS by Cain »
if Cain edit the post twice, the date/time is updates
if admin edit the post, nothing change.

So with this hack, all rules are complied.


What do you think about ?

this worked for me :)
keep smiling, they'll always wonder what your up too.....

FBI

if (!$user_info['is_admin'])

Its works for my forum with Simplicity Themes :)
Thanks..

Vinspire

#42
Tried all the codes that is provided in this thread but none of it working.  :'( :'( :'(

I am using SMF 1.1 RC 2  :'( :'( :'(

And what if the forum got founder, admin & global mods that i want them to have this function ?

sawz

all your doing is adding 1 line of code to Post.php

if (!$user_info['is_admin'])

add that where its saying, right before

// Have admins allowed people to hide their screwups?

keep smiling, they'll always wonder what your up too.....

Vinspire

Quote from: sawz on May 14, 2006, 02:19:27 PM
all your doing is adding 1 line of code to Post.php

if (!$user_info['is_admin'])

add that where its saying, right before

// Have admins allowed people to hide their screwups?

Did that. Even tried Bliss code but none of it working.  :'( :'( :'(

sawz

it won't remove old edited by messages, those will remain.
keep smiling, they'll always wonder what your up too.....

Vinspire

Quote from: sawz on May 14, 2006, 02:39:20 PM
it won't remove old edited by messages, those will remain.

Hmm ... I c. Then I think i did actually get it to work coz i notice the time different but though it was just a forum error. Will try it out again. Thanks :)

Vinspire

Quote from: sawz on May 14, 2006, 02:39:20 PM
it won't remove old edited by messages, those will remain.

Followed Bliss code and its working fine now.

Ermmm ... Another question is. If my global mods edit the text ... will the "edit notice" came out ?

sawz

i was wondering the same thing, you'll probaby have to
add a line of code for them too. let us know how it works out.
keep smiling, they'll always wonder what your up too.....

mark25

it works for me.. but i hope on the next release, there would be a button if you want to see last edit when you edit post..  ;)

Vinspire

Quote from: Elijah Bliss on September 08, 2004, 03:18:14 PM
Quote from: Bloc on September 08, 2004, 01:50:18 PM
You could just change the Display.template.php file, but then you will not see your own edits. And you have to do it on every theme.

Just find this in Display.template.php:
                // Show "« Last Edit: Time by Person »" if this post was edited.
                if ($settings['show_modify'] && !empty($message['modified']['name']))


and replace with

                // Show "« Last Edit: Time by Person »" if this post was edited.
                if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)


Now this mod worked but in reverse, the admin can't see his/hers "Last Edits" but everyone else can.




I just changed this from:
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)

to

if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=0)

and it worked.

I just upgrade my forum board to RC3 and did this edit .... till today only i noticed i fall for this trick.

I thought i can't see the "edited by : " and all my forummers can't see it too  :D

truelight5

I am using RC3 and was wondering which code will work for this feature with my post.php.

The code that is being changed is not like any listed here:

Quote// Have admins allowed people to hide their screwups?
      if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
      {
         $msgOptions['modify_time'] = time();
         $msgOptions['modify_name'] = addslashes($user_info['name']);
      }

Thanks in advance to anyone who can offer some assistance!

Blessings!
Susie

Vinspire

Quote from: mab on March 09, 2005, 05:24:59 PM
In post.php, I just made that :

                                                                      FIND :
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


                                                                      REPLACE WITH :
// Just add if (!$user_info['is_admin'])

if (!$user_info['is_admin'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();



and it seems working.


ex :
a post has been written by Cain (the test user)

if admin edit the post, nothing appears
if Cain edit the post :  « Last Edit: xxxxxxxx XX, 200X, HH:MM:SS by Cain »
if Cain edit the post twice, the date/time is updates
if admin edit the post, nothing change.

So with this hack, all rules are complied.


What do you think about ?

This is my favourite code  :D ;D

Thanks.

truelight5

I swear I feel so dumb...of course...there is the line.  I don't know why when I kept looking at it before it didn't look right for some reason...  :P  I think I need to take a break lol

Thanks for the repost...for some reason it "clicked" and I see it now...

Blessings!
Susie

MarkoWeb


bcswebco.com

Quote from: Marko_ on December 13, 2006, 12:32:43 PM
What about 1.1? please!

Thank you!

Same modification to 1.1 and 1.1.1 in Post.php

Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.

Hadi

#56
which modifecation we are talking here?

do you mean this:


Quote from: bcswebco.com on January 02, 2007, 10:49:49 AM
Quote from: Marko_ on December 13, 2006, 12:32:43 PM
What about 1.1? please!

Thank you!




Same modification to 1.1 and 1.1.1 in Post.php

Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.
Quote from: Vinspire on October 09, 2006, 05:51:14 PM
Quote from: mab on March 09, 2005, 05:24:59 PM
In post.php, I just made that :

                                                                      FIND :
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


                                                                      REPLACE WITH :
// Just add if (!$user_info['is_admin'])

if (!$user_info['is_admin'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();



and it seems working.


ex :
a post has been written by Cain (the test user)

if admin edit the post, nothing appears
if Cain edit the post :  « Last Edit: xxxxxxxx XX, 200X, HH:MM:SS by Cain »
if Cain edit the post twice, the date/time is updates
if admin edit the post, nothing change.

So with this hack, all rules are complied.


What do you think about ?

This is my favourite code  :D ;D

Thanks.

symon

Quote from: bcswebco.com on January 02, 2007, 10:49:49 AM
Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.

I was just about to post and say this works but not on admin's own posts. But then I read this quoted post and realised I'd used the quick edit.

Can we get a similar tweak that also does the quick edit? :D

ssnickerer

Hey everyone. Sorry to bother, but I'm a bit confused by what's happened here. Can someone distill all that to tell me what find/replace I should do to implement this mod on 1.1.2? Thanks!!

TrueSatan

Go to your Sources directory...find Post.php...in it find // Have admins allowed people to hide their screwups?

above that add if (!$user_info['is_admin'])

...and that's it.

Advertisement: