TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 103
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 68
  • Total: 68

Top referrers Block for KarlBeson's Referral Mod

Started by Megaforum, November 06, 2007, 02:12:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dragooon

This is a top referrer block either by referrals or by link hits, made for Referrals Mod By Karlbenson


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 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.

FUBAR

No problems implementing and works great!  Thanks for posting this! :)


RichardWing

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

Dragooon


Dark_Star

#5
Excellent!  Thank you!

FERNSIDEâ„¢

Brilliant as always Dragooon.

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?

Dragooon


FERNSIDEâ„¢

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

Dragooon

I see, there's a version 2.0 of the mod
Try the attached file

This website is proudly hosted on Crocweb Cloud Website Hosting.