I know this is a lot to ask for and I dont expect someone to just give me a mod to do this, but I think in the future this would be a good mod to make. I was thinking a referral system, and everytime someone mkes an account they can say who told them to come, and then users can check their own referrals to see how many they have, and admins can check evreyones referrals. I dunno how hard this is because im not a coder, but its just an idea, tell me what you think.
good idea for a MOD
Anybody working on this?
I doubt it.
Quote from: mager on July 05, 2005, 07:50:51 PM
I doubt it.
??? wrote this one.
Open: Sources/Register.php
Look for:
// Register them into the database.
db_query("
INSERT INTO {$db_prefix}members
(" . implode(', ', array_keys($register_vars)) . ")
VALUES (" . implode(', ', $register_vars) . ')', __FILE__, __LINE__);
$memberID = db_insert_id();
updateStats('member');
add after:
// Handle referrals seperately.
if (!empty($_POST['referrals']))
{
$referrals = explode(',', $_POST['referrals']);
// Make sure there are no doubles!
$referrals = array_unique($referrals);
foreach ($referrals as $referral)
{
// Find and do this member seperately..
$request = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '$referral'
AND ID_MEMBER != $memberID", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
db_query("
UPDATE {$db_prefix}members
SET referrals = referrals + 1
WHERE ID_MEMBER = $row[ID_MEMBER]", __FILE__, __LINE__);
}
}
Open: Themes/default/Register.template.php
Look for:
<tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" />
</td>
</tr>
add after:
<tr>
<td width="40%">
<b>Referrals:<div class="smalltext">Optional; Seperate multiple names with commas</div></b>
</td>
<td>
<input type="text" name="referrals" size="60" />
</td>
</tr>
Open: Themes/default/Profile.template.php
Look for:
elseif ($modSettings['karmaMode'] == '2')
echo '
<tr>
<td>
<b>', $modSettings['karmaLabel'], ' </b>
</td><td>
+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '
</td>
</tr>';
echo '
add after:
<tr>
<td><b>Referrals: </b></td>
<td>', $context['member']['referrals'], '</td>
</tr>
FINALLY, run this query:
ALTER TABLE {yourdbprefix}members ADD referrals smallint(5) NOT NULL AFTER karmaGood
look for:
mem.memberIP, mem.location, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood
add after:
, mem.referrals,
You will need to do it twice..
then look for:
'karma' => array(
'good' => &$profile['karmaGood'],
'bad' => &$profile['karmaBad'],
'allow' => !$user_info['is_guest'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user
),
and add after:
'referrals' => empty($profile['referrals']) ? 0 : $profile['referrals'],
-Dan The Man
Sorry, didnt realize, thanks a lot dan!
Quote from: mager on July 06, 2005, 12:31:42 AM
Sorry, didnt realize, thanks a lot dan!
No problem :).
-Dan The Man
at the risk of looking foolish... I'm a little confused about the last part of those instructions. Is that going to be found in the sql or one of the php files? I have all the edits i know of to me to the listed php files complete and i'm really interested in trying this one out so any help would be great.
Quote from: umiya on July 10, 2005, 12:36:48 PM
were are the last edits made at?
What last edits?
-Dan The Man
I think someone may have already written a referral mod here. :P
Quotelook for:
Code:
mem.memberIP, mem.location, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood
add after:
Code:
, mem.referrals,
You will need to do it twice..
then look for:
Code:
'karma' => array(
'good' => &$profile['karmaGood'],
'bad' => &$profile['karmaBad'],
'allow' => !$user_info['is_guest'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user
),
and add after:
Code:
'referrals' => empty($profile['referrals']) ? 0 : $profile['referrals'],
Those are the ones i am confused about. Are those in the sql or a php file?
Quote from: Digital Frostbyte on July 10, 2005, 01:47:59 PM
Those are the ones i am confused about. Are those in the sql or a php file?
The SMF PHP files, or course.
-Dan The Man
what exacty file tho, you never specifi which one
i have searched in all the php files listed and i have yeat to find those things in any of them
Load.php, it looks like.
-[Unknown]
Quote from: [Unknown] on July 10, 2005, 06:54:26 PM
Load.php, it looks like.
-[Unknown]
100% correct thanks a lot [Unknown] :D
I really hate being a pain but is there anyway to edit the amount of referals people have. I had a basic profile field setup before that would let you to add it manualy. I would like to give people credit for thier referals with this now.
Yup, its called phpMyAdmin ;)
edit: a simple php script could also be designed to do that...
well right now i have to figure out why it's not working at all. It shows up on the page and in profiles like it should, but when people enter the person that refered them it does not raise the persons referals
I tryed this and get an error :'(
QuoteUnknown column 'mem.referrals' in 'field list'
File: /home/cjexotic/public_html/yabbse/Sources/Load.php
Line: 469
Any idea what I'm doing wrong?
Luckily I know and admit this stuff isn't easy for me :-[ so I just uploaded an unaltered copy of Load.php for now so to do away with the error and keep my forum working,but eventually I'd like to get this referal thing working.
Quote from: <? Piranha($fx); ?> on July 10, 2005, 01:27:17 PM
I think someone may have already written a referral mod here. :P
It's none existent and that's a big problem if one intends to build a real online community. This is a simple feature that could have been easily implemented.
QuoteI tryed this and get an error
Quote
Unknown column 'mem.referrals' in 'field list'
File: /home/cjexotic/public_html/yabbse/Sources/Load.php
Line: 469
Any idea what I'm doing wrong?
so
QuoteIt's none existent and that's a big problem if one intends to build a real online community. This is a simple feature that could have been easily implemented.
It just doesn't work?
Or does anyone know what I messed up?
i tryed me too this code, because i realy need it , but i not see change
i see in profile only one 0 and not the name of the referral
I've got the referal box showing up on the registration page.
Referal count showing up in profiles.
but just haveing trouble with the last bits of what to change/add.
Where does this part get added or edited?
QuoteFINALLY, run this query:
Copy to clipboardCode:
ALTER TABLE {yourdbprefix}members ADD referrals smallint(5) NOT NULL AFTER karmaGood
Into the database. What is phpMyAdmin? (http://www.simplemachines.org/community/index.php?topic=21919.0)
-[Unknown]
please i want know how i can see in profile user the name of referal ? not the sum but the name of the referal
thanx for answer
Quote from: Digital Frostbyte on July 12, 2005, 01:02:09 AM
well right now i have to figure out why it's not working at all. It shows up on the page and in profiles like it should, but when people enter the person that refered them it does not raise the persons referals
Ditto here,, it shows only as zero on a test forum Im playing with (ver 1.0.5 if it matters)
Quote from: oscar2001 on July 19, 2005, 07:26:31 AM
Quote from: Digital Frostbyte on July 12, 2005, 01:02:09 AM
well right now i have to figure out why it's not working at all. It shows up on the page and in profiles like it should, but when people enter the person that refered them it does not raise the persons referals
Ditto here,, it shows only as zero on a test forum Im playing with (ver 1.0.5 if it matters)
Just to add,, the refferal count is showing up in the members table in the database itself each time a referal is given, just not the profile section on the forum scrpt which stays as zero. Ive double checked the code etc.
some solution for add the name of referall in profile and not one 0 ?
Is there a link that goes with the system so users can do... www.SITENAME.com/akjshal?USERNAME THAT REFERRED ? So they can post there link somewere and people click the link it automatically puts there username in the referral box.
Also when I go into admin I get
Parse error: parse error, unexpected T_STRING in /home/brad/public_html/smf/Sources/Admin.php on line 165
NM just can't get it to show referrals in profile page it stays as 0...
Is anyone porting this mod to work with Beta 3 yet?
Sorry for the bump, but is there any way we can get this for 1.1 RC1?
I've added the things to the php.... don't like that, so i've return everything to it's original position (i've backed up the files), but now when a member want to register it gives him this message:
"An Error Has Occurred!
You are not allowed to access this section"
AAh what should i do now?
.
the forum is www.tu-ke.com
THANKS!
You cant register more than once in 30 mins.
Aha so that was the problem, beacuse a friend made a test register and it worked for him.
Sorry about that, and thanks!
I'm confused right here...
QuoteFINALLY, run this query:
Copy to clipboardCode:
ALTER TABLE {yourdbprefix}members ADD referrals smallint(5) NOT NULL AFTER karmaGood
look for:
Code:
mem.memberIP, mem.location, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood
add after:
Code:
, mem.referrals,
You will need to do it twice..
then look for:
Code:
'karma' => array(
'good' => &$profile['karmaGood'],
'bad' => &$profile['karmaBad'],
'allow' => !$user_info['is_guest'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user
),
and add after:
Code:
'referrals' => empty($profile['referrals']) ? 0 : $profile['referrals'],
Where do I look for this stuff?
I figured the last thing out, but is there anyway to view how many referrals you have on the profile, it stays at 0, but update sin the DB...
Does this work with 1.1rc1?
I've created a referral system which also allows admins to modify the scoring, etc. for points given for referrals and posts by people you've referred. It's completely different than the other mod in this thread, but I figured it may help people searching for such a mod. You can download it here: http://www.cs.ucsb.edu/~sheltren/downloads/smf_referral_mod.tar.gz
Currently, it is only for SMF 1.0.5
Sounds like a good mod. Any chance of you updating it for SMF1.1 and maybe submitting it here for download?
;)
Thanks - yes I did submit it here (and you're free to post it or link to my download). The site I wrote it for is currently using 1.0.5, but if they move to 1.1 soon or if there is enough other interest in it, then I'll look into re-doing it for SMF 1.1.
Well i am interested and will give u a donation for updating it to 1.1 rc1/rc2 that be great!
Hi,
I'm interested in one for smf1.1 rc2 pls.
:D
I am interested in this 1.1RC1 ;)
me too... for RC2!! :)
and me rc2!! common now people are begging
Quote from: JeffIsGood on December 22, 2005, 11:38:44 AM
I've created a referral system which also allows admins to modify the scoring, etc. for points given for referrals and posts by people you've referred. It's completely different than the other mod in this thread, but I figured it may help people searching for such a mod. You can download it here: http://www.cs.ucsb.edu/~sheltren/downloads/smf_referral_mod.tar.gz
Currently, it is only for SMF 1.0.5
I installed this on 1.0.5. and it does install and in the top header of the page it does show
You have 1 referral and your referral has posted 2 messages.
Your referral rating is 0 out of 5.
Click here to refer a friend to our site.
However, when posting, under their name where it says: Referral Rating:
Nothing shows up. Is something suppose to?
Nevermind.. figured it out.. needed to set the # in admin area to something lower so a star would show up.
QuoteThanks - yes I did submit it here (and you're free to post it or link to my download). The site I wrote it for is currently using 1.0.5, but if they move to 1.1 soon or if there is enough other interest in it, then I'll look into re-doing it for SMF 1.1.
I am interested in mod for RC2
Me 2, for RC2. Thanks.
Me 2 ;)
Thanks :D
update please!!!
*bump*
and me too for RC2 please
And me...cough cough ;D ;D
I would like this mod so i can run a comp to see who can refer the most peopel then thta peorson would win some free web hosting!
Me too!!! RC2!!! Would be great!!
Trouble is preventing people from referring users that will register simply to boost the original person's referrals - or preventing someone from sending referral emails to themselves, i.e. the script will check the IP of the person clicking the activating link to ensure that its not the same as the IP that sent the referral in the first place.
can i find this on Package servers ??
is that mod for 1.0.7? :)
if yes, please write me :)
Hmm is this referral thing different than this affiliate mod ?
http://www.simplemachines.org/community/index.php?topic=71952.15 ??
i have smf 1.0.7 i want o refferal system can u update pls
ALL MEMEBRS DO NOT POST HERE
PLEASE POST IN http://www.simplemachines.org/community/index.php?topic=71952.0
Quote from: JeffIsGood on December 22, 2005, 11:38:44 AM
I've created a referral system which also allows admins to modify the scoring, etc. for points given for referrals and posts by people you've referred. It's completely different than the other mod in this thread, but I figured it may help people searching for such a mod. You can download it here: http://www.cs.ucsb.edu/~sheltren/downloads/smf_referral_mod.tar.gz
Currently, it is only for SMF 1.0.5
I'm using 1.0.8, and I was able to run the install just fine. However, I'm confused abt. how to patch the files. In the readme you say to run the command,
Quotepatch -p1 < referral_mod.patch
In what context do I run that command?
I would like this for 1.1.1 please. It would be good for advertising my forums (which are at 5 Members :D ).
-WhiteEagle
I also want this mod. I don't want your mod, tarkhorani, as it is "pay to user"...
1.1.1 please!!
for 1.1.1 Pleaseeeeee
someone else put this into a mod for the package manager? lol, it would be very useful
What's the bottom line on this now? Is there a mod available for 1.1?
Quote from: dtm.exe on July 05, 2005, 09:54:47 PM
Quote from: mager on July 05, 2005, 07:50:51 PM
??? wrote this one.
Open: Sources/Register.php
Look for:
// Register them into the database.
db_query("
INSERT INTO {$db_prefix}members
(" . implode(', ', array_keys($register_vars)) . ")
VALUES (" . implode(', ', $register_vars) . ')', __FILE__, __LINE__);
$memberID = db_insert_id();
updateStats('member');
add after:
// Handle referrals seperately.
if (!empty($_POST['referrals']))
{
$referrals = explode(',', $_POST['referrals']);
// Make sure there are no doubles!
$referrals = array_unique($referrals);
foreach ($referrals as $referral)
{
// Find and do this member seperately..
$request = db_query("
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '$referral'
AND ID_MEMBER != $memberID", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
db_query("
UPDATE {$db_prefix}members
SET referrals = referrals + 1
WHERE ID_MEMBER = $row[ID_MEMBER]", __FILE__, __LINE__);
}
}
Open: Themes/default/Register.template.php
Look for:
<tr>
<td width="40%">
<b>', $txt[82], ':</b>
</td>
<td>
<input type="password" name="passwrd2" size="30" />
</td>
</tr>
add after:
<tr>
<td width="40%">
<b>Referrals:<div class="smalltext">Optional; Seperate multiple names with commas</div></b>
</td>
<td>
<input type="text" name="referrals" size="60" />
</td>
</tr>
Open: Themes/default/Profile.template.php
Look for:
elseif ($modSettings['karmaMode'] == '2')
echo '
<tr>
<td>
<b>', $modSettings['karmaLabel'], ' </b>
</td><td>
+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '
</td>
</tr>';
echo '
add after:
<tr>
<td><b>Referrals: </b></td>
<td>', $context['member']['referrals'], '</td>
</tr>
FINALLY, run this query:
ALTER TABLE {yourdbprefix}members ADD referrals smallint(5) NOT NULL AFTER karmaGood
look for:
mem.memberIP, mem.location, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood
add after:
, mem.referrals,
You will need to do it twice..
then look for:
'karma' => array(
'good' => &$profile['karmaGood'],
'bad' => &$profile['karmaBad'],
'allow' => !$user_info['is_guest'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user
),
and add after:
'referrals' => empty($profile['referrals']) ? 0 : $profile['referrals'],
-Dan The Man
can someone modify the register.template.php and SQL code for 1.1.1. alll other codes are the same.
i don't know much about php or modding
but is there a referral/affiliate that works like this
people register on the forum like normal, they get a link like .. domain.com/bnjgnw (the bnjgnw being their unique code)
so when people click that link, the person will be sent to your website and the person who posted the link will have like a stat page, so they could see how many visits they have sent
for contest that would work by the winner being the person who has sent the most visits
does this kinda thing exist?
Not yet.I hope someone develops It for 1.1.1 :)
am waitin for some to help me with the code. they just have to re-edit the "Register.template.php" code, rest all are working perfectly.
how is it coming along? progress?
no luck yet?
I know need it for 1.1.2.