News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Annoy User

Started by Arantor, October 22, 2009, 01:51:42 AM

Previous topic - Next topic

Mari-chi

Hi,

I'm trying to use the Annoy User mod on 2.0 RC4. Currently I'm having trouble with 2 parts (it says 'test failed' when I try to install it):

1) I can't seem to find this part of the code in Load.php:
if (isset($modSettings['integrate_load_theme'])



2) Instead of adding this to ModerationCenter.php:
,
'a' => 'AnnoyedUsers',


I changed it to:
$valid_blocks['a'] = 'AnnoyedUsers';



Does that look right? I wasn't sure; I have absolutely no experience with PHP.

Spoogs

Quote from: Mari-chi on January 12, 2011, 09:24:31 PM
Hi,

I'm trying to use the Annoy User mod on 2.0 RC4. Currently I'm having trouble with 2 parts (it says 'test failed' when I try to install it):

1) I can't seem to find this part of the code in Load.php:
if (isset($modSettings['integrate_load_theme'])
Code (instead find) Select
// Call load theme integration functions.


Quote from: Mari-chi on January 12, 2011, 09:24:31 PM
2) Instead of adding this to ModerationCenter.php:
,
'a' => 'AnnoyedUsers',


I changed it to:
$valid_blocks['a'] = 'AnnoyedUsers';



Does that look right? I wasn't sure; I have absolutely no experience with PHP.
that seems about right... i do have this mod updated for rc4 for my own use... when i get the chance i'll check the edits for ya

tbombaci

Quote from: Spoogs on January 12, 2011, 09:58:55 PMthat seems about right... i do have this mod updated for rc4 for my own use... when i get the chance i'll check the edits for ya

That would be great if you could post the edits. I have tried and failed miserably trying to modify the mod to work with RC4.

Tom

Mari-chi

Quote from: Spoogs on January 12, 2011, 09:58:55 PM
that seems about right... i do have this mod updated for rc4 for my own use... when i get the chance i'll check the edits for ya

Thank-you so much; that would really help. :D

Spoogs

ok so here we go...

Code (find on themes/default/profile.template.php) Select

if (!empty($context['can_have_buddy']) && !$context['user']['is_owner'])
echo '
<br /><a href="', $scripturl, '?action=buddy;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a>';

Code (add after) Select


if ($context['can_annoyuser'] && !$context['user']['is_owner'] && empty($modSettings['annoyuser_disabled']))
echo '<br /><a href="', $scripturl, '?action=annoyuser;u=', $context['id_member'], ';', $context['session_var'], '=', $context['session_id'], '">[', ($context['member']['annoyuser'] != 0 ? $txt['remove_from_annoy'] : $txt['add_to_annoy']), ']</a>';




Code (find on sources/load.php) Select
// Call load theme integration functions.
Code (add before) Select
AnnoyUser('popup');




Code (find on sources/moderationcenter.php) Select
$valid_blocks['w'] = 'WatchedUsers';
Code (add after) Select
$valid_blocks['a'] = 'AnnoyedUsers';



Code (add to end of themes/default/moderationcenter.template.php) Select


function template_annoyed_users() {
global $settings, $options, $context, $txt, $scripturl;

echo '
<div class="cat_bar">
<h3 class="catbg">
', $txt['mc_annoyuser'], '
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content modbox">
<ul class="reset">';

foreach ($context['annoyed_users'] as $user) {
echo '
<li class="smalltext">
<span class="smalltext">', sprintf(!empty($user['last_login']) ? $txt['mc_seen'] : $txt['mc_seen_never'], $user['link'], $user['last_login']), '</span>
</li>';
}

// Don't have any watched users right now?
if (empty($context['annoyed_users']))
echo '
<li>
<strong class="smalltext">', $txt['mc_annoyed_users_none'], '</strong>
</li>';

echo '
</ul>
</div>
<span class="botslice"><span></span></span>
</div>';
}

Mari-chi

Thanks for taking the time to post that; I think everything but the load.php functions... I don't know why, but sometimes it gives me an error that says it has something to do with that file. :I No idea; I got so scared of jacking up my forum, that I just undid all the manual changes and uninstalled the mod lol!

Spoogs

lol... no worries... do this... install the mod ingoring all the errors and post those 4 files and i'll fix you up

Mari-chi

Hi Spoogs! :)

I added everything except AnnoyUser('popup'); in Load.php, and everything is working well... Is AnnoyUser('popup'); only required if I want to use the popup feature? I'm not planning on using that one. :3

impreza

Great addition - I tested it, I greet and thank
Portal ToTemat.pl - treści w postaci artykułów i filmów tematycznych.

Arantor

Quote from: Mari-chi on January 19, 2011, 03:42:00 PM
Hi Spoogs! :)

I added everything except AnnoyUser('popup'); in Load.php, and everything is working well... Is AnnoyUser('popup'); only required if I want to use the popup feature? I'm not planning on using that one. :3

It is only required if you want the feature. If you don't, don't worry about it :) I wrote it to be modular like that.

Mari-chi

Yay, thanks Arantor. <3

busterone

Enjoy the mod Mari-chi. I have had more fun with this one than any other modification has come close to.  When there is a troublesome member, it is more fun to play with them and irritate the crap out of them without them knowing what you are doing. They usually leave on their own, no need for corrective measures or banning.  ;D

Arantor

And that's exactly the point. From a psych standpoint, banning doesn't give closure. It's the digital equivalent of slamming the door in the face, it doesn't actually solve anything, just puts a barrier up. The natural instinct, therefore, is to kick against it. Maybe not by brute force on the door itself, but certainly to kick against it in some form.

By gently discouraging them, making it look entirely natural - but not overdoing it, of course - they will get the closure by choosing to leave on their own.

butchs

Or depending on their attitude the prolonged annoyance can get them really pissed and they just may do worse things like compete with the site or stalk the admin.  Sometimes you never win...  O:)
I have been truly inspired by the SUGGESTIONS as I sit on my throne and contemplate the wisdom imposed upon me.

Mari-chi

#154
I agree, Arantor; this mod is very subtle in the way it 'encourages' a user out the back door. XD

@busterone: Thanks! I'm having a bit of fun with this one, too! :D

swordsman1

Quote from: butchs on January 21, 2011, 08:16:48 PM
Or depending on their attitude the prolonged annoyance can get them really pissed and they just may do worse things like compete with the site or stalk the admin.  Sometimes you never win...  O:)

Especially if the troublemaker logs-out, sees your site is running perfectly again, and realises that you've been toying with them.

Arantor

Which is why you don't set it too high so it appears genuinely sporadic.

swordsman1

Yep that is what I did. 15% of the time my forum goes slow for them. Any more than that I think and they will spot it when they log out. Trouble is that is not enough deterrent and my troublemakers are still here.

It's a pity this mod doesn't use ip numbers as well as usernames, like the vbulletin Miserable Users mod does.

Arantor

I did that for a reason: IP numbers aren't really that effective, because you have to invariably use a range of them which will hit other users too.

katdillon

Will this be available for 2.0 RC 5?

Advertisement: