You are missing our premiere tool bar navigation system! Register and use it for FREE!


Author: LucielPostPosted: Tue Mar 15, 2005 1:16 am    Post subject: Re: List only unique http referrers

kk, ill do it later today and post the result



Nuke Cops -> Tips And Tricks

All times are GMT - 8 Hours

Page 1 of 1

Powered by phpBB © 2001,2002 phpBB Group
NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 

Author: MesumLocation: ChicagoPostPosted: Sat Oct 02, 2004 5:12 pm    Post subject:

Nice nice!

Author: ProphetLocation: Florida, USA, Earth, SpacePostPosted: Sat Oct 02, 2004 7:20 pm    Post subject: Re: List only unique http referrers

I forgot to mention to NOT use this code if you use a block or module that lists top referrers. Very Happy

Author: MesumLocation: ChicagoPostPosted: Sat Oct 02, 2004 7:50 pm    Post subject:

Does this includes MSA too? Since it uses it's own database and files to collect information.

Author: ProphetLocation: Florida, USA, Earth, SpacePostPosted: Sat Oct 02, 2004 8:17 pm    Post subject: Re: List only unique http referrers

If MSA uses it's own database and does not share data with the nuke_referer table then it shouldn't be affected.
Any module or block that shares data from the nuke_referer table is affected by this modification.
I don't use any other blocks/modules that use that table, other than the http referers admin module. I don't know about you, but I get tired of wading through the redundant urls.

Author: jib_intelliLocation: Lucknow, IndiaPostPosted: Fri Mar 04, 2005 7:23 am    Post subject:

Does this work with PHPNuke 7.6?

Author: ProphetLocation: Florida, USA, Earth, SpacePostPosted: Fri Mar 04, 2005 2:24 pm    Post subject: Re: List only unique http referrers

Yes, I believe it will work for PHP-Nuke Version 7.6.

Author: LucielPostPosted: Mon Mar 14, 2005 7:53 am    Post subject: Re: List only unique http referrers

I was looking in my index.php (nuke 7.5) and its kinda different:


if ($httpref==1) {
$referer = $_SERVER["HTTP_REFERER"];
$referer = check_html($referer, nohtml);
if ($referer=="" OR eregi("^unknown", $referer) OR substr("$referer",0,strlen($nukeurl))==$nukeurl OR eregi("^bookmark",$referer)) {
} else {
$sql = "INSERT INTO ".$prefix."_referer VALUES (NULL, '$referer')";
$result = $db->sql_query($sql);
}
$sql = "SELECT * FROM ".$prefix."_referer";
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
if($numrows>=$httprefmax) {
$sql = "DELETE FROM ".$prefix."_referer";
$result = $db->sql_query($sql);
}
}


Any suggestions?

Author: ProphetLocation: Florida, USA, Earth, SpacePostPosted: Mon Mar 14, 2005 12:54 pm    Post subject: Re: List only unique http referrers

Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 199 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - List only unique http referrers List only unique http referrers

Nuke Cops -> Tips And Tricks

Author: ProphetLocation: Florida, USA, Earth, Space PostPosted: Sat Oct 02, 2004 3:50 pm    Post subject: List only unique http referrers

Open index.php in the root Nuke directory.
Around lines 25 through 36 find the following...
Code:
if ($httpref==1) {
    $referer = $_SERVER["HTTP_REFERER"];
    $referer = check_html($referer, nohtml);
    if ($referer=="" OR eregi("^unknown", $referer) OR substr("$referer",0,strlen($nukeurl))==$nukeurl OR eregi("^bookmark",$referer)) {
    } else {
   $result = $db->sql_query("INSERT INTO ".$prefix."_referer VALUES (NULL, '$referer')");
    }
    $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_referer"));
    if($numrows>=$httprefmax) {
   $result2 = $db->sql_query("DELETE FROM ".$prefix."_referer");
    }
}


Replace with the following...

Code:
if ($httpref==1) {
   $url = $_SERVER["HTTP_REFERER"];
    $url = check_html($url, nohtml);
    if ($url=="" OR eregi("^unknown", $url) OR substr("$url",0,strlen($nukeurl))==$nukeurl OR eregi("^bookmark",$url)) {
   echo "";
    } elseif ($db->sql_numrows($db->sql_query("SELECT url FROM ".$prefix."_referer WHERE url='$url'")) > 0) {
   echo "";
   } else {
   $result = $db->sql_query("INSERT INTO ".$prefix."_referer VALUES (NULL, '$url')");
   }
    $numrows = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_referer"));
    if($numrows>=$httprefmax) {
   $result2 = $db->sql_query("DELETE FROM ".$prefix."_referer");
    }
}


This will stop duplicate referrers from being stored in the database.
Luciel wrote:
I was looking in my index.php (nuke 7.5) and its kinda different:
Any suggestions?


You can replace it with the code I previously posted.
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.350 Seconds - 177 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
added by Evaders - DO NOT REMOVE
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::