Notifications
Clear all

[Sticky] Handmade "Bad behavio(u)r 2" include

36 Posts
12 Users
0 Likes
9,822 Views
(@sheepcontrol)
Posts: 332
Reputable Member
Topic starter
 

Hi there!

After having included it into eFiction 5 (which is still progressing), _and_ having some fellow archives being hit by spam registration, I decided to rework the "bad behaviour" filter for eFiction 3.

If you have never heard of this project, please go to their website and check it out.

Now this is not a module that simply works by uploading, but instead requires some handwork.

#1 - Language files (start simple)
Add this at the very end of your language file, right before the closing "?>" tag:

english:

// Bad Behaviour

define ("_BADBEHAVIOUR", "Bad Behaviour");
define ("_BB_BLOCKSTRING", "has blocked <strong>%1$s</strong> access attempts in the last 7 days.");

german:

// Bad Behaviour

define ("_BADBEHAVIOUR", "Bad Behaviour");
define ("_BB_BLOCKSTRING", "hat in den letzten 7 Tagen <strong>%1$s</strong> Zugriffe blockiert.");

The variable encapsulated in the <strong> tags is the counter, so you can easily rewrite this for your language - or rewrite it at all.

#2 - Upload files:
Extract the attached archive, which is mainly the core bad behaviour files as found at their site, the renamed setting files, a .htaccess file to protect the ini-files (which is not exactly necessary, but hey) and the eFi3 specific loader.
The files and the folder need to be uploaded into the includes/ folder.

#3 - Enable:
Open the header.php file (since this file will be loaded by every module).
Look for the string "includes/corefunctions.php" - this should exist only once, at around line 110.
Right below, add this line:

include_once(_BASEDIR."includes/bad-behaviour-efiction3.php");

Well, technically, that's it - the module will auto-create its log table and do its work.

If you want some stats displayed, here are the steps:

#4a - Stats (1)
Open includes/pagesetup.php.
At around line #109, there should be this:

$tpl->assign( "footer", $copyright);

Right below, add this:

	if ( function_exists('bb2_insert_stats') )
$tpl->assign("bb2stats", bb2_insert_stats() );

#4b - Stats (2)
Open the footer.tpl for the skin you want to modify, and wherever you want to, add this:

{bb2stats}

For the stats to show, "display_stats" in the settings file has to be true.

If there's an error, simply comment or remove the line you included in step #3, this will at least keep your site running until fixed.

Update: Latest BB sources

 
Posted : 13/08/2016 6:11 am
(@dsecrets)
Posts: 32
Eminent Member
 

Thanks for this πŸ™‚ I have added this to gluttonyfiction.com without error.

 
Posted : 14/08/2016 1:06 am
(@sheepcontrol)
Posts: 332
Reputable Member
Topic starter
 

Well that's good to hear  :cool2:

 
Posted : 14/08/2016 5:30 am
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

Just added it to my site also.  I also didn't see any issues getting it running and it has already blocked 1 attempt according to it's stats.

Will let you know what happens.

Thanks!
Chad

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 15/08/2016 12:18 am
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

So far:

Bad Behaviour has blocked 428 access attempts in the last 7 days.

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 15/08/2016 11:31 pm
(@ladama)
Posts: 57
Trusted Member
 

Thanks so much for this! Instructions were nice and easy to follow. Installed it at More Than That last night with no trouble, and 9 access attempts have been blocked so far!  :biggrin:

(just FYI to anyone lurking out there and not finding the download link, you need to be logged in to these forums to see it)

 
Posted : 16/08/2016 1:43 pm
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

Bad Behaviour has blocked 764 access attempts in the last 7 days.

No complaints from anyone that it has blocked them.

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 16/08/2016 5:07 pm
(@dsecrets)
Posts: 32
Eminent Member
 

I have had some spam get through from this domain name: autobestpreis.eu, that's about it so far. Bad Behaviour has blocked 171 access attempts in the last 7 days.

 
Posted : 19/08/2016 7:48 am
(@ladama)
Posts: 57
Trusted Member
 

I have had some spam get through from this domain name: autobestpreis.eu, that's about it so far. Bad Behaviour has blocked 171 access attempts in the last 7 days.

Yeah we had three spam registrations from this domain yesterday, three different IP addresses but all located in Sweden. they filled their bios with spam links and nonsense but I managed to lock them before any spam reviews were left.

 
Posted : 19/08/2016 4:03 pm
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

I also had the same. He hit me 6 or 8 times and I was just removing the text and link from his profile then locking the account while he was doing it. I think it was a real person doing it an not a bot. The attempts all came from different IP's but were too slow between them. I think he was changing IP's between attempts.

I wrote a little code into my site to be able to block entire email domains.  I'll clean it up a bit and post it for others to be able to use later today.

Also... Bad Behaviour has blocked 2496 access attempts in the last 7 days.  πŸ™‚

Thanks,
Chad

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 19/08/2016 5:16 pm
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

I just posted 3 mods that some may find helpful.  My most recent was was because of the "autobestpreis.eu" spammer: Block entire domains from registering.

They are:

Mod: Block Email Domains From Registering
https://efiction.org/forums/index.php?topic=8905.0

Mod: Registration Notice
https://efiction.org/forums/index.php?topic=8906.0

Mod: Chapter Review Notice
https://efiction.org/forums/index.php?topic=8907.0

Hope they help.

Thanks,
Chad

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 19/08/2016 8:59 pm
(@tagsit)
Posts: 7
Active Member
 

Excellent and easy to follow instructions. Thank you so much for helping out us Newbies! Hope this helps - our site has been getting hit with about 20 of these fake registrations a week and it's really annoying. I catch them pretty quick so I don't think they've had time to spam us, but it's still a lot of work to keep up with them. Thanks for all your hard work on the coding assists either way! TAG πŸ˜€

 
Posted : 27/08/2016 3:43 pm
(@tagsit)
Posts: 7
Active Member
 

Loaded all this code without problem but not able to get the stats to show.

[pre]For the stats to show, "display_stats" in the settings file has to be true.
[/pre]

I'm not sure I've done this part correctly. I don't see anything in my settings about this. Anyone able to walk me through this part?

Thanks.

TAG

 
Posted : 31/08/2016 1:03 am
(@hpfanficarchive-com)
Posts: 41
Eminent Member
 

Loaded all this code without problem but not able to get the stats to show.

[pre]For the stats to show, "display_stats" in the settings file has to be true.
[/pre]

I'm not sure I've done this part correctly. I don't see anything in my settings about this. Anyone able to walk me through this part?

Thanks.

TAG

In the bb-settings.ini file that is in /includes:

display_stats = true

Thanks,
Chad

http://www.FicSavers.Com
http://www.HPFanFicArchive.Com
http://www.FavoritesTracker.Org

 
Posted : 31/08/2016 1:13 am
(@guest15364)
Posts: 0
New Member Guest
 

This is brilliant stuff, but I'm not able to get stats to appear at the footer myself.  Have checked that logging and displaying are true, doublechecked that all code goes where it's supposed to, but no joy.  As long as it works, I'm happy, but if anyone's run into this issue and figured a way around it, let me know?

ETA: Oi.  I musta done something wrong, we got whacked with spammers last night.

 
Posted : 18/09/2016 2:10 am
Page 1 / 3
Share: