Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43295
Total Topics: 7523
Most Online Today: 191
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 205
Total: 205

Author Topic: [Mod] Referrals Mod  (Read 6979 times)

0 Members and 1 Guest are viewing this topic.

Offline karlbenson

  • Member
  • *
  • Posts: 14
    • View Profile
    • Off-Topic
[Mod] Referrals Mod
« on: August 08, 2007, 06:06:22 pm »
Referrals Mod
SMF Version: 1.1.3

Description:

REFERRALS MOD v1.3
By Karl Benson





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

People using version < 1.3 are recommended to uninstall the current version and re-install 1.3 to get all the bug fixes for proper stats tracking.

Warning!
This mod is an initial release. Please report any bugs you find, no matter how trivial.
Remember to backup your database AND files before installing any modifications, especially initial releases and betas

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

Manual edits will be required to install this modification onto custom themes which have custom templates of the following files;
- Profile.template.php
- Display.template.php
- Register.template.php
- Stats.template.php
- Xml.template.php
(Most custom themes will not have custom versions of all of those files, only where a custom version exists, will you need to perform the edits)

Profile.template.php
Open Themes/{themename}/Profile.template.php, and FIND:
Code: [Select]

// Messenger type information.

ADD BEFORE:
Code: [Select]

// 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>';
foreach($context['member']['referredmembers'] as $x) {
echo $x;
}
// FREE KEVIN
unset($x);
echo '</select>';
}
echo' </td>
</tr>
<tr>
<td><b>'.$txt['referrals_referralshits'].'</b></td>
<td>'.$context['member']['referralshits'].'</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>';


Display.template.php
Open Themes/{themename}/Display.template.php, and FIND:
Code: [Select]

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

REPLACE WITH:
Code: [Select]

// 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>';


Register.template.php
Open Themes/{themename}/Register.template.php, and FIND:
Code: [Select]

// Are there age restrictions in place?

ADD BEFORE:
Code: [Select]

// IF REFERRAL INFORMATION IS SET IT WILL HAVE BEEN PASSED USING THIS VARIABLE
global $referrals;
if (isset($referrals))
{
echo ' <tr>
<td width="40%"><b>'.$txt['referrals_information'].'</b></td>
<td>'. $txt['referrals_youwerereferredby'].' '. $referrals['referredbyname'].
' '.$txt['referrals_on'].' '. date("jS M Y",$referrals['referredon']);

// NOW WRITE THE INFORMATION INTO HIDDEN INPUTS TO BE PASSED TO THE NEXT FUNCTION
echo ' <input type="hidden" name="referredby" value="'.$referrals['referredbyid'].'"/>
<input type="hidden" name="referredon" value="'.$referrals['referredon'].'"/>
</td>
</tr>';
}


If your theme has a custom Stats.template.php there are several additional manual modifications required to make the stats show on that theme (although it doesn't stop them being recorded)

If you are still having trouble, I recommend the Modification Parser by Daniel 15

Features
o Adds a referral link to each users profile area
Code: [Select]

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
 ::  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)

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

Screenshots

In the poster information area of posts

On the profile area (showing people user has referred)

On the register area (showing registering user who referred them)

On the stats area (showing referrals stats)

On the profile area (showing who referred the user)

New in v1.3 (link shown in input box for easy copy and paste)



Link to Mod

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1541 Views
Last post February 13, 2018, 09:14:56 am
by SMFHacks

+- Recent Topics

Please Help! by SMFHacks
April 17, 2024, 08:04:55 am

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

Powered by EzPortal