Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.1.x Mods

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-02-2011, 04:21 PM
Tony's Avatar
Tony Tony is offline
I program.
 
Join Date: Jan 2011
Posts: 75
Gender: Male
Credits: 8,172
Tony is on a distinguished road
Default Refferal system + rewards V1

Ref system V1:
I DID NOT DO MUCH TESTING, IF YOU FIND AN ERROR, LET ME KNOW.

How this works?
step1: go into admincp
step2: Site settings
step3: View or Edit Basic Site Settings
step4: Rewards for referrals set the value
step5: Be happy.




Future updates:
rewarding pets
IP address checking to stop abuse.
User must be active for at least X amount of time before the reward is recieved
PM the user telling him/her they were rewarded.
taking suggestions.


database
SQL WILL COME SOON.

add Referrer and Referrals to the end of prefix_users

add refreward and a default value of 0 to prefix_settings






Register.php

First find this:
PHP Code:
//Grab the post data from the form
$username $_POST["username"];
$pass1 $_POST["pass1"];
$pass2 $_POST["pass2"];
$email $_POST["email"];
$tos $_POST["tos"];
$hidden $_POST["hidden"]; 
and change it to this:
PHP Code:
//Grab the post data from the form
$refer $_POST["refer"];
$username $_POST["username"];
$pass1 $_POST["pass1"];
$pass2 $_POST["pass2"];
$email $_POST["email"];
$tos $_POST["tos"];
$hidden $_POST["hidden"]; 
find this:
PHP Code:
$article_title $regnew;
    
$article_content $regnewexplain."<br><form name='form1' method='post' action='register.php'>
      <p>Username: <input name='username' type='text' id='username' maxlength='20'></p>
      <p>Your username may be up to 20 characters long and may only contain letters, numbers and spaces. </p>
      <p>Password: <input name='pass1' type='password' id='pass1' maxlength='20'></p>
      <p>Your password may be up to 20 characters long and may contain letters, numbers, spaces and special characters. The use of a special character, such as * or ! is recommended for increased security. </p>
      <p>Confirm Password: <input name='pass2' type='password' id='pass2' maxlength='20'></p>
     <p>Email Address: <input name='email' type='text' id='email'></p>
      <p><input name='tos' type='checkbox' id='tos' value='yes'> I agree to the <a href='tos.php' target='_blank'>Terms of Service</a>. 
      <input name='hidden' type='hidden' id='hidden' value='goregister'></p>
      <p><input type='submit' name='Submit' value='Register'>
      </p></form>"

and change to this:
PHP Code:
//TMOD added Reffered field.
    
$article_title $regnew;
    
$article_content $regnewexplain."<br><form name='form1' method='post' action='register.php'>
      <p>Username: <input name='username' type='text' id='username' maxlength='20'></p>
      <p>Your username may be up to 20 characters long and may only contain letters, numbers and spaces. </p>
      <p>Password: <input name='pass1' type='password' id='pass1' maxlength='20'></p>
      <p>Your password may be up to 20 characters long and may contain letters, numbers, spaces and special characters. The use of a special character, such as * or ! is recommended for increased security. </p>
      <p>Confirm Password: <input name='pass2' type='password' id='pass2' maxlength='20'></p>
     Who invited you? Leave blank if no one!
    <p>Referrer: <input name='refer' type='text' id='refer'></p> 
    <p>Email Address: <input name='email' type='text' id='email'></p>
      <p><input name='tos' type='checkbox' id='tos' value='yes'> I agree to the <a href='tos.php' target='_blank'>Terms of Service</a>. 
      <input name='hidden' type='hidden' id='hidden' value='goregister'></p>
      <p><input type='submit' name='Submit' value='Register'>
      </p></form>"

find this:
PHP Code:
    if(@eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email)) {
    
    
$emailisvalid "yes";
    
    } 
replace with this: *And wasn't working with the SQL so I just have two queries, i'll fix eventually.*
PHP Code:
if(@eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"$email)) {
    
    
$emailisvalid "yes";
    
    }
    
        
//TMOD +1 for refferal..
    
if($refer){
    
$query "SELECT value FROM ".$prefix."settings WHERE name = 'refreward'";
    
$result mysql_query($query);
    
$row mysql_fetch_array($result);
    
$refreward $row['value'];
    
    
mysql_query("UPDATE ".$prefix."users SET Referrals = Referrals + 1 WHERE username = '$refer'");
    
mysql_query("UPDATE ".$prefix."users SET dollar = dollar + '$refreward' WHERE username = '$refer'");
    } 
find:
PHP Code:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0')"); 
and change to:
PHP Code:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0', '$refer', '')"); 
Admin.php
find:
PHP Code:
  <p>Site Title
    <
input name='sitetitle' type='text' id='sitetitle' value='".grabanysetting("browsertitle")."'>
</
p
add:
PHP Code:
  <p>Site Title
    <
input name='sitetitle' type='text' id='sitetitle' value='".grabanysetting("browsertitle")."'>
</
p>

This is the amount of gold you want to give out for each refferal.
<
p>Rewards for refferals
    <
input name='reward' type='text' id='reward' value='".grabanysetting("refreward")."'>
</
p
admpost.php
find:
PHP Code:
$sitenamevar $_POST["sitename"];
$sitenamevar secure($sitenamevar); 
add:
PHP Code:
// We are changing the settings for the site...
$rewardvar $_POST["reward"];
$rewardvar secure($rewardvar);

$sitenamevar $_POST["sitename"];
$sitenamevar secure($sitenamevar); 
find:
PHP Code:
// Everything looks good, update the settings...

    
$query "UPDATE ".$prefix."settings SET value='".$sitenamevar."' WHERE name='sitename'";
    
mysql_query($query); 
add:
PHP Code:
// Everything looks good, update the settings...

    
$query "UPDATE ".$prefix."settings SET value='".$sitenamevar."' WHERE name='sitename'";
    
mysql_query($query);
    
    
$query "UPDATE ".$prefix."settings SET value='".$rewardvar."' WHERE name='refreward'";
    
mysql_query($query); 

Last edited by Tony; 02-02-2011 at 04:39 PM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.3 Personality System Hwona Mys v1.3.x Mods 15 12-18-2016 09:13 PM
Trade System Kyttias Questions and Supports 4 05-29-2016 12:29 AM
Abandon system bokkun Mys v1.1.x Mods 30 11-16-2010 10:19 PM
Trade System? sensacion Questions and Supports 5 08-20-2010 11:36 AM
Trade System? SieghartZeke Questions and Supports 1 12-28-2009 07:06 AM


All times are GMT -5. The time now is 09:32 PM.

Currently Active Users: 288 (0 members and 288 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636