News:

Wondering if this will always be free?  See why free is better.

Main Menu

referal links

Started by umiya, January 19, 2005, 09:41:43 PM

Previous topic - Next topic

umiya

how about a nice lil referal system that when the person registers they can put who refered them or a link that person1 can send person2 to register and it would be stored in person1 profile the amount of ppl that person refered. 

Kirby

doesnt vBulletin have something like that?

umiya

never used vb so i realy dunno

umiya

I'm gonna bump this once As I would love to see this happen

Kirby

hmm.. it shouldnt be that hard to do

ryanbsoftware

yes i too would like to see this feature.
atleast as a mod.

umiya

would be nice to have maybe grudge ill see this thread ;)

Kirby

i might give this a shot :P

ryanbsoftware


umiya

great!!

if you need any help just let me know, i may not be an expert when it comes to php but  I have my ways around

umiya


Kirby

havent been able to start yet, really... i'm kind of short on time here, but hopefully things should pick up soon!

jl

Quote from: Kirby on January 19, 2005, 09:44:23 PM
doesnt vBulletin have something like that?

Yes, vBulletin has that feature but you want that in SMF, don't you?

The big problem with vBulletin is that even though you have that feature, you cannot sort members by 'referral credits'.  Nor can you download member email list along with that piece of data.  So, unless you hack, there is not much you can do with it.

In my view vBulletin's member data export, being limited to email addresses only, is very rudimentary and limited.  I am very surprised given how long they've been around.  The vBulletin sales people have an arrogant tone and not very open to new ideas and suggestions, and not very helpful or unable to be, on important questions.  It is a mistake to hire snobs to run the sales or marketing department of any business, in my opinion.


umiya


Kirby

i'm really short on time so yeah..i hope to get started soon but i have a lot of things i needa do :x

ryanbsoftware

well an idea for those, a temp solution would be a custom profile field saying who refered them until this mod is done at least. ;)
i want to be able to give members credit for refering people.

3guk

If it helps I would really love a mod like this too

nelweb

I would love to have this mod also.  Any idea of when its going to come out?

dtm.exe

This has got to be the mod that I'm most anticipating.  I would be so happy if it's released.

-Dan The Man

Kirby


dtm.exe

Quote from: Kirby on January 19, 2005, 09:44:23 PM
doesnt vBulletin have something like that?

They do, and it works like a charm :).

-Dan The Man

3guk

Would love to see this mod :)

Kirby

#22
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

3guk

Excuse me for being stupid but where does each member get thier individual links ?

If this works you are a god !!

edi67

i done this mod and all seem ok but i cannot see in user profile the name of the referals please explain me how i can see this ..

and for me too you will be a god  :P
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Kirby

Quote from: 3guk on June 02, 2005, 10:53:13 PM
Excuse me for being stupid but where does each member get thier individual links ?
Can you rephrase that?

Quotei done this mod and all seem ok but i cannot see in user profile the name of the referals please explain me how i can see this ..
The mod only logs the number of referrals :P

edi67

#26
QuoteThe mod only logs the number of referrals :P

please i need to see name of referals in profile of new user

is possible ?? please i need to know which user made invitation in my forum
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Kirby

it is, but at the moment the mod only logs the number..ill work on it when i have time

Kirby

#28
bleh, stupid me...you need to add this too..
open Load.php

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'],


i've also done a fix in the register.php part, be sure to fix it!

dtm.exe

Quote from: ??? on June 03, 2005, 04:19:50 PM
Quote from: 3guk on June 02, 2005, 10:53:13 PM
Excuse me for being stupid but where does each member get thier individual links ?
Can you rephrase that?

What 3guk is trying to ask is if members will have referral IDs such as yoursite.com/index.php?referrer=12345.

-Dan The Man

Kirby


dtm.exe

Quote from: ??? on June 03, 2005, 10:37:00 PM
hm no, thats not in

Could that be implemented?

-Dan The Man

code

i really need this mod :D
Far more than just another brick in the wall..

edi67

pity but not work for me nothing appear i need mod for referal registering in forum and see in profile of new user the referal user that invited to register in my forum

thanxk anyway kirby
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Kirby

Quote from: OIDanTheManIO on June 03, 2005, 11:53:10 PM
Quote from: ??? on June 03, 2005, 10:37:00 PM
hm no, thats not in

Could that be implemented?

-Dan The Man
when i get the time (i dont have much right now), ill add a whole bunch of new stuff and upload it to the mod site

misscalais

I have seen this in use at other forums as a reward system for members whereas they get bonus things such as choosing there own avatar for say 20 referrals then they get to be in a select group of members for 50+ referrals etc etc

I could see this as being beneficial to domain/hosting sellers in that for every 50 (example)successful referrals made by a member to the forums then that member could get a domain registered for free as a reward or reduced price hosting. the list could go on and on if u wanted to offer a rewards system for referrals!

Bring it on I say lol

cheers



umiya

still would liek to see this happen

tyademosu

 I am trying to implement the referral code on smf.  It's in place but it doesn't seem to be incrementing i.e the referral field is staying at 0.  Help.  Thanks

Ride

I also get the following error in the forum error log:   (this is on my test server)

8: Undefined index: referrals
File: C:\Program Files\Apache Group\Apache2\htdocs\forum\Themes\default\Profile.template.php (eval?)
Line: 150


And of course line 150 has this code:
<tr>
<td><b>Referrals: </b></td>
<td>', $context['member']['referrals'], '</td>
</tr>
<tr>

Ride

Stupid me had the settings pointing to another forum's source files on my test server.  I'm retarded.


There is one little "bug" if you want to call it that.  A user can register fake accounts to boost their (or a friends, etc.) referral number.  The referral credit is given before the registration is activated.  Would this be something easy to adjust for in the code?  Thanks.

SexyDSM95

I did everything exact and when I ran the query it ran perfect! When a new user goes to register the referral line is there and referrals do get entered into the database. The only problem I am having is in the profiles, there is no line in the profiles saying how many referrals each member has. I know personally I have around 3, can someone please help. Just tell me what you need me to post up and I shall. Thanks!

Ride

In profile.template.php just put this somewhere:

'$context['member']['referrals']

Here's a piece of my code so you get an idea.

// If karma enabled show the members karma.
if ($modSettings['karmaMode'] == '1')
echo '
<tr>
<td>
<b>', $modSettings['karmaLabel'], ' </b>
</td><td>
', ($context['member']['karma']['good'] - $context['member']['karma']['bad']), '
</td>
</tr>';
elseif ($modSettings['karmaMode'] == '2')
echo '
<tr>
<td>
<b>', $modSettings['karmaLabel'], ' </b>
</td><td>
+', $context['member']['karma']['good'], '/-', $context['member']['karma']['bad'], '
</td>
</tr>';
echo '
<tr>
<td><b>Referrals: </b></td>
<td>', $context['member']['referrals'], '</td>
</tr>
<tr>
<td><b>', $txt[233], ': </b></td>
<td>', $context['member']['registered'], '</td>
</tr><tr>
<td><b>', $txt['lastLoggedIn'], ': </b></td>
<td>', $context['member']['last_login'], '</td>
</tr>';

tarkhorani

it is have a place to send email to referrals
Get a Free SMForum on http://www.myboards.com (Ver 1.1.1)



Vinspire

So, is this mod working ?

Advertisement: