News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Referral System

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

Previous topic - Next topic

SMFHacks.com Team

Link to Mod

Referral System

Supports SMF 2.0.x and SMF 1.1.x

This mod allows you track how many people a member has referred to the forum.
Tracks by either a cookie or the username entered on registration.

3.2
+Clicking on the referral number in posts or profile now shows a list of users. That user referred.

3.1
+Added easy copyright removal ordering system

3.0.1
!Fixed spelling of referrals
!Fixed link tracking for referrals

New Version 3.0
+Rewrote the modification from the ground up.
+Settings to control where referrals are shown
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Hoochie Coochie Man

Good job! Thanks for this great mod.
İnadına SMF 1.1.X


shadow82x

I believe this mod is only supported on SMF2.0 beta or above. Which is only downloadable for charter.members. Use Karlbenson's mod for the SMF1.1 branch.
Colin B
Former Spammer, Customize, & Support Team Member

karlbenson

No that is incorrect.
This mod is for 1.1.x ONLY.
Its just that this version of the mod is 2.0

It will not work for SMF 2.0 betas.  I believe YodaOfDarkness will be working on a version for smf 2.0 in the future.

paypalcommunity

thats... it works good to me
join my forum - http://www.paypalcommunity.info a site where you can earn money from posting and trading and learning new things. join http://www.paypalcommunity.info - this is newly site :)

JoshieDaMan

It has 2 files in it.

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

Then profile and stats went all empty saying it wouldn't load. So I had to restore the backup twice when I was trying this.

Eliana Tamerin

Problem: The 'Find Referrer' link on the registration page opens in the same window. It needs to open in a popup window like other [?] links so that it doesn't disrupt the registration process.

This occurs in Firefox and Firefox-based browsers, but not IE or Opera (they open in popup windows). Popup blocker is off and did not register any popups being submitted from my site when it was turned on. Firefox v 2.0.0.12.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

karlbenson

Eliana Tamerin it should use a popup.  In fact the code it uses is from smf. :(

Eliana Tamerin

#10
I don't know. I'm a bit tired, but here's the code from the register.template.php:

echo ' <tr>
<td width="40%"><b>', $txt['referrals_who'] ,'</b>
<div class="smalltext">', $txt['referrals_who_description'], '</div></td>
<td><input name="referredby" type="text" size="30" value="', ( !empty($context['referrals']['referred_by_name']) ? $context['referrals']['referred_by_name'] : '' ) ,'" />
<a href="', $scripturl, '?action=findmember;input=referredby;sesc=', $context['session_id'], '" onclick="document.getElementById(\'referredby\').value=\'\';document.getElementById(\'referredon\').innerHTML =\'&nbsp;\';return reqWin(this.href, 350, 400);"><img src="', $settings['images_url'], '/icons/assist.gif" border="0" alt="', $txt['referrals_findreferrer'] ,'" /> ', $txt['referrals_findreferrer'] ,'</a><br /><span id="referredon" class="smalltext">', ( !empty($context['referrals']['referred_date']) ? $txt['referrals_on'].' '.$context['referrals']['referred_date'] : '' ) ,'</span></td>
</tr>';


I tried taking the space out of the link (here: $context['session_id'], '" onclick=), but it didn't make a different. Here's what I currently have:

echo ' <tr>
<td width="40%"><b>', $txt['referrals_who'] ,'</b>
<div class="smalltext">', $txt['referrals_who_description'], '</div></td>
<td><input name="referredby" type="text" size="30" value="', ( !empty($context['referrals']['referred_by_name']) ? $context['referrals']['referred_by_name'] : '' ) ,'" />
<a href="', $scripturl, '?action=findmember;input=referredby;sesc=', $context['session_id'], '"onclick="document.getElementById(\'referredby\').value=\'\';document.getElementById(\'referredon\').innerHTML =\'&nbsp;\';return reqWin(this.href, 350, 400);"><img src="', $settings['images_url'], '/icons/assist.gif" border="0" alt="', $txt['referrals_findreferrer'] ,'" /> ', $txt['referrals_findreferrer'] ,'</a><br /><span id="referredon" class="smalltext">', ( !empty($context['referrals']['referred_date']) ? $txt['referrals_on'].' '.$context['referrals']['referred_date'] : '' ) ,'</span></td>
</tr>';


You can try it for yourself. I tried in both Firefox and Flock: http://intonarnia.com/index.php?action=register

And if it works for you, I'll be satisfied and ignore it, must just be mine for some odd reason.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

karlbenson

Your right it doesn't appear to be working properly in Firefox.

Eliana, do you have the same problem with the Find Members inside SMF. (eg admin > banned) or admin > Boards > modify boards (for the moderator)

Eliana Tamerin

No on both counts. They both appear as popups without redirecting the current page.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Fustrate

I too looked at this problem... and besides the height/width attributes in the referrals mod popup, there aren't any differences that I can find.
Steven Hoffman
Former Team Member, 2009-2012

~Kikoish~

It's not working with my forum. There's an error. I tried the Modification Parser but still there's an error:

QuoteparseArchive(): No package-info.xml in this mod! Is it corrupted?

How to fix this?


Spamiam

I received the same thing. This mod is tossing in a LOT of errors into the errors log. Apparently one for every person who looks at every post.

I tried the uninstall but got a failed on ./Themes/default/Display.template.php. I can't find out where to alter that file manually.

The error log says:
8: Undefined index: referralsno
File: /home/amstew/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 340

HUNDREDS of pages of that, and fills back up as fast as I can delete them. :(

~Kikoish~

How to edit the referrals?

JoshieDaMan

9.    Execute Modification    ./Themes/default/Stats.template.php    Test successful
10.    Execute Modification    ./Themes/default/Stats.template.php    Test failed

Probably skipped my first post in this topic but how I can get this 2nd stats.template.php to be passed, or at least is this a duplicate file?

Eliana Tamerin

There are two counts of Stats.template.php modifications. Here's mine.

9.     Execute Modification     ./Themes/default/Stats.template.php     Test successful
10.    Execute Modification    ./Themes/default/Stats.template.php    Test successful

Try editing the file manually then installing it.




Any ideas on the Firefox popup window problem? Perhaps there's some missing javascript in the head of the register.template.php file.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Fustrate

#19
Quote from: Spamiam on March 07, 2008, 09:38:56 AM
I received the same thing. This mod is tossing in a LOT of errors into the errors log. Apparently one for every person who looks at every post.

I tried the uninstall but got a failed on ./Themes/default/Display.template.php. I can't find out where to alter that file manually.

The error log says:
8: Undefined index: referralsno
File: /home/amstew/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 340

HUNDREDS of pages of that, and fills back up as fast as I can delete them. :(


Go into $themedir/Display.template.php and search for referralsno
replace it with referrals_no

The error isn't in the package, so I'm assuming you ahd an earlier version installed, which didn't change for some reason.

As for the basic install errors: the mod parser isn't working right now, so here's what to do:
Open Stats.template.php
Search for something LIKE:
foreach ($context['top_boards'] as $board)
echo '
<tr>
<td width="60%" valign="top">', $board['link'], '</td>
<td width="20%" align="left" valign="top">', $board['num_posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $board['post_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $board['num_posts'], '</td>
</tr>

AFTER that, add:
// Start of Referrals Mod Stats
echo '
</table>
</td>
</tr><tr>
<td class="catbg" colspan="2" width="50%"><b>'.$txt['referrals_top5referrers'].'</b></td>
<td class="catbg" colspan="2" width="50%"><b>'.$txt['referrals_top5referrersbyposts'].'</b></td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_info.gif" width="20" height="20" alt="" /></td>
<td class="windowbg2" width="50%" valign="top">
<table border="0" cellpadding="1" cellspacing="0" width="100%">';
if (empty($context['totalreferrals']))
echo '<tr>
<td valign="top" style="text-align:center">'. $txt['referrals_noneyet'] . '</td>
</tr>';
else
{
foreach ($context['top_referrers'] as $referrer)
echo '
<tr>
<td width="60%" valign="top">', $referrer['link'], '</td>
<td width="20%" align="left" valign="top">', $referrer['referrals_no'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $referrer['referrals_percent'] . '" height="15" alt="" />' : '&nbsp;', '</td>
<td width="20%" align="right" valign="top">', $referrer['referrals_no'], '</td>
</tr>';
}

echo '
</table>
</td>
<td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_info.gif" width="20" height="20" alt="" /></td>
<td class="windowbg2" width="50%" valign="top">
<table border="0" cellpadding="1" cellspacing="0" width="100%">';
unset($referrer);
if (empty($context['totalreferralsposts']))
echo '<tr>
<td valign="top" style="text-align:center">'. $txt['referrals_noneyet'] . '</td>
</tr>';
else
{
foreach ($context['top_referrers_by_posts'] as $referrer)
echo '
<tr>
<td width="60%" valign="top">', $referrer['link'], '</td>
<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>
<td width="20%" align="right" valign="top">', $referrer['posts'], '</td>
</tr>';
}
// End of Referrals Mod Stats

Steven Hoffman
Former Team Member, 2009-2012

Advertisement: