SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

No Changing Moderator's Edit

Started by live627, April 06, 2005, 08:32:29 PM

Previous topic - Next topic


Link to Mod

This modification makes it so that if a moderator or admin was the last person to edit a post then the owner can not
edit the post even if they normally have the rights.

This modification will attempt to retroactivaly determine if a moderator was the last editor.  Note that if a moderator has
changed their name since the time of the edit the modification will fail to retroactivaly mark that post as moderator edited.

All future posts should be marked properly.

With this mod you can choose on a per theme basis to display the modification notice if the last editor was a mod or not


Good idea!....

When moderator or adminstrator changes an user's post,  the poster (a normal member) cannot edit anymore.

Dovenforum Nederland -- a forum for deaf people in the Netherlands --


Since I didn't explain it:
After a moderator or admin edit's the post anyone with the permission modify_any or modify_replies can still change it as I figured only moderators would have those permissions.


I'm having little problems.
Mod works but is giving me errors:

8: Undefined index: hide_modEdit
File: ....../forum/Themes/default/Display.template.php (eval?)
Line: 439

I'm using smf 1.0.4


I'll look into this and get back to you.

if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit'] && $settings['hide_modEdit']) )

if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit'] && isset($settings['hide_modEdit'])) )


does this work with 1.1. beta 2 or 1.1 beta 3??
Angelus Ex Quo Nox


Probably note.  I'll try to find some time to make a Beta 3 version this weekend.


After modifying the file, I'm gettting same error.
Maybe the problem is with reading the language file?


I tried to install this with Package Manager on my 1.0.5 and ended up in a world of pain.

I downloaded the package and clicked to install it, didn't get any error messages.
When I installed it the process stalled and withina few seconds the database became unresponsive.
The process to update the DB then ran amok and sapped up all of the DB resources.
The forum spat error messages saying it couldn't connect to the DB, phpmyadmin refused to allow me to connect to the DB at all.
Eventually I managed to get in to phpmyadmin/processes and found that the edit to the messages table had been running flat out for ages. I tried to kill it in phpmyadmin but it refused to be killed.
I was able to restore my backed up files using ftp but the DB update just refused to be killed for the next 50 minutes.
Eventually I managed to reverse the table edit and remove the mod edit column from the table and the forum then came back online.

I just thought you should be aware.
"Reality is merely an illusion, albeit a very persistent one." - A.E.


I had pretty much the same issue as Fizzy, I tried to install it via the package manager, but when I clicked 'proceed' everything ground to a halt and I had to go in via ftp and remove what files I could to get my site back...

Shame, as this is what I was after  :-\


I'd be willing to bet that its getting hung up when trying to figure out which posts were last editted by a mod.

You can try this:  Open the package up and edit add_settings.php
// Now try to figure out if the current messages have been mod editted and dump them into a temporary table
$result db_query ("
{$db_prefix}NoChangeModEdit SELECT 
IF( !ISNULL(modifiedName) AND (mem.ID_GROUP = 1 OR mem.ID_GROUP = 2 OR !ISNULL(mods.ID_MEMBER)), 1, 0) AS modEdit,
{$db_prefix}members AS mem, {$db_prefix}messages AS msg
{$db_prefix}members AS mem2 ON ( IFNULL(mem2.realName,mem2.memberName) = modifiedName )
{$db_prefix}moderators AS mods ON (mem2.ID_MEMBER=mods.ID_MEMBER 
if ( 
$result // ok well we got the info lets update it then
{$db_prefix}messages AS msg 
SET modEdit= (
{$db_prefix}NoChangeModEdit AS b 

and remove it


Version 0.3 released
Updated for SMF 1.1 RC 1+

I removed the part where it tries to mark the current messages.  It was causing too high of a load.  If it find a good method I'll release a seperate file to do it.


i installed this and i am getting pages of errors. apparently to me the function is undefined

8: Undefined index: hide_modEdit
File: /home/mdccla2/public_html/forums/Themes/helios/Display.template.php (eval?)
Line: 536

noting that i have modifying my Display.template.php so the line number is off

this is what line 536 is on when i download my display.template.php file and go to that line:

if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit']) )

i removed  && $settings['hide_modEdit'] so it looked like
if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit']) )
and the errors stopped and yet it still works.... odd..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ ~ Support the SMF Support team!


I'll look into it SleePy.  The hide_modEdit is just an option to not display the "Editted by" if the editor was a mod.


I'm trying to install this manually on my forum (using a different theme) but have one question.  I edited all those files accordingly, but got stuck when I looked at the add_settings file.  I know they are usually used for the Package Manager install, but don't I have to do those database changes also?  If I need to change it, what and how do I do this?  The install.xml file doesn't mention it and I'm not very database savvy.



add_settings.php is actually really easy to do.  Upload it to your forum root directory and then surf to it.  You should get no output.  Then delete it.


Thanks for the reply MikeMill.

It won't change anything else right as long as I don't upload that xml file also?  Just changes the database?

If I wanted to uninstall it later on, I assume I just need to upload the other file (I think delete_settings.php) to remove the changes made in the database right?

Just want to do this correctly  :D



Correct on all counts.  add_settings.php just makes database changes.  remove_settings.php undoes those changes.


im getting these errors:
8: Undefined index: modEdit
File: /home/egrounds/public_html/forums/Sources/Post.php
Line: 601
8: Undefined index: modEdit
File: /home/egrounds/public_html/forums/Sources/Post.php
Line: 1155

is this part of your mod, or ?