Dragonfly CMS v9 ⇒ CPG-BB (forum) ⇒ Mod / hack for blocking site trolls ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

Mod / hack for blocking site trolls Reply to topic


Have put this together for a site I use which has an ongoing problem with a few Trolls, and with other users who simply haven't got the self-control to ignore them.

It's basically an Admin-defined "ignore" list that users can opt-out of if they want. Admin also have the power to over-rule an opt-out if the user concerned persistently troll-baits. It involves two new columns in `user_info`, one new record in `user_fields`, and small changes to 3 core files.

Two things I could do with help with:

1) Anyone who'd be prepared to check the changes to confirm there are no security or performance implications would be appreciated.

2) If the code looks secure, help on how to package and offer it as a Mod would be appreciated as this is my first attempt at Mod / hack writing that may be useful to a more general market.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


If you make it a 'block-list' I'll support you totally... meaning each user has a list that they maintain and who ever is on the list is not seen in the forums...

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Unix / 2.0.46 (Red Hat) / 0.9.7a / 4.1.9-standard / 4.3.2 / 9.0.6.1


well, wasn't the plan with the problem we had - more one of "Troll Baiters" than the trolls themselves tbh Wink - but can certainly look at modding it.

I believe they've included that in ForumPro anyway, but I guess a lot of sites won't want to make a full upgrade?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


This MOD is now running on a test site at www.ournet.org.uk/tft and also gone live on www.arrse.co.uk

On the test site there are a number of users set up (listed on the test thread) who's passwords are the same as their usernames so if anyone wants to play, feel free.

It does what it says on the tin and also prevents PMs between "troll tagged" members and those who've chosen to ignore them.

The mod itself is available to download from the test site in what I hope is a clear format - I'm still not sure what the preferred method of packaging mods for Dragonfly is!

There are a couple of small issues with it that, because of time constraints, if anyone can help with it would be appreciated.

1) Where a thread has more posts "blocked" than there are on the last page of thread, going to the last page produces a "no posts for this topic" error. Not a huge problem, but may be annoying for some users.

2) At present, people can still search for posts by trolls and get the first few lines of their posts. Also, you can still bring up a Troll's profile and see the start of their posts from there. It would be nice to stop that as well.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


A quick thank you to spunkymonkey for this one. The mod is excellent, very simple and the moderators are really pleased with it. Also the lack of additional DB queries means that I don't get all worked up about server performance - my usual passtime.

We've a couple of really peristant trolls, one who is on about her 30th user account, and this is exactly what's needed, so I second the 'help appreciated' - particularly the "no posts exist for theis topic".

Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2


No thanks needed.

The code on the test site has now been changed to work round the "no posts for this topic" problem. Rather than filtering as part of the SQL query the new code filters out "troll" posts as they're sent to the browser.

This means that the page count for the topic stays correct, but pages with "blocked" posts will display a lower number of posts. For example, if you have a page length of 15 posts and on one page 4 posts are blocked, that page will show the remaining 11 posts without affecting where the next page starts. Even if ALL posts on a page are blocked, the page will display with the usual navigation and reply links etc, but with no posts actually put on the screen.

Seemed a generally better option than recalculating post counts as that would need separate totals for "troll" and "non-troll" viewing, and would either have to be re-counted on each viewing or require an admin function to search all threads for troll posts whenever a new troll was tagged. Either of those would defeat the idea of something quick, simple and effective with minimal impact on site performance.

Help would still be appreciated on extending it to prevent viewing of Trolls' profiles or searching for their posts.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


Can we see the code yet?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Unix / 2.0.46 (Red Hat) / 0.9.7a / 4.1.9-standard / 4.3.2 / 9.0.6.1


It's set up running on www.ournet.org.uk/tft at the moment, and can be downloaded from there (zip file with modified versions of the affected files and instructions on how to install manually over other mods)

The site is purely to test this out with, so the passwords of all users (except mine Smile ) are the same as the usernames. theboss is an Admin user for anyone who wants to see that side of it - please don't break the site Wink

Also, from arrse.co.uk we found pretty quickly that allowing users to turn it off was not good. Some users are so sick of the trolls that they were turning it off just to bait them.

To avoid that, when creating the new DB columns, if you use DEFAULT 2 for ignore_troll instead of DEFAULT 1 then all users will have the "on/off" option disabled unless Admin individually enable it for them (eg: for moderators, but note that, regardless of the ignore setting, all posts will show in Moderate Forum )

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


For demonstrating admin aspects without risk, you may not be aware that you can create an admin (not superuser) called demo and assign admin access to various modules.

demo has admin functionality but changes cannot be saved.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux / apache 2.2.22 / mysqli 5.6.34 / 7.1.22 / 10.0.48.9418+


Phoenix,

Interesting feature. Is this just for DF Core modules? Tried it on Pro_News and actions took effect...

Can you give me a pointer as to what code I need to incorporate in Pro_News to support this? TIA!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Thanks, Phoenix, I wasn't aware of that but have changed theboss now Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
winxp/2.0/5.0.27/5.2.0/9.1.2.1


@layingback
The admin named "demo" must NOT be a SuperUser - you assign modules from the list but DO NOT check the SuperUser box. You'll know if you've done it right because of the red message displayed on every page.

It's been a feature of Dragonfly for a very long time, years. So long as you have assigned "radmin" in cpg_inst.php it should work.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux / apache 2.2.22 / mysqli 5.6.34 / 7.1.22 / 10.0.48.9418+


We've now been using this module live on our (Main Site) for a while now and it seems to be very successful so thanks a lot SpunkyMonkey. I've also had a few thoughts on how it could be enhanced to reduce admin workload ....

What I'd like is for anyone on the site to be able to nominate a user as a troll - possible with a button on the user profile page? This would include a box where the user could provide a rationale for suggesting it.

An admin interface would then have the list of all nominated trolls with the rationale. These could then be approved, etc.

An additional feature could also be the option to automatically classify a user as a troll if they received more than {admin definable} nominations.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.2.4/5.0.37/5.2/9.1.2.1


does anyone have a copy to share, as the authors site is down and love to make sure this one does not get lost on the shelf!

dfaddons.com

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
OS/Apache/Mysql/php/9.2.X/


I just read this post and I have it and dropping it off at DFA if its not already there.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux,apache,5.0.11.,5.6.30,9.3.4.1

All times are UTC


Jump to: