Can anyone help me out pleaseee

Wondering why that MOD you have won't install correctly? Let's take a look
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
User avatar
Poomerio
Registered User
Posts: 552
Joined: Tue Jan 02, 2007 7:09 pm
Location: 4(x - 20y) = 20

EM Friendly Referral Plus MOD

Post by Poomerio »

Here is an EM friendly version of the Referral Plus MOD:

Code: Select all

################################################################
## MOD Title: Referral Plus
## MOD Author: MentalMaze < N/A > (Michael) http://msmconstruction.net/dev/
## MOD Description: Adds an Advanced Referall System with User Management and Rewards System add-on.
## MOD Version: 1.4.0
##
## Installation Level: Intermediate
## Installation Time: 25
## Files To Edit: profile.php
##		  viewonline.php
##		  viewtopic.php
##		  admin/index.php
##		  admin/admin_users.php
##		  includes/constants.php
##		  includes/page_header.php
##		  includes/sessions.php
##		  includes/usercp_register.php
##		  includes/usercp_viewprofile.php
##		  language/lang_english/lang_admin.php
##		  templates/subSilver/overall_header.tpl
##		  templates/subSilver/profile_view_body.tpl
##		  templates/subSilver/subSilver.cfg
##		  templates/subSilver/viewtopic_body.tpl
##		   
## Included Files: rp_center.php
##		   rp_list.php
##		   rp_top.php
##		   rp_top_rewards.php
##                 admin/admin_rp_clean.php
##                 admin/admin_rp_forum.php
##                 admin/admin_rp_log.php
##		   admin/admin_rp_rewards_log.php
##                 admin/rp_settings.php
##                 images/icon_rpgold.gif
##		   includes/user_rp_center.php
##		   language/lang_english/lang_extend_rp.php
##		   language/lang_english/email/rp_clean_email.tpl
##		   language/lang_english/email/rp_invite_email.tpl
##		   templates/subSilver/rp_center_body.tpl
##		   templates/subSilver/rp_list_body.tpl
##		   templates/subSilver/rp_top_body.tpl
##		   templates/subSilver/rp_top_rewards_body.tpl
##                 templates/subSilver/admin/rp_clean_body.tpl
##                 templates/subSilver/admin/rp_forum_body.tpl
##                 templates/subSilver/admin/rp_log_body.tpl
##		   templates/subSilver/admin/rp_rewards_log_body.tpl
##                 templates/subSilver/admin/rp_settings_body.tpl
##                 templates/subSilver/images/lang_english/icon_referplus.gif
##
## License: http://opensource.org/licenses/gpl-license.php GNU Public License v2                  
############################################################## 
## For security purposes, please check: http://www.phpbb.com/mods/ 
## for the latest version of this MOD. Although MODs are checked 
## before being allowed in the MODs Database there is no guarantee 
## that there are no security problems within the MOD. No support 
## will be given for MODs not found within the MODs Database which 
## can be found at http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes:
##
##	Expanded Description:
##	1. Tracking of referrals through cookie allows referred member to browse before joining while
##	   still giving credit to referring user.
##	2. All referral information is availble	to users in the Referral Center including Invite email
##	   and Top 10 Pages along with the lists for whom they referred, both current and all time.
##	3. Adds 2 Top 10 member referral pages, one "Lifetime" and one "Current". 
##	4. Adds Invite Email for members to use to Invite Friends. Complete with forum link 
##	   and refer_id to track who referred the member.
##	5. Adds links to the Page Header which may be configured to View or not View.
##	6. Adds referral ability and keeps track of the total "Lifetime" and 
##	   "Current Promotion" referrals for all users.
##	7. Adds Member Rewards for referrals using Cash Mod which users get when they refer people.
##	   It will automatically add the Configurable Rewards to the referring members Rewards
##	   when the referred member joins. 
##	8. Offers User Reward Management. It will in the case of deleteing a refered user, 
##	   delete the user and the Referral Rewards from the referring member. So if you get
##	   bogus referrals you can use User Rewards Management to delete users which have not
##	   activated their account or have a zero post count. The Reward will be removed from
##	   the referring members Reward reserves. Send email to zero post or non activated accounts.
##
##	Special thanks to Smootchie for providing cookie tracking concept of the refer_id.
##	Special thanks to ycl6 for for getting me to look closer at the code for this Mod.
##	Thanks ptirhiik for the style for Referral Center.
##	Thanks to Yzaak for allowing the testing of new features on her forum.
##	Special thanks to "wGEric" for his excellant code which helped make 
##	User Rewards Management	a reality.
##	Thanks to ptirhiik and Hater for helping me with a bug fix.
##	Special thanks to alcaeus who helped me sort out my SQL issues
##	when deleting user gold if a reffered member was deleted.
##
##	Contrib:
##	* Categories hierarchy - 2.1.x adaptation.
##	* Advanced Version Check compatible. http://www.phpbb.com/phpBB/viewtopic.php?t=281446
##	* PCP 2x for phpbb. Not tested with Categories hierarchy - 2.1.x
##	* Cash Mod fix for Categories hierarchy - 2.1.x
##
##	Translations onto Referral Plus:
##	* French: Thanks to calibal.
##
##	Referral Plus was started from Doe Ray Me's Bring People based on John B. Abela's referral mod.
##	This adds and combines many functions to create a Referral "Plus" program that can be used
##	with Cash Mod by Xcore.
##
##   Original Mods by:
##
##   **Mod Title: Bring People
##   **Author: Doe Ray Me < admin@drm-hacks.com > (William Shand) http://www.drm-hacks.com
##   **Copyright:      Copyright © 2005 Bring People - Without PCP 0.2.3 - William Shand
##   **Mod Title: Referral Mod
##   **Copyright © John B. Abela, < abela@johnabela.com >  http://www.johnabela.com/mods/ 
##
##
##	PRIOR TO INSTALLATION: If choosing to use with Cash Mod
##
##	Set rewards to enable if you choose to use the rewards system after installation!
##	If you have cash mod or points system and wish to use the rewards system,
##
##	FOLLOW carefully these pre-install steps: 
##	* To have a seperate reward for Referrals Only you must set up a new user_* in cash mod.
##	1. Be sure you have a currency setup in Cash Mod to use for rewards if you choose to use the
##	   rewards system. Where Name of currency = user_* This may be one you allready use.
##	   Database field for currency (this must be set according to cash mod or a points system
##	   with user_*) = user_gold or whatever you choose. Number of decimals for currency = 0, 
##	   Default value for currency = 0. ( you may set this to whatever you like if you want the user to
##	   get a certain amount of Reward when they register).
##
##	2. If you want to use the image provided then set "Display the currency as an image" to yes.
##	   (This part must be done after copy)Set image path to images/icon_rpgold.gif. 
##	   and set all values under "Implementation" to 0 if you only want users to get this
##	   currency for referrals.. 
##
##	3. If you do not want users to exchange or donate this Gold be sure,
##		Implementation/Allow users to exchange this currency = no
##		Implementation/Allow users to donate their cash to other users = no
##
############################################################## 
## MOD History:
## 2005/08/13 v1.4.0 Method added to track refer_id with cookie. Small changes to Invite email language.
## 2005/08/13 v1.2.4 Small bug fix in user_rp_center not caught on update for phpbb v2.0.17.
## 2005/08/07 v1.2.3 Another liitle change to email handling and some minor ACP updates.
## 2005/08/03 v1.2.2 Changed handling of mail for invite email.
## 2005/07/31 v1.2.1 Updated switching for page header and applied new page constants.
## 2005/07/27 v1.2.0 Set new method of tracking referrals. Changes to DB. Several code changes. 
## 2005/07/18 v1.1.4 Applied fixes for phpBB update ver2.0.17 when deleting users in Rewards Users.
##		     Changed redirect after send email to return to Referral Center not index.
##		     Set email to use first part of email address as name in email.
## 2005/07/17 v1.1.3 Fixed ACP View forum to reflect ability to change the language 
##		     for current top 10 list.
## 2005/07/16 v1.1.2 Changed most error handling to lang file.
## 2005/07/14 v1.1.1 Enhanced user side and ACP functions. Made many changes to code
##		     to bring up to phpbb standards. Many changes to tpl's for code changes.
##		     Switching re-worked a bit. Header links changed.
## 2005/06/30 v1.0.0 Finalized documentation. Small lang and format changes. For history
##		     prior to 1.0.0 see Docs/Updates/Mod_History.txt
## 
##############################################################  
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ SQL ]------------------------------------------
# If you have another Pre-Fix, please change it.
# If a translation exists for your language use the lang_yourlang_install.txt to install the SQL
#

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_gold' );
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.php
copy root/rp_list.php to rp_list.php
copy root/rp_top.php to rp_top.php
copy root/rp_top_rewards.php to rp_top_rewards.php
copy root/admin/admin_rp_clean.php to admin/admin_rp_clean.php
copy root/admin/admin_rp_forum.php to admin/admin_rp_forum.php
copy root/admin/admin_rp_log.php to admin/admin_rp_log.php
copy root/admin/admin_rp_rewards_log.php to admin/admin_rp_rewards_log.php
copy root/admin/admin_rp_settings.php to admin/admin_rp_settings.php
copy root/images/icon_rpgold.gif to images/icon_rpgold.gif
copy root/includes/user_rp_center.php to includes/user_rp_center.php
copy root/language/lang_english/lang_extend_rp.php to language/lang_english/lang_extend_rp.php
copy root/language/lang_english/email/rp_clean_email.tpl to language/lang_english/email/rp_clean_email.tpl
copy root/language/lang_english/email/rp_invite_email.tpl to language/lang_english/email/rp_invite_email.tpl
copy root/templates/subSilver/rp_center_body.tpl to templates/subSilver/rp_center_body.tpl
copy root/templates/subSilver/rp_list_body.tpl to templates/subSilver/rp_list_body.tpl
copy root/templates/subSilver/rp_top_body.tpl to templates/subSilver/rp_top_body.tpl
copy root/templates/subSilver/rp_top_rewards_body.tpl to templates/subSilver/rp_top_rewards_body.tpl
copy root/templates/subSilver/admin/rp_clean_body.tpl to templates/subSilver/admin/rp_clean_body.tpl
copy root/templates/subSilver/admin/rp_forum_body.tpl to templates/subSilver/admin/rp_forum_body.tpl
copy root/templates/subSilver/admin/rp_log_body.tpl to templates/subSilver/admin/rp_log_body.tpl
copy root/templates/subSilver/admin/rp_rewards_log_body.tpl to templates/subSilver/admin/rp_rewards_log_body.tpl
copy root/templates/subSilver/admin/rp_settings_body.tpl to templates/subSilver/admin/rp_settings_body.tpl
copy root/templates/subSilver/images/lang_english/icon_referplus.gif to templates/subSilver/images/lang_english/icon_referplus.gif

# 
#-----[ OPEN ]------------------------------------------ 
#

viewonline.php

#
#-----[ FIND ]------------------------------------------
#
<?php

#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus --------------------------------------------------
# 
#-----[ 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 ]------------------------------------------
#
profile.php

#
#-----[ FIND ]------------------------------------------
#
<?php

#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus --------------------------------------------------
#
#-----[ 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 ]------------------------------------------
#
<?php

#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$user_sig_bbcode_uid = $postrow[$i]['user_sig_bbcode_uid'];

#
#-----[ BEFORE, ADD ]------------------------------------------
#
        //
        // Referral Plus
        //
        if (($board_config['rp_enable']) && ($userdata['user_id'] == ANONYMOUS))
        {
                $temp_url = append_sid("profile.$phpEx?mode=register&refer_id=$poster_id");
                $refer_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_referplus'] . '" alt="' . $lang['Rp_viewtopic'] . '" title="' . $lang['Rp_viewtopic'] . '" border="0" /></a>';
        }
        else
        {
                $refer_img = '';
		}
        //
        // Referral Plus
        //

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

		'PROFILE' => $profile,

#
#-----[ AFTER, ADD ]------------------------------------------
#
        'REFER_IMG' => $refer_img, // Referral Plus
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ 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 ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#

						case PAGE_FAQ:
							$location = $lang['Viewing_FAQ'];
							$location_url = "index.$phpEx?pane=right";
							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 ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
# 
#-----[ FIND ]------------------------------------------ 
#

define('PAGE_TOPIC_OFFSET', 5000);

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
define('PAGE_REFER_PANEL', -2065); // Referral Plus
define('PAGE_REFER_LIST', -2066); 
define('PAGE_REFER_C_LIST', -2067); // Referral Plus
#
#-----[ FIND ]------------------------------------------
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');

#
#-----[ AFTER, ADD ]------------------------------------------
#
// start : Refer Plus
define('REFER_PLUS_TABLE', $table_prefix.'refer_plus');
define('REFER_TOP_TABLE', $table_prefix.'refer_top');
// Fin: Refer Plus

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
<?php

#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus --------------------------------------------------
#
#-----[ 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 ]------------------------------------------ 
# Admin ID handled in ACP for contact admin link.
	'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 ]------------------------------------------ 
#

//
// Login box?
//
if ( !$userdata['session_logged_in'] )
{
	$template->assign_block_vars('switch_user_logged_out', array());
	//
	// Allow autologin?
	//
	if (!isset($board_config['allow_autologin']) || $board_config['allow_autologin'] )
	{
		$template->assign_block_vars('switch_allow_autologin', array());
		$template->assign_block_vars('switch_user_logged_out.switch_allow_autologin', array());
	}
}
else
{
	$template->assign_block_vars('switch_user_logged_in', array());

	if ( !empty($userdata['user_popup_pm']) )
	{
		$template->assign_block_vars('switch_enable_pm_popup', array());
	}
}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

// Referral Plus
if ( ($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 ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
# 
#-----[ 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 ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$unhtml_specialchars_replace = array('>', '<', '"', '&');

#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Referral Plus
//
if (isset($_COOKIE['RefCookie']) == true) 
    $refer_id = intval($_COOKIE['RefCookie']);
else 
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 ]------------------------------------------
#
function show_coppa()
{

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//
//-- mod : Referral Plus -------------------------------------------------------
// modify add:  , $refer_id;
# 
#-----[ FIND ]------------------------------------------ 
#

	global $userdata, $template, $lang, $phpbb_root_path, $phpEx;
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

$phpEx

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

, $refer_id

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

		"AGREE_UNDER_13" => $lang['Agree_under_13'],
		'DO_NOT_AGREE' => $lang['Agree_not'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
		//
		// Referral Plus
		// modify add: &refer_id=$refer_id
# 
#-----[ FIND ]------------------------------------------ 
#
		"U_AGREE_OVER13" => append_sid("profile.$phpEx?mode=register&agreed=true"),

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

agreed=true

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
&refer_id=$refer_id

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

		"U_AGREE_UNDER13" => append_sid("profile.$phpEx?mode=register&agreed=true&coppa=true"))

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

&coppa=true

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
&refer_id=$refer_id
# 
#-----[ FIND ]------------------------------------------ 
#

	);

	$template->pparse('body');

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
		//
		// Referral Plus
		//

#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)

#
#-----[ BEFORE, 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, $lang['Rp_error_enter'], '', __LINE__, __FILE__, $sql);
                                      }
                                }
                        }

                        if ($board_config['rp_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, $lang['Rp_error_enter'], '', __LINE__, __FILE__, $sql);
                                      }
                                }
                        }
                        //
                        // Referral Plus
                        //
#
#-----[ FIND ]------------------------------------------
#
			$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'],  '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

#
#-----[ AFTER, 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 ]------------------------------------------ 
#

			case USER_AVATAR_GALLERY:
				$avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $user_avatar . '" alt="" />' : '';
				break;
		}
	}


# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

//
// Referral Plus
// modify-add <input type="hidden" name="refer_id" value="' . $refer_id . '" />'
# 
#-----[ FIND ]------------------------------------------ 
#

	$s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="agreed" value="true" /><input type="hidden" name="coppa" value="' . $coppa . '" />';

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#

<input type="hidden" name="coppa" value="' . $coppa . '" />

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#

<input type="hidden" name="refer_id" value="' . $refer_id . '" />


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

	if( $mode == 'editprofile' )
	{

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
// Referral Plus
//

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

#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
//
// Generate page
//

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
// Referral Plus
//
if ( ($board_config['rp_enable'] == '1') && ($profiledata['user_posts']) >= ($board_config['rp_posts_allowed']) )
{
	$rp_life_time = $board_config['rp_life_time'];
	$refer_id = $profiledata['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'];
// Display total referrals
	$temp_url = $refer_plus_total;

		$invite = append_sid('rp_center.'.$phpEx.'?mode=referralcp&u='.$userdata['user_id']);
		$refer_plus = $board_config['rp_life_time'];
}
else
{
	$board_config['rp_referc_header'] = $lang['Rp_disabledm'];
	$refer_plus_total = '';
	$invite = append_sid('index.'.$phpEx);
	$refer_plus = ($lang['Rp_post_amount'] . $board_config['rp_posts_allowed'] . $lang['Rp_post_refer']);
}
// Use switch to remove all signs of Referral Plus from forum!
if ( ($board_config['rp_enable'] == '1') )
{
	$template->assign_block_vars('switch_user_rp_enable', array());
}
else
{
if ( ($board_config['rp_enable'] == '0') )
{
	$template->assign_block_vars('switch_user_rp_no_enable', array());
	}
}

//
// Referral Plus
//
#
#-----[ FIND ]------------------------------------------
#
	'YIM' => $yim,

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'REFER_PLUS' => $refer_plus, // Referral Plus
	'INVITE' => $invite,
	'REFER_PLUS_TOTAL' => $refer_plus_total,
	'RP_REFERC_HEADER' => $board_config['rp_referc_header'], // end Referral Plus

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
<?php

#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus --------------------------------------------------

# 
#-----[ 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 ]------------------------------------------
# 
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#
<td height="25" align="center" valign="top" nowrap="nowrap">
#
#-----[ FIND ]------------------------------------------
#
{L_LOGIN_LOGOUT}
#
#-----[ FIND ]------------------------------------------
#
</tr>
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# in new line
					<tr>
						<td height="25" align="center" valign="top" nowrap="nowrap">
						<span class="mainmenu">&nbsp;
						<!-- BEGIN switch_user_rp_center -->
						<a href="{U_CENTER}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{RP_REFERC_HEADER}" hspace="3" />{RP_REFERC_HEADER}</a>
						<!-- END switch_user_rp_center -->
						<!-- BEGIN switch_user_rp_header -->
						&nbsp;<a href="{U_REWARD}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{RP_TOP10_LIST}" hspace="3" />{RP_TOP10_LIST}</a>&nbsp;<a href="{U_VPROF}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_VPROF}" hspace="3" />{L_VPROF}</a>&nbsp;&nbsp;<a href="{U_CONTADM}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{L_CONTADM}" hspace="3" />{L_CONTADM}</a>&nbsp;</span>
						<!-- END switch_user_rp_header -->
						</td>
					</tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# in new line
		<!-- BEGIN switch_user_rp_enable -->
	        <tr>
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{RP_REFERC_HEADER}:</span></td>
                  <td><b><span class="gen">{REFER_PLUS_TOTAL}&nbsp;{REFER_PLUS}&nbsp;<a href="{INVITE}"class="gen">{RP_REFERC_HEADER}</a></span></b></td>
		</tr>
		<!-- END switch_user_rp_enable -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#
<?php

#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ FIND ]------------------------------------------
#
$images['icon_quote'] = "$current_template_images/{LANG}/icon_quote.gif";

#
#-----[ BEFORE, ADD ]------------------------------------------
#

//-- mod : Referral Plus -------------------------------------------------------
$images['icon_referplus'] = "$current_template_images/{LANG}/icon_referplus.gif";
//-- mod : Referral Plus -------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{postrow.PROFILE_IMG}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.PROFILE_IMG}

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 {postrow.REFER_IMG}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
- Poomie

abdulbasit
Registered User
Posts: 18
Joined: Thu Oct 12, 2006 9:44 am

Re: Can anyone help me out pleaseee

Post by abdulbasit »

Thank You so much for your help Sir.

I just want to ask you one question that yesterday you fixed my Advanced Referral Mod codes and i was getting internal server error which just now host fixed it and while on step 2 i get these 2 errors.

2 Warning(s) reported by the SQL Parser
Non-portable syntax option(s) "TYPE=MyISAM", ignored, statement: 1, table: "phpbb_refer_plus"
Non-portable syntax option(s) "TYPE=MyISAM", ignored, statement: 3, table: "phpbb_refer_top"

Can i continue to step 3? Will my board get some problem ? Or what should i do now ?

Waiting for your reply,

Thank You,
AB

User avatar
Poomerio
Registered User
Posts: 552
Joined: Tue Jan 02, 2007 7:09 pm
Location: 4(x - 20y) = 20

Re: Can anyone help me out pleaseee

Post by Poomerio »

I suggest you contact the MOD author about this.
Or you could do what I suggested in the PM I sent you.

- Poomie

abdulbasit
Registered User
Posts: 18
Joined: Thu Oct 12, 2006 9:44 am

Re: Can anyone help me out pleaseee

Post by abdulbasit »

Okay Sir. Thanks a lot for your great help and support.

abdulbasit
Registered User
Posts: 18
Joined: Thu Oct 12, 2006 9:44 am

Re: Can anyone help me out pleaseee

Post by abdulbasit »

& what about User Class MOD. Can you help me in that too ?

abdulbasit
Registered User
Posts: 18
Joined: Thu Oct 12, 2006 9:44 am

Re: Can anyone help me out pleaseee

Post by abdulbasit »

Thanks a lot. You have helped me a lot and lottt. All the mods are working perfectly well.

:)

Locked