News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Referral System

Started by SMFHacks.com Team, March 03, 2008, 01:02:01 PM

Previous topic - Next topic

br360

Quote from: 4Kstore on June 20, 2012, 05:27:54 PM
I made a mini script for this...
maybe can help to someone.

Result:


Steps:
1º Install the mod *duhhh*

2º Edit: Sources/Load.php

Search:
// What a monstrous array...

Add before:

//Referrer Start
$context['referinfo'] = array();
$referinfo = array();
if($profile['referrals_no'] != 0)
{
$request2 = $smcFunc['db_query']('', '
SELECT referred_by, real_name, id_member
FROM {db_prefix}members
WHERE referred_by = {int:id_member_profile}',
array(
'id_member_profile' => $profile['id_member'],
)
);

while($row = $smcFunc['db_fetch_assoc']($request2))
{
  $referinfo = &$context['referinfo'][];  
  $referinfo['referidos_url'] = ''. $scripturl .'?action=profile;u='.$row['id_member'].'';  
  $referinfo['referidos_name'] = $row['real_name'];  
}
$smcFunc['db_free_result']($request2);
}
//Referrer END


Save and upload

3º:  Edit: Themes/{tutheme}/Profile.template.php

Search:

echo '
<dt>', $txt['ref_refferals'] , '</dt>
<dd>', $context['member']['referrals_no'], '</dd>
';


Replace for:

echo '
<dt>', $txt['ref_refferals'] , '</dt>
<dd>', $context['member']['referrals_no'], '';
if (!empty($context['referinfo']))
{
echo' - <select name="menu2">';
foreach($context['referinfo'] as $info)
{
echo'<option value="'.$info['referidos_url'].'">'.$info['referidos_name'].'</option>';
}
echo'</select>';
}
echo'</dd>';


Save and upload
Baii

That worked great, but now I am getting an error. When someone registers, they have to be approved. Once they are approved, the link under the "read all posts since last visit" doesn't disappear- even though there are no new members to approve or reject. I've refreshed, cleared cache, cookies, etc.

Here is the error in sources/load.php

8: Undefined index: actual_theme_dir
Apply Filter: Only show the errors from this file
File: /home/content/xxxxx/Sources/Load.php
Line: 2124

Here is an image-



   

$settings['actual_theme_dir'] . '/languages', on line 2123 is currently in my load.php source folder, but is the error telling me to add that line a second time to 2124 as well?

rajupatel

i have smf 2.0.4 forum..
and i have 1 error before installation test fail..
plz update and fix this problem.

Kindred

rajpatel,


I don't think you understand how mods work.

There is nothing to update.
The system works fine on 2.0.4.

If you have an error, it is probably because you have installed other mods.



http://wiki.simplemachines.org/smf/Error_in_mod_installation
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ForumACK

Very nice but Whether part of the profile referred by.


vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

P1G0M

Hello!
Is there a way to put in the profile a field named:
QuoteReferred by: user
I mean, I want to show in the profile of a member, the member who has referred it to the forum.
Is that possible?
With this: http://www.simplemachines.org/community/index.php?topic=226191.msg3357221#msg3357221
I've put this in the Profile.template.php:
echo '
<dt><b>', $txt['ref_reffered_by'] , '</b></dt>
<dd>', $context['member']['referinfo'], '

But where says $context['member']['referinfo'] I don't know what to put assuming that in the Load.php I have this:
//Referrer Start
$context['referinfo'] = array();
$referinfo = array();
if($profile['referrals_no'] != 0)
{
$request2 = $smcFunc['db_query']('', '
SELECT referred_by, real_name, id_member
FROM {db_prefix}members
WHERE referred_by = {int:id_member_profile}',
array(
'id_member_profile' => $profile['id_member'],
)
);

while($row = $smcFunc['db_fetch_assoc']($request2))
{
  $referinfo = &$context['referinfo'][];  
  $referinfo['referidos_url'] = ''. $scripturl .'?action=profile;u='.$row['id_member'].'';  
  $referinfo['referidos_name'] = $row['real_name'];  
}
$smcFunc['db_free_result']($request2);
}
//Referrer END

What $context have I to put in the Profile.template.php?
Do I have to put something else in the Load.php?

Thanks!

Dragonflair

Hi guys,

Im looking to hold a referrals competition with this mod, it works fine in every way i need, except displaying top referrers, Is there a way i can get the top referrers added to the statistics page? or have another page in the admin panel?

This would be a really great help to me as i do not know how to script to input this myself

