Show online img Error, Help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Show online img Error, Help!

    How to show a real count online visitor, check this friends, it's count online show error..
    Code:
    <?
    
    ///////////////////////////    разработка StarWap-Group      ///////////////////////////////
    
    Error_Reporting(E_ALL & ~E_NOTICE);
    $currHour=gmdate("H",time()+(25200));
    $currDate=gmdate("d", time()+(25200));
    $currTime=gmdate("$currHour:i:s", time()+(25200));
    $time=time();
    $timeof=$time-500;
    $onfile="rekd/online=$nc.dat";
    
    
    $counter = @implode("",@file("rekd/rekds=$nc.dat"));
    $counter=trim($counter);
    if($counter==""){$fp=fopen("rekd/rekds=$nc.dat","w");
    fputs($fp,"0 \r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);
    chmod ("rekd/rekds=$nc.dat", 0777);
    $fp=fopen("rekd/rekdo=$nc.dat","w");
    fputs($fp,"0 \r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);
    chmod ("rekd/rekdo=$nc.dat", 0777);
    $fp=fopen("rekd/data=$nc.dat","w");
    fputs($fp,"$currDate \r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);}
    chmod ("rekd/data=$nc.dat", 0777);
    
    $pdat = @implode("",@file("rekd/data=$nc.dat"));
    $pdat=trim($pdat);
    if($currDate!=$pdat) {$fp=fopen("rekd/rekds=$nc.dat","w");
    fputs($fp,"0 \r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);
    chmod ("rekd/rekds=$nc.dat", 0777);
    $fp=fopen("rekd/data=$nc.dat","w");
    fputs($fp,"$currDate \r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);
    chmod ("rekd/data=$nc.dat", 0777);
    }
    
    
    
    $online = @implode("",@file("$onfile"));
    $online=trim($online);
    if($online==""){		$fp=fopen("$onfile","w");
    fputs($fp,"\r\n");                                     ////////////////// создание нового файла счетчика
    fclose($fp);
    chmod ("$onfile", 0777);}
    
    
    $uz=getenv('REMOTE_ADDR');
    $brayz=getenv('HTTP_USER_AGENT');
    $textsr="$uz:||:$brayz";
    $textrek="$time:||:$uz:||:$brayz";
    
    $ss = file("$onfile");
    $strok = sizeof($ss);
    $ns=0;
    $ni=1;
    while($ns <= $strok)
    {$inkl=@file("$onfile");
    $unkl=explode(":||:",$inkl[$ns]);
    $timepr=trim($unkl[0]);
    $adrpr=trim($unkl[1]);
    $brpr=trim($unkl[2]);
    $prov="$adrpr:||:$brpr";
    if($timeof<$timepr) { if($prov!=$textsr) {$aron[$ni]="$timepr:||:$adrpr:||:$brpr"; $ni=$ni+1;}}
    $ns=$ns+1;}
    
    $aron[$ni]=$textrek;
    
    $fp = @fopen("$onfile","wb");
    @fputs($fp,"");
    @fclose($fp);
    
    $ns=1;
    while($ns <= $ni)
    {$fp=fopen("$onfile","a");
    fputs($fp,"$aron[$ns] \r\n");
    fclose($fp);
    $ns=$ns+1;}
    
    
    $counter = file("rekd/rekds=$nc.dat","w");        ///////////увеличеваем счетчик
    $pt = $counter[0]+1;
    $fp = @fopen("rekd/rekds=$nc.dat","wb");
    @fputs($fp,$pt);
    @fclose($fp);
    
    $counter = file("rekd/rekdo=$nc.dat","w");        ///////////увеличеваем счетчик
    $ptv = $counter[0]+1;
    $fp = @fopen("rekd/rekdo=$nc.dat","wb");
    @fputs($fp,$ptv);
    @fclose($fp);
    
    $pt=trim($pt); $ptv=trim($ptv);
    
    
    $mt=1; $mtv=1;
    $i=1;
    while($k!="stop")
    {if($pt>=$i) {$mp=$mt; $i=$i*10; $mt=$mt+1;} else {$k="stop";}};
    
    $pik=$mp*6;
    $pik=98-$pik;
    
    $iv=1;
    while($kv!="stop")
    {if($ptv>=$iv) {$mpv=$mtv; $iv=$iv*10; $mtv=$mtv+1;} else {$kv="stop";}};
    
    $pikv=$mpv*6;
    $pikv=98-$pikv;
    
    $iv=1;
    while($kvo!="stop")
    {if($ni>=$iv) {$mpo=$mto; $iv=$iv*10; $mto=$mto+1;} else {$kvo="stop";}};
    $piko=$mpo*6;
    $piko=47-$piko;
    
    /////////////Выводим картинку:
    
    $im = ImageCreateFromgif("12.gif");
    ImageString ($im, 3, $piko, 1,$ni,5);
    ImageString ($im, 2, $pik, 17,$pt,3);
    ImageString ($im, 2,$pikv, 28,$ptv,3);
    $text_color = imagecolorallocate($im, 255, 255, 0); //цвет текста
    imagettftext($im, 8, 0, 34, 12, $text_color, "arial.ttf", "Online: $ni");
    
    
    header("Content-type: image/gif");
    imagegif($im);
    
    
    ?>
    Plis help...
    Last edited by subzero; 27.04.12, 03:36. Reason: [code] Your Script Here [/code]

    #2
    which error do u get?

    Comment


      #3
      all these StarWap-Group scripts you have got problems with is because they are old and need Globals to be turned on for them to work

      Comment

      Working...
      X