Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Aiheen aloitti: JoshieDaMan - heinäkuu 23, 2007, 02:14:56 AP

Otsikko: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 23, 2007, 02:14:56 AP
I am looking for referral system where people can referr and get them to signup, then have "Referr: The name that they referred" and also a top list of referrer.

Is this possible? Or is there one mod already made? Which I am current using 1.1.3.
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 23, 2007, 11:05:05 AP
My beta version of a referral mod is awaiting approval,

Details can be found: http://www.simplemachines.org/community/index.php?topic=174132.0
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 25, 2007, 12:59:04 AP
Lainaus käyttäjältä: karlbenson - heinäkuu 23, 2007, 11:05:05 AP
My beta version of a referral mod is awaiting approval,

Details can be found: http://www.simplemachines.org/community/index.php?topic=174132.0
Great! I got that mod:D Now, I am wondering how can I make more than five top referral in the stats section?
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 25, 2007, 11:08:21 AP
There isnt a quick/easy setting.

You'd need to alter the mysql to get more than the top 5.
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 25, 2007, 04:20:02 IP
Oh, ok. Another last question about this. I am wondering how can I put textarea field with that referral link so it can be easier for member to grab?

Thanks a lot!
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 25, 2007, 04:33:21 IP
I've been considering changing it to a textbox. or alternatively putting a icon with some javascript to the left of it which copies it to your clipboard.

For the moment, it would require altering the profile.template.php
And putting before the start of the link
<input type="text" value="

and after it

" width="200px"/>

*you may have to change the 200px to fit the whole url if your domain name is long or short.
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 25, 2007, 07:59:54 IP
So, like this.

echo '<tr>
<td colspan="2"><b>'.$txt['referrals_link'].'</b></td></tr>
<tr><td colspan="2" style="text-align:center;">'.$scripturl.'?referredby='. $context['member']['id'] .'</td>
</tr>';


To-
echo '<tr>
<td colspan="2"><b>'.$txt['referrals_link'].'</b></td></tr>
<tr><td colspan="2" style="text-align:center;"><input type="text" value="'.$scripturl.'?referredby='. $context['member']['id'] .'width="200px"/></td>
</tr>';


?
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 25, 2007, 08:02:08 IP
yeah (almost),
your just missing the closing " after the link (before the width bit)


echo '<tr>
<td colspan="2"><b>'.$txt['referrals_link'].'</b></td></tr>
<tr><td colspan="2" style="text-align:center;"><input type="text" value="'.$scripturl.'?referredby='. $context['member']['id'] .'" width="200px"/></td>
</tr>';
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 25, 2007, 10:45:00 IP
That code, you provide isn't working correctly. But, however I worked a little bit my way, but you are welcome to update your script with the code I will provide you how to use the correct of textarea.

<td colspan="2"><b>'.$txt['referrals_link'].'</b></td></tr>
<tr><td colspan="2" style="text-align:center;"><textarea class="textform" rows="1" cols="50" onclick="this.select();">'.$scripturl.'?referredby='. $context['member']['id'] .'</textarea></td>


:)
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 25, 2007, 10:59:51 IP
I guess you put it in a textarea.

To be honest, I think I'm going to just put an icon to copy it rather than a box. (but at the moment, I'm in the middle of re-writing my adrevenuesharing mod from scratch.
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - heinäkuu 26, 2007, 06:35:01 IP
Are you talking about when you click in the text area, then the icon showed up saying that it's copied?
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - heinäkuu 26, 2007, 07:52:24 IP
The url itself would be as is in the 'default' referral mod - just non-active text.
To the right would be a little icon which when clicked would add the url to your clipboard.
(think of the smilie as the icon)

http://www.youposted.com/index.php?referredby=1   ;)

or alternatively something like

http://www.youposted.com/index.php?referredby=1   [copy to clipboard]
Otsikko: Re: Referral System.
Kirjoitti: JoshieDaMan - elokuu 17, 2007, 07:22:14 IP
Hello, I have another question regarding to this mod. I am wondering if there's a way I can make another top referral.

I don't want to clear the current top referral, but I want another one that I can clear it any time I want, because I run referral contest sometime.
Otsikko: Re: Referral System.
Kirjoitti: karlbenson - elokuu 17, 2007, 07:36:58 IP
There is no way to do that with the modification.

I'm unsure whether I'll add such a feature because I'm trying to keep the mod as a Simple Referral system.  There are already far more stats than I had planned.

It would be possible for you or someone else to write a query between between any dates you specify. (querying 'referredon' column of members table [which is a timestamp])