PDA

View Full Version : Forum Home Enhancements - Latest Referral On Forum Home (Digg Like)


sunilvarma
08-19-2007, 10:00 PM
(My First Add-on! :))

This add-on displays the latest referral on the Forum Home below the navbar just like on Digg.

UPDATE

(I was so excited to release my first add-on that I didn't pay attention to some finer details!)

The latest referral will not be shown to Unregistered Users/Guests and Banned Users.

Fixed a bug. (If there are no referrals yet on your forum, there was some problem earlier.) (Thanks danward for the hint.)

Only the template edit is updated. Its not required to add the plugin again.

Installation Instructions

Download and extract the attached zip file.

Import the plugin_latestreferral.xml file as a plugin.

See the readme.txt file or the below section for instructions to edit the FORUMHOME template.

Template Edits

In the FORUMHOME template, FIND:
$navbar

BELOW, ADD:
<if condition="!is_member_of($bbuserinfo,1, 8) && $last_referrer[userid]">
<center>
$vboptions[bbtitle] user <a href="member.php?u=$last_referrer[userid]">$last_referrer[username]</a> just invited <a href="member.php?u=$last_referred_userid">$last_referred_username</a> to join $vboptions[bbtitle]
</center>
<br />
</if>

Uninstalling Instructions

1) In the ACP, in plugin manager, just uncheck the "Active" option against the "Latest Referral On Forum Home" and click on "Save Active Status"

2) Open the FORUMHOME template and remove the code you added earlier.

yahoooh
08-20-2007, 08:44 PM
any demo?

asj
08-20-2007, 10:32 PM
user just invited to join ? :(

ElForro
08-20-2007, 11:39 PM
Thanks... I've asked for this a few days ago...

Here is one screenshot...

http://img248.imageshack.us/img248/2294/imagen1hk1.jpg

In english it would be something like:

"Spreading the Word... The user ‘TAtari’ just invited ‘Tb3o3’ to join yourforum! Invite your own friends!"

sunilvarma
08-21-2007, 12:57 AM
thats more digg like! thanks for the screen.

Hornstar
08-21-2007, 07:29 AM
Thanks, this looks helpful to building your site members up more!

4x4 Mecca
08-21-2007, 08:55 PM
Spreading the Word... 4x4 Mecca user just invited to join 4x4 Mecca Invite your own friends!

That's how mine reads... Any idea why it's not calling out the data?

SCRIPT3R
08-21-2007, 09:48 PM
could you do the template addition via injection from the plugin; very nice.

sunilvarma
08-22-2007, 12:27 AM
Spreading the Word... 4x4 Mecca user just invited to join 4x4 Mecca Invite your own friends!

That's how mine reads... Any idea why it's not calling out the data?

did you actually add the plugin?

danward
08-22-2007, 02:00 PM
Spreading the Word... 4x4 Mecca user just invited to join 4x4 Mecca Invite your own friends!

That's how mine reads... Any idea why it's not calling out the data?

This may be because no one has yet referred a user to your site. Set up a test account and input a referrer and see if it works once this has been done! ;)

sunilvarma
08-22-2007, 02:28 PM
Thanks danward and 4x4 Mecca for the hint. I fixed the problem.

rayphua
08-22-2007, 03:25 PM
Hi, how do i get the output to be in a box like how yours is like?

sunilvarma
08-22-2007, 04:55 PM
Hi, how do i get the output to be in a box like how yours is like?

In template, FORUMHOME,

FIND:
$navbar

AFTER ADD:
<if condition="!is_member_of($bbuserinfo,1, 8) && $last_referrer[userid]">
<table class="tborder" width="100%">
<tr>
<td width="3%" align="left"><img src="images/misc/latest-referral.png" /></td>
<td align="left">$vboptions[bbtitle] user <a href="/forum/member.php?u=$last_referrer[userid]">$last_referrer[username]</a> just invited <a href="/forum/member.php?u=$last_referred_userid">$last_referred_username</a> to join $vboptions[bbtitle]!</td>
</tr>
</table>
<br />
</if>

Save the template and upload the attached image to your images/misc folder.

danward
08-23-2007, 09:40 AM
Thanks danward and 4x4 Mecca for the hint. I fixed the problem.

No problem, glad to help! ;)

extreme101a
08-25-2007, 10:59 AM
really want to use this mod. but i get this error

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /includes/functions.php(1243) : eval()'d code on line 5

it does work, but with the error up top of page.
uploaded the plugin, and put code it.

im on vb 3.6.7 PL1.

rayphua
08-25-2007, 11:33 AM
In template, FORUMHOME,

FIND:
$navbar

AFTER ADD:
<if condition="!is_member_of($bbuserinfo,1, 8) && $last_referrer[userid]">
<table class="tborder" width="100%">
<tr>
<td width="3%" align="left"><img src="images/misc/latest-referral.png" /></td>
<td align="left">$vboptions[bbtitle] user <a href="/forum/member.php?u=$last_referrer[userid]">$last_referrer[username]</a> just invited <a href="/forum/member.php?u=$last_referred_userid">$last_referred_username</a> to join $vboptions[bbtitle]!</td>
</tr>
</table>
<br />
</if>

Save the template and upload the attached image to your images/misc folder.

Thank you!!!

rnadmo
01-01-2008, 11:00 PM
Anyone got this working on 3.7.0b3?

Mine won't work..

It's the <if condition="!is_member_of($bbuserinfo,1, 8) && $last_referrer[userid]"> that it doesn't like.. where is that variable coming from? It's empty now.

TCE Killa
01-01-2008, 11:15 PM
Great mod, thanks.

ERAFOX
10-08-2008, 02:29 AM
whit global star no problems

great mod !

Sadie Frost
09-09-2010, 07:54 PM
This worked fine on 3.8X until my host upgraded php and mysql, and now with it enabled I get this message:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]/includes/functions.php(1455) : eval()'d code on line 5

:(