Page 19 of 20

Re: [2.0.20] MOD Troll

Posted: Wed Mar 05, 2008 6:28 pm
by M.O.B.
I'm sorry but that would be a bit over my head. If you do find the time to test this for us, I know I would be very appreciative. Or hopefully someone else with an expert mind for php coding can assist us with this.

Re: [2.0.20] MOD Troll

Posted: Wed Mar 05, 2008 6:50 pm
by Merlin Sythove
I just tested it here and it works fine.

In the file includes/functions_post.php, find this line:
function submit_post($mode ....
and then find this line
//END MOD troll
and PM me everything between those lines, including those lines, in a code block. I'll see if I can figure out why it doesn't work for you.

Re: [2.0.20] MOD Troll

Posted: Wed Mar 05, 2008 7:22 pm
by M.O.B.
Merlin Sythove wrote:I just tested it here and it works fine.

In the file includes/functions_post.php, find this line:
function submit_post($mode ....
and then find this line
//END MOD troll
and PM me everything between those lines, including those lines, in a code block. I'll see if I can figure out why it doesn't work for you.
Thanks for helping me with this. Here it goes:

Code: Select all

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$post_flagged)
{
	global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
	global $userdata, $user_ip;


/*----------------------------------------------------------------------
// Subject Check - Begin Code Alteration
//		Original phpBB Code:
	include($phpbb_root_path . 'includes/functions_search.'.$phpEx);
*/
	include_once($phpbb_root_path . 'includes/functions_search.'.$phpEx);
//
// Subject Check - End Code Alteration
//----------------------------------------------------------------------



	$current_time = time();
	$post_flagged = (empty($post_flagged)) ? 0 : 1;


	//
	// Exclamation points in title
	//
	$post_subject = preg_replace("/([\!])+/", "\\1", $post_subject);
	$post_subject = preg_replace("/([\?])+/", "\\1", $post_subject); 

	if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
	{

        //START MOD troll
        if ($userdata['user_troll'])
        {
//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.");

                switch (rand (1,2)) //case 3 is done by miserable_user.php
                {
                case 1: //Give obfuscating message
                        message_die(GENERAL_MESSAGE, $lang['Troll_error_posting_' . rand (1,3) ]);
                        break;
                case 2: //Pretend it worked
                        $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
                //MOD Moderate_user
                        $message = $lang['Stored'];
                        if ($post_moderated) $message .= '<br />' .  $lang['moderate_user_notify'];
                                $message .= '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
                                message_die(GENERAL_MESSAGE, $message);
                        break;
                case 3: //Abort further processing, computer "hangs"
                        exit;
                        break;

                }
        }
        //END MOD troll   

Re: [2.0.20] MOD Troll

Posted: Wed Mar 05, 2008 7:33 pm
by Merlin Sythove
Nothing wrong with the code. Figuring out what may be wrong may be quite a lengthy process, all I can think of is that the troll flag for that user is not set properly, you can test that by changing
if ($userdata['user_troll'])
to
//if ($userdata['user_troll'])

and posting something, and seeing if you get an email. And then restoring the line again of course.

Re: [2.0.20] MOD Troll

Posted: Wed Mar 05, 2008 7:41 pm
by M.O.B.
But wouldn't that disable the Troll MOD? Could you provide me a copy of your functions_post.php file (just the same section as above) so I can compare it with mine? Thanks in advance.

Re: [2.0.20] MOD Troll

Posted: Thu May 15, 2008 11:34 pm
by Asbestos
Wow, this mod is totally annoying. I made a test account and set it as a troll user. After 1 minute of trying to log in, finally getting logged in, then being logged out by clicking on a topic, I gave up.

Great job guys! This mod will definitely come into good use!

Thanks again

Re: [2.0.20] MOD Troll

Posted: Fri May 16, 2008 5:27 am
by Merlin Sythove
Need therapy now? :lol:

Glad you enjoyed it!

Re: [2.0.20] MOD Troll

Posted: Thu Jun 12, 2008 7:09 pm
by mk264
Can anyone help? I am getting a blank white page with this mod on phpbb 20.0.22

I installed everything including the database command.

Then the blank page came when i visited the forum. I then replaced each file one at a time and the forum come back up once the sessions.php file was replaced. Im assuming then that the sessions.php file is causing the problem and the blank page on my forum.

Any ideas?

Re: [2.0.20] MOD Troll

Posted: Fri Jun 13, 2008 5:55 am
by Merlin Sythove
You're the troll? :lol:

Carefully check if you made any mistakes in sessions.php.

Re: [2.0.20] MOD Troll

Posted: Mon Jul 14, 2008 8:18 pm
by clyde4210
why not just ban the user?, as this is basically all this acts like.

Re: [2.0.20] MOD Troll

Posted: Fri Oct 24, 2008 1:59 pm
by raqman
Because if you simply ban a user, he will register again. Using this, most users give up, or re resgister and get trolled again.

However I have been using this mod for sometime now on phpbb2 and it was brilliant, but it seems with the advent of Chrome and all the new browsers privacy settings, users are able to bypass this or am I wrong.

Re: [2.0.20] MOD Troll

Posted: Fri Oct 24, 2008 2:03 pm
by Merlin Sythove
You can easily check if a troll is actually making posts.

Re: [2.0.20] MOD Troll

Posted: Tue Nov 04, 2008 5:06 pm
by internetbrother
What if I want to chage some options in there
for example how many second time out and bla bla
what file should i modify?

Re: [2.0.20] MOD Troll

Posted: Tue Nov 04, 2008 6:28 pm
by Merlin Sythove
miserable_user.php

Re: [2.0.20] MOD Troll

Posted: Wed Nov 05, 2008 12:21 am
by internetbrother
Thank you for your reply , the problem is that I do not know how to configure it to make it less
See I want the user have about 30% chance to post or send topic
It seems this way sooner or later they will find out and that is what I do not want.