News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Moderator and Administrator Comment Tags

Started by Arantor, September 01, 2009, 06:26:49 AM

Previous topic - Next topic

Shambles

Could someone "with the power" remove the "solved" from this support thread? I tend to skim over threads marked as such :)


Kindred

huh?   this is a mod thread... there is no "solved"

-edit - it looks liek the original author used the standard icon selection....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Westwegoman

I can also confirm that this works fine on 2.0.4. Just use emulate. :)


simplebeer

Hello All,

I wonder if it is possible to have more green modtags in the post template.

I think it's difficult to discribe, but please look at my image.

What i want is that normal moderators have 5 green buttons, each button for a different standard moderator comment.

Can anybody tell me what i must add to the html? Try different things like add more

'if($modtag)
$context['bbc_tags'][$last]['mod'] = array('code' => 'mod', 'before' => '[mod]', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);


in the post.template , but works not as good as i hope  :-X

Thanks!
Sorry for my poor English, but i think it's probably better then your Dutch :)

simplebeer

#444
Just found out if i add a extra line with ['mod2']

Quote$context['bbc_tags'][$last]['mod2'] = array('code' => 'mod', 'before' => '[mod]', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);
         if($gmodtag)

and also add a mod2.gif it is working.

now i have to find out how to change the text  ;D
Sorry for my poor English, but i think it's probably better then your Dutch :)

simplebeer

Ok done, for anyone who is interested.

Add as many of these line's you want and change the ['mod'] in for example ['mod2'] ['mod2'].....etc

Quote$context['bbc_tags'][$last]['mod2'] = array('code' => 'mod', 'before' => '[mod]', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);
         if($gmodtag)

$context['bbc_tags'][$last]['mod3'] = array('code' => 'mod', 'before' => '[mod]', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);
         if($gmodtag)
And don't forget to add as many mod2.gif, mod3.gif....etc as you add lines!

You can type standard tekst here:

Quote$context['bbc_tags'][$last]['mod2'] = array('code' => 'mod', 'before' => '[mod]you can add here', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);
         if($gmodtag)

$context['bbc_tags'][$last]['mod3'] = array('code' => 'mod', 'before' => '[mod]you can add here something else ', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod']);
         if($gmodtag)

Now it wil work, but of course i want to help the moderators, it should be easy if they can see which buttons do what if they touch it with the cursor.

So i also change the ['tag_comment_mod'] to ['tag_comment_mod2'] , ['tag_comment_mod3']....etc

Quote$context['bbc_tags'][$last]['mod2'] = array('code' => 'mod', 'before' => '[mod]you can add here', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod2']);
         if($gmodtag)

$context['bbc_tags'][$last]['mod3'] = array('code' => 'mod', 'before' => '[mod]you can add here something else', 'after' => '[/mod]', 'description' => $txt['tag_comment_mod3']);
         if($gmodtag)

After that go to the ./Themes/default/languages/Modifications.english.php

and add extra $txt['tag_comment_mod'] = ' lines

Quote$txt['tag_comment_mod'] = 'youre moderator comment for helping mod 1 ';
$txt['tag_comment_mod2'] = 'youre moderator comment for helping mod 2';
$txt['tag_comment_mod3'] = 'youre moderator comment for helping mod 3';


Ok that's it i think!

Or do i forget anything? permissions appear to be good  ::)
Sorry for my poor English, but i think it's probably better then your Dutch :)

Ninja ZX-10RR

Aaaaand I managed to break it XD
If somebody that is NOT an admin or a global mod etc has his post edited by someone with permission to add those commands and then he tries to quickly-edit his reply without removing the tag he just can't edit the command but if he goes into the actual post screen and tries to post you get a database error in the error log.

Quote
Type of error: Database
URLhttp://vige.altervista.org/forum/index.php?action=jsmodify;topic=84;c6275ebdef=4600ccf29079e457e6c75ef44e91e72a;xml
Database Error: Unknown column 'mem.posts' in 'field list'
File: /Sources/Post.php
Line: 2856

Also no clues of the reason why it is not really "Database Error" but that piece of report is in Italian while everything else is set to English..... Wtf....

Anyway I hope you will still follow this up even if it was a long time ago... You could either kill the error or call a new function pointing to an error popping out when somebody tries to edit a comment edited by an admin or global mod etc.

Thanks in advance, eventually :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Arantor

Please attach your Post.php.

I don't remember the query involved... but I have a feeling this mod isn't it because I don't recall it using queries to get post count. At least... I don't remember writing it to use that.

Ninja ZX-10RR

Idk how I could forget about attaching the file... That's probably what doing multiple things at the same time does... Anyway there it is :)
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Arantor

As suspected this is nothing whatsoever to do with this mod.

Something else has broken that post query; gut instinct says it's the Anti Spam Links mod if that's installed since the query on line 2856 is not touched by the mod (as verifiable from this mod's parse page)

Ninja ZX-10RR

Then why does this happen ONLY while editing posts including these tags?
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Arantor

Considering the query would be run on *any* quick modify call and doesn't do a proper join to the members table (thus mem.posts is never defined)...?

*shrug* Whatever. It is not the problem of this mod, seeing how the mod does not modify Post.php.

$request = $smcFunc['db_query']('', '
SELECT
t.locked, t.num_replies, t.id_member_started, t.id_first_msg, t.add_authors, t.is_sticky,
m.id_msg, m.id_member, m.poster_time, m.subject, m.smileys_enabled, m.body, m.icon,
m.modified_time, m.modified_name, m.approved, IFNULL(mem.posts, 0) AS postcount, IFNULL(m.id_member, 0) AS poster_id
FROM {db_prefix}messages AS m
INNER JOIN {db_prefix}topics AS t ON (t.id_topic = {int:current_topic})
WHERE m.id_msg = {raw:id_msg}
AND m.id_topic = {int:current_topic}' . (allowedTo('approve_posts') ? '' : (!$modSettings['postmod_active'] ? '
AND (m.id_member != {int:guest_id} AND m.id_member = {int:current_member})' : '
AND (m.approved = {int:is_approved} OR (m.id_member != {int:guest_id} AND m.id_member = {int:current_member}))')),
array(
'current_member' => $user_info['id'],
'current_topic' => $topic,
'id_msg' => empty($_REQUEST['msg']) ? 't.id_first_msg' : (int) $_REQUEST['msg'],
'is_approved' => 1,
'guest_id' => 0,
)
);


This is not standard - and is not changed by the installer as can be verified by anyone here.

Ninja ZX-10RR

And that's ok to me but still the question remains - why does it happen only with messages containing these tags? It's ok that the error is not from this mod but then what should I do to fix it or who should I ask about? The anti spam links mod author perhaps? I don't quite get it, sorry :/
EDIT: oh lol the author is smf cust team... And the mod is actually installed here too IIRC...
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Arantor

It's not the same mod as installed here. I would double check the installation instructions. Odds are one of your other mods clashes somewhere.

Ninja ZX-10RR

Indeed. I tried it in a clean install and it works without the error but... You know what? I will keep it like this and the reason is quite simple: if someone tries to edit the admin comment I get notified for free XD *evilface*
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Arantor

And if they try to edit the admin comment, it's going to fail on them afterwards which is why if you read the thread the advice has always been: put your admin comments in their own post where they can't be edited by unauthorised users anyway.

Ninja ZX-10RR

Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Humphr3y

I'm testing this mod at the moment and it looks great :)

Just one thing. I just find out that any user can use the mod tags while writing their PMs. Is there a way to avoid it?

Arantor

Tell your users not to do it, and issue warnings if they don't behave?

Ninja ZX-10RR

Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Advertisement: