Disable 'last edit by...' message in posts for administrators?

Started by City Builder, January 29, 2011, 05:41:57 PM

Previous topic - Next topic

City Builder

Hi, I'm running SMF 2.0 RC4 and I'd like to know what I have to change (and where) so that it disables the 'last edit' notification on messages that the administrator edits.

Thanks,


Kays

Hi, see if this works.

In Post.php look for:


// Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])


And replace the second line with


if (!$user_info['is_admin'] && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))


That should hide all admin edits. Including their own posts

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

City Builder


Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods


Doburpally

Quote from: Kays on February 07, 2011, 10:47:10 PM
Hi, see if this works.

In Post.php look for:


// Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])


And replace the second line with


if (!$user_info['is_admin'] && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))


That should hide all admin edits. Including their own posts

Thanks Kays ;)

P.S
I have made this in to a Package installer all credit goes to Kays :)


Doburpally

Quote from: K@ on April 11, 2011, 04:54:46 AM
Why not submit it to the mod site? ;)

Not a bad idea 8)

Quote from: Arantor on April 11, 2011, 05:05:01 AM
(If it is, make sure it's renamed first to not include spaces in the filename.)

The file will be renamed accordingly ;)

I am talking to Kays, It was him that posted the fix, I just incorporated it in to an install package, giving Kays full credit of course :D
One of us will upload it to the mod site :P

Kays

Hi, sorry for the slow response.

If you wish to submit it as a mod, I don't have a problem with it. :)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Sleezy

SMFNew Advocate for SMFNew (Dagger)


Sleezy

No, I am trying to say, how could you submit it, if its just words?
SMFNew Advocate for SMFNew (Dagger)

Illori

it is more then just words, there are code changes as listed above.

Doburpally

Added file to Mods database, it's now awaiting approval.
Mod name = Disable 'last edit by....' for Administrators

later on I'll be adding support for 1.1.11 + ;)

I have found the code and undergoing testing 8)

City Builder

Thanks for turning this into a mod, I lost it with some update to my forum but now it's back in as a mod, love it and find it exceptionally useful since we regularly modify peoples posts to award them awards that we use, and it makes it much nicer not to see that a post has been edited by an admin when we award them an award in the OP on the topic.

Doburpally

Quote from: City Builder on April 17, 2011, 07:37:45 AM
Thanks for turning this into a mod, I lost it with some update to my forum but now it's back in as a mod, love it and find it exceptionally useful since we regularly modify peoples posts to award them awards that we use, and it makes it much nicer not to see that a post has been edited by an admin when we award them an award in the OP on the topic.

No worries bud. I'm glad that you Like it ;)

coldy316

Quote from: Guy with a Colt on April 16, 2011, 09:30:53 PM
Added file to Mods database, it's now awaiting approval.
Mod name = Disable 'last edit by....' for Administrators

later on I'll be adding support for 1.1.11 + ;)

I have found the code and undergoing testing 8)


working perfect and find on 2.0RC5 i would have a preview but adult sites are a no no in smf support

thumbs up on this and thanks for the update on this colt.... thumbs up all the way
Would you believe it that i live in gods country
Australia

Kays

For 1.1.x the second line is slightly different. Use this instead:


if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Doburpally

Quote from: Kays on April 29, 2011, 07:52:30 AM
For 1.1.x the second line is slightly different. Use this instead:


if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))


Cheers for that, I already found it ;) I sifted through the 1.1.13 installer :)

The mod is still awaiting approval  ???
Does it really take forever for a mod to get approved? :o

Doburpally

The mod is accepted and updated, browse here to download the mod :)
It now supports both versions 1.1.xx + 2.0 RCx ;)

Tomcraft

Quote from: Kays on February 07, 2011, 10:47:10 PM
Hi, see if this works.

In Post.php look for:


// Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])


And replace the second line with


if (!$user_info['is_admin'] && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))


That should hide all admin edits. Including their own posts

Hi there,

do you also have a solution for the quick modifybutton?

Regards, Torsten

Kays

Hmm, you should be starting your own topic on this.

However, find:


// Can the user modify the contents of this post?  Show the modify inline image.
if ($message['can_modify'])


And replace it with:


// Can the user modify the contents of this post?  Show the modify inline image.
if ($user_info['is_admin'] && $message['can_modify'])


This way only the admin can see that button.

Is that what you want? And why would you want to do this? ???



If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Tomcraft

I think you misunderstood. ::)

I want to show the buton to all, that's no problem at all, but I don't want to show admin-edits when using the quickmodify button.