Thanks

Bob Perry of Web Presence Consulting

Quote from: Dragonflair on August 18, 2013, 04:54:14 AM
Hi guys,

Im looking to hold a referrals competition with this mod, it works fine in every way i need, except displaying top referrers, Is there a way i can get the top referrers added to the statistics page? or have another page in the admin panel?

This would be a really great help to me as i do not know how to script to input this myself

Thanks

I've added statistics on my copy of it in a SMF 2.0.5, but hate to be the bearer of bad news, I'm pretty sure you may run into problems if you run your competition as there still some bugs in the functioning of the software without some customization, but adding to the statistics page is not effected by these bugs, I can do that for you for a price, come to my site and we'll talk about it.
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Dragonflair

Problem is we are non-for-profit Gaming community providing public game servers for people to play on, we cannot afford too much on things for our website, the mods we do use, we are happy to credit them on the bottom of our page

Bob Perry of Web Presence Consulting

Quote from: Dragonflair on August 18, 2013, 05:23:03 AM
Problem is we are non-for-profit Gaming community providing public game servers for people to play on, we cannot afford too much on things for our website, the mods we do use, we are happy to credit them on the bottom of our page

Not out to rape ya dude, but my time is of some value to me yes? you'll notice that there is only one entry in my referral stats page listings yes? That is because I have to system set to only display users who have more than 1 referral, my guess is that you've got a ton of users with only one, yes?
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Dragonflair

i have only just installed the mod, does it show after a user referrs more then 1 person, because i have not advertised that the mod is installed because i wanted to have it set up to our liking first

Bob Perry of Web Presence Consulting

Quote from: Dragonflair on August 18, 2013, 05:39:08 AM
i have only just installed the mod, does it show after a user referrs more then 1 person, because i have not advertised that the mod is installed because i wanted to have it set up to our liking first


does what show? the statistics, well sure AFTER you add the modifications to do the stats page, it's not a part of the original package
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Westwegoman

How hard would it be to make this appear under "additional Information" instead of "Required Information" on the registration page?

People may think its actually required.

br360

You can change the verbiage in languages/Modifications.english.php if you would like.

Find-

$txt['ref_reffered_by'] = 'Referred by Membername:';

change to

$txt['ref_reffered_by'] = ' If you were referred by a member, type in their member name here:';

or

$txt['ref_reffered_by'] = 'Referred by Membername (not required, and leave blank if not referred by a member here):';

or something similar


Westwegoman


Bob Perry of Web Presence Consulting

Quote from: Westwegoman on October 15, 2013, 02:03:23 AM
Great. Thanks, I'll do that.

If it doesn't work the first time out, maybe you're using .utf8? You must make same edit in that language file as well...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

Westwegoman

It actually worked perfect. I went ahead and did it to both files.

whatever

it will be nice if this mod can be integrated with smfshop mod~~.eg. when someone make a post, it gives smfshop points to the one who referred him ...

Bob Perry of Web Presence Consulting

Quote from: whatever on December 10, 2013, 12:48:47 AM
it will be nice if this mod can be integrated with smfshop mod~~.eg. when someone make a post, it gives smfshop points to the one who referred him ...

This is a good idea, but there are a couple major flaws with the referral system that would be disastrous if it were tied to the credit system, namely that a validation upon registration that the referred by user is indeed a previously registered user and NOT the referee them self, the other flaw deals with when a member account gets deleted...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

whatever

Quote from: Bob Perry on December 10, 2013, 08:13:22 PM
Quote from: whatever on December 10, 2013, 12:48:47 AM
it will be nice if this mod can be integrated with smfshop mod~~.eg. when someone make a post, it gives smfshop points to the one who referred him ...

This is a good idea, but there are a couple major flaws with the referral system that would be disastrous if it were tied to the credit system, namely that a validation upon registration that the referred by user is indeed a previously registered user and NOT the referee them self, the other flaw deals with when a member account gets deleted...

so basically you say the flaws it gets right now are:
1. Let's say my username is A, and then I register another username B and say that I am referred by A, and it goes through(A gets one referral).
2. And then if I delete B, A's referral count is still 1.

Hmmm,
For 1, not sure if SMF can do this, but can't you just set the forum in ACP to do IP check. And then tell SMF thru ACP to not accept registration from same IP? hmmm....
For 2, may be putting up a PHP script and tell cron jobs to do referral count check every day?~~

that's just an idea of mine btw:P not sure if it is effective or not~~

Advertisement: