[2.0.20] MOD Troll

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
30
77%
Very Good
2
5%
Good
3
8%
Fair
1
3%
Poor
3
8%
 
Total votes: 39

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: [2.0.20] MOD Troll

Post by Merlin Sythove »

Sure, you could add code to email troll postings to the forum admin.

In functions_post.php find this:

Code: Select all

      //START MOD troll    
      if ($userdata['user_troll'])
      {              
        switch (rand (1,2)) //case 3 is done by miserable_user.php
And just before the line with switch, you would insert a block of code to email the post to the forum admin.
You should of course follow the phpbb standards in creating such a message, with a template and everything, but for a quick and dirty test period you can use the normal mail() function:

Code: Select all

mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
and fill in the parameters. The full code to insert just before the switch line would become:

Code: Select all

mail ($board_config['board_email'], "Troll posting by $post_username",
					"Dear forum administrator,\n\n\
					A troll user has just tried to post this message:\n\n
					Subject: $post_subject \n\n
					$post_message\n\n
					Note: this post is NOT posted on the forum.");
Of course fill in your own email address! See how you get on.
Once it works you can make it more universal, even down to making a proper template and using the phpbb way to send mails.
(And you would have to test how it behaves with html code, quotes and other stuff in the message, you may need to "escape" things like that - it quickly gets complicated :D)
Need custom work done? Pimp My Forum!

User avatar
newsbee
Registered User
Posts: 279
Joined: Sat Mar 29, 2003 1:07 pm
Location: Moscow
Contact:

Re: [2.0.20] MOD Troll

Post by newsbee »

Hi,

Any further steps that can be taken against trolls? I have two trolls who keep registering under new nicknames shortly after I turn them into trolls.

James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: [2.0.20] MOD Troll

Post by James N »


User avatar
newsbee
Registered User
Posts: 279
Joined: Sat Mar 29, 2003 1:07 pm
Location: Moscow
Contact:

Re: [2.0.20] MOD Troll

Post by newsbee »

Thanks, James N! Useful info in your signature too.

User avatar
M.O.B.
Registered User
Posts: 935
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: [2.0.20] MOD Troll

Post by M.O.B. »

Merlin Sythove wrote:Sure, you could add code to email troll postings to the forum admin.

In functions_post.php find this:

Code: Select all

      //START MOD troll    
      if ($userdata['user_troll'])
      {              
        switch (rand (1,2)) //case 3 is done by miserable_user.php
And just before the line with switch, you would insert a block of code to email the post to the forum admin.
You should of course follow the phpbb standards in creating such a message, with a template and everything, but for a quick and dirty test period you can use the normal mail() function:

Code: Select all

mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
and fill in the parameters. The full code to insert just before the switch line would become:

Code: Select all

mail ($board_config['board_email'], "Troll posting by $post_username",
					"Dear forum administrator,\n\n\
					A troll user has just tried to post this message:\n\n
					Subject: $post_subject \n\n
					$post_message\n\n
					Note: this post is NOT posted on the forum.");
Of course fill in your own email address! See how you get on.
Once it works you can make it more universal, even down to making a proper template and using the phpbb way to send mails.
(And you would have to test how it behaves with html code, quotes and other stuff in the message, you may need to "escape" things like that - it quickly gets complicated :D)
Could you please provide us an exact procedure for this code, like what pages to edit and add (before or after what code) thanks. I'd love to try this.
Image

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: [2.0.20] MOD Troll

Post by Merlin Sythove »

##---[ FIND] -----

You want instructions like that? Sorry. The information you need, is all there: which file to open, what code to find, wat to insert exactly where.
Need custom work done? Pimp My Forum!

User avatar
Xclavo
Registered User
Posts: 185
Joined: Thu Sep 20, 2007 1:54 am

Re: [2.0.20] MOD Troll

Post by Xclavo »

I thought this mod used a cookie to ban in the first place? no wonder they keep registering new nicks. argh.


Kathera_Lockhart
Registered User
Posts: 2
Joined: Thu Feb 21, 2008 3:05 am

Re: [2.0.20] MOD Troll

Post by Kathera_Lockhart »

I have a question, what folder do you install mods into on PhPbb 2? I am sort of new at installing mods on PhPbb,
so anyhelp is appreciated, oh and yes I am trying to install the troll mod, I have been plagued by trolls in the past and I am planning on installing this so the trolls grow fed up and leave when the come back.

James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: [2.0.20] MOD Troll

Post by James N »

Kathera_Lockhart wrote:I have a question, what folder do you install mods into on PhPbb 2? I am sort of new at installing mods on PhPbb,
so anyhelp is appreciated, oh and yes I am trying to install the troll mod, I have been plagued by trolls in the past and I am planning on installing this so the trolls grow fed up and leave when the come back.
Have a read of this http://www.phpbb.com/community/viewtopi ... 16&t=61611

User avatar
M.O.B.
Registered User
Posts: 935
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: [2.0.20] MOD Troll

Post by M.O.B. »

Merlin Sythove wrote:##---[ FIND] -----

You want instructions like that? Sorry. The information you need, is all there: which file to open, what code to find, wat to insert exactly where.
Sorry, I just want to create an EasyMOD installation for this add-on. Please tell me if this code looks okay as you suggested above?

Code: Select all

############################################################# 
## MOD Title: add-on email MOD Troll postings 
## MOD Author: Merlin Sythove  < unknown@unknown.unknown > N/A http://www.unknown.unknown/
## MOD Description: add-on to MOD Troll to recieve emails of posts that were trolled.
## MOD Version: 1.0.0 
## 
## Installation Level: Easy 
## Installation Time: 1 Minutes 
## Files To Edit: 4
##		  includes/functions_post.php
## Included Files: N/A 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
############################################################## 
## MOD History: 
## 
##   2008-02-03 - Version 1.0.0 
##      - First version 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/functions_post.php

# 
#-----[ FIND ]------------------------------------------ 
# 
        switch (rand (1,2)) //case 3 is done by miserable_user.php

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
//mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
mail ($board_config['board_email'], "Troll posting by $post_username",
               "Dear forum administrator,\n\n\
               A troll user has just tried to post this message:\n\n
               Subject: $post_subject \n\n
               $post_message\n\n
               Note: this post is NOT posted on the forum.");

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Last edited by M.O.B. on Wed Mar 05, 2008 7:22 am, edited 1 time in total.
Image

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: [2.0.20] MOD Troll

Post by Merlin Sythove »

The line mail ( string $to .... is just explanation of how to use the mail function and should have // in front of it, or remove it completely. Otherwise it looks fine!
Need custom work done? Pimp My Forum!

User avatar
M.O.B.
Registered User
Posts: 935
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: [2.0.20] MOD Troll

Post by M.O.B. »

Merlin Sythove wrote:The line mail ( string $to .... is just explanation of how to use the mail function and should have // in front of it, or remove it completely. Otherwise it looks fine!
I just updated the above install as you mention above, does it look good now? Thanks in advance. ;)
Image

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: [2.0.20] MOD Troll

Post by Merlin Sythove »

Yep, looks fine.
Need custom work done? Pimp My Forum!

User avatar
M.O.B.
Registered User
Posts: 935
Joined: Tue Jan 04, 2005 1:07 am
Location: San Diego CA USA
Contact:

Re: [2.0.20] MOD Troll

Post by M.O.B. »

Merlin Sythove wrote:Yep, looks fine.
Okay, I just installed it, I then made a second account to be trolled. After posting with the MOD Troll enabled on that account, I never got an email. I tried several times, but nothing was sent to my email account (admin email). I checked my spam folder, but nothing. Any ideas why it isn't working??
Image

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: [2.0.20] MOD Troll

Post by Merlin Sythove »

No, no ideas, you'd have to start testing - I do that with echo statements, to see which bits of code are executed (or not) and what the variables are. The first step would be to enter fixed values in the mail()function to see if there are errors mailing anything. The result would look like this:

Code: Select all

echo ("mark 1 ");
     if ($userdata['user_troll'])
      {
        echo ("mark2 ");
        //Addition 31-01-2008 - messages may need escaping quotes etc.
        //Check the normal notification for how to do that, but then you should use a proper email template too.
        //testing:
       mail('myemail@provider.com', 'MySubject', "MyMessage');
      //mail($board_config['board_email']....
Now if you run the code you should see output on screen (the marks) and get an email. Depending on what bit fails, you know where to find the error.
Need custom work done? Pimp My Forum!

Post Reply

Return to “[2.0.x] MOD Database Releases”