Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: robinrobin - helmikuu 06, 2009, 03:32:15 IP

Otsikko: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 06, 2009, 03:32:15 IP
Right now, i have two questions:

How can i make the warning level meter when giving someone a warning get a minimum range of ten points instead of five? (10, 20... 90, 100 instead of 5, 10, 15 etc)

How can i remove the pop-up notification for users posting under a moderation watch as well as deactivate the color-change and message in the posts that they submit? I want it to appear to users as if their posts are live when they post them even when they are actually unapproved and not visible to the others.

2.0 RC1
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 12:06:55 IP
Bumporeno
Otsikko: Re: Warnings and Moderation
Kirjoitti: phpMyTony - helmikuu 07, 2009, 12:08:04 IP
Is there a certain mod for this? If so, please use the support topic for it.
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 12:14:06 IP
There is none for 2.0 RC1 so far, no.
Otsikko: Re: Warnings and Moderation
Kirjoitti: karlbenson - helmikuu 07, 2009, 12:14:33 IP
Warning / Moderation is a core feature in smf 2.x

However there are no settings to do the specific things which the user is asking.
(Making unapproved posts appear like approved ones is a bit sneaky/unethical? no?)
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 12:22:54 IP
Well, I do not believe you can change how much the warning level increments.

For the second part, it would involve editing Post.template.php, and I believe this is what you would need to do:
In Post.template.php, Find and remove:

', ($context['becomes_approved'] ? '' : 'alert('' . $txt['js_post_will_require_approval'] . '');'), '


However, removing the color of unapproved topics and messages wouldn't be such a good thing as it would be a bit harder to see which posts and topics are not approved...

But, whatever :P

In MessageIndex.template.php find:

         // Calculate the colour class of the topic.
         if ($context['can_approve_posts'] && $topic['unapproved_posts'])
            $color_class = $topic['approved'] ? 'approvebg' : 'approvetbg';
         else
            $color_class = !empty($settings['separate_sticky_lock']) && $topic['is_sticky'] ? 'windowbg3' : 'windowbg';


Replace with:

         // Calculate the colour class of the topic.
        $color_class = !empty($settings['separate_sticky_lock']) && $topic['is_sticky'] ? 'windowbg3' : 'windowbg';


In Display.template.php find:

$message['approved'] ? ($message['alternate'] == 0 ? 'windowbg' : 'windowbg2') : 'approvebg'

Replace with:

$message['alternate'] == 0 ? 'windowbg' : 'windowbg2'


And it should do what you want :)
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 12:25:09 IP
The forum i want to do this in is strictly moderated. I simply want to make it so that human spammers don't come back a second time pretending to be a behaving user for a certain amount of posts when they automatically would switch to another user group, and then wrecking their havoc when they noticed that their posts no longer have to be approved. Making spammers believe that their posts are reaching through from the first one while they actually are hidden is an effective way to stop spammers from coming back. I have tested this before in other bulletin board softwares. I hope some security-aware modder can try this out in SMF for him/herself and share the way to do it with the rest of the world.
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 12:41:30 IP
Thank You, Aldo!

The modification to MessageIndex.template.php is unnecessary since only members of the staff can see the changed topic color anyways.

The modification to Display.template.php didn't make any visible difference.

The color of the unapproved posts are still red while viewing a topic and has the note about the need for approval still visible to the author of the post. There's a note at the top of the editor interface when writing a post too that would need to be removed.
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 01:04:06 IP
About the second message, I am not sure. You could remove this:

// If this won't be approved let them know!
if (!$context['becomes_approved'])
{
echo '
<tr>
<td></td>
<td align="left">
<i>', $txt['wait_for_approval'], '</i>
<input type="hidden" name="not_approved" value="1" />
</td>
</tr>';
}

In Post.template.php however I don't think it would be a smart idea as the not_approved thing is probably needed, though you could do it another way I suppose by just echo'ing:

<input type="hidden" name="not_approved" value="1" />

In the template
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 04:41:02 IP
Thanks again, Aldo! That worked fine, removing all that.

What about the "(Awaiting Approval)" text added to the end of the topics while viewing the board for the author?
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 04:48:49 IP
Mhmm.

In MessageIndex.template.php find:

echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</b>' : '';


Replace with:

echo '
', $topic['is_sticky'] ? '<b>' : '' , '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</b>' : '';


Should do the job. ;)
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:02:08 IP
Dude, where have You been all my life? lol ;)

That worked perfect too. Since spammers most often are prepared and try to post as much as possible as fast as they can, there's a great chance they won't actually notice that the posts are moderated now since it's only visible if they actually enter their topics/posts after they've been made.
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 05:03:15 IP
Your welcome :)

And interesting, be sure to tell us if this works and how much of a decrease you see in spam.
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:26:21 IP
Sorry to bother You further Aldo, but i rarely come across as helpful people as You, so i'd like to ask some more questions i've been thinking of before:

Can i disable the need to enter an e-mail address when guests post under moderation?

Can i remove the "Return to topic" alternative on the Additional Options drop-down list at the bottom of the post-editor?
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:27:42 IP
Oh and by the way, i'm sure it will work great Aldo. =O)
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 05:29:54 IP
1) I do not believe it is a feature you can do, you could certainly remove such a thing by editing Post.php and Post.template.php
2) I am not sure what you are talking about. Could you be more specific?
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:33:20 IP
Thank You.

If You try and reply to this topic again, and check right under the text-field where You write Your reply, there's an "Additional Options..." alternative. On that drop-down list, when You click it, You'll see a "Return to this topic." alternative that You can check. By doing so, well, try it out.
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 05:36:29 IP
Oh, that. I think it would be something like this:
In Post.template.php find:

<td class="smalltext"><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="check" />


replace with:

<td class="smalltext"><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . (!empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="check" />
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:47:32 IP
You wouldn't happen to be out of the ol' closet, would You? I'm not, but i would consider it... Haha  ;D

Anyways, i just removed the whole darn thing there (since nothing changed with Your edit) and it's still a smooth sailing.

I'm gonna see what i can do about that e-mail requirement then.

***** <- 5 stars for aldo's support
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 07, 2009, 05:55:13 IP
Here i go again...

Uh, You wouldn't happen to know how i could make the approve-requirement pop-up only appear to guests, would You? How does the user-group handling look like in the SMF code?
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 07, 2009, 07:58:24 IP
If you remove the whole input, it could mess up peoples user settings if they wanted to return to the topic...

So try:

<td class="smalltext"><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="check" />


replace with:

<td class="smalltext"><label for="check_back"><input type="checkbox" name="goback" id="check_back"' . ($context['back_to_topic'] ? ' checked="checked"' : '') . ' value="1" class="check" />

As I am not sure which variable is which ;)

And yes, you could do that, the variable $context['user']['is_guest'] holds a boolean value, so true if they are not logged in, false if they are a member.
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 08, 2009, 09:35:06 AP
Good day Aldo.

Yeah, i thought about that too, but everything works fine so far. I don't see why anyone would need this feature anyways.

Uh, would You also happen to know how i can use that boolean value within this tag:

($context['becomes_approved'] ? '' : 'alert(\'' . $txt['js_post_will_require_approval'] . '\');')

Where do i add $context['user']['is_guest'] ?
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 08, 2009, 11:43:56 AP
You would do it like this:

($context['becomes_approved'] || $context['user']['is_guest'] ? '' : 'alert(\'' . $txt['js_post_will_require_approval'] . '\');')
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 08, 2009, 04:55:45 IP
Nice one. Thank You! You're not done with me yet i'm afraid :P

I got into the language files to get rid of the approval requirement note that the author see in the top of their posts inside topics, but that container made up of red lines is still there and i don't even see where that stuff comes from while viewing the html source code. Any idea on how to get rid of it?

Not that it matters much, but i found and set the color of unapproved topics and posts in the css, and since there's only one color definable for that originally red color of unapproved posts when viewing topics, they either have to be light gray or dark gray to look similar to the other posts around them. This creates a minor problem, which is that if i set the color to the darker gray that every other post inside topics use, there can be two posts with that color or even more next to each other, which looks pretty odd. Any ideas?

Thank!
Otsikko: Re: Warnings and Moderation
Kirjoitti: aldo - helmikuu 08, 2009, 04:58:14 IP
So you want to remove the red borders and the red background on unapproved topics/posts? For topics it would be found in MessageIndex.template.php and posts would be found in Display.template.php
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 08, 2009, 05:07:21 IP
I've only got the red border in posts left now actually, so i guess that would be in Display then. I'll see what i can find!
Otsikko: Re: Warnings and Moderation
Kirjoitti: robinrobin - helmikuu 09, 2009, 11:00:59 AP
Goo day Aldo. How are You?

I just wanted to report back on the red border-lines. It is an entry called ".approve_post" in forum.css that defines those borders. With that gone, i've finally achieved what i wanted to with this topic, so i'll make this one solved now. =O)

Thanks to Aldo for his fantastic assistance!