################################################################## MOD Title]------------------------------------------# If you have another prefix, please change it.# If a translation exists for your language use the lang_yourlang_install.txt to install the SQL# You can also use rp_db_install.php instead of manually inputing this data into phpmyadmin.# CREATE TABLE phpbb_refer_plus ( rp_id mediumint(8) unsigned NOT NULL auto_increment, refer_id varchar(7) NOT NULL default '0', refer_new varchar(7) NOT NULL default '0', rp_time varchar(10) NOT NULL default '', PRIMARY KEY (rp_id)) TYPE=MyISAM; INSERT INTO phpbb_refer_plus VALUES (1, 2, 2, '1115859081'); CREATE TABLE phpbb_refer_top ( rp_id mediumint(8) unsigned NOT NULL auto_increment, refer_id varchar(7) NOT NULL default '0', refer_new varchar(7) NOT NULL default '0', rp_time varchar(10) NOT NULL default '', PRIMARY KEY (rp_id)) TYPE=MyISAM; INSERT INTO phpbb_refer_top VALUES (1, 2, 2, '1105474506'); INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_default_id', '0' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_enable', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_rtop_enable', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_rewards_enable', '0' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_refer_new_posts', '5' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_posts_allowed', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_gold', '1000' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_top', '10' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_time', 'Current Referrals' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_timem', 'Life Time Referrals' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_reward', 'user_points' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_top10_list', 'Top 10 Referrals' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_top10_list_explain', 'All Time Top 10 List of Members Who Have Referred New Members.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_life_time', '= the Number of Friends You have Referred. To Invite a Friend and Get Credits on Your Account, Please visit the:' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_now_time', '= the Total Number of Friends You have Referred During our Current Promotion.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_top_list_enabled', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_header', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_invite', '1' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_email', 'We are removing members from our database that are no longer active on our forum. If you wish to keep your account active, please visit our site and your account will not be de-activated.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_board', 'About forum.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_invite_header', 'Invite a Friend' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_invite_friend', 'Send Emails to Invite Friends to Join this Forum.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_top_now_list', 'Current Referrals Top 10 List of Members Who Have Referred New Members to our forum .' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_admin_id', '2' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_life_time_rc', '= the Total Number of Friends You have Referred to our forum.' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_rewards', 'Current Rewards' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_rewards_explain', '= Your Rewards Total for Referring New Members!' );INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ( 'rp_referc_header', 'Referral Center' ); ##-----[ COPY ]------------------------------------------# copy root/rp_center.php to rp_center.phpcopy root/rp_list.php to rp_list.phpcopy root/rp_top.php to rp_top.phpcopy root/rp_top_rewards.php to rp_top_rewards.phpcopy root/admin/admin_rp_clean.php to admin/admin_rp_clean.phpcopy root/admin/admin_rp_forum.php to admin/admin_rp_forum.phpcopy root/admin/admin_rp_log.php to admin/admin_rp_log.phpcopy root/admin/admin_rp_rewards_log.php to admin/admin_rp_rewards_log.phpcopy root/admin/admin_rp_settings.php to admin/admin_rp_settings.phpcopy root/images/icon_rpgold.gif to images/icon_rpgold.gifcopy root/includes/user_rp_center.php to includes/user_rp_center.phpcopy root/language/lang_english/lang_extend_rp.php to language/lang_english/lang_extend_rp.phpcopy root/language/lang_english/email/rp_clean_email.tpl to language/lang_english/email/rp_clean_email.tplcopy root/language/lang_english/email/rp_invite_email.tpl to language/lang_english/email/rp_invite_email.tplcopy root/templates/fisubice/rp_center_body.tpl to templates/fisubice/rp_center_body.tplcopy root/templates/fisubice/rp_list_body.tpl to templates/fisubice/rp_list_body.tplcopy root/templates/fisubice/rp_top_body.tpl to templates/fisubice/rp_top_body.tplcopy root/templates/fisubice/rp_top_rewards_body.tpl to templates/fisubice/rp_top_rewards_body.tplcopy root/templates/fisubice/admin/rp_clean_body.tpl to templates/fisubice/admin/rp_clean_body.tplcopy root/templates/fisubice/admin/rp_forum_body.tpl to templates/fisubice/admin/rp_forum_body.tplcopy root/templates/fisubice/admin/rp_log_body.tpl to templates/fisubice/admin/rp_log_body.tplcopy root/templates/fisubice/admin/rp_rewards_log_body.tpl to templates/fisubice/admin/rp_rewards_log_body.tplcopy root/templates/fisubice/admin/rp_settings_body.tpl to templates/fisubice/admin/rp_settings_body.tplcopy root/templates/fisubice/images/lang_english/icon_referplus.gif to templates/fisubice/images/lang_english/icon_referplus.gif ##-----[ OPEN ]------------------------------------------#profile.php ##-----[ FIND ]------------------------------------------#include($phpbb_root_path . 'common.'.$phpEx); ##-----[ AFTER, ADD ]------------------------------------------#//-- mod : Referral Plus --------------------------------------------------include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_extend_rp.' . $phpEx);//-- mod : Referral Plus -------------------------------------------------- # #-----[ OPEN ]------------------------------------------ #viewtopic.php # #-----[ FIND ]------------------------------------------ # /* Hide Buttons :: Altered $buttons_panel = pcp_output_panel('PHPBB.viewtopic.buttons', $postrow[$i]);*/ if ($userdata['session_logged_in']){ $buttons_panel = pcp_output_panel('PHPBB.viewtopic.buttons', $postrow[$i]); } # #-----[ REPLACE WITH ]------------------------------------------ # $buttons_panel = pcp_output_panel('PHPBB.viewtopic.buttons', $postrow[$i]); ##-----[ OPEN ]------------------------------------------#admin/admin_users.php ##-----[ FIND ]------------------------------------------# $sql = "SELECT privmsgs_id ##-----[ BEFORE, ADD ]------------------------------------------# // // Referral Plus // $sql = "SELECT refer_id FROM " . REFER_PLUS_TABLE . " WHERE refer_new = $user_id"; if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, $lang['Rp_error_data'], '', __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { $reward = $board_config['rp_reward']; if ( ($board_config['rp_rewards_enable']) ) $sql = "UPDATE " . USERS_TABLE . " SET $reward = $reward - ".$board_config['rp_gold']." WHERE user_id = ".$row['refer_id']; if (!($result2 = $db->sql_query($sql))) { message_die(GENERAL_ERROR, $lang['Rp_error'] . $board_config['rp_reward'], '', __LINE__, __FILE__, $sql); } } $sql = "DELETE FROM " . REFER_PLUS_TABLE . " WHERE refer_new = $user_id"; if( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['Rp_error_del_plus'], '', __LINE__, __FILE__, $sql); } $sql = "DELETE FROM " . REFER_TOP_TABLE . " WHERE refer_new = $user_id"; if( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['Rp_error_del_top'], '', __LINE__, __FILE__, $sql); } // // Referral Plus //# #-----[ OPEN ]------------------------------------------ # admin/index.php # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "../faq.$phpEx"; break; # #-----[ AFTER, ADD ]------------------------------------------ #// Referral Plus case PAGE_REFER_PANEL: $location = $lang['Rp_refer_panel']; $location_url = "index.$phpEx?pane=right"; break; case PAGE_REFER_LIST: $location = $lang['Rp_refer_list']; $location_url = "index.$phpEx?pane=right"; break; case PAGE_REFER_C_LIST: $location = $lang['Rp_refer_c_list']; $location_url = "index.$phpEx?pane=right"; break;// Referral Plus##-----[ OPEN ]------------------------------------------#includes/constants.php ##-----[ FIND ]------------------------------------------#define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); ##-----[ AFTER, ADD ]------------------------------------------#// start : Refer Plusdefine('REFER_PLUS_TABLE', $table_prefix.'refer_plus');define('REFER_TOP_TABLE', $table_prefix.'refer_top');// Fin: Refer Plus # #-----[ FIND ]------------------------------------------ # define('PAGE_TOPIC_OFFSET', 5000); # #-----[ BEFORE, ADD ]------------------------------------------ # define('PAGE_REFER_PANEL', -2065); // Referral Plusdefine('PAGE_REFER_LIST', -2066); define('PAGE_REFER_C_LIST', -2067); // Referral Plus # #-----[ OPEN ]------------------------------------------ #includes/page_header.php ##-----[ FIND ]------------------------------------------ #define('HEADER_INC', TRUE);##-----[ AFTER, ADD ]------------------------------------------#include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_extend_rp.' . $phpEx); # #-----[ FIND ]------------------------------------------ # 'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread, 'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,# #-----[ AFTER, ADD ]------------------------------------ # 'RP_REFERC_HEADER' => $board_config['rp_referc_header'], // start- Referral Plus 'RP_ADMIN_ID' => $board_config['rp_admin_id'], 'RP_INVITE_HEADER' => $board_config['rp_invite_header'], 'RP_TOP10_LIST' => $board_config['rp_top10_list'], // fin- Referral Plus# #-----[ FIND ]------------------------------------------ # 'L_USERGROUPS' => $lang['Usergroups'], # #-----[ AFTER, ADD ]------------------------------------------ # 'L_RP_CENTER' => $lang['Rp_center'], // start- Referral Plus 'L_VPROF' => $lang['Rp_vprof'], 'L_CONTADM' => $lang['Rp_contadm'], // fin- Referral Plus# #-----[ FIND ]------------------------------------------ # 'U_FAQ' => append_sid('faq.'.$phpEx), # #-----[ AFTER, ADD ]------------------------------------------ # 'U_REWARD' => append_sid('rp_list.'.$phpEx), // start- Referral Plus 'U_REWARDS' => append_sid('rp_top_rewards.'.$phpEx), 'U_TOP' => append_sid('rp_top.'.$phpEx), 'U_VPROF' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $userdata['user_id']), 'U_CENTER' => append_sid("rp_center.$phpEx?mode=referralcp&" . POST_USERS_URL . "=" . $userdata['user_id']), 'U_CONTADM' => append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $board_config['rp_admin_id']), // fin- Referral Plus ##-----[ FIND ]------------------------------------------ # $template->assign_block_vars('switch_lw_user_logged_in', array()); $template->assign_vars(array( 'L_LW_EXPIRE_REMINDER' => $lwuserreminder, ) ); } # #-----[ AFTER, ADD ]------------------------------------------ # // Referral Plusif ( ($userdata['session_logged_in']) && ($board_config['rp_enable'] =='1') && ($board_config['rp_invite'] =='1') ){ $template->assign_block_vars('switch_user_rp_center', array());}else{if ( ($board_config['rp_enable'] == '0') ){ $template->assign_block_vars('switch_user_rp_no_center', array()); }}if ( ($userdata['session_logged_in']) && ($board_config['rp_enable']) && ($board_config['rp_header'] == '1') ){ $template->assign_block_vars('switch_user_rp_header', array());}else{if ( ($board_config['rp_header'] == '0') ){ $template->assign_block_vars('switch_user_rp_no_header', array()); }}// Referral Plus ##-----[ OPEN ]------------------------------------------#includes/sessions.php # #-----[ FIND ]------------------------------------------ # $current_time = time(); unset($userdata); # #-----[ BEFORE, ADD ]------------------------------------------ #// Referral Plus if (isset($_COOKIE['RefCookie']) == false) { if (isset($_GET['refer_id']) == true ) { $refferer = $_GET['refer_id']; setcookie("RefCookie", "$refferer", time()+1814400, $cookiepath, $cookiedomain, $cookiesecure); } } // Referral Plus # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_admin.php # #-----[ FIND ]------------------------------------------ # $lang['Restore_DB'] = 'Restore Database'; # #-----[ AFTER, ADD ]------------------------------------------ #$lang['Referral_Plus'] = 'Referral Plus'; // Referral Plus$lang['Rewards: Users'] = 'Rewards: Users';$lang['View Forum'] = 'View Forum';$lang['View Referral Log'] = 'View Referral Log';$lang['View Reward Log'] = 'View Reward Log';$lang['Referral Settings'] = 'Referral Settings'; // Referral Plus ##-----[ OPEN ]------------------------------------------#profilcp/profilcp_board_config.php ##-----[ FIND ]------------------------------------------#// startif ( !defined('IN_PHPBB') ){ die('Hacking attempt'); exit;} ##-----[ AFTER, ADD ]------------------------------------------#//// Referral Plus//if ( !empty($HTTP_GET_VARS['refer_id']) ){ $refer_id = intval($HTTP_GET_VARS['refer_id']);}else if (!empty($HTTP_POST_VARS['refer_id'])){ $refer_id = intval($HTTP_POST_VARS['refer_id']);}else{ $refer_id = intval($board_config['rp_default_id']);} //// Referral Plus// ##-----[ FIND ]------------------------------------------# // insert user + start transaction $sql = "INSERT INTO " . USERS_TABLE . "($sql_key) VALUES ($sql_val)"; if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) ){ message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql); } ##-----[ AFTER, ADD ]------------------------------------------# // // Referral Plus // if ($board_config['rp_enable']) { if ($refer_id != '') { $sql = "INSERT INTO " . REFER_PLUS_TABLE . " (rp_id, refer_id, refer_new, rp_time) VALUES ('', '" . $refer_id . "', '" . intval($user_id) . "', '" . time() . "')"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Sorry, but the data could not be entered', '', __LINE__, __FILE__, $sql); } } } if ($board_config['rp_rtop_enable']) { if ($refer_id != '') { $sql = "INSERT INTO " . REFER_TOP_TABLE . " (rp_id, refer_id, refer_new, rp_time) VALUES ('', '" . $refer_id . "', '" . intval($user_id) . "', '" . time() . "')"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Sorry, but the data could not be entered', '', __LINE__, __FILE__, $sql); } } } // // Referral Plus // ##-----[ FIND ]------------------------------------------# // send messages // relocate $ret_link = append_sid("./portal.$phpEx"); # #-----[ BEFORE, ADD ]------------------------------------------ # // // Referral Plus // $reward = $board_config['rp_reward']; if ( ($board_config['rp_rewards_enable'] == '1') ) { $rp_reward = $reward + $board_config['rp_gold']; $sql = "UPDATE " . USERS_TABLE . " SET $reward = $reward + $rp_reward WHERE user_id = '" . str_replace("'", "''", $refer_id) . "'"; if( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, $lang['Rp_error'] . $board_config['rp_reward'], '', __LINE__, __FILE__, $sql); } } // // Referral Plus // # #-----[ FIND ]------------------------------------------ # // system $s_hidden_fields .= '<input>'; $s_hidden_fields .= '<input>'; $s_hidden_fields .= '<input>'; $s_hidden_fields .= '<input>'; # #-----[ AFTER, ADD ]------------------------------------------ # //// Referral Plus // $s_hidden_fields .= '<input>';//// Referral Plus // ##-----[ OPEN ]------------------------------------------#profilcp/def/def_userfields.php # #-----[ FIND ]------------------------------------------ # // messengers informations # #-----[ BEFORE, ADD ]------------------------------------------ # 'user_totalpvm' => array( 'lang_key' => $board_config['rp_time'], 'class' => 'generic', 'type' => 'MEDIUMINT', 'visibility' => true, 'dsp_func' => 'pcp_output_rp_totalpvm', ), 'user_rp_refer' => array( 'lang_key' => 'Refer', 'class' => 'generic', 'type' => 'MEDIUMINT', 'visibility' => true, 'dsp_func' => 'pcp_output_user_rp_refer', ), ##-----[ OPEN ]------------------------------------------#profilcp/def/def_userfuncs_custom.php ##-----[ FIND ]------------------------------------------#?> ##-----[ BEFORE, ADD ]------------------------------------------##//-----------------------------------//// user_totalpvm output function////----------------------------------- function pcp_output_rp_totalpvm($field_name, $view_userdata, $map_name=''){global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata;global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields;global $db; $txt = ''; $img = ''; $res = ''; if ( ($board_config['rp_enable'] == '1') && ($view_userdata['user_posts']) >= ($board_config['rp_posts_allowed']) ) { $rp_life_time = $board_config['rp_life_time']; $refer_id = $view_userdata['user_id']; $sql = "SELECT COUNT(rp_id) AS rp_total FROM " . REFER_PLUS_TABLE . " WHERE refer_id = $refer_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, $lang['Rp_error_data'], '', __LINE__, __FILE__, $sql); } $refer_plus_total = array(); $refer_plus_total = $db->sql_fetchrow($result); $refer_plus_total = $refer_plus_total['rp_total']; $temp_url = $refer_plus_total; $refer_plus = $board_config['rp_life_time']; $invite = append_sid("rp_center.$phpEx?mode=referralcp&" . POST_USERS_URL . "=" . $userdata['user_id'].""); $txt = $temp_url . ' <span>' . $refer_plus . ' </span><a><i>' . $board_config['rp_referc_header'] . '</i></a>'; } else { $board_config['rp_referc_header'] = $lang['Rp_or']; $refer_plus_total = ''; $invite = append_sid('index.'.$phpEx); $refer_plus = ($lang['Rp_post_amount'] . $board_config['rp_posts_allowed'] . $lang['Rp_post_refer']); $txt = $temp_url . ' <span>' . $refer_plus . ' </span><a><i>' . $board_config['rp_referc_header'] . '</i></a>'; } // result $res = pcp_output_format($field_name, $txt, $img, $map_name); return $res;} //-----------------------------------//// user_rp_refer output function////-----------------------------------function pcp_output_user_rp_refer($field_name, $view_userdata, $map_name=''){ global $board_config, $phpbb_root_path, $phpEx, $lang, $images, $userdata, $db; global $values_list, $tables_linked, $classes_fields, $user_maps, $user_fields; $img = ''; $res = ''; $poster_id = $view_userdata['user_id']; if (($board_config['rp_enable']) && ($userdata['user_id'] == ANONYMOUS)) { $temp_url = append_sid("profile.$phpEx?mode=profil&sub=profile_prefer&mod=0&refer_id=$poster_id"); $img = '<a><img></a>'; } else { $img = ''; } // result $res = pcp_output_format($field_name, $txt, $img, $map_name); return $res;} # #-----[ OPEN ]------------------------------------------ # profilcp/def/def_userfuncs_viewonline.php # #-----[ FIND ]------------------------------------------ # case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "faq.$phpEx"; break; # #-----[ AFTER, ADD ]------------------------------------------ #// Referral Plus case PAGE_REFER_PANEL: $location = $lang['Rp_refer_panel']; $location_url = "rp_center.$phpEx"; break; case PAGE_REFER_LIST: $location = $lang['Rp_refer_list']; $location_url = "rp_top.$phpEx"; break; case PAGE_REFER_C_LIST: $location = $lang['Rp_refer_c_list']; $location_url = "rp_top_rewards.$phpEx"; break;// Referral Plus ##-----[ OPEN ]------------------------------------------#profilcp/def/def_usermaps.php ##-----[ FIND ]------------------------------------------# ), ), 'PCP.viewprofile.base.real' => array( # #-----[ BEFORE, ADD ]------------------------------------------ # '[lf]4' => array( ), 'user_totalpvm' => array( 'leg' => true, 'txt' => true, 'style' => '<span>%s</span>', ), # #-----[ FIND ]------------------------------------------ # 'PHPBB.viewtopic.buttons' => array( 'title' => 'Buttons', 'fields' => array( 'username' => array( 'img' => true, 'style' => '<td><span>%s </span></td>', ), # #-----[ AFTER, ADD ]------------------------------------------ # 'user_rp_refer' => array( 'img' => true, 'style' => '<td><span>%s </span></td>', ), ##-----[ OPEN ]------------------------------------------#templates/fisubice/fisubice.cfg ##-----[ FIND ]------------------------------------------#$images['icon_quote'] = "$current_template_images/{LANG}/icon_quote.gif" width="$topic_iw" height="$topic_ih" class="imgtopic"; ##-----[ BEFORE, ADD ]------------------------------------------# //-- mod : Referral Plus -------------------------------------------------------$images['icon_referplus'] = "$current_template_images/{LANG}/icon_referplus.gif";//-- mod : Referral Plus ------------------------------------------------------- ##-----[ DIY ]------------------------------------------#Now you must manually add several links to the qbar, all links are optional. Qbar Configuration can be found in ACP>General Admin>Qbar.Select either Menu or Board Config depending on where you would like the links to appear.Once you have selected where you would like the links, do the following so that they appear. Link to Referall Center1. Scroll down to the bottom of the page and click "Add a new field".2. Input the following information into the form. - Field Name: Referall Center - Display Shortcut: Yes - Shortcut: Referall Center - phpBB prog: Yes - Program URL: rp_center_redirect.php - Logged In: Required All other form fields are optional.3. Click Submit Link to Top 10 Referalls1. Scroll down to the bottom of the page and click "Add a new field".2. Input the following information into the form. - Field Name: Top 10 Referalls - Display Shortcut: Yes - Shortcut: Top 10 Referalls - phpBB prog: Yes - Program URL: rp_list.php - Logged In: Required All other form fields are optional.3. Click Submit Link to Contact Admin1. Scroll down to the bottom of the page and click "Add a new field".2. Input the following information into the form. - Field Name: Contact Admin - Display Shortcut: Yes - Shortcut: Contact Admin - phpBB prog: Yes - Program URL: privmsg.php?mode=post&u=2 - Logged In: Required All other form fields are optional.3. Click Submit Move the links where you would like in the list by using the "move up/move down" option. ##-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ ## EoM
<php>sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Could not obtain lastvisit data from user table', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); if ( $user_id != ANONYMOUS ) { lw_check_membership($userdata); $auto_login_key = $userdata['user_password']; if ( $auto_create ) { if ( isset($sessiondata['autologinid']) && $userdata['user_active'] ) { // We have to login automagically if( $sessiondata['autologinid'] === $auto_login_key ) { // autologinid matches password $login = 1; $enable_autologin = 1; } else { // No match; don't login, set as anonymous user $login = 0; $enable_autologin = 0; $user_id = $userdata['user_id'] = ANONYMOUS; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; $result = $db->sql_query($sql); $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); } } else { // Autologin is not set. Don't login, set as anonymous user $login = 0; $enable_autologin = 0; $user_id = $userdata['user_id'] = ANONYMOUS; $sql = 'SELECT * FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS; $result = $db->sql_query($sql); $userdata = $db->sql_fetchrow($result); $db->sql_freeresult($result); } } else { $login = 1; } } else { $login = 0; $enable_autologin = 0; } // // Initial ban check against user id, IP and email address // preg_match('/(..)(..)(..)(..)/', $user_ip, $user_ip_parts); $sql = "SELECT ban_ip, ban_userid, ban_email FROM " . BANLIST_TABLE . " WHERE ban_ip IN ('" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . $user_ip_parts[4] . "', '" . $user_ip_parts[1] . $user_ip_parts[2] . $user_ip_parts[3] . "ff', '" . $user_ip_parts[1] . $user_ip_parts[2] . "ffff', '" . $user_ip_parts[1] . "ffffff') OR ban_userid = $user_id"; if ( $user_id != ANONYMOUS ) { $sql .= " OR ban_email LIKE '" . str_replace("'", "''", $userdata['user_email']) . "' OR ban_email LIKE '" . substr(str_replace("'", "''", $userdata['user_email']), strpos(str_replace("'", "''", $userdata['user_email']), "@")) . "'"; } if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Could not obtain ban information', '', __LINE__, __FILE__, $sql); } if ( $ban_info = $db->sql_fetchrow($result) ) { if ( $ban_info['ban_ip'] || $ban_info['ban_userid'] || $ban_info['ban_email'] ) { message_die(CRITICAL_MESSAGE, 'You_been_banned'); } } // // Create or update the session // $sql = "UPDATE " . SESSIONS_TABLE . " SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin WHERE session_id = '" . $session_id . "' AND session_ip = '$user_ip'"; if ( !$db->sql_query($sql) || !$db->sql_affectedrows() ) { list($sec, $usec) = explode(' ', microtime()); mt_srand((float) $sec + ((float) $usec * 100000)); //$session_id = md5(uniqid(mt_rand(), true)); global $HTTP_SERVER_VARS; $session_id = ( !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) ? md5(uniqid(mt_rand(), true)) : md5(d8ef2eab); $sql = "INSERT INTO " . SESSIONS_TABLE . " (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin) VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql); } } if ( $user_id != ANONYMOUS ) {// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : ( $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; if (!$admin) { $sql = "UPDATE " . USERS_TABLE . " SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit WHERE user_id = $user_id"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql); } } $userdata['user_lastvisit'] = $last_visit; $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologinid']; $sessiondata['userid'] = $user_id; } $userdata['session_id'] = $session_id; $userdata['session_ip'] = $user_ip; $userdata['session_user_id'] = $user_id; $userdata['session_logged_in'] = $login; $userdata['session_page'] = $page_id; $userdata['session_start'] = $current_time; $userdata['session_time'] = $current_time; $userdata['session_admin'] = $admin; setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure); $SID = 'sid=' . $session_id; return $userdata;} //// Checks for a given user session, tidies session table and updates user// sessions at each page refresh//function session_pagestart($user_ip, $thispage_id){ global $db, $lang, $board_config; global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID; $cookiename = $board_config['cookie_name']; $cookiepath = $board_config['cookie_path']; $cookiedomain = $board_config['cookie_domain']; $cookiesecure = $board_config['cookie_secure']; // Referral Plus if (isset($_COOKIE['RefCookie']) == false) { if (isset($_GET['refer_id']) == true ) { $refferer = $_GET['refer_id']; setcookie("RefCookie", "$refferer", time()+1814400, $cookiepath, $cookiedomain, $cookiesecure); } } // Referral Plus $current_time = time(); unset($userdata); if ( isset($HTTP_COOKIE_VARS[$cookiename . '_sid']) || isset($HTTP_COOKIE_VARS[$cookiename . '_data']) ) { $sessiondata = isset( $HTTP_COOKIE_VARS[$cookiename . '_data'] ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookiename . '_data'])) : array(); $session_id = isset( $HTTP_COOKIE_VARS[$cookiename . '_sid'] ) ? $HTTP_COOKIE_VARS[$cookiename . '_sid'] : ''; $sessionmethod = SESSION_METHOD_COOKIE; } else { $sessiondata = array(); $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : ''; $sessionmethod = SESSION_METHOD_GET; } if (!preg_match('/^[A-Za-z0-9]*$/', $session_id)) { $session_id = ''; } global $HTTP_SERVER_VARS; if ( empty($session_id) && strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') ) { $sessiondata = ''; $session_id = md5(d8ef2eab); $sessionmethod = SESSION_METHOD_GET; } $thispage_id = (int) $thispage_id; // // Does a session exist? // if ( !empty($session_id) ) { // // session_id exists so go ahead and attempt to grab all // data in preparation // $sql = "SELECT u.*, s.* FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u WHERE s.session_id = '$session_id' AND u.user_id = s.session_user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); } $userdata = $db->sql_fetchrow($result); // // Did the session exist in the DB? // if ( isset($userdata['user_id']) ) { lw_check_membership($userdata); // // Do not check IP assuming equivalence, if IPv4 we'll check only first 24 // bits ... I've been told (by vHiker) this should alleviate problems with // load balanced et al proxies while retaining some reliance on IP security. // $ip_check_s = substr($userdata['session_ip'], 0, 6); $ip_check_u = substr($user_ip, 0, 6); if (( $ip_check_s == $ip_check_u ) || ($session_id == md5(d8ef2eab)&&(strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot')))) { $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : ''; // // Only update session DB a minute or so after last update // if ( $current_time - $userdata['session_time'] > 60 ) { // A little trick to reset session_admin on session re-usage $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', session_admin = 0' : ''; $sql = "UPDATE " . SESSIONS_TABLE . " SET session_time = $current_time, session_page = $thispage_id$update_admin WHERE session_id = '" . $userdata['session_id'] . "'"; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql); } if ( $userdata['user_id'] != ANONYMOUS ) { $sql = "UPDATE " . USERS_TABLE . " SET user_session_time = $current_time, user_session_page = $thispage_id WHERE user_id = " . $userdata['user_id']; if ( !$db->sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql); } } // // Delete expired sessions // $expiry_time = $current_time - $board_config['session_length']; $sql = "DELETE FROM " . SESSIONS_TABLE . " WHERE session_time < $expiry_time AND session_id <session_id>sql_query($sql) ) { message_die(CRITICAL_ERROR, 'Error removing user session', '', __LINE__, __FILE__, $sql); } setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure); return true;} //// Append $SID to a url. Borrowed from phplib and modified. This is an// extra routine utilised by the session code above and acts as a wrapper// around every single URL and form action. If you replace the session// code you must include this routine, even if it's empty.//function append_sid($url, $non_html_amp = false){ global $SID, $HTTP_SERVER_VARS; if ( !empty($SID) && !preg_match('#sid=#', $url) && !defined('IS_ROBOT') ) { $url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } return $url;} ?>