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

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

Previous topic - Next topic

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: