Neuigkeiten:

Want to get involved in developing SMF, then why not lend a hand on our github!

Hauptmenü
Advertisement:

Don't Show Last Edit If Updater Is Admin

Begonnen von 127.0.0.1, September 05, 2004, 05:12:17 NACHMITTAGS

Vorheriges Thema - Nächstes Thema

sawz

Zitat von: mab in März 09, 2005, 05:24:59 NACHMITTAGS
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

Zitat von: sawz in Mai 14, 2006, 02:19:27 NACHMITTAGS
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

Zitat von: sawz in Mai 14, 2006, 02:39:20 NACHMITTAGS
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

Zitat von: sawz in Mai 14, 2006, 02:39:20 NACHMITTAGS
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

Zitat von: Elijah Bliss in September 08, 2004, 03:18:14 NACHMITTAGS
Zitat von: Bloc in September 08, 2004, 01:50:18 NACHMITTAGS
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:

Zitat// 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

Zitat von: mab in März 09, 2005, 05:24:59 NACHMITTAGS
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

Zitat von: Marko_ in Dezember 13, 2006, 12:32:43 NACHMITTAGS
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:


Zitat von: bcswebco.com in Januar 02, 2007, 10:49:49 VORMITTAG
Zitat von: Marko_ in Dezember 13, 2006, 12:32:43 NACHMITTAGS
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.
Zitat von: Vinspire in Oktober 09, 2006, 05:51:14 NACHMITTAGS
Zitat von: mab in März 09, 2005, 05:24:59 NACHMITTAGS
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

Zitat von: bcswebco.com in Januar 02, 2007, 10:49:49 VORMITTAG
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: