Referral system

Started by mager, April 21, 2005, 01:41:32 PM

Previous topic - Next topic

sbclansite.com

Hmm is this referral thing different than this affiliate mod ?

http://www.simplemachines.org/community/index.php?topic=71952.15 ??
The Mod , Modifier :). For Mods/Scripts/GameServer Installations contact me via http://www.forums.sbclansite.com <<Free Image hosting, Free WebHosting and Free Featured Listing available also.
Webhosting @ 1.55$ : http://www.a1whs.com
Free Seo Friendly Directory : http://www.sbclansite.com

erasert

i have smf 1.0.7 i want o refferal system can u update pls

tarkhorani

Get a Free SMForum on http://www.myboards.com (Ver 1.1.1)



Gill

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: hxxp:www.cs.ucsb.edu/~sheltren/downloads/smf_referral_mod.tar.gz [nonactive]

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?

WhiteEagle

#64
I would like this for 1.1.1 please. It would be good for advertising my forums (which are at 5 Members :D ).

-WhiteEagle

gangsta

I also want this mod. I don't want your mod, tarkhorani, as it is "pay to user"...

Uber_Tiny



kenlapz


njoker555

someone else put this into a mod for the package manager? lol, it would be very useful
Gamers Forum << PR3 forum WebZ Junk Blog << PR3 Blog ZenPix Blog

coffeegroup

What's the bottom line on this now? Is there a mod available for 1.1?

exodia

#71
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.

WH33LS

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?

Lamarck

Not yet.I hope someone develops It for 1.1.1 :)

exodia

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.

WH33LS

how is it coming along? progress?


WH33LS


WhiteEagle

I know need it for 1.1.2.

Advertisement: