Advertisement:

Author Topic: No Changing Moderator's Edit  (Read 65449 times)

Offline live627

  • Developer
  • SMF Hero
  • *
  • Posts: 5,620
  • Gender: Male
    • live627 on Facebook
    • live627 on GitHub
    • live627 on LinkedIn
    • @live627 on Twitter
    • livemods
No Changing Moderator's Edit
« on: April 06, 2005, 08:32:29 PM »
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
Try not to become a man of success, but rather try to become a man of value.
- Albert Einstein

Offline huijaa

  • Jr. Member
  • **
  • Posts: 119
  • Gender: Male
  • ~Jaap Huijsman~
    • Dovenforum Nederland
Re: No Changing Moderator's Edit
« Reply #1 on: April 07, 2005, 07:10:41 AM »
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 --

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #2 on: April 07, 2005, 10:00:15 AM »
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.

Offline Greybrow

  • Semi-Newbie
  • *
  • Posts: 45
  • Gender: Male
    • Liga Liero
Re: No Changing Moderator's Edit
« Reply #3 on: June 16, 2005, 09:42:35 AM »
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

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #4 on: June 17, 2005, 12:22:38 PM »
I'll look into this and get back to you.

Find:
Code: [Select]
if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit'] && $settings['hide_modEdit']) )
Replace
Code: [Select]
if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit'] && isset($settings['hide_modEdit'])) )
« Last Edit: June 17, 2005, 12:25:52 PM by MikeMill »

Offline LostProphecy

  • Jr. Member
  • **
  • Posts: 381
  • Gender: Female
    • The Lost Prophecy
Re: No Changing Moderator's Edit
« Reply #5 on: June 18, 2005, 02:44:35 AM »
does this work with 1.1. beta 2 or 1.1 beta 3??
Angelus Ex Quo Nox

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #6 on: June 18, 2005, 09:18:52 AM »
Probably note.  I'll try to find some time to make a Beta 3 version this weekend.

Offline Greybrow

  • Semi-Newbie
  • *
  • Posts: 45
  • Gender: Male
    • Liga Liero
Re: No Changing Moderator's Edit
« Reply #7 on: June 20, 2005, 08:59:56 AM »
After modifying the file, I'm gettting same error.
Maybe the problem is with reading the language file?

Offline Fizzy

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,676
  • Gender: Male
  • SMF World Domination
Re: No Changing Moderator's Edit
« Reply #8 on: August 03, 2005, 04:10:37 AM »
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.


Offline Envy

  • Jr. Member
  • **
  • Posts: 128
  • Gender: Female
    • My Blog
Re: No Changing Moderator's Edit
« Reply #9 on: August 26, 2005, 01:09:02 AM »
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  :-\

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #10 on: September 06, 2005, 02:09:45 AM »
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
Find:
// Now try to figure out if the current messages have been mod editted and dump them into a temporary table
	
$result db_query ("
	
	
CREATE TEMPORARY TABLE 
{$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,
	
	
msg.ID_MSG
	
	
FROM 
{$db_prefix}members AS mem, {$db_prefix}messages AS msg
	
	
LEFT JOIN 
{$db_prefix}members AS mem2 ON ( IFNULL(mem2.realName,mem2.memberName) = modifiedName )
	
	
LEFT JOIN 
{$db_prefix}moderators AS mods ON (mem2.ID_MEMBER=mods.ID_MEMBER 
	
	
AND msg.ID_BOARD=mods.ID_BOARD)
	
	
WHERE mem.ID_MEMBER=msg.ID_MEMBER
	
	
"
__FILE____LINE__);
	
if ( 
$result // ok well we got the info lets update it then
	
	
db_query("
	
	
	
UPDATE 
{$db_prefix}messages AS msg 
	
	
	
SET modEdit= (
	
	
	
	
	
SELECT modEdit FROM 
{$db_prefix}NoChangeModEdit AS b 
	
	
	
	
	
WHERE msg.ID_MSG = b.ID_MSG
	
	
	
	
	
)
	
	
	
"
__FILE____LINE__);

and remove it

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #11 on: November 27, 2005, 09:47:29 PM »
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.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,266
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: No Changing Moderator's Edit
« Reply #12 on: November 29, 2005, 01:16:51 AM »
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:

Code: [Select]
if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit']) )
i removed  && $settings['hide_modEdit'] so it looked like
Code: [Select]
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
Support the SMF Support team!
Profiles:
GitHub

Offline ArkServer

  • SMF Hero
  • ******
  • Posts: 1,831
  • My posts are my own
    • BlushyFace | A spoopy and creppy site
Re: No Changing Moderator's Edit
« Reply #13 on: November 29, 2005, 02:42:01 PM »
i like it!

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #14 on: December 01, 2005, 12:14:29 PM »
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.

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: No Changing Moderator's Edit
« Reply #15 on: December 02, 2005, 08:22:33 PM »
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.

Thanks.

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #16 on: December 03, 2005, 12:40:35 AM »
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.

Offline greyknight17

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,890
  • Gender: Male
    • Kevin's Resource Center
Re: No Changing Moderator's Edit
« Reply #17 on: December 03, 2005, 05:52:09 PM »
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

Thanks.

Offline Thantos

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 16,163
  • Gender: Male
Re: No Changing Moderator's Edit
« Reply #18 on: December 03, 2005, 10:42:37 PM »
Correct on all counts.  add_settings.php just makes database changes.  remove_settings.php undoes those changes.

Offline jerm

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,247
Re: No Changing Moderator's Edit
« Reply #19 on: December 08, 2005, 11:27:59 PM »
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 ?