Welcome, Guest. Please Login or Register.
April 26, 2025, 11:22:15 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.3.+][Code]Referalls « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: [Beta 1.3.+][Code]Referalls  (Read 4492 times)
Darkshady
Noobie
*
Posts: 40


I'm a llama!

[Beta 1.3.+][Code]Referalls
« on: May 14, 2002, 08:22:13 PM »
Reply with quote

<id>
User Referall Mod
</id>

<version>
.1
</version>

<mod info>
If you a user refers someone to the board the referer will get a referall point.  The referall points don't do anything but i'm sure
you could hold contest or something with them.

Features:
-A link in your profile which you can refer users with
-Displays referalls in members profiles
-Referall points goes up when someone has you as a refer

Hopefully in other releases:
-Turn off/on in admin
-Users cannot pick who refered them (all they have to do now is change the name when they are registering)
-Shows referalls in memberlist
-Shows who refered them in a users profile
-Will show users with most referalls
-Show referall in posts
-Special titles for people who have certain amount of referalls (like custom titles)

Bugs:
I am betting the code that is in your profile will now show correctly (I am running yabb from my computer and still having trouble getting it to stay logged in.

</mod info>

<author>
DarkShady
</author>

<homepage>
None
</homepage>

<edit file>
Sources/Register.php
</edit file>

<search for>
   global $yytitle,$txt,$color,$cgi,$action,$allow_hide_email,$modSettings,$RegAgree,$emailpassword,$vardir,$db_prefix;
</search for>

<replace>
   global $yytitle,$txt,$color,$cgi,$action,$allow_hide_email,$modSettings,$RegAgree,$emailpassword,$vardir,$db_prefix,$referall,$referingperson;
</replace>

<search for>
   $request = mysql_query("INSERT INTO {$db_prefix}members (memberName,realName,passwd,emailAddress,posts,personalText,avatar,dateRegistered,hideEmail,memberIP) VALUES ('$member[user]','$member[user]','$queryPasswdPart','$member[email]',0,'$txt[209]','blank.gif',$requesttime,'$hideemail','$memIP')");
</search for>

<replace>
$request = mysql_query("INSERT INTO {$db_prefix}members (memberName,realName,passwd,emailAddress,posts,personalText,avatar,dateRegistered,hideEmail,memberIP,referer,referalls) VALUES ('$member[user]','$member[user]','$queryPasswdPart','$member[email]',0,'$txt[209]','blank.gif',$requesttime,'$hideemail','$memIP','$member[referer]','0')");
   $request = mysql_query("SELECT referalls FROM {$db_prefix}members WHERE memberName='$member[referer]'");
   $referallsettings = mysql_fetch_array($request);
$newnumberofreferalls = $referallsettings[0]+1;
   $request = mysql_query("UPDATE {$db_prefix}members SET referalls='$newnumberofreferalls' WHERE memberName='$member[referer]'");
</replace>

<search for>
      <tr>
        <td width="40%"><font size=2>* <b>$txt[98]:</b></font>
        <BR><font size="1">$txt[520]</font></td>
        <td><input type=text name=user size=20 maxlength=18></td>
      </tr><tr>
</search for>

<replace>
      <tr>
        <td width="40%"><font size=2>* <b>$txt[98]:</b></font>
        <BR><font size="1">$txt[520]</font></td>
        <td><input type=text name=user size=20 maxlength=18></td>
      </tr>
      <tr>
        <td width="40%"><font size=2><b>$referall[2]:</b></font>
        <BR><font size="1">$referall[3]</font></td>
        <td><input type=text name=referer size=20 maxlength=18 value=$referingperson></td>
      </tr><tr>
</replace>

<search for>
   global $allow_hide_email,$modSettings,$REMOTE_ADDR;
</search for>

<replace>
   global $allow_hide_email,$modSettings,$REMOTE_ADDR,$referallsettings;
</replace>

<edit file>
Sources/Profile.php
</edit file>

<search for>
   global $username,$password,$pwseed,$action,$cookiepassword,$cookieusername,$db_prefix,$modSettings;
</search for>

<replace>
   global $username,$password,$pwseed,$action,$cookiepassword,$cookieusername,$db_prefix,$modSettings,$referall;
</replace>

<search for>
   global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset;
</search for>

<replace>
   global $MaxSigLen,$timeformatstring,$db_prefix,$locale,$modSettings,$language,$timeoffset,$boardurl,$user,$mbname,$referall;
</replace>

<search for>
      </tr><tr>
   <td width="45%"><font size=2><b>$txt[604]: </b></font><BR>
   <font size=1>$txt[602]</font></td>
   <td><font size=2><input type=text name=yim size=20 value="$memsettings[YIM]"></font></td>
      </tr><tr>
</search for>

<replace>
      </tr><tr>
   <td width="45%"><font size=2><b>$txt[604]: </b></font><BR>
   <font size=1>$txt[602]</font></td>
   <td><font size=2><input type=text name=yim size=20 value="$memsettings[YIM]"></font></td>
      </tr><tr>
<tr>
   <td width="45%"><font size=2><b>$referall[1]: </b></font><BR></td>
   <td><font size=2><textarea><a href="$boardurl/index.php?board=;action=register&referingperson=$user">Join $mbname</a></textarea></font></td>
      </tr><tr>
</replace>

<search for>
/*                                                                           */
/* The GNU GPL can be found in gpl.txt in this directory                     */
/*****************************************************************************/
</search for>

<add after>
include("./Settings.php");
</add after>

<search for>
      </tr><tr>
        <td><font size=2><b>$txt[227]: </b></font></td>
        <td><font size=2>$memsettings[15]</font></td>
      </tr>$usrlng
</search for>

<replace>
      </tr><tr>
        <td><font size=2><b>$txt[227]: </b></font></td>
        <td><font size=2>$memsettings[15]</font></td>
      </tr><tr>
        <td><font size=2><b>$referall[4]</b></font></td>
        <td><font size=2>$memsettings[26]</font></td>
      </tr>$usrlng
</replace>

<search for>
   $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN FROM {$db_prefix}members WHERE memberName='$user'");
</search for>

<replace>
   $request = mysql_query("SELECT passwd,realName,emailAddress,websiteTitle,websiteUrl,signature,posts,memberGroup,ICQ,AIM,YIM,gender,personalText,avatar,dateRegistered,location,birthdate,timeFormat,timeOffset,hideEmail,ID_MEMBER,usertitle,karmaBad,karmaGood,lngfile,MSN,referalls FROM {$db_prefix}members WHERE memberName='$user'");
</replace>

<edit file>
english.lng
</edit file>

<search for>
$txt['yse_stats_12'] = "Top 10 Topics (by Views)";
$txt['yse_stats_13'] = "Monthly Summary";
$txt['yse_stats_14'] = "Most Online";
</search for>

<add after>
$referall['1'] = "Referall Code";
$referall['2'] = "Referer";
$referall['3'] = "Username of Referer";
$referall['4'] = "Referalls:";
</add after>

Put that in a .mod file and use boardmod to install it.  

You must also run this mysql query in phpmyadmin:

ALTER TABLE yabbse_members ADD COLUMN referer tinytext;

ALTER TABLE yabbse_members ADD COLUMN referalls tinytext;
UPDATE yabbse_members SET referalls= 0;

I have no bugs with it but Positronix said that when users registered it wouldn't actually put them in the DB and that the profiles were screwed up.  I am not sure if the code when you edit your profile work because I cannot stay logged in on my board.

Can you tell me if the code works in the EDIT profile part (i bet it doesn't and if it doesn't i think i know why) and if you can have users register.

EDIT: I just updated the code. I have everything working now.
« Last Edit: August 19, 2002, 04:54:15 AM by Nemesis » Logged
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:[Code]Referalls
« Reply #1 on: May 14, 2002, 09:56:05 PM »
Reply with quote

maybe using that IP Scan mod to make sure that the user isn't just signing up more than once to get the points?
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Darkshady
Noobie
*
Posts: 40


I'm a llama!

Re:[Code]Referalls
« Reply #2 on: May 14, 2002, 10:54:04 PM »
Reply with quote

I'll try using that later.  Did you try it? Did it work?
Logged
iamdamnsam
Full Member
***
Posts: 225


RamchargerCentral.Com

WWW
Re:[Code]Referalls
« Reply #3 on: May 14, 2002, 10:55:54 PM »
Reply with quote

wait, you don't even know if this works?
Logged

Darkshady
Noobie
*
Posts: 40


I'm a llama!

Re:[Code]Referalls
« Reply #4 on: May 14, 2002, 11:21:08 PM »
Reply with quote

It works perfectly for me but positronix said he was having troubles.  The only I part I'm unsure of is the code in the profile.  (I am running my testboard from my computer and their is a problem with the cookies so I cannot goto edit profile.)
Logged
Kalin Somphane
YaBB God
*****
Posts: 555


I am personal text!

ICQ - 20280987 WWW
Re:[Code]Referalls
« Reply #5 on: May 15, 2002, 12:04:30 AM »
Reply with quote

I would like to request credit, as I was the first one to make it.

I dunno if you took any code, but least gimme idea credit.
Logged

EZTARCH - The Original YaBBSE PHP Portal
Unlike many others, I accept support requests, in exchange for godly worship every weekday including saturday and sunday.
myk
Jr. Member
**
Posts: 99


I'm a llama! *spit*

ICQ - 1938747 WWW
Re:[Code]Referalls
« Reply #6 on: May 15, 2002, 01:04:24 PM »
Reply with quote

and i'd like to request a sausage and bacon sandwich from that little roach coach in Sheffield

at least give me a plane ticket to the UK

 :P
Logged

claimed mods:
none. the world is better off with me on the receiving end of mods rather than the giving end
Kalin Somphane
YaBB God
*****
Posts: 555


I am personal text!

ICQ - 20280987 WWW
Re:[Code]Referalls
« Reply #7 on: May 15, 2002, 05:37:34 PM »
Reply with quote

DUde, that's not funny. I am serious. I thought of that. Ask whoever you want.
Logged

EZTARCH - The Original YaBBSE PHP Portal
Unlike many others, I accept support requests, in exchange for godly worship every weekday including saturday and sunday.
Big P
Mod Team
YaBB God
*****
Posts: 1462


"Back in '68, I don't like you, The End."

ICQ - 76064555pierceward@hotmail.com WWW
Re:[Code]Referalls
« Reply #8 on: May 15, 2002, 06:01:02 PM »
Reply with quote

Well just to make Kalin feel happy;
The mod isn't coded very well, don't ever replace global lines, add a new line after, you're increasing mysql querys with no need, you don't need to include settings.php, as its already included by yabb.. etc. etc.

And... just to make it worse... Someone already made this mod a while back; for version 1.0.0 I believe. :P
I think I gave out to them for not putting in any credit too kalin ::) lol
Logged

PHPNews has been released!!! Download it now!!!
Darkshady
Noobie
*
Posts: 40


I'm a llama!

Re:[Code]Referalls
« Reply #9 on: May 15, 2002, 08:42:33 PM »
Reply with quote

Alright sorry Kalin.  I never saw your mod before.


I'll add it when I change the global stuff.  Also I edited my post, I forgot to include the query stuff so the members table had columns for the referalls.

Big P, this is my first mod so I expect it to suck.
Logged
Kalin Somphane
YaBB God
*****
Posts: 555


I am personal text!

ICQ - 20280987 WWW
Re:[Code]Referalls
« Reply #10 on: May 15, 2002, 09:25:29 PM »
Reply with quote

wow, I was just kidding... don't take it personally :)

thanks Big P

Logged

EZTARCH - The Original YaBBSE PHP Portal
Unlike many others, I accept support requests, in exchange for godly worship every weekday including saturday and sunday.
Big P
Mod Team
YaBB God
*****
Posts: 1462


"Back in '68, I don't like you, The End."

ICQ - 76064555pierceward@hotmail.com WWW
Re:[Code]Referalls
« Reply #11 on: May 15, 2002, 09:30:31 PM »
Reply with quote

Quote from: Kalin Somphane on May 15, 2002, 09:25:29 PMwow, I was just kidding... don't take it personally :)

thanks Big P


lol, me too! You're just lucky the Mod  Team review system wasn't set up yet, I'm sure you'll get used to it anyway  ;)
Logged

PHPNews has been released!!! Download it now!!!
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:[Code]Referalls
« Reply #12 on: June 14, 2002, 03:28:25 PM »
Reply with quote

Does this work for 1.4?
Logged

Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:[Code]Referalls
« Reply #13 on: June 14, 2002, 03:34:32 PM »
Reply with quote

Who cares, its coded awful...
Logged
Big P
Mod Team
YaBB God
*****
Posts: 1462


"Back in '68, I don't like you, The End."

ICQ - 76064555pierceward@hotmail.com WWW
Re:[Code]Referalls
« Reply #14 on: June 15, 2002, 11:34:25 PM »
Reply with quote

Quote from: Jedi~ on June 14, 2002, 03:34:32 PMWho cares, its coded awful...
lol, there is only 1 <add after> tag in the mod. Everything else is a <replace> tag! Not good, for other mods anyway.
David this is for 1.3.0 I believe.  ;)
Logged

PHPNews has been released!!! Download it now!!!
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Beta 1.3.+][Code]Referalls « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.103 seconds with 20 queries.