News:

SMF 2.1.2 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

vosje505

if your members cant lock topics themself the code will do the job for you ;D

askepott


ragots

it works for me. And i'm on 1.1 RC3.
Thanks vosje505

vosje505

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

King Steph1

#84
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..?

xXxMetaSoulxXx

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

TrueSatan

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://www.simplemachines.org/community/index.php?topic=34526.0

The following may also prove helpful:

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

Mirror of the last link:

http://www.smfhacks.com/smf-package-parser.html

miseryshining

#87
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.

DeMar

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.

[embed-flash(width,height)]

Kar.ma

#89
Hi. I liked a lot the way vosje505 produce a "soft mod" (I'm talking about THIS).

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.
My SMF Forum: http://forum.associazioneelectron.org [nofollow]

Atthar

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 .
Persian Music Recording Forum at http://atthar.com/forum/ [nofollow]

Atthar

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 ?
Persian Music Recording Forum at http://atthar.com/forum/ [nofollow]

Kar.ma

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.
My SMF Forum: http://forum.associazioneelectron.org [nofollow]

Atthar

Wow ! Thank you kar.ma [nofollow] . 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 !!!
Persian Music Recording Forum at http://atthar.com/forum/ [nofollow]

Kar.ma

#94
You're welcome, I'm very happy I could help you! :D

[EDIT]
I was trying to see your forum http://atthar.com/forum/ [nofollow] but it's unavailable... ?
I tried http://www.atthar.com/ [nofollow] too but with no luck.
My SMF Forum: http://forum.associazioneelectron.org [nofollow]

protonxl

Can this be continued for 1.1.6 ?
its almost a MUST on my forums.. please are very disobedient..

let me know, thanks!

Kar.ma

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 ? '



My SMF Forum: http://forum.associazioneelectron.org [nofollow]

smokester

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

bobybc

To the authors : Could you consider adapt this mod to latest versions - 1.1.8 and 2.0RC1 pls?

LuminaRS

Bump for great justice!

How about an updated version for 1.1.x installations?

Advertisement: