TinyPortal

Development => Block Codes => Topic started by: Dragooon on November 06, 2007, 02:12:37 PM

Title: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on November 06, 2007, 02:12:37 PM
This is a top referrer block either by referrals or by link hits, made for Referrals Mod By Karlbenson (http://custom.simplemachines.org/mods/index.php?mod=836)


This Snippet has 2 options, one is top referrer by referrals and other is top referrer by link hits. And the limit of output can be changed(All details are in The Block code).
This is made ONLY for Referrals Mod By Karlbenson (http://custom.simplemachines.org/mods/index.php?mod=836) And is tested with its version 2.0


To Implement Download RB_1.0.php(I attached it) and upload it to your sources directory.
Then in a PHP Block add
/***********************************
*   Top referrers by referrals or by link hits
*   By Dragooon                           
*   Version 1.1                           
*   www.gforumx.com 
*   Code for Showing the top referrers
************************************/
// Call the Globals so that we can call the Source File
global $sourcedir;

// Call the actual file which contains the function
require_once($sourcedir . '/RB_1.0.php');
/***********************************
*   About
***********************************/
/*
This Code Snippet is for showing the top referrers either by there referrals or by there link hits. This code snippet is for KarlBenson's Referral Mod and will NOT work for anything else.
It is tested with SMF 1.1.x and Referral Mod 1.4.

Customizing this is very easy, There are 2 variables to set, $limit and $mode.
$limit sets the MAX amount of referrers to show and $mode is for choosing between Top Referrers by referrals or hits.
If you set $mode = 1, It is for Top Referrers by referrals
If you set $mode = 2, It is for Top referrers by link hits.
*/
/***********************************
*   End About
***********************************/
/***********************************
*   Function time
***********************************/
top_referrers(
# Set the max. amount of persons to show
$limit = 5,
# Set the mode as explained before
$mode = 1
);

// Thank you for using this code snippet and hope you like it :).

And you are done. Customizing is explained in the block code.


Top Referrer by referrals or by link hits
By Dragooon
Version 1.0

Please use this thread for comment, support or feedback.
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FUBAR on November 10, 2007, 12:39:17 PM
No problems implementing and works great!  Thanks for posting this! :)
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on November 10, 2007, 05:20:07 PM
Thank you :).
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: RichardWing on November 12, 2007, 10:55:02 AM
Dragoon,

I love your block...

Is there a way you can add some code so we can select a period of time to show referrals stats.

for instance I would like to be able to display tops for the period (monthly) also not the entire totals.

Would this be possible?

Thanks
Richard Wing
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on November 12, 2007, 11:06:36 AM
I don't think so I believe.
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dark_Star on February 23, 2008, 09:53:52 PM
Excellent!  Thank you!
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FERNSIDEâ„¢ on March 23, 2008, 07:37:30 AM
Brilliant as always Dragooon. (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.postsmile.net%2Fimg%2F19%2F1942.gif&hash=018d7ac4eb395efbb2008a3b65d85b3d0f827bd5)

But Im having a strange problem with this.

I lose my site when its implemented  ???

The whole screen is white, then I have to bypass the home/front page, and disable the block.
Any ideas?
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on March 23, 2008, 07:45:34 AM
Anything in the error log?
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FERNSIDEâ„¢ on March 23, 2008, 10:59:31 AM
Yeah..  Sorry mate.

I was in between cooking dinner and removing the RB1.0 file.. lol

This error uses 22 pages in the logs.
Database Error: Unknown column 'm.referralsno' in 'field list'
File: //htdocs/home/Sources/RB_1.0.php
Line: 45
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on March 23, 2008, 11:27:32 AM
I see, there's a version 2.0 of the mod
Try the attached file
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FERNSIDEâ„¢ on March 23, 2008, 11:37:49 AM
Would the block code need to be edited too??

I tried this php file twice..
Same thing, different line.
Database Error: Unknown column 'm.referralsno' in 'where clause'
File: /htdocs/home/Sources/RB_1.0.php
Line: 48


Only 11 pages this time lol..
I forgot to mention it was version 2 aswell mate :-\
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Dragooon on March 23, 2008, 11:39:16 AM
No, Block doesn't needs edits.

And try the attached file
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FERNSIDEâ„¢ on March 23, 2008, 11:58:17 AM
Bravo master Jedi (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.postsmile.net%2Fimg%2F19%2F1954.gif&hash=e00218ffd295679918dec469b4da190945c178e1)
We are in business!! (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.getsmile.com%2Femoticons%2Fenergizer-smileys-51935%2Fbreakdance.gif&hash=06b6240776773b1493570a06a7f711b0e4ab1365)

May be best to add that file to the first post aswell.
Thanks mate :)

Happy Easter (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi72.photobucket.com%2Falbums%2Fi190%2Fpavilion_2007%2Fbeer-1.gif&hash=ee414dba494e857ef630f84255fc33188d5c4ade)
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: G6Cad on March 23, 2008, 11:59:21 AM
Sabre, you really know how to express your thoughts and feelings with your smileys, this one made me laugh a lot  :D
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: FERNSIDEâ„¢ on March 23, 2008, 12:11:05 PM
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.postsmile.net%2Fimg%2F19%2F1947.gif&hash=99e2a6ce4bc06661e0d274d1c15be2ca73b21361) Yeah..   They're pretty good. (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.postsmile.net%2Fimg%2F19%2F1960.gif&hash=843213bb41349ee67859135e1914291bda55f6bc)
I enjoy a good smiley thrown in here or there.
The right one, can put a smiley, and even a smile (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fsmilies.sofrayt.com%2Ffsc%2Fwink2.gif&hash=662ce870c0892007000b10bb7906c74c827bca54) on any face.
Always a good thing in my books.
Happy Easter G6  (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi147.photobucket.com%2Falbums%2Fr315%2Felusivelyyours%2Fsmilies%25203%2Fbbq.gif&hash=18513cdbc4758a193b1aafb711fb609bcaa4e374)    <---Im in Aussie..   This is how we celebrate everything.. lol
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: thefley on April 11, 2008, 01:32:20 AM
KarlBeson's Referral Mod
where could I fing this mod now? the links are bad... I did a search no luck, can someone post a good link of the mod
Title: Re: Top referrers Block for KarlBeson's Referral Mod
Post by: Ken. on April 11, 2008, 01:56:17 AM
Its on SMF, maybe this one?
http://custom.simplemachines.org/mods/index.php?mod=1114