Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/09/2004, 13:17
juandedios
 
Fecha de Ingreso: mayo-2003
Ubicación: Lima
Mensajes: 967
Antigüedad: 20 años, 11 meses
Puntos: 8
Problemas con contador

He bajado este script, pero no cuenta, solo se queda en el 1 podrian revisar el script y decirme en que falla?
Código PHP:
###########################################
#Counter script released by antido.com    #
#Please define if you want to use smilies:#
$smilies = "on";                          #
$counter = "count.txt";                      #
###########################################

$today = getdate();
$month = $today[month];
$mday = $today[mday];
$year = $today[year];
$current_date = $mday . $month . $year;
$fp = fopen($counter, "a");
$line = $REMOTE_ADDR . "|" . $mday . $month . $year . "\n";
$size = strlen($line);
fputs($fp, $line, $size);
fclose($fp);
$contents = file($counter);
$total_hits = sizeof($contents);
$total_hosts = array();
for ($i=0;$i<sizeof($contents);$i++) {
    $entry = explode("|", $contents[$i]);
    array_push($total_hosts, $entry[0]);
}
$total_hosts_size = sizeof(array_unique($total_hosts));
$daily_hits = array();
for ($i=0;$i<sizeof($contents);$i++) {
    $entry = explode("|", $contents[$i]);
    if ($current_date == chop($entry[1])) {
        array_push($daily_hits, $entry[0]);
    }
}
$daily_hits_size = sizeof($daily_hits);
$daily_hosts = array();
for ($i=0;$i<sizeof($contents);$i++) {
    $entry = explode("|", $contents[$i]);
    if ($current_date == chop($entry[1])) {
        array_push($daily_hosts, $entry[0]);
    }
}
$daily_hosts_size = sizeof(array_unique($daily_hosts));?>
<? 
if($smilies == "on"){
if(
$daily_hosts_size "5")
    {
        
define("SMILIE""<img src=img/icon_cry.gif>");
    }

elseif(
$daily_hosts_size "4" && $daily_hosts_size "16")
    {
        
define("SMILIE""<img src=img/icon_frown.gif>");
    }

elseif(
$daily_hosts_size "15"  && $daily_hosts_size "26")
    {
        
define("SMILIE""<img src=img/icon_confused.gif>");
    }

elseif(
$daily_hosts_size "25"  && $daily_hosts_size "49")
    {
        
define("SMILIE""<img src=img/icon_lol.gif>");
    }

elseif(
$daily_hosts_size "49"  && $daily_hosts_size "70")
    {
        
define("SMILIE""<img src=img/icon_razz.gif>");
    }

elseif(
$daily_hosts_size "70")
    {
        
define("SMILIE""<img src=img/icon_biggrin.gif>");
    }}
if(
$smilies == "on")
{
echo 
"
Uniques today: " 
$daily_hosts_size " " SMILIE "
<br>
Total Unique Hits: " 
$total_hosts_size;
}
else{
echo 
"
Uniques today: " 
$daily_hosts_size "
<br>
Total Unique Hits: " 
$total_hosts_size;
}
__________________
El aprendiz.