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

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
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, 375 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 [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Oct 02, 2004 3:50 pm Reply with quoteBack to top

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.

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Sat Oct 02, 2004 5:12 pm Reply with quoteBack to top

Nice nice!

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Oct 02, 2004 7:20 pm Reply with quoteBack to top

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

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Mesum
Support Staff
Support Staff


Joined: Mar 11, 2003
Posts: 842

Location: Chicago

PostPosted: Sat Oct 02, 2004 7:50 pm Reply with quoteBack to top

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

_________________
Only FREE Dating site for Desis.
Find all posts by MesumView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Sat Oct 02, 2004 8:17 pm Reply with quoteBack to top

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.

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
jib_intelli
Captain
Captain


Joined: Jun 10, 2004
Posts: 338

Location: Lucknow, India

PostPosted: Fri Mar 04, 2005 7:23 am Reply with quoteBack to top

Does this work with PHPNuke 7.6?

_________________
It is not our abilities which decide what we truly are, it is our choices.

Image
Find all posts by jib_intelliView user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Fri Mar 04, 2005 2:24 pm Reply with quoteBack to top

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

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Luciel
Sergeant
Sergeant


Joined: Aug 28, 2004
Posts: 119


PostPosted: Mon Mar 14, 2005 7:53 am Reply with quoteBack to top

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?
Find all posts by LucielView user's profileSend private message
Prophet
Captain
Captain


Joined: Mar 14, 2004
Posts: 422

Location: Florida, USA, Earth, Space

PostPosted: Mon Mar 14, 2005 12:54 pm Reply with quoteBack to top

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.

_________________
- Prophet
Get the Last Visit module (and others modules I designed) from my website! FREE! http://jasonlau.biz

http://DotCom.Name
Find all posts by ProphetView user's profileSend private messageVisit poster's websiteAIM Address
Luciel
Sergeant
Sergeant


Joined: Aug 28, 2004
Posts: 119


PostPosted: Tue Mar 15, 2005 1:16 am Reply with quoteBack to top

kk, ill do it later today and post the result
Find all posts by LucielView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
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: 1.216 Seconds - 322 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::