PS: This utilizes the current "Allowance" from any of Napoleon's mods if you've already installed Tetris and use this system instead of Points or Quiz ofcourse. Should take minor tweaking to convert to "Points" if you desire.
Code: Select all
#################################################################
## MOD Title: Referral Allowance [Addon]
## MOD Author: LaZeR <[email protected]> (Ron L.) http://www.oasisforum.valcato.net/phpbb/portal.php
## MOD Description: Creates a points style crediting system tying together AbelaJohnB's Referral Mod
## with Napoleon's Allowance system.
##
## MOD Version: 0.9.0
##
## Installation Level: Easy
## Installation Time: 5 minutes
## Files To Edit:
## includes/usercp_register.php
##
## Included Files:
## None
##
#################################################################
## MOD History:
##
## 0.9.0 - 12/22/2002 - Initial Release
#################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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/downloads/
#################################################################
##
## Author Note:
##
## This is simply an addon and requires the "Referral Mod" by AbelaJohnB <abela@phpbb> (John B. Abela) http://www.johnabela.com/
## and the "Allowance System" by Napoleon <[email protected]> (Christopher Moore) http://www.gigaknight.com/community/index.php
## both to be installed on your board first and working properly. Tested with the "Referral Mod" v1.0.3 and the allowance system via
## "Quiz MOD" v0.1.0. As mentioned above, both of these original mods are copyright to the listed owners.
##
## Important! Replace the below SQL prefix to _config with your appropriate prefix if different than default phpbb and change the number
## 50 to your desired reward amount before running the SQL query!
##
## Future Plans:
##
## Add ACP support to control reward amount for referrals via ACP in the "Allowance System" of Napoleon with his permission.
##
##
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config VALUES ('referall_reward', '50');
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
if ($ruid != '')
{
$ruid = stripslashes($ruid);
$sql = "INSERT INTO " . REFERRAL_TABLE . " (referral_id, ruid, nuid, referral_time)
VALUES ('', '" . str_replace("\'", "''", $ruid) . "', '" . str_replace("\'", "''", $user_id) . "', '" . time() . "')";
//
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into referrals table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_money = $user_money + $board_config['referall_reward'];
$sql = "UPDATE " . USERS_TABLE . "
SET user_money = user_money + $user_money
WHERE user_id = '" . str_replace("\'", "''", $ruid) . "'";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not Update Users ' . $board_config['money_name'], '', __LINE__, __FILE__, $sql);
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#EoM