PostNuke

Flexible Content Management System

News

Modifications to the HTTP Referers

Contributed by Anonymous on Jul 20, 2001 - 10:02 AM











ALTER TABLE nuke_referer ADD count INT not nul


















then in the index.php there is a referer section






replace the standard insert with (somewhere around line 120 i think)


















$result = mysql_query("select * from $prefix"._referer." where url='$referer'");






if (mysql_num_rows($result) >= "1")






{






while($row=mysql_fetch_array($result))






{






$count = $row["count"];






$new_count = $count + 1;






}






mysql_query("update $prefix"._referer." set count='$new_count' where url='$referer'");






}else{






mysql_query("insert into $prefix"._referer." values (NULL, '$referer')");






}












then in the admin/modules/referer.php look for $hresult = and replace the $hresult and while loop with












$hresult = mysql_query("select rid, url, count from $prefix"._referer."");






echo "idrefererhits";






while(list($rid, $url,$count) = mysql_fetch_row($hresult)) {






echo "$rid"






."$url$count";






}












This should do it.












Matt Jezorek






http://bluelinux.sourceforge.net












663