PDA

View Full Version : Help with phpBB Modding.



BoA
05-27-2006, 06:00 AM
Hello,

I wish to install a phpBB Mod called "Cracker Trakcer" as my board always get's hacked...

I am the middle of installing but I am stuck on this line:


#
#-----[ FIND ]------------------------------------------
#
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
$message = $lang['Stored'] . '<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>');


#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// CBACK CrackerTracker Spammer Protection Engine
//
$ctinfomeldung = '';
if(($mode == 'newtopic' || $mode == 'reply') and ($ctracker_config['floodprot'] == 1))
{
if($userdata['user_level'] == 0 && $userdata['user_id'] != ANONYMOUS)
{
if($userdata['ct_posttime'] >= time())
{
if($userdata['ct_postcount'] > $ctracker_config['postintime'])
{
if($ctracker_config['autoban'] == 1)
{
ct_filllog();
$sql = "INSERT INTO " . BANLIST_TABLE . "( `ban_id` , `ban_userid` , `ban_ip` , `ban_email` ) VALUES ('', '" . $userdata['user_id'] . "', '', NULL);";

if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}

if( $userdata['session_logged_in'] )
{
session_end($userdata['session_id'], $userdata['user_id']);
}
}
else
{
ct_filllog();
$sql = "UPDATE " . USERS_TABLE . " SET user_active = 0 WHERE user_id = '" . $userdata['user_id'] . "'";

if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}

if( $userdata['session_logged_in'] )
{
session_end($userdata['session_id'], $userdata['user_id']);
}
}

message_die(GENERAL_MESSAGE, $lang['ct_forum_blo']);
}
else if($userdata['ct_postcount'] == $ctracker_config['postintime'])
{
$ctinfomeldung = sprintf($lang['ct_forum_wa'] . '<br /><br />', $ctracker_config['posttimespan']);
}
else
{
$ctinfomeldung = '';
}

$sql = "UPDATE " . USERS_TABLE . " SET ct_postcount = ct_postcount + 1 WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
}
else
{
$stime = time() + $ctracker_config['posttimespan'];
$sql = "UPDATE " . USERS_TABLE . " SET ct_posttime = " . $stime . " WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . USERS_TABLE . " SET ct_postcount = 2 WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
}
}
}


This must be inserted into the file attached.

Any help would be greatly appreciated.

1darkangel
05-27-2006, 02:59 PM
You may have a mod installed that changed your code or this is for an outdated version. I will NOT promise this is correct but after looking at your code that you incuded I think I found where you need to look. You also may want to look into installing ezmod if you have not done so already. It beats spending hours handmodding a board. Also If you look at phpBB.com's boards you will find plenty of mods in their database with support. So if you had a problem they could help. I believe you need this. (again I may be wrong so make a backup before changing so you can restore if it does not work)


#
#-----[ FIND ]------------------------------------------
#
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid('viewtopic.'.$phpEx.'?' . POST_POST_URL . '=' . $post_id) . '">';
}
else
{
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">';
}

if($urgent_post)
{
$sql = "UPDATE " . DIGEST_CONFIG_TABLE . "
SET config_value = 1
WHERE config_name = 'urgent_run_required'";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error updating digest config table', '', __LINE__, __FILE__, $sql);
}

$message = $lang['Urgent_stored'] . '<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>');
}
else
{
$message = $lang['Stored'] . '<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>');
}

#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// CBACK CrackerTracker Spammer Protection Engine
//
$ctinfomeldung = '';
if(($mode == 'newtopic' || $mode == 'reply') and ($ctracker_config['floodprot'] == 1))
{
if($userdata['user_level'] == 0 && $userdata['user_id'] != ANONYMOUS)
{
if($userdata['ct_posttime'] >= time())
{
if($userdata['ct_postcount'] > $ctracker_config['postintime'])
{
if($ctracker_config['autoban'] == 1)
{
ct_filllog();
$sql = "INSERT INTO " . BANLIST_TABLE . "( `ban_id` , `ban_userid` , `ban_ip` , `ban_email` ) VALUES ('', '" . $userdata['user_id'] . "', '', NULL);";

if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}

if( $userdata['session_logged_in'] )
{
session_end($userdata['session_id'], $userdata['user_id']);
}
}
else
{
ct_filllog();
$sql = "UPDATE " . USERS_TABLE . " SET user_active = 0 WHERE user_id = '" . $userdata['user_id'] . "'";

if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}

if( $userdata['session_logged_in'] )
{
session_end($userdata['session_id'], $userdata['user_id']);
}
}

message_die(GENERAL_MESSAGE, $lang['ct_forum_blo']);
}
else if($userdata['ct_postcount'] == $ctracker_config['postintime'])
{
$ctinfomeldung = sprintf($lang['ct_forum_wa'] . '<br /><br />', $ctracker_config['posttimespan']);
}
else
{
$ctinfomeldung = '';
}

$sql = "UPDATE " . USERS_TABLE . " SET ct_postcount = ct_postcount + 1 WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
}
else
{
$stime = time() + $ctracker_config['posttimespan'];
$sql = "UPDATE " . USERS_TABLE . " SET ct_posttime = " . $stime . " WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . USERS_TABLE . " SET ct_postcount = 2 WHERE user_id = '" . $userdata['user_id'] . "'";
if( !$db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not perform Database operation", "", __LINE__, __FILE__, $sql);
}
}
}
}

I hope maybe this helps. Also some old mods don't run well on new boards without tweaking them to fit. I don't know what version this mod was released for. So just something to think about when you mod.