Eu uso um contador de cliques mas ele só conta cliques para link's normais (http://site.com/pasta/index.php), mas preciso que conte link desse tipo:
http://site.com/pasta/index.php?mostrar=noticiacompleta&id=??????????• Os contadores q testei só contam cliques assim:
http://site.com/pasta/index.php
Quando mando contar desse jeito:
http://site.com/pasta/index.php?mostrar=noticiacompleta&id=??????????
Ele só aparece assim:
http://site.com/pasta/index.php?mostrar=noticiacompleta
&id=??????????, some:
Abaixo o códiog que uso:
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
$nilc=explode(".",basename($url));
if($url!=""){
$filename=strtolower($url);
$filename= str_replace ("http://","", $filename);
$filename= str_replace ("/","", $filename);
$filename= str_replace ('.',"", $filename);
$filename= str_replace ('?',"", $filename);
$filename= str_replace ('=',"", $filename);
$filename= str_replace (';',"", $filename);
}
$day =date("d");
$month =date("M");
$year =date("Y");
$dt="$day-$month-$year";
$ip = getenv(REMOTE_ADDR);
if(file_exists("data_d/".$filename)) {
}else{
$fr=fopen("data_d/".$filename, "w");
fputs($fr, "0|0|0|0|$dt");
fclose($fr);
}
if($url!=""){
$comp=fopen("data_d/".$filename, "r");
$old_stats=file("data_d/".$filename);
$stat=explode("|", $old_stats[0]);
fclose($comp);
if($stat[3]!=$ip){
$comp1=fopen("data_d/".$filename, "w");
$old_stats1=file("data_d/".$filename);
$stat1=explode("|", $old_stats[0]);
$new_stats= $stat1[0]+1;
fputs($comp1, "$new_stats|$url|$nilc[0].$nilc[1]|$ip|$stat1[4]");
fclose($comp1);
header("Location:$url");
exit;
}else{
$comp1=fopen("data_d/".$filename, "w");
$old_stats1=file("data_d/".$filename);
$stat1=explode("|", $old_stats[0]);
$new_stats= $stat1[0];
fputs($comp1, "$new_stats|$url|$nilc[0].$nilc[1]|$ip|$stat1[4]");
fclose($comp1);
header("Location:$url");
exit;
}
}
if($action=="show_stats"){
echo "<style>TD { FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Verdana }</style>";
echo "<FONT SIZE=3 COLOR=#FF9966 face=arial><CENTER><B>Unique Links Counter</B></CENTER></FONT><BR>";
$handle = @opendir("data_d");
echo "<table cellspacing=0 align=center border=1 bordercolor=#FF9966 ><td align=center>Filename</td><td align=center>URL</td><td align=center>Count</td><td>Counting since</td>";
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." ) {
$fn=fopen("data_d/".$file,"r");
$statis=file("data_d/".$file);
$stat=explode("|", $statis[0]);
fclose($fn);
if($stat[2] != "0"){
echo "<tr><td>$stat[2]</td><td><a href='$stat[1]' target=_new>$stat[1]</a></td><td align=center>$stat[0]</td><td>$stat[4]</td></tr>";
}
}
}
closedir($handle);
echo "</table><hr color=#FF9966 width=50%>";
echo "<table width=100% align=center><td align=center>Copyright: <A HREF=http://www.cgixp.tk target=_new>Cgixp Team</A></td></table>";
}
if($link!=""){
$linker=strtolower($link);
$linker= str_replace ("http://","", $linker);
$linker= str_replace ("/","", $linker);
$linker= str_replace ('.',"", $linker);
$linker= str_replace ('?',"", $linker);
$linker= str_replace ('=',"", $linker);
$linker= str_replace (';',"", $linker);
if(file_exists("data_d/".$linker)) {
$fn=fopen("data_d/".$linker,"r");
$statis=file("data_d/".$linker);
$stat=explode("|", $statis[0]);
fclose($fn);
if($stat[0]>=2){ $spell="times"; }else{$spell="time";}
echo "Downloaded $stat[0] $spell";
}else{
echo "Not yet downloaded";
}
}
?>Alguém pode me ajudar?
Edição feita por: EduardoPG, 29/09/2005, 09:21.










