Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2003-10-24, 12:23 PM   #1
spacemanspiff
Where there's a will, I want to be in it.
 
spacemanspiff's Avatar
 
Join Date: Aug 2003
Location: Looz-e-anna
Posts: 1,015
Send a message via ICQ to spacemanspiff
Top Referrers Script

I'm looking for a good way to add a "top referrers" section to a page. I'd don't want to have to use referrer codes, I would like to be able to exclude url's like search engines and such, and no sign up necessity would be great. ie. "just send hits to bla-bla.com and you'll be ranked in the top referrers section." If it could reset every 24 hours, without me having to get into anything dangerous like cron, that would be awesome

Thanks
SS
__________________
Submit your free sites to Free Sex Pics
spacemanspiff is offline   Reply With Quote
Old 2003-10-24, 12:28 PM   #2
MrMaryLou
i fucking told i type to fucking fast wtf
 
MrMaryLou's Avatar
 
Join Date: Mar 2003
Location: New York
Posts: 11,247
Send a message via ICQ to MrMaryLou
This one Kicks Ass http://www.cgiman.com/autorefs.shtml
__________________
<a href="http://www.greenguysboard.com/onthebench/">Join Me For On The Bench
</a>
MrMaryLou is offline   Reply With Quote
Old 2003-11-03, 05:42 PM   #3
BNS
I'm going to the backseat of my car with the woman I love, and I won't be back for TEN MINUTES
 
Join Date: Oct 2003
Location: Puta Madre
Posts: 84
does anyone know if there is any free script similar to autorefs?
i need it for something relatively small to spend $300 on it.
BNS is offline   Reply With Quote
Old 2003-11-15, 10:17 AM   #4
Auke
Aw, Dad, you've done a lot of great things, but you're a very old man, and old people are useless
 
Auke's Avatar
 
Join Date: Nov 2003
Location: Netherlands
Posts: 28
Send a message via ICQ to Auke
PHP Code:
//check if it is the first of the month.
//if so reset counter
$datum date("Y-m-d H:i:s");
$lastmonth date("m")-1;
$thisyear date("Y");

        
$getsites mysql_query("SELECT * FROM pages WHERE hitsin > '0' AND lasthit LIKE '$thisyear-0$lastmonth-%' LIMIT 1")or die(mysql_error());
         
$count_site mysql_num_rows($getsites);
            if(
$count_site == 1){//count
                
$allsites mysql_query("SELECT * FROM pages")or die(mysql_error());
                while(
$rowall mysql_fetch_array($allsites)){//while
                    
mysql_query("UPDATE pages SET hitsin = '0', lasthit WHERE accepted = 'y'")or die(mysql_error());                    
                }
//while
            
}//count

//register referer and ip adres
$refip getenv ("REMOTE_ADDR");
$referer getenv("HTTP_REFERER");
$c_url mysql_query("SELECT hitsin, lastip, lasthit FROM pages WHERE url = '$referer%'")or die("er is iets mis: ".mysql_error());
$tell mysql_num_rows($c_url);
    if(
$tell == 1){
    
$row mysql_fetch_array($c_url);
    
$lastip $row['lastip'];
    
$hitsnu $row['hitsin'];
        if(
$lastip == $refip){
        
$histnew $hitsnu;
        }else{
        
$hitsnew $hitsnu 1;
        }
    
$update_site mysql_query("UPDATE pages SET hitsin = '$hitsnew', lastip = '$refip', lasthit = '$datum' WHERE url = '$referer%' ")or die("er is iets mis: ".mysql_error());
    } 
This is a peace of a script i wrote and use to registrer referers.
If you can do a little of php scripting you can ajust it to your needs.
__________________
Respect,
Auke

ICQ:325256616
Auke is offline   Reply With Quote
Old 2003-11-15, 01:52 PM   #5
BNS
I'm going to the backseat of my car with the woman I love, and I won't be back for TEN MINUTES
 
Join Date: Oct 2003
Location: Puta Madre
Posts: 84
Hi,

thanx for script

if i am not asking too much, can you please give some example how exactly to use it? i see it has mysql queries, but where does it connect to db and for instance how does the output html look like?

tia,
BNS
BNS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:10 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc