Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: live627 on April 06, 2005, 08:32:29 PM

Title: No Changing Moderator's Edit
Post by: live627 on April 06, 2005, 08:32:29 PM
Link to Mod (http://mods.simplemachines.org/index.php?mod=117)

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
Title: Re: No Changing Moderator's Edit
Post by: huijaa 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.

Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: Greybrow 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
Title: Re: No Changing Moderator's Edit
Post by: Thantos on June 17, 2005, 12:22:38 PM
I'll look into this and get back to you.

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

Replace
if ($settings['show_modify'] && !empty($message['modified']['name']) && !($message['modEdit'] && isset($settings['hide_modEdit'])) )
Title: Re: No Changing Moderator's Edit
Post by: LostProphecy on June 18, 2005, 02:44:35 AM
does this work with 1.1. beta 2 or 1.1 beta 3??
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: Greybrow 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?
Title: Re: No Changing Moderator's Edit
Post by: Fizzy 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.
Title: Re: No Changing Moderator's Edit
Post by: Envy 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  :-\
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: SleePy 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:

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..
Title: Re: No Changing Moderator's Edit
Post by: ArkServer on November 29, 2005, 02:42:01 PM
i like it!
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: greyknight17 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.
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: greyknight17 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.
Title: Re: No Changing Moderator's Edit
Post by: Thantos 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.
Title: Re: No Changing Moderator's Edit
Post by: jerm 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 ?
Title: Re: No Changing Moderator's Edit
Post by: Thantos on December 08, 2005, 11:29:57 PM
yeah it is.  Hmmm let me take a look at it, I may not be using isset()

Edit:
I think I found the problem but I don't have time to check it.  Can you try making these changes to Post.php and letting me know if the error goes away?

<operation>
<search><![CDATA[
t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER, m.posterTime]]></search>
<add><![CDATA[, m.modEdit]]></add>
</operation>
<operation>
<search><![CDATA[
t.ID_FIRST_MSG, t.locked, t.isSticky, t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER]]></search>
<add><![CDATA[, m.modEdit]]></add>
</operation>
Title: Re: No Changing Moderator's Edit
Post by: jerm on December 08, 2005, 11:53:02 PM
is this in post.php?
<operation>
<search><![CDATA[
t.ID_FIRST_MSG, t.locked, t.isSticky, t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER]]></search>
<add><![CDATA[, m.modEdit]]></add>
</operation>
Title: Re: No Changing Moderator's Edit
Post by: Thantos on December 09, 2005, 12:04:45 AM
sorry about that..

In Post.php
search for t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER, m.posterTime and add after that , m.modEdit
then search for t.ID_FIRST_MSG, t.locked, t.isSticky, t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER and add after that , m.modEdit
Title: Re: No Changing Moderator's Edit
Post by: jerm on December 09, 2005, 12:09:02 AM
Quote from: MikeMill on December 09, 2005, 12:04:45 AM
sorry about that..

In Post.php
then search for t.ID_FIRST_MSG, t.locked, t.isSticky, t.ID_MEMBER_STARTED AS ID_MEMBER_POSTER and add after that , m.modEdit
ya, thats what i dont have..
   <id>MikeMill:NoChangeModEdit</id>
   <version>0.3</version>
Title: Re: No Changing Moderator's Edit
Post by: jerm on January 05, 2006, 12:45:07 PM
there a chance this mod will be updated to 1.1RC2?
Title: Re: No Changing Moderator's Edit
Post by: spiros on February 25, 2006, 02:06:47 AM
Which version should I install for SMF 1.0?
Title: Re: No Changing Moderator's Edit
Post by: Dr. Jones on March 27, 2006, 12:10:23 AM
I'm using 1.0.6 and would love to use this, but I don't see support for that version and am hesitant to give it a shot.  Is it functional as-is for 1.0.6 or should I make any of the above-mentioned tweaks first, or should I just not use it?
Title: Re: No Changing Moderator's Edit
Post by: Dr. Jones on April 03, 2006, 10:18:17 AM
i've updated to 1.0.7 now... tried to give it a spin but it doesn't seem to work.  any ideas?
Title: Re: No Changing Moderator's Edit
Post by: URPG on April 05, 2006, 06:36:51 PM
Trying to install 0-3 in SMF1.1RC2+MKP1.1RC1 with some other minor mods installed (more tags, etc.) i get:

1024: Undefined XML element: search from /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php on line 1409
File: /hp/aa/ae/eq/www/urpg/smf/Sources/Subs-Package.php
Line: 2791


How do I install by hand? I'd like the Package Manager to work with it so i can easilie deinstall it... It sounds very usefule, but who knows...
Title: Re: No Changing Moderator's Edit
Post by: RBH on April 12, 2006, 12:48:35 AM
    still nothing for rc2? this should be an standard feature of the forum itself.
Title: Re: No Changing Moderator's Edit
Post by: ivo2296 on April 12, 2006, 11:24:28 AM
Quote from: Dr. Jones on April 03, 2006, 10:18:17 AM
i've updated to 1.0.7 now... tried to give it a spin but it doesn't seem to work.  any ideas?

Which file is for 1.0.7?
Title: Re: No Changing Moderator's Edit
Post by: Dr. Jones on April 12, 2006, 12:54:19 PM
Quote from: ivo2296 on April 12, 2006, 11:24:28 AM
Quote from: Dr. Jones on April 03, 2006, 10:18:17 AM
i've updated to 1.0.7 now... tried to give it a spin but it doesn't seem to work.  any ideas?

Which file is for 1.0.7?

There isn't one.  I tried to hack it (edit package-info.xml and change the version number) but that didn't work.  I'm not terribly knowledgeable about modding so I gave up after that rather than trying to keep going and risk fubaring my forums ;)
Title: Re: No Changing Moderator's Edit
Post by: ivo2296 on April 13, 2006, 03:25:51 PM
Quote from: Dr. Jones on April 12, 2006, 12:54:19 PM
Quote from: ivo2296 on April 12, 2006, 11:24:28 AM
Quote from: Dr. Jones on April 03, 2006, 10:18:17 AM
i've updated to 1.0.7 now... tried to give it a spin but it doesn't seem to work.  any ideas?

Which file is for 1.0.7?

There isn't one.  I tried to hack it (edit package-info.xml and change the version number) but that didn't work.  I'm not terribly knowledgeable about modding so I gave up after that rather than trying to keep going and risk fubaring my forums ;)

I'll give try to implement it this week. It easy for new smf 1.0.* installations but mine forum is too much modified that's why i need more spear time.
Title: Re: No Changing Moderator's Edit
Post by: ivo2296 on May 28, 2006, 10:25:00 PM
I try to edit all manually for smf 1.0.7 and i have only one problem - missing code to be found in Subs-Post.php :

<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="before"><![CDATA[
if (isset($posterOptions['name']))
$messages_columns[] = "posterName = '$posterOptions[name]'";]]></search>
<add><![CDATA[
$messages_columns[] = "modEdit=$msgOptions[modEdit]";]]></add>
</operation>
</file>




For all other files everything is OK.
Title: Re: No Changing Moderator's Edit
Post by: PrizeLive.com on July 08, 2006, 06:59:53 PM
Is this available for version 1.1 RC2?
Title: Re: No Changing Moderator's Edit
Post by: PrizeLive.com on July 12, 2006, 10:31:59 AM
Can someone make this for version 1.1 rc2?
Title: Re: No Changing Moderator's Edit
Post by: PrizeLive.com on July 13, 2006, 09:58:40 AM
Quote from: RBH on April 12, 2006, 12:48:35 AM
    still nothing for rc2? this should be an standard feature of the forum itself.

Anything yet?
Title: Re: No Changing Moderator's Edit
Post by: RebelRose on July 22, 2006, 11:10:51 AM
Will this be made to work with SMF 1.1 RC 2 or does it work now with it?
Title: Re: No Changing Moderator's Edit
Post by: PrizeLive.com on July 28, 2006, 03:16:55 PM
BUMP!

Available for 1.1 RC2?
Title: Re: No Changing Moderator's Edit
Post by: ivo2296 on July 28, 2006, 10:26:32 PM
This option should be a basic function in all versions of SMF. What's the point a moderator to edit a post and after that the user to re-edit it?!? I'm not talking for the case when we have a locked topic.
Title: Re: No Changing Moderator's Edit
Post by: fritpa on July 29, 2006, 07:35:09 PM
Not for be annoying only for show the interest :D, i would like this work with RC2 please.

Thank you.
Title: Re: No Changing Moderator's Edit
Post by: denislici on July 30, 2006, 07:54:49 AM


yeah it will be cool.... for rc2
Title: Re: No Changing Moderator's Edit
Post by: GJ-tje on August 05, 2006, 01:47:48 PM
I also would like a 1.1RC2 compatible version for this! :D
Title: Re: No Changing Moderator's Edit
Post by: URPG on September 10, 2006, 07:55:03 AM
reading the last posts... LOL

*ping*

Does it work for RC3?
Title: Re: No Changing Moderator's Edit
Post by: Col on September 13, 2006, 11:09:53 AM
I think Thantos is ignoring the thread! :D

I've only just come across this mod; I'd install it too if an R3 version were available. And to mirror what another post remarked: this should be standard feature.
Title: Re: No Changing Moderator's Edit
Post by: Skipdawg on September 13, 2006, 01:33:37 PM
Maybe it will be updated for 1.1 final (gold)
Title: Re: No Changing Moderator's Edit
Post by: junglecat on November 23, 2006, 01:52:59 PM
Quote from: URPG on September 10, 2006, 07:55:03 AM
reading the last posts... LOL

*ping*

Does it work for RC3?

I want to know this too. I need it for RC3.
Title: Re: No Changing Moderator's Edit
Post by: cjbailey1 on January 02, 2007, 03:11:39 PM
I wanted this for my forum, so I hacked it to work for 1.1.1.  It may work on RC3, but it may not.  I guess it should work for 1.1.  Here is my hack: http://www.andsum.be/SMFMods/modEdit_0-3-CJB.zip
(standard disclaimers apply)


Feel free to try this one out, although I'm getting some errors I haven't noticed before and I haven't traced which mod they are from yet!


The errors seem to disappear when I tick and save, then untick and save again the 'Hide last modification date on modified posts if the editor was a moderator or admin?' on the 'Current Theme' admin area.  Seems to all be working.

Excellent mod Thantos!

Regards,
    Chris
Title: Re: No Changing Moderator's Edit
Post by: perplexed on January 23, 2007, 01:04:13 PM
Anyone updating this for 1.1.1?

~thanks
Title: Re: No Changing Moderator's Edit
Post by: 0uK^- on February 19, 2007, 01:37:00 AM
update??
Title: Re: No Changing Moderator's Edit
Post by: Col on February 19, 2007, 10:38:59 AM
This really should be a core function. It makes no sense that a post can be again edited by the poster AFTER it has been moderated.

Anyway, Thantos, any chance of this being updated for 1.1.2? ;)
Title: Re: No Changing Moderator's Edit
Post by: Skipdawg on February 25, 2007, 06:47:19 PM
Friendly "Bump"  ;)
Title: Re: No Changing Moderator's Edit
Post by: Markco on April 04, 2007, 04:11:39 AM
Update please for 1.1.2
Thank's
Title: Re: No Changing Moderator's Edit
Post by: Alpay on April 12, 2007, 09:03:06 AM
Update please for 1.1.2
Thank's
Title: Re: No Changing Moderator's Edit
Post by: Thantos on April 17, 2007, 01:18:45 PM
I am no longer able to keep my mods up to date since I'd rather spend the time I have on developing SMF.  As such the following mods are up for the taking.  I give my permission to update and/or modify and restribute under your name this mod.  All I request is that you let the Customization Team know if / when you post a new version of the mod so that they can remove my version.  thanks.
Title: Re: No Changing Moderator's Edit
Post by: Col on April 18, 2007, 09:29:33 AM
Hi Thantos,

What are the chances of this mod becoming part of the core?
Title: Re: No Changing Moderator's Edit
Post by: Thantos on April 18, 2007, 09:31:53 AM
No plans to add it.
Title: Re: No Changing Moderator's Edit
Post by: ivo2296 on May 28, 2007, 07:19:13 PM
Quote from: Thantos on April 18, 2007, 09:31:53 AM
No plans to add it.

But i think there is no sense if users can re-edit moderators, sometimes deleting a post isn't the best way for some situations. 
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 07, 2007, 11:41:34 PM
has someone already picked this mod up for updating?? ::)

I hope so :-\
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 10, 2007, 05:18:07 PM
if only your moderators and administrators can lock topics and you do not mind that the name of the moderator stays you could use this code

search in display.template.php for
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



and replace it with
// Can the user modify the contents of this post?
if (($context['can_lock']) && ($message['modified']['name']['can_lock']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';
elseif ($message['can_modify'] && ($message['modified']['name']) == ($context['user']['name']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';
elseif ($message['can_modify'] && empty($message['modified']['name']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';


it does the job for me. futher support i cant give.
Title: Re: No Changing Moderator's Edit
Post by: Col on June 10, 2007, 07:44:00 PM
I'll give that a go. :)
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 11, 2007, 06:00:02 AM
Quote from: Col on June 10, 2007, 07:44:00 PM
I'll give that a go. :)

im curious, did it do the job with you as well??  :)
Title: Re: No Changing Moderator's Edit
Post by: Col on June 11, 2007, 10:11:54 AM
Hi,

OK, I've just installed your code, made a few tests, and it all seems fine. This seems like really easy code to keep on top of with template upgrades. I guess the downside will be for unusual forum setups where groups other than moderators or admins can lock threads. It works for me though. :)
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 11, 2007, 12:06:19 PM
great  :D

and indeed for those who have users lock topics have to find a function that only admin and moderaters can do and replace the ['can_lock'] code  8)
Title: Re: No Changing Moderator's Edit
Post by: Col on June 17, 2007, 04:11:39 PM
Hi vosje,

I've found a problem - this throws up loads of errors each time any moderator views a thread:

Quote8: Uninitialized string offset: 0
File: /home/xxxxx/public_html/forum/Themes/New template/shout.template.php (main sub template - eval?)
Line: 398

I'm going to have to remove this mod, otherwise it makes the error log unusable.

Do you have a solution?
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 17, 2007, 07:27:40 PM
hey col,

no i dont have the solution right a way.

but some questions :

do you only have it with shout or more?
do you have installed the mod itself too or just the lines i added?

hope to hear it from ya
Title: Re: No Changing Moderator's Edit
Post by: Col on June 17, 2007, 07:53:01 PM
Hi,

From what I understand, the error messages can be misleading. I first looked to the Shoutbox template, but that doesn't have enough lines for the error to make sense. Only by checking the other files in my own modified template did I find the problem - the error line number was exactly where I'd added your code. The errors were only created when myself or another moderator viewed a thread - ordinary members did not trigger the error. The error was consistent. The errors stopped as soon as I changed the code back to the original.

I did/do not have the mod installed; I used only your code.

Hope that helps.
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 19, 2007, 04:19:20 AM
ok here is what i have :hope you can do anything with this info
Title: Re: No Changing Moderator's Edit
Post by: Col on June 19, 2007, 10:13:10 AM
Hi,

I'll add your code to another template (one without the shoutbox) to test it. ;)
Title: Re: No Changing Moderator's Edit
Post by: Col on June 19, 2007, 10:27:01 AM
Hmmm. I made a copy of the default theme, added your code, and the errors do not appear. If I post my Shoutbox template file, would you care to look at it?
Title: Re: No Changing Moderator's Edit
Post by: Col on June 19, 2007, 10:31:51 AM
Quote from: vosje505 on June 19, 2007, 04:19:20 AM
ok here is what i have :
  • I do not have shoutbox installed (and cant test your error because of that)
  • I do have the mod installed before adding the code
  • I don't have the error
hope you can do anything with this info

Is that a typo? You have the mod installed? I thoughyt your code did away with using the mod code! ??? It worked for me without the mod code (apart from the errors), and the errors disappeared with the default template.
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 19, 2007, 05:32:06 PM
haha no it's not a typo. I've installed it and after that i made the code and was too lazy to remove it again.
since it doesn't trouble each other I left it.

but you did tried the code in the default and there was everthing ok?  :o
strange but usefull
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on June 19, 2007, 05:33:14 PM
Quote from: Col on June 19, 2007, 10:27:01 AM
Hmmm. I made a copy of the default theme, added your code, and the errors do not appear. If I post my Shoutbox template file, would you care to look at it?

i would like to try to. but can't promise if there will come a solution, but trying never hurts ;)
Title: Re: No Changing Moderator's Edit
Post by: Col on June 19, 2007, 08:12:01 PM
Hi vosje505,

Thanks.

I did make some small chnages to the shoutbox template, so it is worth me posting that rather than you looking at the one that comes with the Ultimate Shoutbox mod.
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on July 15, 2007, 10:02:42 AM
i've looked into it and i couldnt find it.
but i'm not a codingmiracle myself maybe someone else would like to take a look at it and maybe find it.

i'm sorry col
Title: Re: No Changing Moderator's Edit
Post by: flame baiter on July 21, 2007, 12:09:23 PM
So does this mod work with SMF 1.1.3 or not?
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on July 21, 2007, 12:17:02 PM
the mod partial and the code does work in 1.1.3

Quote from: vosje505 on June 10, 2007, 05:18:07 PM
if only your moderators and administrators can lock topics and you do not mind that the name of the moderator stays you could use this code

search in display.template.php for
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



and replace it with
// Can the user modify the contents of this post?
if (($context['can_lock']) && ($message['modified']['name']['can_lock']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';
elseif ($message['can_modify'] && ($message['modified']['name']) == ($context['user']['name']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';
elseif ($message['can_modify'] && empty($message['modified']['name']))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';


it does the job for me. futher support i cant give.

note : this code only works if only the moderators can lock topics
Title: Re: No Changing Moderator's Edit
Post by: askepott on July 21, 2007, 02:31:31 PM
is this working well on 1.1.3? I would like to give a try if so :)
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on July 21, 2007, 02:56:35 PM
depends on what you exactly want and how the premissions are set up.

but im working with 1.1.3 and it works for me 8) ;D
Title: Re: No Changing Moderator's Edit
Post by: flame baiter on July 21, 2007, 06:55:23 PM
What I want?

Quoteif 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.

That's all I want...   ;)
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on July 21, 2007, 07:23:00 PM
if your members cant lock topics themself the code will do the job for you ;D
Title: Re: No Changing Moderator's Edit
Post by: askepott on July 23, 2007, 10:15:41 AM
sweet.
i'll give a try :)
Title: Re: No Changing Moderator's Edit
Post by: ragots on September 16, 2007, 06:27:19 AM
it works for me. And i'm on 1.1 RC3.
Thanks vosje505
Title: Re: No Changing Moderator's Edit
Post by: vosje505 on September 18, 2007, 05:23:03 PM
Quote from: ragots on September 16, 2007, 06:27:19 AM
it works for me. And i'm on 1.1 RC3.
Thanks vosje505
Glad to hear that  :D

glad to be of assist to you
Title: Re: No Changing Moderator's Edit
Post by: King Steph1 on October 09, 2007, 06:23:41 PM
I'm using SMF 1.1.4 and it doesn't work with me..

Edit: It works now :P

But I was wondering if there's any way to make the message still editable by guests, just not the text the moderator added..?
Title: Re: No Changing Moderator's Edit
Post by: xXxMetaSoulxXx on October 11, 2007, 03:53:28 AM
I was going to install this mod for SMF 1.1.4, but I get this error:

1.     Execute Code     add_settings.php     
2.    Execute Modification    ./Sources/Display.php    Test failed
3.    Execute Modification    ./Themes/default/Settings.template.php    Test successful
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
5.    Execute Modification    ./Themes/default/Display.template.php    Test successful
6.    Execute Modification    ./Sources/Post.php    Test failed
7.    Execute Modification    ./Sources/Subs-Post.php    Test successful
Title: Re: No Changing Moderator's Edit
Post by: TrueSatan on October 11, 2007, 04:30:16 AM
Errors like those simply tell you that another mod you have already installed has edited the files in question and so this mod can't do an automatic installation...you need to do a manual installation instead.

Please read:

http://docs.simplemachines.org/index.php?topic=402.msg531#msg531 (http://docs.simplemachines.org/index.php?topic=402.msg531#msg531)

http://www.simplemachines.org/community/index.php?topic=34526.0 (http://www.simplemachines.org/community/index.php?topic=34526.0)

The following may also prove helpful:

http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)

Mirror of the last link:

http://www.smfhacks.com/smf-package-parser.html (http://www.smfhacks.com/smf-package-parser.html)
Title: Re: No Changing Moderator's Edit
Post by: miseryshining on October 15, 2007, 11:39:18 AM
Quote from: TrueSatan on October 11, 2007, 04:30:16 AM
Errors like those simply tell you that another mod you have already installed has edited the files in question and so this mod can't do an automatic installation...you need to do a manual installation instead.

or it simply means the mod was broken in the first place ;-)

There was an endtag missing, and one of the queries is changed in latest SMF + some other changes. Besides that, it didn't get the mod-edit value from the messages table, which means that anyone was still able to modify posts.

Attached is a fixed version, for testing.
Title: Re: No Changing Moderator's Edit
Post by: DeMar on December 01, 2007, 02:38:13 AM
is there a way with this mod to block moderator to change admins post lock?
So if a admin lock a post, no one moderator can unlock this post.
Title: Re: No Changing Moderator's Edit
Post by: Kar.ma on May 02, 2008, 11:42:11 AM
Hi. I liked a lot the way vosje505 produce a "soft mod" (I'm talking about THIS (http://www.simplemachines.org/community/index.php?topic=32501.msg1122684#msg1122684)).

and I semplified and improved it this way. INSTEAD of his mod (not apply both them) do this:
search in display.template.php for
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



and replace it with
// Can the user modify the contents of this post?
if ($message['can_modify'] && (($message['modified']['name']) == ($context['user']['name']) || (empty($message['modified']['name']) || (($message['member']['name']) != ($context['user']['name'])) )))
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



More, don't forget this one, too:
find
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '



and replace with:
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', ($message['can_modify'] && (($message['modified']['name']) == ($context['user']['name']) || (empty($message['modified']['name']) || (($message['member']['name']) != ($context['user']['name'])) ))) ? '



This one has not the previous downside for unusual forum setups where groups other than moderators or admins can lock threads.

I hope you will enjoy this mod. :D

[EDIT]
I fixed my code, that had an error.
Title: Re: No Changing Moderator's Edit
Post by: Atthar on June 10, 2008, 03:14:35 PM
Thank you "miseryshining" . but when I install it on 1.1.5 , After successful Install , it destroys Quick Edit (Modify [Ajax]) option in posts . I can't edit any post in "modify" mode . In fact,  I(normal user) can EDIT a post if Admin is the last person who edited that post .


And "vosje505" , Thank to you for you effort , But when I apply the code you provided , Users Still can Edit/Modify admin/moder edited posts . I just Applied you code and nothing else . [ Users can not EDIT or LOCK any topic as you said]

Where am I wrong ?? plz help .
Title: Re: No Changing Moderator's Edit
Post by: Atthar on June 10, 2008, 03:32:10 PM
Thanks "Kar.ma"

I've Added your code and permissions went ok !  but !! again , I've problem with quick modify. It stocks at ... Loading ... . Ajax thing :-( . But anyother editing will be ok for Admin and Users can't Edit . Just that ^%#^$ ajax thing !!!

Any Solution ?
Title: Re: No Changing Moderator's Edit
Post by: Kar.ma on June 11, 2008, 06:17:22 PM
Hi Atthar, I don't know why you have this problem, it seems strange since in my forum it's everything OK, even the Quick Edit, and so was with the vosje505 mod.

Did you try this mod in the default template or not?





And, moreover, my last version of the mod:

Search in display.template.php for
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



and replace it with
// Can the user modify the contents of this post?
($message['can_modify'] && (($message['modified']['name']) == ($context['user']['name']) || ($context['allow_admin'] || empty($message['modified']['name']) || (($message['member']['name']) != ($context['user']['name'])) ))) ?
$can_modify_2 = 1 : 0;
if ($can_modify_2)
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



In the same file search for
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '



and replace with
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $can_modify_2 ? '



This version produce the following:
- Simple Users can edit their posts unless a mod/admin edit them
- Mod Users can edit their posts unless a mod/admin edit them
- Mod Users can edit others' posts
- Admin can edit every post

Note that Simple and Mod Users can always edit somehow (using my mod or vosje505 one) using a workarond.
Title: Re: No Changing Moderator's Edit
Post by: Atthar on June 12, 2008, 12:18:42 PM
Wow ! Thank you kar.ma . I use this code on new and clear install of 1.1.5 . and every thing is OK know . maybe something was wrong with other MODs I have installed.

THANK YOU Very MUCH . You are my hero !!!
Title: Re: No Changing Moderator's Edit
Post by: Kar.ma on June 12, 2008, 01:04:11 PM
You're welcome, I'm very happy I could help you! :D

[EDIT]
I was trying to see your forum http://atthar.com/forum/ but it's unavailable... ?
I tried http://www.atthar.com/ too but with no luck.
Title: Re: No Changing Moderator's Edit
Post by: protonxl on November 06, 2008, 08:58:37 AM
Can this be continued for 1.1.6 ?
its almost a MUST on my forums.. please are very disobedient..

let me know, thanks!
Title: Re: No Changing Moderator's Edit
Post by: Kar.ma on November 09, 2008, 06:50:50 AM
Hi protonxl, I cannot help you because I still use old SMF 1.1.4 (I need to upgrade soon!).

Recently, my mod stopped working on some posts, while it was working on them before (don't ask me why), and today I could fix.
This is what I changed.

If you use a clean display.template.php file, search for
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



and replace it with
// Can the user modify the contents of this post?
if ($message['can_modify'] && (($message['modified']['name']) == ($context['user']['name']) || ($context['allow_admin'] || empty($message['modified']['name']) || (($message['member']['name']) != ($context['user']['name'])) )))
$can_modify_2 = 1;
else $can_modify_2 = 0;
if ($can_modify_2)
echo '
<a href="', $scripturl, '?action=post;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $modify_button, '</a>';



In the same file search for
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $message['can_modify'] ? '



and replace with
<div class="post"', $message['can_modify'] ? ' id="msg_' . $message['id'] . '"' : '', '>', $message['body'], '</div>', $can_modify_2 ? '



Title: Re: No Changing Moderator's Edit
Post by: smokester on February 15, 2009, 04:06:35 PM
Quote from: xXxMetaSoulxXx on October 11, 2007, 03:53:28 AM
I was going to install this mod for SMF 1.1.4, but I get this error:

1.     Execute Code     add_settings.php     
2.    Execute Modification    ./Sources/Display.php    Test failed
3.    Execute Modification    ./Themes/default/Settings.template.php    Test successful
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
5.    Execute Modification    ./Themes/default/Display.template.php    Test successful
6.    Execute Modification    ./Sources/Post.php    Test failed
7.    Execute Modification    ./Sources/Subs-Post.php    Test successful


I am using 1.1.7 and I get the same error as the one above.  Has anyone installed this manualy in 1.1.7 successfully?

Thanks
Title: Re: No Changing Moderator's Edit
Post by: bobybc on May 15, 2009, 08:44:31 AM
To the authors : Could you consider adapt this mod to latest versions - 1.1.8 and 2.0RC1 pls?
Title: Re: No Changing Moderator's Edit
Post by: LuminaRS on December 19, 2009, 11:05:37 PM
Bump for great justice!

How about an updated version for 1.1.x installations?
Title: Re: No Changing Moderator's Edit
Post by: Humphr3y on June 02, 2011, 05:43:05 AM
...and bump again... can anyone help with this?
Title: Re: No Changing Moderator's Edit
Post by: Kindred on August 08, 2012, 10:56:32 AM
Heya Live - Resurrecting an ancient post...

Any plans to update this for 2.0?   Are you willing to pass on authorship if not?
Title: Re: No Changing Moderator's Edit
Post by: Humphr3y on November 29, 2013, 03:57:42 AM
...bump - *sigh*
Title: Re: No Changing Moderator's Edit
Post by: Ninja ZX-10RR on August 06, 2014, 05:56:03 PM
Quote from: Kindred on August 08, 2012, 10:56:32 AM
Heya Live - Resurrecting an ancient post...

Any plans to update this for 2.0?   Are you willing to pass on authorship if not?
Same question here :( I would love this one but ofc it doesn't work on SMF 2.0.8...
Title: Re: No Changing Moderator's Edit
Post by: Ninja ZX-10RR on November 28, 2014, 08:27:21 AM
Please update us about this mod... It would be very useful for 2.0.x but never answered in more than 3 years... If you dropped the support please pass on authorship or something, don't let it die like this.
Title: Re: No Changing Moderator's Edit
Post by: misaka on February 07, 2017, 03:01:27 PM
is there any updates for 2.0 available?
Title: Re: No Changing Moderator's Edit
Post by: misaka on February 17, 2017, 03:39:41 PM
I really like how this mod works but it won't work for me
Title: Re: No Changing Moderator's Edit
Post by: Kindred on February 17, 2017, 09:33:19 PM
That is because it has not been designed for 2.0.x
Title: Re: No Changing Moderator's Edit
Post by: misaka on February 18, 2017, 03:06:45 PM
Quote from: misaka on February 07, 2017, 03:01:27 PM
is there any updates for 2.0 available?

Will it ever be updated for the 2.0 version?
Title: Re: No Changing Moderator's Edit
Post by: Kindred on February 18, 2017, 09:03:30 PM
Probably not, at this point
Title: Re: No Changing Moderator's Edit
Post by: misaka on February 21, 2017, 09:43:27 AM
Quote from: Kindred on February 18, 2017, 09:03:30 PM
Probably not, at this point

How does one get it updated?
Should I make a thread asking for an updated version?


Side note when does this capcha thing die off?
Posting from a tablet
Title: Re: No Changing Moderator's Edit
Post by: Kindred on February 21, 2017, 10:38:05 AM
The mod would have to be completely rewritten since the existing license does not allow for this mod or the code for this mod to be redistributed or reused.
Title: Re: No Changing Moderator's Edit
Post by: misaka on February 21, 2017, 11:07:09 AM
Quote from: Kindred on February 21, 2017, 10:38:05 AM
The mod would have to be completely rewritten since the existing license does not allow for this mod or the code for this mod to be redistributed or reused.

Oh
But it is possible though correct?
Title: Re: No Changing Moderator's Edit
Post by: Kindred on February 21, 2017, 02:16:24 PM
If someone was willing to completely re-write it from scratch, yes