[BETA]Http Referrers 0.1.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
romans1423
Registered User
Posts: 1552
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman
Contact:

Post by romans1423 »

Integrating Referrer Karma with this one, I am trying this:

Open /includes/functions_referrers.php ... Find:

Code: Select all

if ($_SERVER['HTTP_REFERER'] && !eregi($_SERVER['HTTP_HOST'] . $board_config['script_path'], $_SERVER['HTTP_REFERER']))
 {
After that, add the code given to you by Referrer Karma, minus the opening and closing PHP tags, which are unnecessary in this case.

Would appreciate anyone else trying this out to see how effective it is.
Bicet
Registered User
Posts: 58
Joined: Mon Nov 15, 2004 6:52 am
Location: IperUranium
Contact:

Post by Bicet »

I will update this mod with the code from Matt if he can give me the permission to use.

There will be a sort of black-list too... Working on it right now.
Latest Mods:
[ Lo-Fi Mod 1.0.0 rc1 | phpBB XS 2 ]
User avatar
*=Matt=*
Registered User
Posts: 389
Joined: Mon Dec 20, 2004 11:56 pm
Location: Oakdale, Wisconsin

Post by *=Matt=* »

I dont care man. Just trying to help out ;)

That blacklist would be an awesome feature to have 8)

Keep up the good work
Abe_D_Omni
Registered User
Posts: 19
Joined: Sat Dec 10, 2005 2:04 am

Post by Abe_D_Omni »

i REALLY wanna use this MOD, but i use BBlite style

is there anything i need to do in order to get it to work?
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Abe_D_Omni wrote: i REALLY wanna use this MOD, but i use BBlite style

is there anything i need to do in order to get it to work?


You might need to change the .tpl of this Mod.
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

I am getting this error and I have run the db update and all said sucessful:

Code: Select all

 
Could not query referrers information

DEBUG MODE

SQL Error : 1146 Table 'database_forums.REFERRERS_TABLE' doesn't exist

SELECT * FROM REFERRERS_TABLE ORDER BY referrer_hits DESC LIMIT 0, 50

Line : 194
File : referrers.php
What am I missing??
romans1423
Registered User
Posts: 1552
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman
Contact:

Post by romans1423 »

Looks like you missed a modification to constants.php ...
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

Thanks, I forgot to upload that file after modding it.
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

Another question, how can I make the referrers link open in a new window?

Thanks.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Post by igorw »

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
referrers.php
#
#-----[ FIND ]------------------------------------------
#
'URL' => '<a href="' . $row['referrer_url'] .'">' . $url_name . '</a>',
#
#-----[ REPLACE WITH ]------------------------------------------
#
'URL' => '<a href="' . $row['referrer_url'] .'" target="_blank">' . $url_name . '</a>',
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

Thanks!
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

*=Matt=* wrote: This is a very nice mod but i didnt like on my site it would count referrers from a different page on my site like someone on the forums goes to the home page it would count that. Well after looking around i have made this part to the functions_referrers.php

Code: Select all

<?php
/***************************************************************************
 *                              referers.php
 *                       -------------------
 *   begin                : Mon Jul 11 2005
 *   copyright            : (C) 2005 The phpBB XS Group
 *   email                : bicet@gmail.com
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}

if ($_SERVER['HTTP_REFERER'] && !eregi($_SERVER['HTTP_HOST'] . $board_config['script_path'], $_SERVER['HTTP_REFERER']))
{
	$referrer_url = $_SERVER['HTTP_REFERER'];
	$referrer_host = str_replace ("http://", "", $referrer_url);
	$referrer_host = substr($referrer_host, 0, strpos($referrer_host, "/"));

	if  ( !($referrer_host=="$board_config['server_name']") )
	{
		$sql = "SELECT * FROM " . REFERRERS_TABLE . " 
			WHERE referrer_url = '$referrer_url'";
		if (!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, "Couldn't get referrers information", "", __LINE__, __FILE__, $sql);
		}
		$row = $db->sql_fetchrow($result);
		if (!$row)
		{
			$sql = "INSERT INTO " . REFERRERS_TABLE . " (referrer_host, referrer_url, referrer_ip, referrer_hits, referrer_firstvisit, referrer_lastvisit) 
				VALUES ('$referrer_host', '$referrer_url', '$user_ip', 1, '" . time() . "', '" . time() . "')";
				
			if (!$result = $db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, "Couldn't insert new referrer", "", __LINE__, __FILE__, $sql);
			}
		}
		else 
		{
			$sql = "UPDATE " . REFERRERS_TABLE . " 
				SET referrer_hits = referrer_hits + 1, referrer_lastvisit = " . time() . ", referrer_ip = '$user_ip' 
				WHERE referrer_url='$referrer_url'"; 
				
			if (!$result = $db->sql_query($sql))
			{
				message_die(GENERAL_ERROR, "Couldn't update referrers information", "", __LINE__, __FILE__, $sql);
			}
		}
	}
}
?>

This well only count referrers out side your domain name


Are you supposta add this to referres.php or replace it with this?
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

Bicet wrote: I will update this mod with the code from Matt if he can give me the permission to use.

There will be a sort of black-list too... Working on it right now.


hey, bicet, are you still working on this? was wondering whether its worth installing when an update may be imminent
Thanks a bunch
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
ewelin
Registered User
Posts: 262
Joined: Fri May 21, 2004 2:13 pm
Location: MA, USA
Contact:

Post by ewelin »

Bicet,

Appears that phpbbxs is down so no one can download your mod. Any chance you can get it back online soon??
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Post by archibalduk »

Does anyone know where I can download a copy of this mod? His site no longer hosts it :cry:
Locked

Return to “[2.0.x] MODs in Development”