Advertisement:

Author Topic: Disable 'last edit by...' message in posts for administrators?  (Read 15400 times)

Offline Doburpally

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #20 on: May 12, 2011, 09:46:49 AM »
The mod is accepted and updated, browse here to download the mod :)
It now supports both versions 1.1.xx + 2.0 RCx ;)

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 121
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #21 on: September 01, 2011, 10:13:44 AM »
Hi, see if this works.

In Post.php look for:

Code: [Select]
// 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

Code: [Select]
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

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #22 on: September 02, 2011, 10:20:28 AM »
Hmm, you should be starting your own topic on this.

However, find:

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

And replace it with:

Code: [Select]
// 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

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 121
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #23 on: September 02, 2011, 03:56:16 PM »
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

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 121
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #24 on: September 06, 2011, 07:12:56 PM »
No idea anyone? ???

Regards, Torsten

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 121
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #25 on: September 14, 2011, 07:05:51 PM »
I hope it is okay to push the topic after 9 days?  O:)

Regards, Torsten

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #26 on: September 15, 2011, 11:35:04 AM »
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

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 121
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #27 on: September 15, 2011, 12:09:30 PM »
That's it! Thanks a lot!  :)

Regards, Torsten

Offline Kays

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,973
  • Gender: Male
    • Kayssplace
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #28 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.

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

Offline Sheda

  • Semi-Newbie
  • *
  • Posts: 87
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #29 on: October 05, 2011, 07:58:22 AM »
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.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 5,189
  • Gender: Male
    • i30 Owners Club
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #30 on: October 05, 2011, 08:04:23 AM »
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 :)

Offline Sheda

  • Semi-Newbie
  • *
  • Posts: 87
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #31 on: October 05, 2011, 05:56:06 PM »
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. :)

Offline Branko.

  • SMF Hero
  • ******
  • Posts: 3,330
  • Gender: Male
  • U zemlji slijepih, jednooki je kralj
    • SATForum
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #32 on: October 05, 2011, 07:24:20 PM »
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.

Offline Sheda

  • Semi-Newbie
  • *
  • Posts: 87
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #33 on: October 06, 2011, 11:56:45 AM »
Hm... should i? I don't wanna annoy him or something...

Offline Branko.

  • SMF Hero
  • ******
  • Posts: 3,330
  • Gender: Male
  • U zemlji slijepih, jednooki je kralj
    • SATForum
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #34 on: October 06, 2011, 01:07:49 PM »
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.

Offline Sheda

  • Semi-Newbie
  • *
  • Posts: 87
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #35 on: October 06, 2011, 01:52:40 PM »
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
« Last Edit: October 06, 2011, 03:06:05 PM by Sheda »

Offline Leo2

  • Semi-Newbie
  • *
  • Posts: 19
  • Gender: Male
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #36 on: December 17, 2011, 07:16:39 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:
Code: [Select]
UPDATE `smf_messages` SET `modified_name` = '' WHERE `id_msg` = 'xxx';
« Last Edit: December 17, 2011, 07:27:01 AM by Leo2 »

Offline Doburpally

  • Jr. Member
  • **
  • Posts: 151
  • Gender: Male
Re: Disable 'last edit by...' message in posts for administrators?
« Reply #37 on: February 15, 2012, 11:34:40 AM »
Sorry for late reply.

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

However, find:

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

And replace it with:

Code: [Select]
// 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? ???




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?