I don't think this needs an extra thread... it just fits fine to the topic. ;)

Regards, Torsten

Tomcraft


Tomcraft

I hope it is okay to push the topic after 9 days?  O:)

Regards, Torsten

Kays

Sorry I did misunderstand your question.

It looks like the line which needs to be modified in Post.php appears in two places. Make sure that you edit it in both places. That should do it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Tomcraft


Kays

Cool, that's good to know. :)

@Reaper.CSF. if you're still following this.

It might be an idea to update the mod to reflect this. Since both lines are similar, I think that just repeating the search and replace in the install script should should modify both lines. The same probably applies for the 1.1.x version also.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Sheda

Heya.
Well... i made my own version of "disable 'last edited by' for admins" and i wonder if anyone would like to check it for bugs or tell me what they think of it.
If it turns out good, others might be interested in it, but i don't wanna post code i am not 100% certain about. As it is, it seems to work fine on my site.

It works like this: Instead of hiding the "last edited by" below the post, it doesn't create it to begin with, meaning it doesn't put modified time and name into the database, if you are an admin and checked a box to do so for this specific edit.
Disadvantage is, that you won't be able to recover the edit, or hide one that is already present, so it requires a bit of thinking ahead. If there's more than one admin, this could also lead to confusion as to who modified which post.
Advantage is, you have the choice for every single time you edit on every single post and old edits will stay in place (for example, if the poster of a post you modified modified the post before you).
I also made it work with the quick edit, or rather, the person who did the coding with me did.

So i wonder if posting the code here would be okay, so you can take a look at it.

Shambles

Well I can't speak for the politics of you posting your mod here, but I'd sure be interested, especially if there was a defaulted action on a per-post basis which could be switched off at the post level :)

Sheda

Yay, i knew there were people interested in this!
It's just probably not a good idea for anyone to copy my approach, before it's been verified by an expert. I'm quite the beginner, you know. :)

Branko.

If you are made any useful thing,you can tell to Reaper.CSF. ...it's the right way.  ;)
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Sheda


Branko.

If you're talking about the version published by the Reaper.CSF. then do not hesitate, any suggestion is welcome.Reaper.CSF. is, like most authors (who publish free mods), I believe, positively oriented about it. If this is your version, which is completely different then contact the SMF mod team.
Strong people don't put others down, they lift them up.
A clever person solves a problem. A wise person avoids it.

Sheda

Actually, it's more like a different version that does something very similar. I dunno if i should go for a mod, as i don't know how to make one. But i guess i will go there then. Thanks.

Umm, where do i find them? xD

Leo2

Quote from: Sheda on October 05, 2011, 07:58:22 AM
It works like this: Instead of hiding the "last edited by" below the post, it doesn't create it to begin with, meaning it doesn't put modified time and name into the database, if you are an admin and checked a box to do so for this specific edit.
Disadvantage is, that you won't be able to recover the edit, or hide one that is already present, so it requires a bit of thinking ahead. If there's more than one admin, this could also lead to confusion as to who modified which post.
Advantage is, you have the choice for every single time you edit on every single post and old edits will stay in place (for example, if the poster of a post you modified modified the post before you).
I also made it work with the quick edit, or rather, the person who did the coding with me did.

So i wonder if posting the code here would be okay, so you can take a look at it.
Oh, I wondered why it doesn't remove the Last Edit if it is already there despite checking the 'hide' option.
May be you could add another option "Remove Last Edit from the message" for this mod? This will solve both tasks - keeping old date and removing Admin last edit if he decides to remove it later (like me :) )
The mysql command for removing can be as simple as:
UPDATE `smf_messages` SET `modified_name` = '' WHERE `id_msg` = 'xxx';

Doburpally

Sorry for late reply.

Quote from: Kays on September 02, 2011, 10:20:28 AM
Hmm, you should be starting your own topic on this.

However, find:


// Can the user modify the contents of this post?  Show the modify inline image.
if ($message['can_modify'])


And replace it with:


// Can the user modify the contents of this post?  Show the modify inline image.
if ($user_info['is_admin'] && $message['can_modify'])


This way only the admin can see that button.

Is that what you want? And why would you want to do this? ???




Quote from: Kays on September 15, 2011, 02:30:20 PM
Cool, that's good to know. :)

@Reaper.CSF. if you're still following this.

It might be an idea to update the mod to reflect this. Since both lines are similar, I think that just repeating the search and replace in the install script should should modify both lines. The same probably applies for the 1.1.x version also.

Which file are we talking about?

Is this the code to look for?

Advertisement: