Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: karlbenson on July 23, 2007, 07:04:38 PM

Title: Referrals Mod
Post by: karlbenson on July 23, 2007, 07:04:38 PM


REFERRALS MOD v1.4
By Karl Benson


Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=836) | Comment On This Mod (http://www.simplemachines.org/community/index.php?topic=184291.0)

Introduction
A simple referral modification (with upto 60 day referral tracking cookie).

Installation
Simply install the package to install this modification on the Default theme.

If your using a non-custom theme I recommend the Modification Parser (http://modparser.dev.dansoftaustralia.net/) by Daniel 15 to get the Manual Theme Edits required.

Features
o Adds a referral link to each users profile area

http://www.youposted.com/index.php?referredby=1
(where 1 is the user id)

o Users can then paste the link to whoever they want to invite - suitable for email, signatures, messengers, webpages, forums etc
o When a guest/visitor uses the referral link a 'tracking' cookie is placed on their computer, so they can browse away from the link and register on your forum upto 60 days later (unless cookies are deleted) with the referral credited to the referring user.

o Adds 2 Referral stats section showing;
:: Top 5 Referrers (By Referrals)
:: Top 5 Referrers (By Referred Members Posts)
:: Daily/Monthly/Yearly Referrals Stats
o Total Referrals of each user shown in the poster information of each post
o Referrals information shown in Profile Summary
::  Shows referral link in profile
::  Showing No. of Referrals
::  Dropdown showing each member user has referred (Linked to the members profile pages)
::  Referral Hits (a.k.a No. of Clicks on your referral link)
o Referred member information also shown in Profile Summary
::  If user was referred, shows the user who referred them and the original date of referral

Support
Please use the modification thread for support with this modification.  (Please don't ask me to do the manual edits for you)

Languages
o English / English UTF-8
If you have any translations for any other languages, I would be grateful if you would send them to me via PM or in the Mods topic.

Before you request a crazy feature addition...
... please remember that this is a SIMPLE referral mod. I intend to keep it as simple as possible with only minor tweaks, bug fixes and updates for future SMF version support.

Changelog
1.0 BETA - 29th May 2007
o Initial release made per SMF user request.
1.1 - 14th June 2007
o Few tweaks - moving it out of BETA
o Wrote out the manual edits
o Improved the readme/documentation for this mod
1.2 - 31st July 2007
o Fixed a stats bug (Reported by Nitins60/Fixed by Lanthan)
1.3 - 6th August 2007
o Fixed XML stats bug (Bugfix provided by Lanthan (thanks again!)
o Fixed stats bug (unfortunately caused some stats bugs)
o Fixed install mysql bug (Reported/BugFix by Lanthan)
o Fixed error referredby (caused when user registered without using referral link)
o Members referral link now shown in an input box to copy
1.4 - 2nd September 2007
o Added - Profile - Selecting a person you referred in the drop down menu will take you to their profile
o Fixed huge stats bar bug
o Added English UTF-8 Support
Title: Re: Referrals Mod
Post by: nitins60 on July 23, 2007, 09:23:36 PM
First one to download approved version
Title: Re: Referrals Mod
Post by: karlbenson on July 24, 2007, 03:58:17 PM
I must say a big thanks to groundup.

The referral mod had been in the queue for a long while (since end may).  With an hour or so of bringing it to his attention.  He tested the mod and gave me a couple of quick fixes to the installer.  I resubmitted it the Customisation Team who approved it. (apologies to any CT member who was also involved in approving it.)

Anyway, its out now! ;)
Title: Re: Referrals Mod
Post by: Flying Drupalist on July 24, 2007, 05:46:51 PM
Could this integrate with the invite mod? It would be really useful then! :D
Title: Re: Referrals Mod
Post by: karlbenson on July 24, 2007, 05:51:03 PM
At this time I don't plan on adding such functionality.

As far as I am aware there is no reason why both modifications could not be used on a forum.
Although I've never used the invite mod personally.
Title: Re: Referrals Mod
Post by: ormuz on July 24, 2007, 07:38:11 PM
The invite mod do the same thing this mod does!? I'm wrong?
Title: Re: Referrals Mod
Post by: karlbenson on July 24, 2007, 07:45:21 PM
As far as I'm aware the invite modification only allows you to invite individual people by sending out an email.
They need to use the specific url (with activation key) in the email.

However with the referral mod, you get a link which is suitable for your signature/email/posts/chatrooms/forums/messengers/blogs to invite anyone who uses the link.
Also users can browse away from the link, if they return within 60 days, using the same browser (and having not cleared cookies or cookies disabled), it will count the referral towards the users count.
Title: Re: Referrals Mod
Post by: ormuz on July 25, 2007, 11:46:18 AM
Quote from: karlbenson on July 24, 2007, 07:45:21 PM
However with the referral mod, you get a link which is suitable for your signature/email/posts/chatrooms/forums/messengers/blogs to invite anyone who uses the link.
Also users can browse away from the link, if they return within 60 days, using the same browser (and having not cleared cookies or cookies disabled), it will count the referral towards the users count.

The invite mod have this feature too, u can choose to invite people by mail or by refferal system! Take a lot to the mod and tell me if i'm wrong!
Title: Re: Referrals Mod
Post by: karlbenson on July 25, 2007, 11:54:14 AM
I've had a quick look at the modification.

These systems are quite different.  With the invite mod (as far as I can see) you invite people on a 1-2-1 basis.
Whereas the referral mod you invite people you don't necessarily know.
Title: Re: Referrals Mod
Post by: ormuz on July 25, 2007, 12:08:06 PM
I just need the refferal system in my site, but I'm using the invite mod because it don't give me problems in my joomla+smf site!

I've tested your mod and the cookies aren't "saved" in joomla+smf! I'm can't explain the problem in english by the correct way, because my english is poor! But let me try...

For example, I've SEF urls (Matt hack on joomla bridge board),

www.xpto.com/community/refferedby/id dont' work
www.xpto.com/community/register/refferedby/id only work by this link

If u join the site by the normal referral URL (1st example)  the cookies don't save the information...

PS: This is just in the joomla+smf bridge!
Title: Re: Referrals Mod
Post by: karlbenson on July 25, 2007, 12:38:21 PM
hmmm.

I haven't tried on a bridged version. But I'll look into it.

I've had a quick look at the code, and the cookie stored has no bearing on the action=register.
In the load.php source file (should be universal, not action specific) it detects if $_REQUEST['referredby'] exists, and if so STORES the cookie.

Only on the register action does it check whether a cookie has been stored and LOADS it.

I don't know how the bridge works, however if the url is converted, the format would be
www.xpto.com/community/referredby/1

In the beta which I posted, some people were getting it to work with a joomla bridge
http://www.simplemachines.org/community/index.php?topic=174132.20
Title: Re: Referrals Mod
Post by: Flying Drupalist on July 25, 2007, 03:06:53 PM
hi, I love the idea behind this mod, but also the invite mod. The invite mod allows you to send emails to friends for invitation... you can do this here too but it's not as easy. Also invites sent with the invite mod doesn't get added to referrals and vice versa. I just feel as if both mods are essentially two sides of the same coin. They accomplish the same purpose and really need to be combined to be comprehensive...
Title: Re: Referrals Mod
Post by: karlbenson on July 25, 2007, 03:36:53 PM
I don't think that many people would use both the invite and referral mod.

They suit different types of boards, with not much crossover.
Title: Re: Referrals Mod
Post by: Danniboi on July 25, 2007, 06:23:52 PM
Great mod mate! my users love it already and now iv got a competition going thanks to this mod :D
Title: Re: Referrals Mod
Post by: nitins60 on July 25, 2007, 11:40:44 PM
I am getting this error in log
Quote
http://akaakaaka.com/forum/index.php?action=register2

Undefined index: referred by
File: /home/xxx/forum/Sources/Register.php
Line: 335
Title: Re: Referrals Mod
Post by: AdrenalineRider on July 26, 2007, 07:38:36 AM
Wonderfull Mod, had waited for a long time for this one. Now its here and works perfectly.

karlbenson : Wonderfull Job ;)

Please help me out with a small issue. The display of Referral is not reflected on TPSimplicity, could you please help me out here ... ;)
Title: Re: Referrals Mod
Post by: karlbenson on July 26, 2007, 10:34:26 AM
You will need to manually install (all or parts) on each theme depending on which custom files each has

See http://docs.simplemachines.org/index.php?topic=402

nitins60: That error shouldn't be a problem for now.  But I'll try to fix it for the next version.
Title: Re: Referrals Mod
Post by: alo on July 29, 2007, 05:06:39 PM
:D work fine for me, thanks!
Title: Re: Referrals Mod
Post by: Lanthan on July 31, 2007, 07:59:05 AM
Thanks for this fantastic Mod. This was something I have waited for..

But I have found a little Error in it, regarding the stats. He counts for every Registered Member the Referral in the Monthly/daily Stats.

But if you change this:

// NOW THAT USER HAS BEEN REGISTERED
// NEED TO INCREASE REFERRALSNO TALLY FOR USER
updateMemberData((int) $_POST['referredby'], array('referralsno' => 'referralsno + 1',));
trackStats(array('referrals' => '+'));

// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
// updateMemberData((int) $_POST['referredby'], array('karmaGood' => 'karmaGood + 25',));

// don't forget it we had a cookie stored to delete it
if(isset($_COOKIE['smfreferrals']))
{
// setting the cookie in the past and empty forces the browser to delete it
setcookie ("smfreferrals", "", time()-60000);
}


to

// don't forget it we had a cookie stored to delete it
if(isset($_COOKIE['smfreferrals']))
{
// NOW THAT USER HAS BEEN REGISTERED
// NEED TO INCREASE REFERRALSNO TALLY FOR USER
updateMemberData((int) $_POST['referredby'], array('referralsno' => 'referralsno + 1',));
trackStats(array('referrals' => '+'));

// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
// updateMemberData((int) $_POST['referredby'], array('karmaGood' => 'karmaGood + 25',));

// setting the cookie in the past and empty forces the browser to delete it
setcookie ("smfreferrals", "", time()-60000);
}


it should work better.

Best Regards
Lanthan
Title: Re: Referrals Mod
Post by: karlbenson on July 31, 2007, 11:14:55 AM
Thanks Lantham.

I believe this was the cause of the errors in the logs reported by nitins60.
(when someone registers who wasnt referred, it gave the error.)

I've incorporated the fix into the mod.  V1.2 now available from the mod section.

If you've installed it already you can just perform the 'EXACT' edit above.

enjoy!
Title: Re: Referrals Mod
Post by: Lanthan on July 31, 2007, 06:16:47 PM
Thanks karlbenson,

But I have another strange behavior (nothing seriously) found...
If you open the daily stats the first time... all I see is the value NULL for the days. After a Refresh of the page all is okay.
Can someone reproduce this?

Best regards
Lanthan

PS If I find a solution I will post it here..
Title: Re: Referrals Mod
Post by: karlbenson on July 31, 2007, 06:44:32 PM
@Lanthan
Its the only other bug that I know about.
Its todo with the xml not getting the value.

When its queries in php it works.

At this moment, I'm sure whats causing it. And was going to take a look after I finish the adrevenuesharing mod which I'm re-writing.
Title: Re: Referrals Mod
Post by: Lanthan on August 01, 2007, 07:47:52 AM
Hi karlbenson,
thanks for the tip with the xml...

I have looked at the code and here is the fix:
Themes/default/xml.template.php

Search for

<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';


and change to:

<day date="', $day['year'], '-', $day['month'], '-', $day['day'], '" new_topics="', $day['new_topics'], '" new_posts="', $day['new_posts'], '" new_members="', $day['new_members'], '" most_members_online="', $day['most_members_online'], '" referrals="', $day['referrals'], '"', empty($modSettings['hitStats']) ? '' : ' hits="' . $day['hits'] . '"', ' />';


Best Regards
Lanthan
Title: Re: Referrals Mod
Post by: Lanthan on August 03, 2007, 05:43:57 PM
Hi its me again,
I have found another thing..

Your additions in the member table are not complete..
install.php

$newcolumns['referredon'] = "int(10) NOT NULL";


should be better

$newcolumns['referredon'] = "int(10) NOT NULL default '0'";


otherwise a restore is not possible.

Best Regards
Lanthan
Title: Re: Referrals Mod
Post by: Pranav on August 03, 2007, 08:45:29 PM
I'll be installing it once i come back from school on my Dilber MC theme.Let's see what happens. :)
Gives me this error while installing :

6.     Execute Modification     ./Themes/default/Display.template.php     Test failed
Title: Re: Referrals Mod
Post by: shaka on August 04, 2007, 09:32:46 PM
Quote from: ulgaming.net on August 03, 2007, 08:45:29 PM
I'll be installing it once i come back from school on my Dilber MC theme.Let's see what happens. :)
Gives me this error while installing :

6.     Execute Modification     ./Themes/default/Display.template.php     Test failed

getting the same error
Title: Re: Referrals Mod
Post by: nitins60 on August 04, 2007, 09:57:50 PM
First of all, Dilber MC theme doesn't have it's own Display.template, m using it n my forum perfectly with many typical mods. It uses Default SMF themes one. You might have installed Custom Profile Mod? Otherwise list the mods which you installed
Title: Re: Referrals Mod
Post by: Pranav on August 04, 2007, 11:57:17 PM
Quote from: nitins60 on August 04, 2007, 09:57:50 PM
First of all, Dilber MC theme doesn't have it's own Display.template, m using it n my forum perfectly with many typical mods. It uses Default SMF themes one. You might have installed Custom Profile Mod? Otherwise list the mods which you installed
So this works with Dilber MC? I have installed that only..So i should try installing on it.
Title: Re: Referrals Mod
Post by: Pranav on August 05, 2007, 08:12:51 PM
Ok..i installed it on Dilber MC and it worked too! But i get this error in my error log :

Quote8: Undefined index: referredby
File: /home/******/public_html/Sources/Register.php
Line: 335
Title: Re: Referrals Mod
Post by: karlbenson on August 05, 2007, 10:31:42 PM
Ok everyone,

Just uploaded v1.3

Fixed all current known bugs.  See version log for list of fixes.

During the process of bug fixing I've discovered the stats have been screwed up and counting a referral every time a user registers.  Therefore to get the stats working fully I'm recommending users uninstall/reinstall to fix all the bugs.

Enjoy!


By request I've also put the referral link in a new input box for easy copy and paste.

See
(http://www.adrevenuesharing.info/smfmods/referrals/newprofile.jpg)
Title: Re: Referrals Mod
Post by: asdas2 on August 05, 2007, 11:48:29 PM
ok budddy here u

smf version 1.1.3
theme Dilber MC

ERROR




Install Actions
Installations actions for "Referrals Mod":
Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/xml.template.php File not found

8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test successful
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Code install.php 
Title: Re: Referrals Mod
Post by: karlbenson on August 06, 2007, 07:36:01 AM
Sorry.  xml should have been Xml.

I've reuploaded to to fix that one.

On the Display.template.php there is obviously a problem with that modification.  You'll have to do it manually.

FIND
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />'


REPLACE WITH
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />';

// show how many referrals they have made
echo $txt['referrals_referrals'].' '.$message['member']['referralsno'].'</br></br>';
Title: Re: Referrals Mod
Post by: Pranav on August 06, 2007, 09:54:49 AM
How can i upgrade my current version??
Title: Re: Referrals Mod
Post by: Lanthan on August 06, 2007, 10:19:44 AM
You have to remove the mod, and then reinstall it. All entries in the db will remain.

Lanthan
Title: Re: Referrals Mod
Post by: Pranav on August 06, 2007, 10:25:41 AM
Yeah it worked..
Title: Re: Referrals Mod
Post by: karlbenson on August 06, 2007, 10:39:04 AM
Thats good news.

Obviously on the Display.template.php Dilber does something differently or it was affected by another installed mod.
Title: Re: Referrals Mod
Post by: LostProphecy on August 07, 2007, 09:34:37 PM
Hi, i just installed this mod and i love it and think it's going to be really useful...

just wondering one small thing...

is there anyway of me manually going backward and giving referral points to members that referred people one month or even one year ago?

would i just need to go into the database and manually add rows of info and that sort of thing or would it just plain not work?
Title: Re: Referrals Mod
Post by: karlbenson on August 07, 2007, 09:57:44 PM
Well you could alter the database manually.  It would probably be alot of hassle.  Altering the user_id of the referrer, the date when referred and increasing the referrers people who have registered by 1 each time.

Although how would you know who referred who? (until my mod came along, there is no record)
Title: Re: Referrals Mod
Post by: LostProphecy on August 07, 2007, 11:26:50 PM
i think i'll do just that thank you :)

i've done heaps of database mods before so it shouldn't be that hard for me...

as for the record, previously we had a member bonus scheme giving members points for joining up others so i have a history thread of who brought whoever along, it's a spoken history but it's enough
Title: Re: Referrals Mod
Post by: askepott on August 08, 2007, 09:15:00 AM
hey, how's the mod going? I'm thinking of adding this to my forum, I'm sure this will help me to advertise my forum :P
Title: Re: Referrals Mod
Post by: Lanthan on August 08, 2007, 10:40:56 AM
The Mod is working fine..
And I hope that many of my members will use it in the future.

So give it a try.

Lanthan
Title: Re: Referrals Mod
Post by: karlbenson on August 08, 2007, 01:56:05 PM
yeah, with lanthan's bug reporting all known bugs have been quashed.
Title: Re: Referrals Mod
Post by: askepott on August 10, 2007, 11:28:17 AM
downloading and will use it now! ;)
Title: Re: Referrals Mod
Post by: Pranav on August 12, 2007, 04:48:27 AM
Hey how about a place where admin can see who member referred who easily.
This will make easy for admin to see.And i pay my members to refer people so i am asking for such a feature so it becomes easy for me to see who referred who easily.
It can be like a member's name and after it can be a drop down box where we can see the names of the members referred by that member.
Title: Re: Referrals Mod
Post by: karlbenson on August 12, 2007, 04:10:05 PM
I'll potentially look at adding some additional 'limited' functionality to the mod in future.
But as I said right at the beginning of the mod, my intention is to keep it 'simple'.

I want to finish my other projects and develop some other mod ideas before I will look at this mod again (other than to fix any bugs which may be discovered, if any)
Title: Re: Referrals Mod
Post by: martina1974 on August 14, 2007, 11:50:28 AM
This looks a great mod does it work with smf 1.1.2 as I have tried to upload it but it didn't show.

These were the errors I got


1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/Xml.template.php Test successful
8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test failed
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Code install.php
Title: Re: Referrals Mod
Post by: karlbenson on August 14, 2007, 12:56:47 PM
Its conflicting with another modification which you have installed.

You'll need to manually install all of the parts onto the profile.template.php the default theme.
Title: Re: Referrals Mod
Post by: martina1974 on August 14, 2007, 04:21:52 PM
Please could you explain to me how to do that as I am new to this, thanks x.
Title: Re: Referrals Mod
Post by: karlbenson on August 14, 2007, 04:47:27 PM
you will need to manually make edits to the Profile.template.php

See this topic for help on the manual installation of mods
http://docs.simplemachines.org/index.php?topic=402
Title: Re: Referrals Mod
Post by: karlbenson on August 14, 2007, 04:57:14 PM
Re the beta topic

To give your users some money (for SMFSHOP) per referral

Open register.php (in sources)

FIND

// updateMemberData((int) $_POST['referredby'], array('karmaGood' => 'karmaGood + 25',));


REPLACE WITH

updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));


Change the 100 to the amount of money you want to give them.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 14, 2007, 05:01:59 PM
Oh so easy, thank you very much.  There was a much more complicated piece of code on their website that didnt work.  This is easy as pie.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 14, 2007, 05:04:49 PM
I do notice something weird though.  It doesnt always say who referred you on the registration page.  It seems to be hit and miss.

I am using http://www.poppedquestion.com/index.php?action=register;referedby=2 and sometimes I need to misspell referedby and then spell it this way again for it to work.
Title: Re: Referrals Mod
Post by: karlbenson on August 14, 2007, 05:23:45 PM
hmmm.  Right I've just done some testing.

The referral link that is created by this mod doesn't include the action=register part.
Eg it would direct users to
http://www.poppedquestion.com/index.php?referredby=2
not
http://www.poppedquestion.com/index.php?action=register;referredby=2

The cookie can be written on any page using the index.php with the referredby variable.
However it appear that it the cookie is set on the register page (by using the link you provided), it will not be read in time (possibly because it is set after the register template is loaded)

So if the user uses http://www.poppedquestion.com/index.php?action=register;referredby=2
then would need to refresh the page, for the referral information to show and be counted.

I will look into this further.
However for now, it doesnt affect anyone using the 'standard referral urls' (which don't have the action=register)
And I would suggest anyone using non-standard urls, just uses the standard ones.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 14, 2007, 05:35:55 PM
Never mind, I reread what you said and digested better, I see what you say now.  Thank you.
Title: Re: Referrals Mod
Post by: trenchteam on August 15, 2007, 04:53:22 AM
Mod works perfect on my site.  thanks!
Title: Re: Referrals Mod
Post by: Noddegamra on August 15, 2007, 10:22:51 AM
I installed it today. Ne errors on installing, still need to test the functionality though.

It looks great though! excatly what my forum needed! So far, so good! thankyou!!! :)

Anyone can feel free to try out this link: http://www.noddegamra.co.uk/forum/index.php?referredby=3    ;)
Title: Re: Referrals Mod
Post by: karlbenson on August 15, 2007, 12:54:58 PM
Thanks.

Just tested the above link.
Works.
Title: Re: Referrals Mod
Post by: ~Unkn0wn~ on August 15, 2007, 01:03:49 PM
Very nice mod, i have been waiting for this long time ago, anyway to increase referrals for admin? Manually maybe... Example to modify the referrals
Title: Re: Referrals Mod
Post by: karlbenson on August 15, 2007, 01:05:33 PM
other than manually editing the figures by phpmyadmin, no
Title: Re: Referrals Mod
Post by: rider on August 15, 2007, 04:55:00 PM
Hi there.I've been having the same problem as martina1974.I've made all the edits and have it working in the profile but see nothing in the adminpanel or the register form page.Any ideas.thanks
PS I should add on my test site it installed with no problems.
Title: Re: Referrals Mod
Post by: karlbenson on August 15, 2007, 05:14:30 PM
what is you forums link?
are there any errors in your error log?
Title: Re: Referrals Mod
Post by: Noddegamra on August 16, 2007, 04:09:18 AM
Got my first referral yesterday. Everything seems to work perfectly. thanks for an awesome mod!!! :)
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 06:58:50 AM
Quote from: karlbenson on August 15, 2007, 05:14:30 PM
what is you forums link?
are there any errors in your error log?
Sorry for the late reply.Had togo to work.I did see some errors pretaining to the profile.php but was able to fix them.Still can't figure out the admin and the register page.Here's a link to my forum. www.ridersplace.net .Thanks for replying.
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 10:24:34 AM
rider
Its working perfectly for me on your site.

The referral link is showing in your profile area.
I used the referral link to register
> it showed you as referring me on the registration page
> it credited you with my referral both on your profile and mine
Title: Re: Referrals Mod
Post by: dxyy on August 16, 2007, 11:08:42 AM
I got an error with:

Themes/default/Display.template.php --> Test Failed.

From reading through this thread, I guess that means that I have to manually install it, is that right? How hard is this for someone with ZERO coding experience to do?

Also, any idea how long it should approximately take?

Thanks. :)
Title: Re: Referrals Mod
Post by: ohvertigo on August 16, 2007, 03:13:11 PM
^ Same here.

EDIT: It's a realy small edit, it took less than a minute.
Thanks for this awesome mod! I'm going to try and give members points on a referral now.
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 03:21:09 PM
Quote from: karlbenson on August 16, 2007, 10:24:34 AM
rider
Its working perfectly for me on your site.

The referral link is showing in your profile area.
I used the referral link to register
> it showed you as referring me on the registration page
> it credited you with my referral both on your profile and mine
Thats great It threw me off by not seeing it anywhere but in the profile.One ? when I log out and click the register tab I don't see it.Is that cause I'm already registered?Thanks for the assist and the mod.
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 03:22:59 PM
Quote from: hugodiaz on August 16, 2007, 11:08:42 AM
I got an error with:

Themes/default/Display.template.php --> Test Failed.

From reading through this thread, I guess that means that I have to manually install it, is that right? How hard is this for someone with ZERO coding experience to do?

Also, any idea how long it should approximately take?

Thanks. :)
Use this link and upload the mod to it.It will show you all the edits that need to be made.It shouldn't take more than a few minutes to do.http://www.smfhacks.com/smf-package-parser.html
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 03:39:02 PM
rider, nothing is shown on the register tab UNLESS you have used a referral link already.

You need to use one of these links
http://www.ridersplace.net/home/index.php?referredby=1
before it will shown who referred you on register tab and after registration.
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 03:56:19 PM
If I got this right what you're saying is you must register 1st then fill in the info on who referred you.Is that right?
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 16, 2007, 04:01:05 PM
no, someone refers you and when you click their link you go to the main site and when you click register it should show up as who referred you.
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 04:07:33 PM
Quote from: RustyBarnacle on August 16, 2007, 04:01:05 PM
no, someone refers you and when you click their link you go to the main site and when you click register it should show up as who referred you.
i think I got it.lol I did see what you were saying when I logged out and clicked the register button.
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 04:22:09 PM
There isnt a box to for you to enter who referred you.
Title: Re: Referrals Mod
Post by: rider on August 16, 2007, 04:36:32 PM
Quote from: karlbenson on August 16, 2007, 04:22:09 PM
There isnt a box to for you to enter who referred you.
That clears things up for me.Now I know what to expect when I help others install it.thanks for taking the time to help me.
Title: Re: Referrals Mod
Post by: dxyy on August 16, 2007, 06:03:58 PM
Ok, I had to edit the Themes/default/Display.template.php file manually.
I also edited Sources/Register.php, because I want referrals to give members money for the shop mod.

The problem now is that there seems to be something off with the display.

It shows the number of posts, the number of referrals, but then it shows the number of posts again!

Here is a screenshot for your convenience.
(http://www.daxueyingyu.com/sitewidepics/referrals-posts.jpg)

Does anyone have some ideas of what could be the problem and how to fix this? Any help would be greatly appreciated. :)
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 06:09:44 PM
When you edited the Display.template.php
you were meant to REPLACE
rather than adding the code AFTER.

Simply editing the display.template again to remove the top posts

It should look something like this
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
Title: Re: Referrals Mod
Post by: ~Unkn0wn~ on August 16, 2007, 07:31:09 PM
What about that when you are watching refferals of others in his profiles when you select one goes to his profile? If it's already in, well doesnt work for me
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 07:40:36 PM
I don't understand what you mean?
Title: Re: Referrals Mod
Post by: ~Unkn0wn~ on August 16, 2007, 07:51:32 PM
Quote from: karlbenson on August 16, 2007, 07:40:36 PM
I don't understand what you mean?

Also, how do i put more referals to admin, please step by step, ANY WAY....

Also, when i go someone profile, i will see how much referrals and the names at the right a thing that you click and a appears down, drop down menu, with the names that he reffered, well when you click in somebody nothing happens, good suggestion is that when you click on somebody it redirects to his profile..

Also, how do i put more referals to admin, please step by step, ANY WAY....
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 08:04:25 PM
You are correct, currently only a dropdown box is produced just to show which users this user referred.
In a future version I'll make each one redirect to the persons profile.

If you want to increase/credit the no of referrals the admin has made, the ONLY way to do it at the moment is via PHPMyAdmin.

In the smf_members table
Change the value in the column 'referralsno' where the ID_MEMBER = the admins id.

Usually it will be the first one in the table.
Title: Re: Referrals Mod
Post by: ~Unkn0wn~ on August 16, 2007, 08:09:29 PM
Quote from: karlbenson on August 16, 2007, 08:04:25 PM
Change the value in the column 'referralsno' where the ID_MEMBER = the admins id.

Usually it will be the first one in the table.


Stuck there, im not so good with phpmyadmin, how do i really do this, sorry and ty for ur patient, very good support

EDIT: Sorry, of out topic but if you help me how to see member passwords, i dont care it's encrypted, if you can help me also pls
Title: Re: Referrals Mod
Post by: karlbenson on August 16, 2007, 08:14:15 PM
Well FIRST you should backup of your database, just in case you screw up.

Making alterations in phpmyadmin is really not recommend unless your familar with it, because you can screw up your forum completely.

view the smf_members table (if you haven't used the 'smf_' prefix then obviously it would be different)

Find the 'admins' record. Usually this will be where under the column/header ID_MEMBER where the record = 1
Click edit (usually a pencil)
Then it should list ALL of the fields/settings for that member.

Find the one called 'referralsno'
That is the number (no.) of referrals.

Enter the correct figure for the no. of referrals the admin has made.

Click save.

(Note this will not show which members referred who, only that they referred 10 users.)
Title: Re: Referrals Mod
Post by: dxyy on August 17, 2007, 12:10:21 AM
Quote from: karlbenson on August 16, 2007, 06:09:44 PM
When you edited the Display.template.php
you were meant to REPLACE
rather than adding the code AFTER.

Simply editing the display.template again to remove the top posts

It should look something like this
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />

Thanks for your reply.

After taking a look at my original display.template I realized that there were two such lines. The first one was 'commented' (not sure what word to use as I only learned about that last night while reading something) and the second one was not. Not knowing what I was doing, I replaced the first, commented code which left me with 2 uncommented lines of code. :)

It seems to be working fine now, so after playing around a little more I will install it on my real forum.

Thanks again, your support is great! :)
Title: Re: Referrals Mod
Post by: karlbenson on August 17, 2007, 08:37:49 AM
No problem,

I'm glad to be able to help out.
Title: Re: Referrals Mod
Post by: rider on August 18, 2007, 05:27:12 AM
I'm back lol.I've installed this on a forum and made all the nessacart edits and when I click on referrel information in profile I get thi erros message.'Unable to load the 'referralsinfo' template'.
any ideas where I went wrong?I see no errors pretaing to the mod in the error log.
"edit"
I was able to fix this. :)
When I installed this the 2 errors that came up were the dreaded failed on the display.template and  profile.php files.I made the edits to fix them but still had to add the edits to the profile.template.php to make it work.
Title: Re: Referrals Mod
Post by: Vastari on August 18, 2007, 07:45:32 AM
Hey, I need some help installing this. My installer doesn't seem able to install the mod, so I've tried installing it manually. I've made all the edits needed to certain files, but I still need to create the database. Does anyone know an SQL query which will do it?
Title: Re: Referrals Mod
Post by: rider on August 18, 2007, 08:03:15 AM
Quote from: Vastari on August 18, 2007, 07:45:32 AM
Hey, I need some help installing this. My installer doesn't seem able to install the mod, so I've tried installing it manually. I've made all the edits needed to certain files, but I still need to create the database. Does anyone know an SQL query which will do it?
What kind of errors are you getting?
Title: Re: Referrals Mod
Post by: Vastari on August 18, 2007, 08:23:06 AM
Fatal error: require() [function.require]: Failed opening required '/mounted-storage/home48b/sub005/sc33455-UFJA/ps360forum.com/Packages/temp/./install.php' (include_path='.:/usr/local/lib/php/') in /mounted-storage/home48b/sub005/sc33455-UFJA/ps360forum.com/Sources/Packages.php on line 552

I get that whenever I try to install it through the package manager. If it is of any consequence, I also have the Ad mod and SMFShop mods installed, and am using the X-Box 360 Elite skin.
Title: Re: Referrals Mod
Post by: rider on August 18, 2007, 08:30:26 AM
have you tried before installing a mod to goto packages>options>make all files writable?Try that and see if the same error happens.
Title: Re: Referrals Mod
Post by: Vastari on August 18, 2007, 08:35:13 AM
Tried it. I used my FTP client and the SMF way, but neither worked.
Title: Re: Referrals Mod
Post by: karlbenson on August 18, 2007, 12:08:28 PM
do you still get this error trying to install any other mods?

Delete the mod and redownload it. See if that works (maybe it got corrupted?)
Title: Re: Referrals Mod
Post by: Vastari on August 18, 2007, 03:41:37 PM
Nope, no such luck. When I install it completely manually, everything is fine, it's only when I try to look at my profile that the error appears. I think it's because it can't find the database table used to list referrals...if that makes any sense. Is there another way to create the table without using the installer?
Title: Re: Referrals Mod
Post by: karlbenson on August 18, 2007, 05:57:14 PM
you could manually run the querys in phpmyadmin.
Title: Re: Referrals Mod
Post by: Vastari on August 19, 2007, 10:38:13 AM
That's what I thought. I just need to know what the queries are....
Title: Re: Referrals Mod
Post by: karlbenson on August 19, 2007, 10:50:44 AM
They are in the install.php (but they are created dynamically) so here they are.&nbsp; You will need to alter smf_ to whatever dbprefix you used.

ALTER TABLE smf_members
ADD COLUMN `referralsno` mediumint(8) NOT NULL default '0'

ALTER TABLE smf_members
ADD COLUMN `referralshits` mediumint(10) NOT NULL default '0'

ALTER TABLE smf_members
ADD COLUMN `referredby` mediumint(8) NOT NULL default '0'

ALTER TABLE smf_members
ADD COLUMN `referredon` int(10) NOT NULL default '0'

ALTER TABLE smf_log_activity
ADD COLUMN `referrals`smallint(5) NOT NULL default '0'
Title: Re: Referrals Mod
Post by: Vastari on August 19, 2007, 04:57:04 PM
Okay, thanks for that I;m not getting the error any more, but I have a new problem. When people sign up via the referral link, the referrer doesn't get credited for it, nor do they get money (I'm using the SMf Shop mod and the line of code you gave to alter the karma award).
Title: Re: Referrals Mod
Post by: dxyy on August 19, 2007, 05:06:57 PM
Quote from: Vastari on August 19, 2007, 04:57:04 PM
Okay, thanks for that I;m not getting the error any more, but I have a new problem. When people sign up via the referral link, the referrer doesn't get credited for it, nor do they get money (I'm using the SMf Shop mod and the line of code you gave to alter the karma award).
I had a similar problem, clear your cookies and do a hard refresh then test it again.

Also ensure that the code line with the money amount to be credited for referrals is uncommented --> remove the "//"

Hope that helps, but maybe not. :(
Title: Re: Referrals Mod
Post by: karlbenson on August 19, 2007, 05:47:11 PM
whats the link to your forum?
Title: Re: Referrals Mod
Post by: Vastari on August 20, 2007, 12:23:02 PM
Thanks for the suggestion, but it didn't work I'm afraid. And I checked the code, looks fine.

my forum can be found at:
www.ps360forum.com
Title: Re: Referrals Mod
Post by: dxyy on August 20, 2007, 02:11:26 PM
Hmm, I think I just discovered a new problem with the referrals mod on my forum. Everything seemed to be working fine before. I invited one person to sign up and got the referral when he did. It also showed up in the stats (both for members referred and posts made).

The problem now is that when a second person was referred to the forum by me my referrals count went up, but my referral post count dropped back down to zero! Any ideas on what may have caused this and how it can be fixed? 
Title: Re: Referrals Mod
Post by: dxyy on August 21, 2007, 07:51:11 PM
Quote from: hugodiaz on August 20, 2007, 02:11:26 PM
Hmm, I think I just discovered a new problem with the referrals mod on my forum. Everything seemed to be working fine before. I invited one person to sign up and got the referral when he did. It also showed up in the stats (both for members referred and posts made).

The problem now is that when a second person was referred to the forum by me my referrals count went up, but my referral post count dropped back down to zero! Any ideas on what may have caused this and how it can be fixed? 

Anyone else experiencing this problem? :(
Title: Re: Referrals Mod
Post by: karlbenson on August 21, 2007, 09:01:49 PM
I've tested it on a clean forum and the no. of posts is right.

I'm convinced there is a bug in my code. I've just not been able to spot it.
Although I haven't had that much time to have a really good look at it.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 22, 2007, 02:21:46 PM
Hello,

I get this error now if I go to my site on a machine that hasnt got a referral.

8: Undefined index: referredby
File: /home/xxxxx/public_html/Sources/Register.php
Line: 349
Title: Re: Referrals Mod
Post by: karlbenson on August 22, 2007, 02:31:25 PM
what version are you using?

I'm pretty sure that was the bug which was fixed in 1.1.3?
Title: Re: Referrals Mod
Post by: rodrigosoares on August 23, 2007, 12:58:52 PM
Is there a way to only show the referral link for the profile owner ?

I am afraid that one user could send other users link by mistake.

Thanks
Title: Re: Referrals Mod
Post by: karlbenson on August 23, 2007, 01:02:35 PM
Well I left it in, because if a user wanted another user to say that x referred them, they could always go to their profile to get the link.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 23, 2007, 05:40:54 PM
I dont know if its been mentioned or not but under stats my bar goes way off the screen.

I'm the most referring person by far and even with a resolution of 1400*1050 the bar is about 3 screen widths wide.
Title: Re: Referrals Mod
Post by: karlbenson on August 23, 2007, 06:11:50 PM
HOLY CRAP.

Its certainly not meant to do that.

I'll look into it.
Title: Re: Referrals Mod
Post by: dxyy on August 28, 2007, 05:27:05 PM
Quote from: RustyBarnacle on August 23, 2007, 05:40:54 PM
I dont know if its been mentioned or not but under stats my bar goes way off the screen.

I'm the most referring person by far and even with a resolution of 1400*1050 the bar is about 3 screen widths wide.
Haha, now I'm experiencing the same problem as you! :( :(
Previously everything seemed to be working just fine, but then after I got two referrals the 'Top 5 Referrers (By Referred Member Posts)' dropped down to zero.

Now it's suddenly back, but the bar for that is waaayyyyy too long and it makes the stats page look horribly ugly. Hehe, and when I say ugly, I mean worse than this: :o :o :o :o
(http://daxueyingyu.com/sitewidepics/ugly.jpg) (http://www.daxueyingyu.com/jokes/all102.html)

Please any assistance in rectifying this situation would be greatly appreciated! ;)

Oh, here is a link to my stats page:
http://www.daxueyingyu.com/forum/index.php?action=stats
Title: Re: Referrals Mod
Post by: fuelthescene on August 28, 2007, 05:41:14 PM
Quote from: hugodiaz on August 16, 2007, 06:03:58 PM
Ok, I had to edit the Themes/default/Display.template.php file manually.
I also edited Sources/Register.php, because I want referrals to give members money for the shop mod.

The problem now is that there seems to be something off with the display.

It shows the number of posts, the number of referrals, but then it shows the number of posts again!

Here is a screenshot for your convenience.
(http://www.daxueyingyu.com/sitewidepics/referrals-posts.jpg)

Does anyone have some ideas of what could be the problem and how to fix this? Any help would be greatly appreciated. :)

Does this actually work with the Shop Mod?

Like, does it give a person so many Credits/Dollars/Points/Whatever for referring someone?  Is there a way to change how much a referral is worth?
Title: Re: Referrals Mod
Post by: dxyy on August 28, 2007, 05:57:42 PM
Fuelthescene, yes it does work with the shop mod, but you need to make some changes.
See this post:

Quote from: karlbenson on August 14, 2007, 04:57:14 PM
Re the beta topic

To give your users some money (for SMFSHOP) per referral

Open register.php (in sources)

FIND

// updateMemberData((int) $_POST['referredby'], array('karmaGood' => 'karmaGood + 25',));


REPLACE WITH

updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));


Change the 100 to the amount of money you want to give them.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 28, 2007, 06:08:08 PM
And that works perfectly.

I do get an error in my log though from people who come to my site without a referral #.
Title: Re: Referrals Mod
Post by: fuelthescene on August 28, 2007, 06:09:19 PM
Thanks a MILLION!  I was trying to search within this thread for "shop" and oddly it didn't bring that post up, even though it had the word shop in it.

Thanks a lot, I greatly appreciate your help.
Title: Re: Referrals Mod
Post by: karlbenson on August 28, 2007, 09:48:42 PM
@rustybarnacle - what version of the mod are you using?
I'm pretty sure people who register without referral link error log entry bug was fixed in the latest version
P.S I'm still unsure why that large size stats error happens.

@ hugodiaz - yeah thanks for posting the easter egg.
I was trying to put a hidden easter egg for people who wanted to add extra bits, without having to code for mods not installed.

@ fuelthescene - for future searches, I'll help it a bit,
shop, ShOp, sHoP, SHOP, S.H.O.P, smfshop, shoop (in case of misspelling)
Title: Re: Referrals Mod
Post by: dxyy on August 28, 2007, 10:04:15 PM
Hmm, I believe I am also using the latest version (1.3), but I too am getting errors in my log.
Haha, maybe that has something to do with why we both have the extra long bar on the stats page? :(
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 28, 2007, 11:48:22 PM
I'm using 1.3
Title: Re: Referrals Mod
Post by: trenchteam on August 29, 2007, 01:28:55 AM
This mod rules! Thanks. Check it out in action on www.shoyoroll.com  I have it in the display and looks good in the user profiles as well! ;D ;D

1.1.3 btw too.
Title: Re: Referrals Mod
Post by: Doughboy on August 30, 2007, 09:03:30 AM
I really like this mod a lot.

What I wanted to know is if I someone could make this work in conjunction with the Bonus section of the Shop Admin section to change referral credits(money) on the fly.  I tried the code here for shop credits but I was wondering if there a way to add it to Shop Admin.

Thanks for a great mod!
Title: Re: Referrals Mod
Post by: dxyy on August 30, 2007, 03:57:13 PM
Any fix for the super long statistics bar as yet? :)

If I uninstall this mod, will all my current referral stats be lost forever?
I really can't stand the way the stats page looks at the moment, but I don't want the referrals count to drop to zero for everyone. Is there a way to simply deactivate the mod without completely removing it?

Please, any help would be greatly appreciated.

Thanks! :)
Title: Re: Referrals Mod
Post by: karlbenson on August 30, 2007, 06:26:09 PM
@ Doughboy 
Its not possible for me to add sections for the mod for mods which users may not have installed. Thats why I first added the easter egg.

@ hugodiaz 
removing the mod does not remove the 'referrals' stuff from the database.
I promise to have a fix for the extra long stats bar by the end of the weekend.  I'll read through the topic and double check for any other bugs that need fixing.
Title: Re: Referrals Mod
Post by: RustyBarnacle on August 30, 2007, 08:47:43 PM
Thanks,

Its a little odd looking but since I rarely look at my stats it wasnt a make or break for me.
Title: Re: Referrals Mod
Post by: dxyy on August 31, 2007, 12:06:24 AM
Quote from: RustyBarnacle on August 30, 2007, 08:47:43 PM
Thanks,

Its a little odd looking but since I rarely look at my stats it wasnt a make or break for me.
Haha, I check the stats every day, and for what reason, I don't know... ::)
Title: Re: Referrals Mod
Post by: Teunel on September 01, 2007, 06:52:29 AM
Hi,

I see it's also possible to see how many hits the unique link had.

I am using this together with the Shop Mod, so I was wondering if it's possible to give the user 1 Credit each times somebody clicks on his link?

Thanks
Title: Re: Referrals Mod
Post by: karlbenson on September 02, 2007, 08:40:05 PM
Sorry for not posting an update as yet.

I've had a problem, I've not been able to reproduce the stats bug in any browser.
I've tested and tested on 2 different clean installs.

This is basically an appeal to the community to see if anyone can find the cause of the problem.
I'm almost completely stumped.

Well I say almost, the only thing that comes to mind is that its because no width proportion has been set. (eg px)

Could someone with the problem edit their Stats.template.php and find

<td width="20%" align="left" valign="top">', $referrer['referralsno'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $referrer['referrals_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>

and replace with

<td width="20%" align="left" valign="top">', $referrer['referralsno'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $referrer['referrals_percent'] . 'px" height="15" alt="" />' : '&nbsp;', '</td>

and find

   <td width="20%" align="left" valign="top">', $referrer['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $referrer['referralsposts_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>

and replace with

   <td width="20%" align="left" valign="top">', $referrer['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $referrer['referralsposts_percent'] . 'px" height="15" alt="" />' : '&nbsp;', '</td>
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 09:46:47 PM
Hmm, ok I replaced both, but I don't see any change. :(

Here is my stats page: http://www.daxueyingyu.com/forum/index.php?action=stats
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 09:48:58 PM
Also, here is a copy of my stats file.
Title: Re: Referrals Mod
Post by: karlbenson on September 02, 2007, 09:59:08 PM
nope, i see its saying 1033px in the sourcecode.

Is it possible for you to attach your sources/Stats.php

The working out the size is done source side
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 10:04:21 PM
Quote from: karlbenson on September 02, 2007, 09:59:08 PM
nope, i see its saying 1033px in the sourcecode.

Is it possible for you to attach your sources/Stats.php

The working out the size is done source side
Oh, I haven't touched the source/stats.php.

Sure, I can attach that for you... give me one sec.

EDIT:
It's now attached. ;)
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 10:06:31 PM
Oh, I'm not sure if you will see this because of the edit...
Title: Re: Referrals Mod
Post by: karlbenson on September 02, 2007, 10:12:49 PM
Thanks ;)


can you try changing at line 316 in stats.php

$context['totalreferralsposts'] += $row['posts'];

to

$context['totalreferralsposts'] += $row['totalposts'];
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 10:33:49 PM
The subs.php file can be found in sources, right?

Hmm, for some strange reason, I cannot find that code... :(
Let me have another look.
Title: Re: Referrals Mod
Post by: karlbenson on September 02, 2007, 10:59:16 PM
I'm very sorry Hugodiaz.  I meant Stats.php

(Its like 4am here in the UK, and i'm really tired, but I'm having to try to finish some stuff)
Title: Re: Referrals Mod
Post by: dxyy on September 02, 2007, 11:07:00 PM
Quote from: karlbenson on September 02, 2007, 10:59:16 PM
I'm very sorry Hugodiaz.  I meant Stats.php

(Its like 4am here in the UK, and i'm really tired, but I'm having to try to finish some stuff)
Haha you never need to apologize to someone you are helping! :)
If anything I should say sorry to bother you so much.

Ok, well I made the changes and it seems to be working perfectly now.

I should mention though, that I recall reading something about getting an error in the logs when a user registers without being referred - I think you said this was fixed, but I still get those errors. Honestly though, I couldn't care less about that, but I just wanted to let you know.

Haha, well, once again thank you very much for your help! 8)
Title: Re: Referrals Mod
Post by: karlbenson on September 02, 2007, 11:15:17 PM
yeah, I've not got any of those errors either.  I'm pretty sure its fixed.

I'll have a read through the topic to check for other bugs and fix those aswell and post an upgrade/install tomorrow.

Anyways I've done was I was up for, so I'm off to bed.
Title: Re: Referrals Mod
Post by: karlbenson on September 03, 2007, 11:37:55 AM
@Teunel, -
Re giving a karma for each hit via the referral link
Open Load.php

Due to the smf word filter, I've had to put a space between the word referrals hits.You need to remove the space.


FIND

updateMemberData((int) $_REQUEST['referredby'], array('referrals hits' => 'referrals hits + 1',));

REPLACE

updateMemberData((int) $_REQUEST['referredby'], array('referrals hits' => 'referrals hits + 1', 'karmaGood' => 'karmaGood + 5',));

CHANGE the 5 to whatever karma amount your want to assign.

NOTE: All that protects from getting multiple karma is the cookie. There is no limit or protection to prevent multiple users of the link.
Title: Re: Referrals Mod
Post by: karlbenson on September 03, 2007, 12:28:32 PM
A little later than promised, I've uploaded version 1.4
And provided an upgrade patch from 1.3 to 1.4 ONLY

Available from the mods page Referrals Mod (http://custom.simplemachines.org/mods/index.php?mod=836)

Fixed: Huge Stats Bar bug
Added: Drop down of members that user has referred is replaced with one that goes to users profile
Added UTF-8 Support
Added 1 extra language string
Title: Re: Referrals Mod
Post by: Teunel on September 04, 2007, 10:32:30 AM
Quote from: karlbenson on September 03, 2007, 11:37:55 AM
@Teunel, -
Re giving a karma for each hit via the referral link
Open Load.php

Due to the smf word filter, I've had to put a space between the word referrals hits.You need to remove the space.


FIND

updateMemberData((int) $_REQUEST['referredby'], array('referrals hits' => 'referrals hits + 1',));

REPLACE

updateMemberData((int) $_REQUEST['referredby'], array('referrals hits + 1', 'karmaGood' => 'karmaGood + 5',));

CHANGE the 5 to whatever karma amount your want to assign.

NOTE: All that protects from getting multiple karma is the cookie. There is no limit or protection to prevent multiple users of the link.
Thanks, will try that :)

Will these also count in the Stats top 5?
Title: Re: Referrals Mod
Post by: karlbenson on September 04, 2007, 10:37:47 AM
The karma?

The figure is added to normal Goodkarma.

So any amounts will increase the karma levels and be reflected in the karma top 5.

Teunel - I've just fixed an error in the above code (due to the filter again) :(
Title: Re: Referrals Mod
Post by: Dem0n on September 04, 2007, 06:30:44 PM
I have installed this mod, and it works fine on the default theme. The only problem I have when manually adding this mod to a custom theme is, the text in post view under the post count doesnt show, it just shows the number 0.

Also, none of the referred by, or referal link text shows in the profile. I have looked at profile.template.php , and display.php and done what the mod said, any ideas?

Also, the users email address shows at the very top of their profile. How do I fix this?
Title: Re: Referrals Mod
Post by: karlbenson on September 04, 2007, 06:37:03 PM
are you using UTF-8?

If so you will need to add copies of the language strings to your themes.

To hide email addresses you could use the smf email system mod which replaces the emails with an email box using smf itself (so it allows users to email each other), but never discloses the email address.
Title: Re: Referrals Mod
Post by: Dem0n on September 04, 2007, 06:41:33 PM
Quote from: karlbenson on September 04, 2007, 06:37:03 PM
are you using UTF-8?

If so you will need to add copies of the language strings to your themes.

To hide email addresses you could use the smf email system mod which replaces the emails with an email box using smf itself (so it allows users to email each other), but never discloses the email address.

Uhm, I dont even know what UTF-8 is. My problem is, everything works fine on the default theme. When I manually installed the mod, to a custom theme, when I click on profile, I only see the number of referrals, and the drop down box. I don't see the text which reads :



Referrals: 
Referral Link Hits:
Referrals Link:


And also, in the post view, under where it shows the number of post, it just displays the number of referrals they have, and not the actual text that says refferals :.

And also, instead of the users email address being next to the section which says :

Email: . The email address is listed in the persons profile above Where it displays the name field.
Title: Re: Referrals Mod
Post by: karlbenson on September 04, 2007, 06:56:01 PM
If you custom theme has a languages folder in it check whether it has a custom profile.english.php

If so you will need to copy the language strings to the custom version.

If your using utf-8 you will need to add the strings to

profile.english-utf8.php in the languages folder
Title: Re: Referrals Mod
Post by: Dem0n on September 04, 2007, 06:58:04 PM
Quote from: karlbenson on September 04, 2007, 06:56:01 PM
If you custom theme has a languages folder in it check whether it has a custom profile.english.php

If so you will need to copy the language strings to the custom version.

If your using utf-8 you will need to add the strings to

profile.english-utf8.php in the languages folder

No, it doesn't have a custom profile.template.php, any other ideals? I don't even know what UTF8 is, so I'm not using it.
Title: Re: Referrals Mod
Post by: karlbenson on September 04, 2007, 07:05:18 PM
the the url to your forum?
Title: Re: Referrals Mod
Post by: Dem0n on September 04, 2007, 07:10:47 PM
Quote from: karlbenson on September 04, 2007, 07:05:18 PM
the the url to your forum?

It's a private forum, for females. I just do all the handy work. I could how ever send you source code files if you need them.

Here is a link to a screen shot.

http://img.photobucket.com/albums/v705/dem0n/pn.gif


Title: Re: Referrals Mod
Post by: Dem0n on September 04, 2007, 07:47:23 PM
anything?
Title: Re: Referrals Mod
Post by: karlbenson on September 05, 2007, 05:53:43 PM
What other mods do you have installed on that theme?

Can you attach your profile.php (in sources dir) and from (Theme/{themename}/) profile.template.php and i'll take a look.
Title: Re: Referrals Mod
Post by: Dem0n on September 05, 2007, 06:06:47 PM
Here you go, thanks.
Title: Re: Referrals Mod
Post by: karlbenson on September 05, 2007, 06:13:14 PM
Dem0n, it looks like you've made a mistake with the manual edits.

You have put code in between parts of the edit

The manual edit

<file name="$themedir/Profile.template.php">
<operation>
<search position="after"><![CDATA[ // Messenger type information.
echo '
<tr>
<td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
</tr><tr>
<td><b>', $txt[513], ':</b></td>
<td>', $context['member']['icq']['link_text'], '</td>]]></search>
<add><![CDATA[

// ADDS THE REFERRAL/REFERRED USER INFORMATION TO THE PROFILE SUMMARY
echo '<tr><td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td></tr>
<tr>
<td><b>'.$txt['referrals_referrals'].'</b></td>
<td>'.$context['member']['referralsno'] .'  ';
// SHOW IN DROPDOWN USERSNAME OF THOSE REFERRED
if(!empty($context['member']['referredmembers']))
{
echo '<select onchange="location=options[selectedIndex].value;">
<option>'.$txt['referrals_membersreferred'].'</option>';
foreach($context['member']['referredmembers'] as $x) {
echo $x;
}
// FREE KEVIN
unset($x);
echo '</select>';
}
echo' </td>
</tr>
<tr>
<td><b>'.$txt['referrals_referral******s'].'</b></td>
<td>'.$context['member']['referral******s'].'</td>
</tr>';
if (!empty($context['member']['referredby']) && $context['member']['referredby'] != 0)
{
echo' <tr>
<td><b>'.$txt['referrals_referredby'].'</b></td>
<td>'.$context['member']['referredbylink'].' '.$txt['referrals_on'].' '. date("jS M Y",$context['member']['referredon']).'
</td>
</tr>';

}

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'] .'" style="width:330px;"/></td>
</tr>';
]]></add>
</operation>
</file>


your code (profile.template.php
Quote


            // ADDS THE REFERRAL/REFERRED USER INFORMATION TO THE PROFILE SUMMARY
      echo '<tr><td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td></tr>   
            <tr>
               <td><b>'.$txt['referrals_referrals'].'</b></td>
               <td>'.$context['member']['referralsno'] .'  ';
      // SHOW IN DROPDOWN USERSNAME OF THOSE REFERRED
      if(!empty($context['member']['referredmembers']))
      {
         echo '<select onchange="location=options[selectedIndex].value;">
            <option>'.$txt['referrals_membersreferred'].'</option>';
         foreach($context['member']['referredmembers'] as $x) {
            echo $x;
         }
         // FREE KEVIN
         unset($x);
         echo '</select>';
      }
      echo'      </td>
            </tr>
            <tr>
               <td><b>'.$txt['referrals_referral******s'].'</b></td>
               <td>'.$context['member']['referral******s'].'</td>
            </tr>';
      if (!empty($context['member']['referredby']) && $context['member']['referredby'] != 0)
      {
         echo'         <tr>
               <td><b>'.$txt['referrals_referredby'].'</b></td>
               <td>'.$context['member']['referredbylink'].' '.$txt['referrals_on'].' '. date("jS M Y",$context['member']['referredon']).'
               </td>
            </tr>';
   // Messenger type information.
   echo '
            <tr>
               <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
            </tr><tr>
               <td><b>', $txt[513], ':</b></td>
               <td>', $context['member']['icq']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[603], ': </b></td>
               <td>', $context['member']['aim']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt['MSN'], ': </b></td>
               <td>', $context['member']['msn']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[604], ': </b></td>
               <td>', $context['member']['yim']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[69], ': </b></td>
               <td>';
   

      
      }
      
      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'] .'" style="width:330px;"/></td>
            </tr>';   



The bit in bold needs moving below the last line of the bit I've quoted.
Title: Re: Referrals Mod
Post by: Dem0n on September 05, 2007, 06:30:36 PM
I did as you suggested, moved the following :


  // Messenger type information.
   echo '
            <tr>
               <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
            </tr><tr>
               <td><b>', $txt[513], ':</b></td>
               <td>', $context['member']['icq']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[603], ': </b></td>
               <td>', $context['member']['aim']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt['MSN'], ': </b></td>
               <td>', $context['member']['msn']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[604], ': </b></td>
               <td>', $context['member']['yim']['link_text'], '</td>
            </tr><tr>
               <td><b>', $txt[69], ': </b></td>
               <td>';


after this,


}
     
      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'] .'" style="width:330px;"/></td>
            </tr>';   
and it still has the same issue? It fixed the email from being displayed at the top, but the rest posted in those images still occur.
Title: Re: Referrals Mod
Post by: karlbenson on September 05, 2007, 06:37:11 PM
Try and find if you have a file in your custom theme directory Themes/default/languages/
called
Modifications.english-utf8.php
or
Modifications.english.php

Check the following if in the file, if not paste it in.

$txt['referrals_information'] = 'Referral Information:';
$txt['referrals_youwerereferredby'] = 'by';
$txt['referrals_on'] = 'on';
$txt['referrals_referrals'] = 'Referrals:';
$txt['referrals_referral******s'] = 'Referral Link Hits:';
$txt['referrals_noneyet'] = 'None Yet!';
$txt['referrals_top5referrers'] = 'Top 5 Referrers (By Referrals)';
$txt['referrals_top5referrersbyposts'] = 'Top 5 Referrers (By Referred Members Posts)';
$txt['referrals_referralsstats'] = 'Referrals';
$txt['referrals_referredby'] = 'Referred By:';
$txt['referrals_link'] = 'Referrals Link:';
$txt['referrals_membersreferred'] = '- Members Referred -';

Title: Re: Referrals Mod
Post by: Dem0n on September 05, 2007, 06:42:32 PM
Quote from: karlbenson on September 05, 2007, 06:37:11 PM
Try and find if you have a file in your custom theme directory Themes/default/languages/
called
Modifications.english-utf8.php
or
Modifications.english.php

Check the following if in the file, if not paste it in.

$txt['referrals_information'] = 'Referral Information:';
$txt['referrals_youwerereferredby'] = 'by';
$txt['referrals_on'] = 'on';
$txt['referrals_referrals'] = 'Referrals:';
$txt['referrals_referral******s'] = 'Referral Link Hits:';
$txt['referrals_noneyet'] = 'None Yet!';
$txt['referrals_top5referrers'] = 'Top 5 Referrers (By Referrals)';
$txt['referrals_top5referrersbyposts'] = 'Top 5 Referrers (By Referred Members Posts)';
$txt['referrals_referralsstats'] = 'Referrals';
$txt['referrals_referredby'] = 'Referred By:';
$txt['referrals_link'] = 'Referrals Link:';
$txt['referrals_membersreferred'] = '- Members Referred -';



I was wondering where the actual text was linked, I used the SMF package phaser to do the manual edits, and I didn't see any edits to this file, thank you. It works now.
Title: Re: Referrals Mod
Post by: karlbenson on September 05, 2007, 06:44:24 PM
ONE SEC (Damn word censor)

Replace
$txt['referrals_referral******s'] = 'Referral Link Hits:';

With (make referrals hits ONE word - no space)
$txt['referrals_referrals hits'] = 'Referral Link Hits:';
Title: Re: Referrals Mod
Post by: Dem0n on September 05, 2007, 06:45:31 PM
Quote from: karlbenson on September 05, 2007, 06:44:24 PM
ONE SEC (Damn word censor)

Replace
$txt['referrals_referral******s'] = 'Referral Link Hits:';

With (make referrals hits ONE word - no space)
$txt['referrals_referrals hits'] = 'Referral Link Hits:';


Done, thanks.
Title: Re: Referrals Mod
Post by: karlbenson on September 05, 2007, 08:03:16 PM
I'm glad we got it sorted in the end ;)
Title: Re: Referrals Mod
Post by: Pranav on September 08, 2007, 08:17:05 PM
ok...i installed "Referrals Mod Upgrade Patch (1.3 to 1.4)" and without uninstalling the old version of Referrals mod(1.3) .Now when i installed it, i see nothing after "Referrals Mod      1.3" in Package Manager. I don't see "uninstall". I see only "[ List Files ]  [ Delete ]" .

And i visited the profile of a member after that.In the drop down box it shows the members referred.Then i clicked one of the members listed in drop down box.And it took me to like : clickex.info/iammember
So it took me to a 404 Page. To a search engine friendly url but my forum's url are not like that.

So help me now! What can i do to fix this??
Title: Re: Referrals Mod
Post by: karlbenson on September 08, 2007, 08:21:22 PM
hmmm. I've got no experience with SEO urls and mods.

But the bit you will need to alter is in the profile.php


$context['member']['referredmembers'][] = '<option value="'.$scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</option>';

the value MUST be a full url.
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 12, 2007, 04:38:05 PM
I know your probly working on half a dozen mods at a time and dreaming of php in your sleep, but, have you had a chance to look at that stats error?
Title: Re: Referrals Mod
Post by: karlbenson on September 12, 2007, 05:14:43 PM
Yes, dreaming SMF Mods 2.0 in my sleep. ;)

Any chance your could attach your register.php please Rusty.
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 12, 2007, 05:28:29 PM
Take a peak:

Title: Re: Referrals Mod
Post by: karlbenson on September 12, 2007, 05:31:39 PM
well that was easy.  i was sure that was fixed in a past version.
I checked in the 1.4 on the download site [it was fixed] (and I've updated the file just to make sure for future installs)

FIND

}

// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));


MOVE the closing brace after the updateMemberData line

eg

// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));

}
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 12, 2007, 05:52:54 PM
Still have the error.
Title: Re: Referrals Mod
Post by: karlbenson on September 12, 2007, 05:56:30 PM
FIND

// NOW THAT USER HAS BEEN REGISTERED
// NEED TO INCREASE REFERRALSNO TALLY FOR USER
if(isset($_POST['referredby'])) {
// VALIDATE THE POST DATA
$_POST['referredby'] = (int) $_POST['referredby'];
if (!empty($_POST['referredby'])) {
updateMemberData($_POST['referredby'], array('referralsno' => 'referralsno + 1',));
trackStats(array('referrals' => '+'));
}


// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));
}
// don't forget it we had a cookie stored to delete it
if(isset($_COOKIE['smfreferrals']))
{
// setting the cookie in the past and empty forces the browser to delete it
setcookie ("smfreferrals", "", time()-60000);
}


REPLACE WITH

// NOW THAT USER HAS BEEN REGISTERED
// NEED TO INCREASE REFERRALSNO TALLY FOR USER
if(isset($_POST['referredby'])) {
// VALIDATE THE POST DATA
$_POST['referredby'] = (int) $_POST['referredby'];
if (!empty($_POST['referredby'])) {
updateMemberData($_POST['referredby'], array('referralsno' => 'referralsno + 1',));
trackStats(array('referrals' => '+'));
// UNCOMMENT THE FOLLOWING IF YOU WANT USERS TO BENEFIT BY +25 PER REFERRAL
updateMemberData((int) $_POST['referredby'], array('money' => 'money + 100',));
}
}
// don't forget it we had a cookie stored to delete it
if(isset($_COOKIE['smfreferrals']))
{
// setting the cookie in the past and empty forces the browser to delete it
setcookie ("smfreferrals", "", time()-60000);
}
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 12, 2007, 06:02:19 PM
Still no go, in fact the second most top referrer by posts' bar got even longer.  :'(

Title: Re: Referrals Mod
Post by: karlbenson on September 12, 2007, 06:12:56 PM
Rusty, are we talking about the same error? ;)
The extended stats bar bug was fixed the other week in the 1.4 patch I provided.

The bug I've been trying to fix is one in your register.php 'referredby' error which appears in your error log, which you posted about 2 pages back
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 13, 2007, 12:31:18 AM
DOH!  Somehow I thought I was on 1.4 but thats another mod, I'm only on 1.3 of this one.

Very sorry about that.
Title: Re: Referrals Mod
Post by: karlbenson on September 13, 2007, 06:33:23 AM
lol
Title: Re: Referrals Mod
Post by: goranbaxy on September 13, 2007, 07:29:08 AM
I'll try this mod, it so far looks great and if it works I'll make translation to Croatian. Also would like to see few steps of refers, so If I refer you to the forum, and you refer someone else I get also credit for that, hop you understand what do I mean!
Title: Re: Referrals Mod
Post by: karlbenson on September 13, 2007, 08:51:25 AM
like a pyramid or tree.
Title: Re: Referrals Mod
Post by: goranbaxy on September 13, 2007, 09:07:10 AM
like tree, look at the image.
Also if it would be possible to gain points for referred people, so if I directly refer someone I get let's say 10 points, but if someone from first step (someone that I have referred) refer someone he gets 10 points but I get let's say 5 points, that would be great, dont know how much work would it be for you :D   
Title: Re: Referrals Mod
Post by: karlbenson on September 13, 2007, 09:52:06 AM
Its probably possible.
But the query would probably be very intensive.

At the moment I'm too busy with my other mods, but as feature requests go, never say never,
Title: Re: Referrals Mod
Post by: goranbaxy on September 13, 2007, 12:12:49 PM
O.K., now I'm trying to install this mod, but as I have custom template I have to make some changes by hand and this is where by problem begins:
<file name="$themedir/Register.template.php">
I dont have that file in my template directory,  what can I do?
Title: Re: Referrals Mod
Post by: karlbenson on September 13, 2007, 12:14:08 PM
if you don't have a register.template.php in your custom theme, then you don't need to make those edits as the the register.template.php from the default theme is used.
Title: Re: Referrals Mod
Post by: goranbaxy on September 13, 2007, 12:18:53 PM
Thanks for the quick answer!
Title: Re: Referrals Mod
Post by: cru on September 15, 2007, 10:04:04 AM
hi! i tested this on my local site.  why do i get this error?
Quote./Themes/default/languages/Modifications.english-utf8.php     Test failed

how do i correct that?

im using SMF1.1.3 default theme with TP0.9.8

Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 12:22:00 PM
it looks like there is an issue with your utf-8 language file.

Open that file up.  And make sure there is a ?> at the very bottom and on its own line
Title: Re: Referrals Mod
Post by: Neorics on September 15, 2007, 01:47:47 PM
dude is there a way to reset the referral stats? or at least edit it on someone's profile?

i think you should include that on next updates...

and oh yah, Dragooon integrated this mod with the referral mod so that each time someone registers through an invite the guy who invited will get +1 count on his referrals
Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 01:51:06 PM
there is no way to reset at the moment.

Which parts specifically are your wanting to reset? And why?
For example I don't see a reason to alter/wipe the person who you referred?

If there is a good reason, I'll consider adding it?
Title: Re: Referrals Mod
Post by: goranbaxy on September 15, 2007, 01:55:47 PM
well I also think it's good idea to put reset button for each person because if you are giving some kind of payment for 100 referre you might want to reset it.   
Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 02:03:16 PM
yeah maybe.

Also please remember as per the read me.  This is a simple referrals mod and I'm wanting to keep it that way.  So I don't plan on adding heavy functionality eg more referrals tracking/stats/admin panel tracking etc.

Some little improvements (maybe reset) may get added.

Maybe resetting the hits/referred counters, but leaving the referred persons drop down intact?
Title: Re: Referrals Mod
Post by: Neorics on September 15, 2007, 02:29:53 PM
Quote from: Neorics on September 15, 2007, 01:47:47 PM
and oh yah, Dragooon integrated this mod with the referral mod so that each time someone registers through an invite the guy who invited will get +1 count on his referrals
oops my bad

we integrated this mod with the invite mod

Quote from: karlbenson on September 15, 2007, 01:51:06 PM
there is no way to reset at the moment.

Which parts specifically are your wanting to reset? And why?
For example I don't see a reason to alter/wipe the person who you referred?

If there is a good reason, I'll consider adding it?

no the thing was, me and dragooon was trying to integrate your mod to the invite mod so that when someone invites someone then it will add a count to the referrals count so we had to do some test and i had to make new accounts and when the testings were successful the admin's(mine) referrals had already gone up a few...

so i wanna reset it or edit it...

besides it's a really cool feature for the admin to be able to edit it because what if people referred themselves and the admin found out? then he deleted the other bogus accounts but the referrals are still there....
Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 03:02:30 PM
hmmm.

Well for now you can edit via phpmyadmin. the field "referrals hits" and "referrals no" (note they are one word each, but i've had to post them separate because of the word filter).

I may add a reset.  I probably won't be adding an edit field.
Title: Re: Referrals Mod
Post by: Neorics on September 15, 2007, 03:27:35 PM
will that be a reset for one profile or complete reset?
Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 04:51:32 PM
I don't know yet. Its going to be a while before I have the time to add such functionality.
Title: Re: Referrals Mod
Post by: goranbaxy on September 15, 2007, 04:58:09 PM
Don't see good reason way it should be complete, but do it as you like :)
Title: Re: Referrals Mod
Post by: cru on September 15, 2007, 10:02:56 PM
Quote from: karlbenson on September 15, 2007, 12:22:00 PM
it looks like there is an issue with your utf-8 language file.

Open that file up.  And make sure there is a ?> at the very bottom and on its own line

i opened the file thru crimson editor. its blank... 0kb. how do i correct it?
Title: Re: Referrals Mod
Post by: karlbenson on September 15, 2007, 10:06:50 PM
probably the easiest way is to

Delete your current blank utf-8 copy, then
copy your Modifications.english.php into your utf-8 directory and then rename it to Modifications.english-utf8.php
Title: Re: Referrals Mod
Post by: cru on September 15, 2007, 10:10:51 PM
wow! very swift reply! thanks! i will do it.
Title: Re: Referrals Mod
Post by: cru on September 15, 2007, 10:20:37 PM
Quote from: karlbenson on September 15, 2007, 10:06:50 PM
probably the easiest way is to

Delete your current blank utf-8 copy, then
copy your Modifications.english.php into your utf-8 directory and then rename it to Modifications.english-utf8.php

i did it, now i just want to make sure if this test is ok.. note on line 12
Quote1.     Execute Modification     .\Sources/Load.php     Test successful
2.    Execute Modification    .\Sources/Register.php    Test successful
3.    Execute Modification    .\Sources/Stats.php    Test successful
4.    Execute Modification    .\Sources/Profile.php    Test successful
5.    Execute Modification    ./Themes/default/Register.template.php    Test successful
6.    Execute Modification    ./Themes/default/Display.template.php    Test successful
7.    Execute Modification    ./Themes/default/Xml.template.php    Test successful
8.    Execute Modification    ./Themes/default/Stats.template.php    Test successful
9.    Execute Modification    ./Themes/default/Stats.template.php    Test successful
10.    Execute Modification    ./Themes/default/Profile.template.php    Test successful
11.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
12.    Execute Modification    ./Themes/default/languages/Modifications.english-utf8.php    Skipping file
13.    Execute Code    install.php
Title: Re: Referrals Mod
Post by: Neorics on September 16, 2007, 02:07:00 AM
Quote from: karlbenson on September 15, 2007, 04:51:32 PM
I don't know yet. Its going to be a while before I have the time to add such functionality.

aight, well maybe Dragooon can make it...
Title: Re: Referrals Mod
Post by: karlbenson on September 16, 2007, 09:57:07 AM
the skipping file is for when you don't have utt-8 files.

However if your using utf-8, its obviously not finding your newly renamed copy as Modifications.english-utf8.php
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 17, 2007, 05:55:26 PM
Your gonna hate me but I think I found another bug.

When you click on the name of someone that a person referred, it tries to go to their profile but goes to it by name and not ID so you get a 404 error.
Title: Re: Referrals Mod
Post by: karlbenson on September 17, 2007, 06:16:52 PM
Rusty.

For some reason your version isnt producing the necessary link value :(
But its definately in new 1.4 install.

Can you post your profile.php

P.S I don't mind bug reports.
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 17, 2007, 11:28:38 PM
Here it is, I just did the upgrade and not the new install.
Title: Re: Referrals Mod
Post by: Pranav on September 18, 2007, 08:28:44 AM
Quote from: karlbenson on September 08, 2007, 08:21:22 PM
hmmm. I've got no experience with SEO urls and mods.

But the bit you will need to alter is in the profile.php


$context['member']['referredmembers'][] = '<option value="'.$scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</option>';

the value MUST be a full url.

After doing this it takes me to the profile of admin! So what can i do now?
Title: Re: Referrals Mod
Post by: karlbenson on September 18, 2007, 09:09:54 AM
@rusty

FIND
$context['member']['referredmembers'][] = '<option>' . $row['realName'] . '</option>';

REPLACE
$context['member']['referredmembers'][] = '<option value="'.$scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</option>';


@ ulgaming.net
I've checked your forum http://www.clickex.info/index.php and its not adding the members id at the end of the string for some reason.  Can you post your profile.template.php and your profile.php so I can have a look (like I've done for rusty)
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 18, 2007, 12:11:01 PM
I changed that line and it always goes to my profile no matter who I select from the dropdown list

In looking at the url I think its because I am the first one and the url ends with u=

No ID number
Title: Re: Referrals Mod
Post by: karlbenson on September 18, 2007, 12:22:27 PM
FIND
$request = db_query("
SELECT realName
FROM {$db_prefix}members
WHERE referredby = " . (int) $context['member']['id']. "
", __FILE__, __LINE__);


For the line SELECT realName
Add ID_MEMBER
eg

SELECT realName, ID_MEMBER
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 18, 2007, 12:41:10 PM
Didnt help  :(
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 18, 2007, 05:06:54 PM
In fact now I get lots of these in the error log if I try even once:

Apply Filter: Only show the error messages of this URL  http://www.poppedquestion.com/index.php?action=profile;u=
Apply Filter: Only show the errors with the same message
8: Undefined index: ID_MEMBER
File: /home/XXXXX/public_html/Sources/Profile.php
Line: 1282
Title: Re: Referrals Mod
Post by: karlbenson on September 18, 2007, 05:09:09 PM
sorry for mucking you about rusty.

For some reason its not adding the user id at the end of the string.

Can you attach your profile.template.php and profile.php

I'll have to setup an install with them both and work out the issues.
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 18, 2007, 05:19:08 PM
No problem, the site is still quite small so it hasnt gone over 5 pages of errors before I clean them all out to keep the log small.

Title: Re: Referrals Mod
Post by: karlbenson on September 18, 2007, 05:25:18 PM
FIND line 1257 Profile.php

CHANGE
SELECT realName, ID_MEMBER
TO
SELECT realName

FIND line 1274 Profile.php

CHANGE
SELECT realName
TO
SELECT realName, ID_MEMBER
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 18, 2007, 06:14:35 PM
still didnt help, and still getting errors in the log
Title: Re: Referrals Mod
Post by: karlbenson on September 18, 2007, 06:57:16 PM
:(

I thought that 100% fixed it.

I've installed a fresh smf install, installed 1.3 of the referrals mod then did the upgrade and it fixed it.

Rusty, I've altered your Profile.php, can you try this one.
Title: Re: Referrals Mod
Post by: Neorics on September 19, 2007, 06:53:37 AM
hey i want to add the top referral stats at the bottom of the main index along with the other stats so can tell me what files to edit and what code i have to add?
Title: Re: Referrals Mod
Post by: karlbenson on September 19, 2007, 10:14:44 AM
I don't have any code written to do that.
You would need to add a query in the BoardIndex.php and then make it show on the BoardIndex.template.php
Title: Re: Referrals Mod
Post by: RustyBarnacle on September 19, 2007, 11:39:25 AM
Hey thanks Karl, that fixed it and no more errors.
Title: Re: Referrals Mod
Post by: karlbenson on September 19, 2007, 11:39:56 AM
Thank **** for that ;) ;) ;)
Title: Re: Referrals Mod
Post by: sjmarsha on September 20, 2007, 05:41:44 PM
I'm getting failed on sources.load

   Execute Modification     ./Sources/Load.php     Test failed

any advice? I'd love to use this!
Title: Re: Referrals Mod
Post by: karlbenson on September 20, 2007, 07:33:52 PM
you probably have a conflict with another mod.  You wll need to manually install the mod.
http://docs.simplemachines.org/index.php?topic=402.msg531#msg531
Title: Re: Referrals Mod
Post by: Pranav on September 20, 2007, 07:38:16 PM
@ karlbenson :
Here are the two files. :) Hope the error gets fixed. :)
Title: Re: Referrals Mod
Post by: karlbenson on September 20, 2007, 07:42:36 PM
Strange, your profile.php is using double line spacing.

FIND line 2677 Profile.php

CHANGE
SELECT realName
TO
SELECT realName, ID_MEMBER

Beware like Rusty, if that line isnt at the right line, that there are TWO almost identical queries.  It is the second one that needs the change.
Title: Re: Referrals Mod
Post by: Pranav on September 20, 2007, 07:56:53 PM
@ karlbenson : I can't seem to find line 2677 in Profile.php .Can you please do it and upload the file here? :)
Title: Re: Referrals Mod
Post by: karlbenson on September 20, 2007, 08:00:02 PM
@ ulgaming.net  (lol)

Yeah, for some reasons your Profile.php is appearing double line spaced in my notepad/notepad++
Title: Re: Referrals Mod
Post by: Pranav on September 20, 2007, 08:02:36 PM
Thanks karl! It's working now. :D Thanks for your help! :)
Title: Re: Referrals Mod
Post by: karlbenson on September 20, 2007, 08:04:45 PM
:) Glad we got it fixed.

No problem.
Title: Re: Referrals Mod
Post by: goranbaxy on September 25, 2007, 11:24:36 AM
Is there a way to change link NOT to bi link to forum index (home page of forum), I would like  to be link to registration form.
So instead of "index.php?referredby=1" to be something like: "index.php?action=register;referredby=1"
Thanks!
Title: Re: Referrals Mod
Post by: Phones on September 27, 2007, 01:52:52 PM
(http://img505.imageshack.us/img505/7358/scr24f810cth5.th.png) (http://img505.imageshack.us/my.php?image=scr24f810cth5.png)
Can't install in a fresh SMF...
Need help...
Title: Re: Referrals Mod
Post by: karlbenson on September 27, 2007, 02:12:02 PM
@Phones, it doesnt look like the download worked properly.

Download the mod again from the smf customize section, then upload it to your smf and try to install.
If it still doesnt work, do you still get the same error with any other mods, if so its not an issue with the mod but your smf/host.

@Goranbaxy, changing the links to the register page won't work because the cookie check isnt called until after the register template is setup.  So in order to make it count users would have to hit refresh on the page to get the referral to show up and therefore be passed/counted on the registration.
Title: Re: Referrals Mod
Post by: Phones on September 27, 2007, 05:35:38 PM
It was of the hosting :D ty
Title: Re: Referrals Mod
Post by: Phones on September 27, 2007, 05:48:53 PM
Here is a present for u :D:

http://rapidshare.com/files/58716347/Modifications.portuguese.rar.html

Download fast, tomorrow I will delete.

Portuguese European Translation.
Title: Re: Referrals Mod
Post by: karlbenson on September 27, 2007, 06:15:49 PM
Thanks, I've saved a copy. I'll sort this out asap.
Title: Re: Referrals Mod
Post by: jdvarner on October 01, 2007, 11:33:29 PM
Got this. Is this an easy fix?

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/Xml.template.php Test successful
8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test successful
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Skipping file
13. Execute Code install.php
Title: Re: Referrals Mod
Post by: karlbenson on October 01, 2007, 11:41:05 PM
it is conflicting with another mod you have installed.

You can either click install, then perform that edit to the display.template.php manually
OR
don't install it
OR
perform all the edits manually.
Title: Re: Referrals Mod
Post by: jdvarner on October 01, 2007, 11:57:41 PM
thanks. to confusing for me as a newbie. wouldnt know where to start.
Title: Re: Referrals Mod
Post by: Pranav on October 06, 2007, 09:03:40 PM
I found these errors in my error log and i think might have been generated due to Referrals mod :

Quote8: Undefined index:  referredbylink
File: /home/yuasj/public_html/Themes/default/Profile.template.php (summary sub template - eval?)
Line: 242

Quote8: Undefined index:  referredbylink
File: /home/yuasj/public_html/Themes/default/languages/Who.english.php (summary sub template - eval?)
Line: 242

How can i fix this??
Title: Re: Referrals Mod
Post by: karlbenson on October 08, 2007, 03:55:44 PM
That variable is set by this mod and is related to the Profile.template.php
I can't see a bug in my code.

By any chance have you modified any referrals information by phpmyadmin?  eg adding the member id who referred you etc.

I can post a solution so you won't get that error, but it won't fix the cause of the error.

Temp solution, open profile.php (sources folder)
FIND

// QUERY IF THE USER ACTUALLY EXISTS
if ($context['member']['referredby'] != 0 && $context['member']['referredby'] != '')

ADD BEFORE

$context['member']['referredbylink'] = '';
Title: Re: Referrals Mod
Post by: invites on October 11, 2007, 02:23:28 PM
Can you tell me if there is an easy way to install the referrals mod on this theme:


http://custom.simplemachines.org/themes/index.php?lemma=20

(I'm using the orange one)
Title: Re: Referrals Mod
Post by: karlbenson on October 11, 2007, 03:25:05 PM
The only way is to manually install/edit it onto the theme (as you would do for any other mod)

When smf 2.0 is released mods will be attempted to be installed on all thees, but for now it means alot of editing of themes.

For help manual editing see http://docs.simplemachines.org/index.php?topic=402.msg531#msg531
Title: Re: Referrals Mod
Post by: Pranav on October 13, 2007, 09:21:49 PM
@ karlbenson : No i have not modified any referral information through phpmyadmin.

What can be the problem? How can i fix this?? And i deleted some members and a person referred them on my forum . But they still appear on his referral list when i go to his profile!
Title: Re: Referrals Mod
Post by: karlbenson on October 13, 2007, 09:58:37 PM
Thanks for getting back to me.
I think that will be the cause of the error error.
Deleted members still showing up in referral lists.

There is no easy fix.  And since its so late I'll have to have a look at this tomorrow.
Title: Re: Referrals Mod
Post by: jdvarner on October 17, 2007, 09:55:26 PM
i get the following on load. any recommendations?

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/Xml.template.php Test successful
8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test successful
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Skipping file
13. Execute Code install.php
Title: Re: Referrals Mod
Post by: jdvarner on October 17, 2007, 09:59:33 PM
Quote from: karlbenson on October 01, 2007, 11:41:05 PM
it is conflicting with another mod you have installed.

You can either click install, then perform that edit to the display.template.php manually
OR
don't install it
OR
perform all the edits manually.

what is the edit on display that i would do?
Title: Re: Referrals Mod
Post by: karlbenson on October 17, 2007, 10:21:25 PM
The utf-8 one is skipped because you are not using utf-8, so it is ignored. (but the mod supports it should you be using it)

The display edit is


<!-- // ADDS TO THE DISPLAY TEMPLATE THE NUMBER OF REFERRALS FOR EACH USER  - YOU'LL NEED TO MANUALLY EDIT THIS IF YOUR THEME USES A CUSTOM DISPLAY.TEMPLATE.PHP // -->
<file name="$themedir/Display.template.php">
<operation>
<search position="replace"><![CDATA[// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';]]></search>
<add><![CDATA[ // Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />';

// show how many referrals they have made
echo $txt['referrals_referrals'].' '.$message['member']['referralsno'].'</br></br>'; ]]></add>
</operation>
</file>


For help on manual installation of mods see http://docs.simplemachines.org/index.php?topic=402.msg531
Title: Re: Referrals Mod
Post by: jdvarner on October 18, 2007, 09:51:43 AM
thanks karlbenson,

im using default theme. so can i put the code you place in last post anywhere in the display.template.php? or in a specific area in that file. just asking before i go on and screw it up. gonna make backup of course. but why not ask first before trying.

thanks.
jd
Title: Re: Referrals Mod
Post by: karlbenson on October 18, 2007, 10:49:56 AM
no you can't put it anywhere, you need to replace
', $txt[26], ': ', $message['member']['posts'], '<br />

that bit which is the posts display txt
Title: Re: Referrals Mod
Post by: jdvarner on October 18, 2007, 10:34:11 PM
looks like im good.

anyone care to test it for me? pretty please.

http://www.jdworld.net/index.php?referredby=1


thank you karlbenson. appreciate the mod and help. just asking but did you come up with the few line script for making a tp block for top referals? just curious. would be cool to have it pull who is refering the most.

thanks.
jd
Title: Re: Referrals Mod
Post by: karlbenson on October 18, 2007, 10:35:50 PM
Re: TP block.
I have never used Tinyportal.  So have not created any blocks.

You can see the top referrer on the stats section.
Title: Re: Referrals Mod
Post by: jdvarner on October 18, 2007, 10:48:20 PM
karlbenson,

i created a user to test it and it worked. but when i deleted the user because i didnt want a fake user on the site, it removed the user but still says i refered 1. can i get rid of that "1" to make it fair?

Title: Re: Referrals Mod
Post by: karlbenson on October 18, 2007, 10:49:35 PM
There is currently no delete/reset.
Title: Re: Referrals Mod
Post by: jdvarner on October 18, 2007, 10:58:38 PM
ok. cool. no biggie.

thank you.

just to ask you, basically in tp portal when you make a block to draw data for the block, there is a feature called ssi. im pretty sure you know about that stuff.

anyway for like top karma the code is simple like this

ssi_topkarma(5);

so i figured for the referal mod you made to pull the top 5 refer's should be something simple like that as well.

just a question. i know you want to keep the mod simple. just thought you might have a sec and a quick answer on it. if not no worries my friend.

thanks again.

jd
Title: Re: Referrals Mod
Post by: karlbenson on October 19, 2007, 12:22:19 PM
Indeed I know about SSI.

It would probably be best asking at Tinyportal for someone to write a block.
Title: Re: Referrals Mod
Post by: Richard Wing on October 19, 2007, 02:36:16 PM
Do you think adding the referral points also into the shop mod points system would be too difficult so that members not only get the recognition as your provides but they could also earn points that are redeemable for the activity?

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 19, 2007, 06:12:42 PM
see http://www.simplemachines.org/community/index.php?topic=184291.msg1201861#msg1201861
Title: Re: Referrals Mod
Post by: Richard Wing on October 20, 2007, 08:56:29 AM
Karl thank you very much for bringing that to my attention.

One last thing...

Im sure you have seen the invite mod... If not it works in a way that you may turn off registration and use the invite mod feature where registrations can only be done if you were invited by an existing member.

With theirs you have to send each person a unigue invite key. Im not interested in the unigue feature.

I was hoping to use your mod in the same manner but the affiliate only has to send out their referral link to invite people to register not a unique key for each person.

Myself and others I know have double optin mailing lists and would be quite cumbersome to have to send out individual keys. Sending out the same link to the list is much easier.

Would you have any suggestions on how I could accomplish a registration by referral invitation feature using your referral mod?

I know you wanted to keep this module simple and I don't think my request is really a complicated feature.

Any direction would be great.

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: Neorics on October 20, 2007, 09:56:31 AM
lol umm why dont you just manually send your list of emails your referral link? it's much faster than using the invite mod cause if you use the invite mod then you need to send an email to each one even if you're using the same link that you are sending them...

but just to let you know i already have that feature on mine + the invited counts are added to the referral counts etc... if you're willing to pay maybe i can customize yours as well...
Title: Re: Referrals Mod
Post by: Richard Wing on October 20, 2007, 10:21:32 AM
My point is that I dont want to have to send each of my 8500 subscribers on my list a seperate invite key . Invite allows you to use one unique key per invite which is not practical for people with a mailing list.

Thats why I want to limit registrations to only people that come from a referral mod link. similar to the invite but one link may be used.

I would like to know more (specifics) as to how your system was moded. Can you contact me through IM.

Yahoo - wingcomandr
MSN - [email protected]
AIM - wingcomandr

We can go from there about price if what you describe is of interest to me.

Thanks for your time,
Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 20, 2007, 11:56:28 AM
RichardWing, you may be best posting a [free] or [paid] request for custom work in the Help Wanted forum.
As indicated at the beginning this is a simple referral mod and I would not consider adding such functionality to the mod.

Eg ask someone to code it so that they can't register unless they have come via a referral link.

HOWEVER, all a user would need to do to register on your forum is change/add a referredby=1 to their url to be able to register.

Instead it maybe better to request free/paid work to customize the invite mod to create a required key (which a user couldnt guess).  And have the same key in all your emails.

Someone like Dragoon maybe able to do this as I know he has mashed both invite/referral mod together so both can be installed at the same time.
Title: Re: Referrals Mod
Post by: Richard Wing on October 20, 2007, 12:19:33 PM
Thanks Karl.

I appreciate your time.

Richard Wing
Title: Re: Referrals Mod
Post by: Neorics on October 20, 2007, 01:06:14 PM
Quote from: karlbenson on October 20, 2007, 11:56:28 AM
Someone like Dragoon maybe able to do this as I know he has mashed both invite/referral mod together so both can be installed at the same time.

yah he's my boss who thought me how to code it and i would recommend him to you as well and btw it's Dragooon hehe he actually wants 3 o's in his name when it's mentioned... yah so you can contact him as well it's just that he's a bit busy doing quite a few TP block customizations... he's awesome...
Title: Re: Referrals Mod
Post by: Richard Wing on October 24, 2007, 03:39:23 PM
Karl,

Can a member append any url on the forum with ?referredby=1 and the visitor be cookied/credited to the referral?

For example...

http://www.myforum.com/index.php/topic,2.0.html?referredby=1

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 24, 2007, 04:40:13 PM
pretty much yes.  The cookie can be set on any smf page.

EXCEPT for the register page.
action=register

Unfortunately that is the page alot of people would like to set it on, however for some reason the cookie is not being detected when it was set on the same page.  So the user would have to refresh before the referral counted.

Its something i will look to fix, so far unsuccessfully.  It may require rewriting somewhat, and I've been hoping to leave that for smf 2.0
Title: Re: Referrals Mod
Post by: Richard Wing on October 25, 2007, 04:02:28 PM
Karl,

I tested both with the seo url feature on and off and added http://www.myforum.com/index.php?topic=2.0?referredby=1 and http://www.myforum.com/index.php/topic,2.0.html?referredby=1 

It didnt work. Do you have any ideas for me where to look into it?

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 25, 2007, 04:08:35 PM
That won't work.

If there is already a ? in the url, you need to use a ; (semi-colon) instead.

eg http://www.myforum.com/index.php?topic=2.0;referredby=1
Title: Re: Referrals Mod
Post by: Richard Wing on October 25, 2007, 05:20:51 PM
Thanks Karl.

Can you tell me how to add it to seo link when that option is used on the forum?

http://www.myforum.com/index.php/topic,2.0.html

Since in that case the ? wasnt already there I tried to add ?referredby=1 to the end like this http://www.myforum.com/index.php/topic,2.0.html?referredby=1 and it didnt work.



Additionally, Could you come up with the bit of code that would display the logged in members referral code added to the page link they are viewing?

I was thinking an icon on each post and reply next to where the Quote icon is and when clicked it will open a new small window with the link to that post/reply with the members affiliate id added to it in the correct fashion.


A different and easier approach I would be pleased with is if the icon was there and the user could rightclick that icon and select copy shortcut would be simple enough. In this case we could have a Alt Tag/Tool Tip that when its hovered it will tell then to "Right Click and Copy Shortcut To Grab Your Referral URL To This Post"


In either instance the seo feature would create the link automatically so that the user wouldnt have to build them themselfs and they would be able to receive creit every single time they sent people or bookmarked posts on the forum.

which makes me think about another idea for your bookmark mod. Have the links that people are bookmarking add in their refferal id code to the link they are bookmarking. If I make my members aware of that feature they will bookmark like crazy.

I am very excited about your referral mod and its a main part of my marketing strategy.

Any help in this direction would be cool. I can pay you for the mod instructons if you like.

BTW. Tell them here to add your By Me A Drink feature so those of us that want to can show our appreciation to those that help us.

Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 25, 2007, 06:18:04 PM
I don't fully know how to make mods work with the seo feature enabled as I have never used it myself
My guess (a quick test on a sample forum) is that it would be something like
http://www.myforum.com/index.php/topic,2.0/referredby,1.html

As has been said many times before.  I am intending to keep this mod as simple as possible.
But I will look in future to add a a click/copy to the profile.

I had looked to add icons to click/copy the link in the past.
However there isnt a proper cross-browser way to do it. Recently the only way I managed to do it with my Select All & Copy Code mod is by embedding a flash object to do the copying. So I will look into future to add copy/click from from select all mod to this mod.

Adding it to each post adds alot of additional overhead.  However it has already been suggested to me to make
Referrals: 0 but a hyperlink or Referrals: 0 [liNK] to click and have it copied to clipboard.

Having the referrals link added to urls is a case of customizing any link and building onto the end the member id and the referred links.  If your using seo urls this would require customizing.

I do NOT provide support for customizing mods/manual edits as I have neither the time nor desire (and at the moment due to internet speed issues nor the ability).  I would recommend asking in the Help Wanted forum with a [free] or [paid] request for custom work.

I've got no time frame as to when an upgrade to this mod will be ready. Primarily I work on bug fixing mods before adding new functionality to mods. And I've already got a handwritten page full of stuff to do on other mods.
Title: Re: Referrals Mod
Post by: Richard Wing on October 25, 2007, 08:45:35 PM
Karl,

I appreciate your time.

If I understand the seo feature correctly it will require no coding on your part. it uses htaccess and has rules on how to rebuild all links on the forum. so it will do the changing itself.

All I am asking for is a simple bit of code that will build a link on a page like this.....

rootdomain + page I am on link + members who is viewing the page affiliate id code = link I can copy

if you can tell me that I will figure out the best place to have it show up on the page

You wont have to make any mods to your module as I know you wish to keep it simple.

I want a simple way to have users refer people into a page. and sdisplaying a link to that page with the referrals id already added to the link saves then a step of piecing it together to send people directly to a place on the site other than the main page.

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: karlbenson on October 25, 2007, 10:25:13 PM
Well you would build the url in the code 'on the fly'.

Depending on where you were putting it, the code would be different.

The part of the link upto the index.php is built by $scripturl
the action/where you are part is created by you wherever you are using it.
the referred bit would be added an then the id would come from a variable, although which variable would again depend on where you are using it.

That is why its not really possible to post generic code.  You really need to hire someone for [free] or [paid] custom work and tell them exactly where you want it to be put.
Title: Re: Referrals Mod
Post by: Richard Wing on October 25, 2007, 10:56:51 PM
ok. I am not sure why but I have marked many paid requests and have not had one single bite.

I can only suspect that no one knows enough to code the mods I am seeking.

I have even offered to release my mods I pay for back to the community.

Its very frustrating. I need a few mods before I can open my forum and can't find anyone.

Richard Wing

Title: Re: Referrals Mod
Post by: karlbenson on October 25, 2007, 11:04:15 PM
What your asking here is not too difficult for someone with basic php/smf knowledge to do.
Its just the amount of time it will take.

Usually I recommend Dragoon for custom work, but there are plenty of other people who may be willing to help out with custom work.

For custom work like the above you would hopefully get someone to do with within a couple of days.
For custom mods however that usually isnt as straight forward and the one you requested with the licence etc, there are very few mod creators who may have the skills to create what you describe.
Title: Re: Referrals Mod
Post by: mcliff1971 on October 28, 2007, 09:46:23 AM
Got error when trying to install -

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/Xml.template.php Test successful
8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test successful
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Test successful
13. Execute Code install.php 

Other mods installed include AdMod, SMFArcade, SimpleAwards.

Any suggestions?
Title: Re: Referrals Mod
Post by: mcliff1971 on October 28, 2007, 10:12:17 AM
Quote from: mcliff1971 on October 28, 2007, 09:46:23 AM
Got error when trying to install -

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/Load.php Test successful
2. Execute Modification ./Sources/Register.php Test successful
3. Execute Modification ./Sources/Stats.php Test successful
4. Execute Modification ./Sources/Profile.php Test successful
5. Execute Modification ./Themes/default/Register.template.php Test successful
6. Execute Modification ./Themes/default/Display.template.php Test failed
7. Execute Modification ./Themes/default/Xml.template.php Test successful
8. Execute Modification ./Themes/default/Stats.template.php Test successful
9. Execute Modification ./Themes/default/Stats.template.php Test successful
10. Execute Modification ./Themes/default/Profile.template.php Test successful
11. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
12. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Test successful
13. Execute Code install.php 

Other mods installed include AdMod, SMFArcade, SimpleAwards.

Any suggestions?

Little more info - The conflict seems to be because I am using SMFShop as well.  If I uninstall that MOD, then install Referrals MOD, it works fine.  If I try and install SMFShop after, same error.  Anyone else run into this?  Any suggestions?
Title: Re: Referrals Mod
Post by: Neorics on October 28, 2007, 10:20:33 AM
you can easily fix that by manually editing the display.template.php

use this to see what edits you need to do for the display template
http://modparser.dev.dansoftaustralia.net/ (http://modparser.dev.dansoftaustralia.net/)
Title: Re: Referrals Mod
Post by: liammc07 on October 29, 2007, 03:09:55 PM
I have installed this and no problems during the install!

Everything that is supposed to be there is there.
The only problem is that when a member trys to use the referal link it just takes them to the index of the forum  :(

Any fixes/ideas?
Title: Re: Referrals Mod
Post by: karlbenson on October 29, 2007, 03:13:02 PM
The referral link takes them to the index page. (and its sets a cookie)

When and if the user then registers the person whos referral link was used, will be credited with the referral.
Title: Re: Referrals Mod
Post by: RustyBarnacle on October 29, 2007, 03:14:12 PM
Its supposed to be like that.  They are being referred to the site.  They can take a peak, see if they like it and then go register.

That and the fact that as said in this thread many times, going straight to the registration page doesnt give it a chance to make the cookie before the code tries to reference it.

Fine, beat me to the punch, see if I care.  :)
Title: Re: Referrals Mod
Post by: Chriss Cohn on October 29, 2007, 07:17:45 PM
A Outstanding Mod!!! Great Work!
Somehow, all - and i am honest- of your mods i tried so far are just great!

Regards, Christian
Title: Re: Referrals Mod
Post by: karlbenson on October 29, 2007, 07:36:59 PM
Many Thanks G-c
Title: Re: Referrals Mod
Post by: Chriss Cohn on October 29, 2007, 08:21:13 PM
Quote from: karlbenson on October 29, 2007, 07:36:59 PM
Many Thanks G-c
Your welcome  ;D
A sugestion for any further version...
Tableless code. Ive looked into the source-code of this mod and it uses everywhere these odd tables... Maybe you could consider of usings divs and <ul>, etc...

Regards, Christian
Title: Re: Referrals Mod
Post by: karlbenson on October 29, 2007, 08:24:47 PM
The only table in this mod adds more rows to an existing smf table.
So there isnt anything I can do about that.  You can't mix and match ;)

Lately though, I have generally been trying to only use tables for tabular data, like they were meant to be used.
Title: Re: Referrals Mod
Post by: dxyy on October 31, 2007, 09:25:02 AM
Just curious if there is a way to increase the stats from the top 5 to top 10?

Also, if it is possible, how easy is it to achieve this?

Haha, sorry to cause more problems. :P
Title: Re: Referrals Mod
Post by: karlbenson on October 31, 2007, 02:27:57 PM
You would need to alter the db query and change LIMIT 5 to LIMIT 10.

Stats.php

FIND x2
      LIMIT 5", __FILE__, __LINE__);

Title: Re: Referrals Mod
Post by: dxyy on November 01, 2007, 04:57:28 AM
Quote from: karlbenson on October 31, 2007, 02:27:57 PM
You would need to alter the db query and change LIMIT 5 to LIMIT 10.

Stats.php

FIND x2
      LIMIT 5", __FILE__, __LINE__);


Thank you! :)
Title: Re: Referrals Mod
Post by: Dumpling on November 01, 2007, 10:55:37 AM
Hey karlbenson,

:) It's me, again. Just want to let you know something. :P

I was playing around with my profile and noticed this:
(http://i13.tinypic.com/63akluh.jpg).
You see how the different messenger icons are right next to "Referrals: 0"? I didn't think it was supposed to be that way, so I (kind of) skimmed through the different modified files since I didn't know where to look specifically. There were lots of scripts/codes and I was lazy so I turned to skimming through this topic and noticed someone else (who was using 1.2 or 1.3) had the same problem. Then, I found out I was supposed to look in the Display.template.php file. Sorry for the super duber long and kind of irrelevant explanation. :P

I used the SMF Package Parser and found this:
In file $themedir/Display.template.php
Find:

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';



Replace with:

// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />';

// show how many referrals they have made
echo $txt['referrals_referrals'].' '.$message['member']['referralsno'].'</br></br>';


I changed the </br></br> to <br /><br /> and that fixed the problem :)

I don't know much/anything about coding, so I'm not sure if </br> is valid. Just want to let you know... O:)
Title: Re: Referrals Mod
Post by: karlbenson on November 01, 2007, 12:20:15 PM
Indeed </br></br> isnt valid.

Will look at it aspa. thanks
Title: Re: Referrals Mod
Post by: Afterglow86 on November 03, 2007, 01:46:52 AM
I'm not sure if this has been asked before since it's quite a long thread, but I was wondering if it would be relatively easy for me to change it so instead of using a referral link as they are often frowned upon that instead, when a member registers they just type in the member who linked them to the site in a field.
Title: Re: Referrals Mod
Post by: dxyy on November 03, 2007, 03:56:42 AM
I want to have a referrals contest on my forum, but I'm not sure exactly how to know who has the most referrals in a particular period of time.

Does anyone know how I can figure out who had the most referrals in a given week. Also, I would like to know if there is a way for me to know all the members who made more than a certain amount of referrals in a given time period - week/month etc.

Any help or guidance on this issue would be greatly appreciated. ;)

Thank you! :)
Title: Re: Referrals Mod
Post by: Neorics on November 03, 2007, 11:35:02 PM
there is a mod that sets a range of dates to show the stats, search in teh mod section, i forgot the name...
Title: Re: Referrals Mod
Post by: Dumpling on November 06, 2007, 08:54:04 PM
Hello!

I'm guessing that someone has probably already asked about this and I'm sorry for being lazy and not going through all 14 pages of response to this topic. :P

I am wondering if it is possible to view the referral stats during a certain period, like have it display the top XX referrers between (date) and (date) or in the month of (month).

I looked at some stats mods in the mod site, but none says they are compatible with 1.1.4. :(


Edit:
I see hugodiaz was wondering about the same thing. :P

Quote from: Neorics on November 03, 2007, 11:35:02 PM
there is a mod that sets a range of dates to show the stats, search in teh mod section, i forgot the name...
I already checked for stats mod on the mod site, but none says they are compatible with SMF 1.1.4 :(
Title: Re: Referrals Mod
Post by: Neorics on November 07, 2007, 08:15:52 AM
...

it's an easy fix

just add
;version_emuale=1.1.4 in the browse package link and it should work fine
Title: Re: Referrals Mod
Post by: karlbenson on November 07, 2007, 10:20:07 AM
Please see my signature.

Thanks
Title: Re: Referrals Mod
Post by: Richard Wing on November 09, 2007, 06:45:34 AM
Karl,

When your back at full steam I was wondering if your referral mod checks against referral signups to the same ip. It wouldnt be fair if someone could be credited for referring themselfs to make another account on the forum.

Is there protection against that by chance built into your mod?

I hope so. If not can or will you consider adding in a check for this and if it happens the admin user # 1 would be the referral set in these cases to prevent cheating?

Thanks,
Richard Wing
Title: Re: Referrals Mod
Post by: chrishicks on November 10, 2007, 02:38:16 AM
I installed this Mod with no errors but I have a problem. I also have the Ultimate Profile Mod that I found here and for some reason I can't find the referral links with it. does anyone know how I can remedy this?

I am using 1.1.4/TP 0.9.8.3
Title: Re: Referrals Mod
Post by: netridge on November 14, 2007, 12:45:06 PM
Does this mod work on 1.1.4?
Title: Re: Referrals Mod
Post by: Dumpling on November 16, 2007, 06:46:44 PM
Quote from: netridge on November 14, 2007, 12:45:06 PM
Does this mod work on 1.1.4?

Yes
Title: Re: Referrals Mod
Post by: U1NO on November 21, 2007, 06:52:16 PM
Hi, i tried to install this mod but i have some problems with install.
If anyone could help me please:

./Themes/default/Xml.template.php        failed

./Themes/default/Stats.template.php     failed

Thank you very much in advanced

Title: Re: Referrals Mod
Post by: U1NO on November 21, 2007, 06:54:24 PM
By the way, i'm using version 1.1.4 and i have this mods installed

Auto Embed Video Clips
SMF Sitemap    
Fix Message Empty Error For Embed Video Mods    
Googlebot & Spiders Mod    
Registered Images

Thanks
Title: Re: Referrals Mod
Post by: karlbenson on November 21, 2007, 07:34:54 PM
another mod must be interferring with the mod and preventing it mebing installed.

The only option is to manually perform all the edits.
Title: Re: Referrals Mod
Post by: anakmacan on December 05, 2007, 12:44:50 AM

Karl, the mod wont edit my Display.template.php. Can you pls help me out to get it editted manually? :)
Title: Re: Referrals Mod
Post by: karlbenson on December 07, 2007, 12:38:10 AM
See Manual Installation of Mods
http://docs.simplemachines.org/index.php?topic=402.msg531#msg531
Title: Re: Referrals Mod
Post by: muise on December 07, 2007, 10:57:48 AM
I am curious though if anyone did find out how to set a specific time period to check on stats.  I wanted to run some ref contests but the stats page only shows the top 5 referrals  I would like to be able to pick a certain range of date.

Thanks
Title: Re: Referrals Mod
Post by: dxyy on December 07, 2007, 12:57:52 PM
Quote from: muise on December 07, 2007, 10:57:48 AM
I am curious though if anyone did find out how to set a specific time period to check on stats.  I wanted to run some ref contests but the stats page only shows the top 5 referrals  I would like to be able to pick a certain range of date.

Thanks

Yes, I had the same question before, because I also wanted to have a contest.

I think you can try this mod: Enhanced user statistics.  (http://custom.simplemachines.org/mods/index.php?mod=843);)

I can't tell you if it will work, because I wasn't able to install it as yet. I need to update my database first, but haven't gotten around to that as yet.

Hope that helps. :)
Title: Re: Referrals Mod
Post by: muise on December 07, 2007, 02:47:14 PM
thank you.

i will try it and let you know.
Title: Re: Referrals Mod
Post by: dxyy on December 07, 2007, 03:14:30 PM
Quote from: muise on December 07, 2007, 02:47:14 PM
thank you.

i will try it and let you know.
Great, hopefully it works well, because I'll be relying heavily on a referral contest to promote my blog soon. :)
Title: Re: Referrals Mod
Post by: glennk on December 10, 2007, 02:49:57 PM
I get this error , does this mean I cant use it ?

   Execute Modification     ./Themes/default/languages/Modifications.english-utf8.php     Test failed
Title: Re: Referrals Mod
Post by: karlbenson on December 10, 2007, 07:04:59 PM
Open ./Themes/default/languages/Modifications.english-utf8.php

Is it blank?
If so ./Themes/default/languages/Modifications.english.php
and COPY + PASTE everything into ./Themes/default/languages/Modifications.english-utf8.php
Save.

Then try installing.

BTW, what mods do you have installed.
Title: Re: Referrals Mod
Post by: mango boy on December 20, 2007, 01:54:38 AM
Hi,

I have two different memberships, free and paid. Existing members (free and paid) may referred someone who become either paid or free members. Referral fees are only paid for referring paid members. Can this referral mod differentiate between which referred members are paid and free? Also can it determine the amount as well?
Title: Re: Referrals Mod
Post by: karlbenson on December 20, 2007, 07:05:00 AM
No it cannot.
A referral is a referral.

This mod is intended as a 'Simple Referrals Mod' so I doubt I would ever add such functionality as standard.

You may however be able to find someone to customize the mod to your needs by posting a [free] or [paid] request in the Help Wanted forum.
Title: Re: Referrals Mod
Post by: Jessondair on January 01, 2008, 04:13:38 PM
This is an awesome mod, exactly what I've been needing!  I installed it with no errors and it seems to be working great, so thank you!

I do have one small request, however...   my forum requires a member referral in order to join, and each member must be manually approved once I've been notified who referred them (it's cut down on the drama factor immensely!).  Is there a way for me to alter the code so that I can see who referred them BEFORE they are approved?

Thanks. :)
Title: Re: Referrals Mod
Post by: karlbenson on January 01, 2008, 06:47:51 PM
I'm almost certain that the referral is only credited once the account is approved/activated by design.

However I do not provide support/assistance for customising my mods.  I don't have the time, nor desire,

You may be able to find someone to customize the mod to your needs by posting a [free] or [paid] request in the Help Wanted forum.
Title: Re: Referrals Mod
Post by: Jessondair on January 01, 2008, 06:52:42 PM
You coded this, right? I only ask because you said "almost certain".  Hmmm.   Well, I guess I'll try to figure out for myself where that "design" is and try to change it on my own.

Thanks.
Title: Re: Referrals Mod
Post by: karlbenson on January 01, 2008, 07:05:14 PM
Yes I coded it. But it was many moons ago.
And with getting on for 50 mods its hard to remember off hand without going through the code line by line.

I just had a quick look, and I'm pretty sure it credits the 'referral' as soon as the member is registered.
You could test it by looking at the users profile when they are 'unapproved' and if they were referred it should show the information.
Title: Re: Referrals Mod
Post by: Jessondair on January 01, 2008, 07:10:18 PM
Nope, that's why I'm here...  I tested it by referring a new member (myself under another username), and there's no reference on my admin profile or the new one, which is as of yet unapproved, that anyone referred anyone.    Would you be willing to at least tell me which page of code I need to look at for modifications?
Title: Re: Referrals Mod
Post by: karlbenson on January 01, 2008, 07:13:21 PM
sources/register.php

Search for the lines
   // NOW THAT USER HAS BEEN REGISTERED
   // NEED TO INCREASE REFERRALSNO TALLY FOR USER
Title: Re: Referrals Mod
Post by: Jessondair on January 01, 2008, 07:55:33 PM
Ah!  My bad -- apparently my register.php somehow didn't get modified (or I somehow overwrote it_.  Once I reinstalled, it actually DOES show who referred the new member, even before they've been activated.  Sorry 'bout that. :)  Thanks for your help.
Title: Re: Referrals Mod
Post by: dxyy on January 09, 2008, 10:56:31 AM
Quote from: karlbenson on October 25, 2007, 04:08:35 PM
That won't work.

If there is already a ? in the url, you need to use a ; (semi-colon) instead.

eg http://www.myforum.com/index.php?topic=2.0;referredby=1
Oh, finally reading through pages of this thread provided me with the answer I was looking for! :)

It's always tricking knowing what keywords to search for.
url refer to thread topic subject... not sure what other words might help someone looking for this in the future. ;)
Title: Re: Referrals Mod
Post by: Ertado on January 13, 2008, 09:54:32 AM
Is there any way to modify a referral link to take the user straight to the registration page? I don't mean change everyone's link, just add something onto one if you want. Like:

/forums/index.php?referredby=1

to

/forums/index.php?referredby=1;register or something
Title: Re: Referrals Mod
Post by: karlbenson on January 13, 2008, 10:38:20 AM
There isn't a quick and easy way to change it.

The only option is to edit the hard-coded link added to the Profile.template.php

As started further inside the topic.
Currently it will not work when redirecting directly to the registration page.

It is something I'll look to fix when re-writing it for smf 2.0.
Title: Re: Referrals Mod
Post by: Ertado on January 13, 2008, 11:19:43 AM
I don't know why anyone would upgrade to 2.0 when it's released. So many mods won't work and it'll take a long time to recode them.
Title: Re: Referrals Mod
Post by: karlbenson on January 13, 2008, 11:22:44 AM
indeed, I have so many mods it will take me some weeks if not months to upgrade all my mods.
Title: Re: Referrals Mod
Post by: TJTELLEZ9 on January 14, 2008, 11:16:42 PM
I have a theme where if you install the referral mod on the profile page it doesnt show the text identifying the the referral link and the referral link hits.  Also, the stats show up twice on the more stats page....HELP.
Title: Re: Referrals Mod
Post by: Chriss Cohn on January 15, 2008, 11:45:36 AM
Quote from: karlbenson on January 13, 2008, 11:22:44 AM
indeed, I have so many mods it will take me some weeks if not months to upgrade all my mods.
So then upgrade this version for 1.1.x series  ;D, so we will have a link which brings to the registration page or even better: The user can decide between two types of links:
One like currently handled and,
One link who points to the registration page

Best Regards, Christian
Title: Re: Referrals Mod
Post by: karlbenson on January 15, 2008, 04:15:13 PM
Bruce.
Probably to make it work for the registration page it would have to be re-written and relocated.  Thats why I waiting for 2.0. Since I don't' want to have to re-write it TWICE.

My intention is just to keep the links pointing to the mainpage. But that doesn't stop any users customizing it or even the admins themselves.
Title: Re: Referrals Mod
Post by: Chriss Cohn on January 15, 2008, 04:48:14 PM
QuoteBruce.
Probably to make it work for the registration pageit would have to be re-written and relocated.  Thats why I waiting for2.0. Since I don't' want to have to re-write it TWICE.
Roger captain!  ;) Was just a idea.....
BTW, you figured out what error it is in the lightbox-mod?

Regards, Christian
Title: Re: Referrals Mod
Post by: karlbenson on January 19, 2008, 12:04:19 AM
I have reuploaded this mod and screenshots for it.

I am in the process of doing it for ALL my other mods aswell.  Please bear with me.
Title: Re: Referrals Mod
Post by: PSNick on January 31, 2008, 11:16:56 PM
Hi there!

First of all, thanks! hehe, because this mod is awesome, it'll help me a lot.

2nd, where can i see the top 5 referrers, etc. cause i can't find where :S
3rd, where are the options in the admin panel, if any?

Thanks!
Title: Re: Referrals Mod
Post by: karlbenson on February 01, 2008, 05:06:58 AM
2. action=stats (its linked to in your stats section on the board index)
3. There aren't any options in the admin center.
Title: Re: Referrals Mod
Post by: Ertado on February 03, 2008, 07:55:19 AM
Hi can you tell me how I could display the TOTAL number of referrals for all boards members on the board index (kind of like total posts)?

I'm very inexperienced with MySQL tables, but is there a way you could add the values of the referral column and output the result?
Title: Re: Referrals Mod
Post by: karlbenson on February 03, 2008, 07:56:50 AM
There is no stored variable of total referrals.

You would need some mysql/sql knowledge to write a query and then show it on the board index.
(although it wouldn't be very efficient).

I personally do not provide support for customizing my mods.
Title: Re: Referrals Mod
Post by: RakeReport on February 03, 2008, 03:40:57 PM
Another awesome mod, just upgraded from 1.3 to 1.4 and it fixed the huge tracking bar issue.

Anyway, quick question:

I have members who have referred others but without using a link.  Can I manually associate existing accounts as referrals of other accounts, or does it only work if they used the links initially?
Title: Re: Referrals Mod
Post by: Ertado on February 04, 2008, 07:28:56 AM
Any tips at least? Where to look to find out how to do it?
Title: Re: Referrals Mod
Post by: karlbenson on February 04, 2008, 07:37:14 AM
@RakeReport
There is no manual way to alter the 'referer'.

@Ertado
In the BoardIndex.php you'd need to write a query to query the total number of referrals in the referrals_count in the
smf_members table.
And then echo it out in the BoardIndex.template.php

Probably an intermediate/moderate level of php/mysql knowledge and understanding of smf would be needed to do it.

If you don't feel capable of doing it yourself, you could post a free or paid request in the help wanted forum.
Title: Re: Referrals Mod
Post by: Fustrate on February 04, 2008, 06:55:57 PM
Quote from: karlbenson on January 15, 2008, 04:15:13 PM
Bruce.
Probably to make it work for the registration page it would have to be re-written and relocated.  Thats why I waiting for 2.0. Since I don't' want to have to re-write it TWICE.

My intention is just to keep the links pointing to the mainpage. But that doesn't stop any users customizing it or even the admins themselves.

Will you by any chance be implementing the changes I made back in the BETA thread? If not, I'd gladly make them myself prior to the 2.0 version being released, if you want to pass it along. I know you've got tons of mods to update, so I'm just offering up some help :)
Title: Re: Referrals Mod
Post by: FUBAR on February 04, 2008, 09:16:33 PM
I've searched through about 11 pages worth of this thread but couldn't find anything regarding my issue. 

I have the mod installed and seems to be working properly but one of my members noticed something recently. 

When you click on his profile you see:
Referrals: 6  - but on the dropdown list [username here] there are 9 names? 

The dropdown is correct because he has referred 9 people but on the profile lists 6 and also in the topic view above the messenger icons it also lists 6.

Do you know what could be causing the conflict? 

Any help is appreciated; thanks in advance.
Title: Re: Referrals Mod
Post by: karlbenson on February 05, 2008, 06:03:21 AM
@FUBAR
Sounds like a bug with the mod.
(unless you've been manually editing the database to change/add someones referrer).

@YodaOfDarkness
I intend to re-write the mod pretty much from scratch.
Although I intend to keep it simple and not add much new. (probably the addition of Find Member)

I have begun slowly updating my mods for 2.0, but it won't be until public releases that I start updating this mod.
Depending on the number of changes, the new version may be 2.0 only.
Title: Re: Referrals Mod
Post by: Fustrate on February 05, 2008, 01:24:55 PM
Mkay, sounds good :)

I get new members through an online game where you can't make/click links, so adding a text box would make it sooo much easier - and I'm willing to bet it would help other people too
Title: Re: Referrals Mod
Post by: FUBAR on February 05, 2008, 05:46:35 PM
Quote from: karlbenson on February 05, 2008, 06:03:21 AM
@FUBAR
Sounds like a bug with the mod.
(unless you've been manually editing the database to change/add someones referrer).

I haven't done any manual edits and seemed to be working properly.  Is there any way to fix it?

Screenshot:
(http://img204.imageshack.us/img204/4504/referrerwz8.png)

Thanks for the help.
Title: Re: Referrals Mod
Post by: karlbenson on February 05, 2008, 05:57:17 PM
you would have to manually update the database.

UPDATE smf_members
SET referralsno = 9
WHERE ID_MEMBER = 12345
LIMIT 1;

Run via PHPMYADMIN
Change 12345 to users id,
Change smf_ to whatever your prefix is

That is a temp fix of course and doesn't fix the issue itself.  I believe the issue is related to one of the reasons I need to re-write the mod.
Title: Re: Referrals Mod
Post by: FUBAR on February 05, 2008, 07:09:21 PM
Thanks for the help Karl.
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 06:58:04 AM
Hi

I added the "referrals mod" to my forum and it loaded well...shows up at the top in the menu area & all...my question is:

Is there somewhere in admin where there are stats on a members number of referrals or is this only so people can refer members, but you as admin have no way to keep track of the actual number of people that any member refers?

As far as I can tell..other than the button at the top of the page, nothing else has been added to the site anywhere...I'm using the default theme.
Title: Re: Referrals Mod
Post by: karlbenson on February 11, 2008, 11:28:11 AM
There is no tracking stats for admins
This is a simple referral mod.

- Top referrers on stats page
- Link & referrer information on profile
- No of referrers in post
- Referrer field on registration.
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 12:14:46 PM
OK...so there is no way to have contests using this?

As I said earlier, I see nothing about referrers or referrals on my "stats" page, or profile or anywhere else....?
Title: Re: Referrals Mod
Post by: karlbenson on February 11, 2008, 02:09:31 PM
Nope. There is no way to do contests. And no plans to.

Are you using the default theme?
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 02:12:28 PM
Yep...
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 02:14:58 PM
Is there such an animal???

Where admins can see how many referrals a members has?
Title: Re: Referrals Mod
Post by: karlbenson on February 11, 2008, 02:17:21 PM
Yes.
On each persons profile. It should show how many referrals each person has, plus who referred them etc
In each post it should show how  many referrals each person has.
On the stats page it should show the top 5 referrers by amount and top 5 referrers by posts.

But there is no stats table to show ALL users and how many each has referred.
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 02:40:13 PM
What a doofus....it looks like I had the "invite mod" not the referral...however, when I just went to install the "referral 1.4" it gave me this message:

An Error Has Occurred!
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 


and yes..I'm using the default theme:

Theme Settings - Default Theme Green
Title: Re: Referrals Mod
Post by: karlbenson on February 11, 2008, 02:44:11 PM
Sorry I meant the SMF Default Core theme.

All other themes are likely to require manual edits.

The mod should install on 1.1.4.
Try downloading the mod to your pc and the uploading it via the browse packages [rather than using the package servers]
Title: Re: Referrals Mod
Post by: Cyclone71 on February 11, 2008, 02:55:50 PM
Thanks Karl...that did the trick...you're the goochiest!

Take Care....
Title: Re: Referrals Mod
Post by: Kenny01 on February 12, 2008, 08:40:05 AM
I prefer the invite mod.
Title: Re: Referrals Mod
Post by: Bigguy on February 13, 2008, 01:48:33 AM
How would I add JUST the database info through phpmyadmin for this mod into a database.
Title: Re: Referrals Mod
Post by: Kenny01 on February 13, 2008, 01:54:46 AM
That's a big question mark?
Title: Re: Referrals Mod
Post by: Bigguy on February 14, 2008, 11:45:53 AM
Ok; well thanks for all the help. :(
Title: Re: Referrals Mod
Post by: karlbenson on February 14, 2008, 11:54:45 AM
hmmm.
I replied here.  I'm sure I did. :(

If your manually doing the install, the to add the columns via PHPMYADMIN


ALTER TABLE smf_members ADD COLUMN referralsno mediumint(8) NOT NULL default '0';
ALTER TABLE smf_members ADD COLUMN referrals_hits mediumint(10) NOT NULL default '0';
ALTER TABLE smf_members ADD COLUMN referredby mediumint(8) NOT NULL default '0';
ALTER TABLE smf_members ADD COLUMN referredon int(10) NOT NULL default '0';
ALTER TABLE smf_log_activity ADD COLUMN referrals smallint(5) NOT NULL default '0';


Notes:
Replace smf_ by your db_prefix
Due to the smf filter on here replace the underscore between the word referrals_hits
Title: Re: Referrals Mod
Post by: Bigguy on February 14, 2008, 12:13:02 PM
Thank you karlbenson; I will give this a try today very soon.
Title: Re: Referrals Mod
Post by: Bigguy on February 14, 2008, 12:19:16 PM
I just tried this and I got this back from phpmyadmin:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hits mediumint(10) NOT NULL default '0'' at line 1


I am very sure I did exactly what you said.
Title: Re: Referrals Mod
Post by: Bigguy on February 14, 2008, 01:39:31 PM
I got it to work...disregard above post.
Title: Re: Referrals Mod
Post by: karlbenson on February 14, 2008, 05:20:04 PM
This is the second time I've posted in a topic and my post has disappeared.

:(

I did reply to the above as I tested it on my phpmyadmin
Title: Re: Referrals Mod
Post by: Bigguy on February 14, 2008, 08:51:28 PM
I got it to work but I had to do each line seperately instead of together. So all that info is in but now I get other errors from other mods. If you are wondering I am trying to restore a database for someone that has alot of mods installed. Everytime I get one error solved another one from another mod pops up......
Title: Re: Referrals Mod
Post by: kota069 on February 18, 2008, 08:46:30 PM
I think it's a fantastic Mod !! - the best "Referral" Mod I've seen for any Board.

There's just one little thing I'd like to see changed or be able to change -

Can we show the link on the Profile Edit page and NOT the normal Summary page?

Edit 2:  I got it.  Just a couple minor edits in the Profile.template file.

GREAT Mod!! 
Thank you!!
Title: Re: Referrals Mod
Post by: Neorics on February 23, 2008, 05:44:29 PM
Hey, is it possible to query a list of members that is referred by a specific member?
Title: Re: Referrals Mod
Post by: karlbenson on February 23, 2008, 06:23:16 PM
Just view their profile.
And the dropdown should show them.
Title: Re: Referrals Mod
Post by: Neorics on February 24, 2008, 03:59:18 PM
Ok, how do i query the referrals only for a certain period? like for a month from 1st of feb to 28th of feb or something like that?

is it possible to have a block that quries the top referrals for the current month? so the count would always start at the start of the month?
Title: Re: Referrals Mod
Post by: karlbenson on February 24, 2008, 04:00:13 PM
There is no feature to do within the mod
Title: Re: Referrals Mod
Post by: Ryan on February 24, 2008, 05:12:45 PM
Love this mod karl hope u continue support for this on 2.0 :)
Thankyou
Title: Re: Referrals Mod
Post by: karlbenson on February 24, 2008, 06:15:56 PM
Will be updated at some point.
But with the no. of mods I have its going to take a while.
Title: Re: Referrals Mod
Post by: biftek on February 26, 2008, 03:38:27 AM
Quote from: kota069 on February 18, 2008, 08:46:30 PM
I think it's a fantastic Mod !! - the best "Referral" Mod I've seen for any Board.

There's just one little thing I'd like to see changed or be able to change -

Can we show the link on the Profile Edit page and NOT the normal Summary page?

Edit 2:  I got it.  Just a couple minor edits in the Profile.template file.

GREAT Mod!! 
Thank you!!

what were those edits ?
Title: Re: Referrals Mod
Post by: karlbenson on February 29, 2008, 09:21:02 PM
YodaOfDarkness is going to be taking over development of this mod.
The new version 2.0 for smf 1.1.x is as yet unapproved. [HERE] (http://custom.simplemachines.org/mods/index.php?mod=1114)

Most of it has been re-written with some new features. So I hope y'all can be patient ;)
Title: Re: Referrals Mod
Post by: Kenny01 on March 01, 2008, 12:18:26 AM
I do prefer the invite mod doe.
Title: Re: Referrals Mod
Post by: Fustrate on March 01, 2008, 12:46:03 AM
and I prefer Carl's Jr. to McDonalds...

everyone has their own tastes in hamburgers and modifications ;)
Title: Re: Referrals Mod
Post by: Kender on March 01, 2008, 02:45:38 AM
Quote from: karlbenson on February 29, 2008, 09:21:02 PM
YodaOfDarkness is going to be taking over development of this mod.
The new version 2.0 for smf 1.1.x is as yet unapproved. [HERE] (http://custom.simplemachines.org/mods/index.php?mod=1114)

Most of it has been re-written with some new features. So I hope y'all can be patient ;)
nice of you to post a link to a mod we cant view :P

I will wait patiently though
Title: Re: Referrals Mod
Post by: Kenny01 on March 01, 2008, 07:42:14 AM
Quote from: YodaOfDarkness on March 01, 2008, 12:46:03 AM
and I prefer Carl's Jr. to McDonalds...

everyone has their own tastes in hamburgers and modifications ;)
Give us a working link.
Title: Re: Referrals Mod
Post by: karlbenson on March 01, 2008, 08:17:31 AM
you can't download the new mod until it has been approved.
Title: Re: Referrals Mod
Post by: Kenny01 on March 01, 2008, 08:19:15 AM
Ok, thanks karlbenson.
Title: Re: Referrals Mod
Post by: ApplianceJunk on March 01, 2008, 10:07:26 AM
Installed and working great with Dilber MC and TP.

Thanks! :)
Title: Re: Referrals Mod
Post by: Kenny01 on March 01, 2008, 01:11:06 PM
ApplianceJunk you got a cool theme.
Title: Re: Referrals Mod
Post by: tahrim007 on March 06, 2008, 05:43:21 PM
$txt['referrals_findreferrer'] = 'Find Referrer'; $txt['referrals_who'] = 'Referral Information:'; $txt['referrallink_copy'] = '[Copy]'; $txt['referrals_who_description'] = 'Did someone refer you to this site?'; $txt['referrals_on'] = 'On'; $txt['referrals_referrer_not_found'] = 'The referring user could not be found. Please double-check the name of the referrer. Or leave it blank.'; $txt['referrals_youwerereferred_by'] = 'By'; $txt['referrals_referrals'] = 'Referrals:'; $txt['referrals_referrals_hits'] = 'Referral Link Hits:'; $txt['referrals_noneyet'] = 'None Yet!'; $txt['referrals_top5referrers'] = 'Top 5 Referrers (By Referrals)'; $txt['referrals_top5referrersbyposts'] = 'Top 5 Referrers (By Referred Members Posts)'; $txt['referrals_referralsstats'] = 'Referrals'; $txt['referrals_referred_by'] = 'Referred By:'; $txt['referrals_link'] = 'Referrals Link:'; $txt['referrals_membersreferred'] = 'Members Referred';

this messege show in front page.........
Title: Re: Referrals Mod
Post by: karlbenson on March 06, 2008, 09:11:41 PM
Open Modifications.english.php

Move ?> to the very bottom of the file.

Also note that code is part of the new version of the Referrals mod which is has been taken over by YodaOfDarkness.
Please See http://www.simplemachines.org/community/index.php?topic=226191.0 for support in future
Title: Re: Referrals Mod
Post by: blouogies20 on July 21, 2008, 03:18:47 AM
Hi ppl

I wonder if there is a way that my new members could say from where did they here of the forum - like google/yahoo?  Is it possible to use this mod for that as well?
Title: Re: Referrals Mod
Post by: Fustrate on July 21, 2008, 04:31:01 AM
Unfortunately, this mod currently does not support general referrals, just from members.

Though I might code that into a later version... it's a good idea.

Oh, and you might want to post in the new topic for this mod: http://www.simplemachines.org/community/index.php?topic=226191.120

(I'm going to ask a mod to close this one)
Title: Re: Referrals Mod
Post by: SlammedDime on July 21, 2008, 05:39:15 AM
Locked per request.