News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

No Changing Moderator's Edit

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

Previous topic - Next topic

Col


vosje505

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??  :)

Col

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. :)

vosje505

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)

Col

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?

vosje505

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

Col

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.

vosje505

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

Col

Hi,

I'll add your code to another template (one without the shoutbox) to test it. ;)

Col

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?

Col

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.

vosje505

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

vosje505

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 ;)

Col

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

vosje505

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

flame baiter

So does this mod work with SMF 1.1.3 or not?

vosje505

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

askepott

is this working well on 1.1.3? I would like to give a try if so :)

vosje505

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

flame baiter

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...   ;)

Advertisement: