Просмотр файла gb/set.php

Размер файла: 4.64Kb
<?
################################################################################
################################################################################
####Скрипт создан by TarZan(icq 8419691) и by Berkut(icq 265753)                                                                                                        ####
####Скрипт распространяеться бесплатно!!                                                                                                 					    ####
####Запрещаеться продавать и переделывать даный скрипт!!!                                                                                                                 ####
####Скрипт скачан с сайта http://bm7.su!!!                                                                                                     	                                               ####
####Все дополнения и новый скрипты ожидайте на сайте http://bm7.su                                                                                                ####
################################################################################
################################################################################
//////////////////////////////////////////////НЕ ТРОГАТЬ//////////////////////////////////////////////////////////////////
$array1 = file("data/admin.dat");
$count1 = count($array1);
$text1 = explode("|", $array1);
for($i=0; $i<$count1; $i++) {
$text1 = explode("|",$array1[$i]);
$up = $i + 1;
$log=$text1[0];
$pas=$text1[1];
$db_host=$text1[2];
$db_user=$text1[3];
$db_base=$text1[4];
$db_pass=$text1[5];
}
$version='BM_GUESTBOOK v.2.1';
$rand=rand(0001,9999);
$soed=mysql_connect($db_host,$db_user,$db_pass); 
$date=date('j/n/Y');
$array = file("data/config.dat");
$count = count($array);
$text = explode("|", $array);
for($i=0; $i<$count; $i++) {
$text = explode("|",$array[$i]);
$up = $i + 1;
$onpage=$text[10];
$captcha=$text[2];
$lenghtname=$text[11];
$lenghttext=$text[12];
$showip=$text[3];
$showua=$text[4];
$mail=$text[5];
$url=$text[6];
$email=$text[9];
$nick=$text[7];
$namesite=$text[8];
$site=$text[13];
/////////////////////////////////////////////////счетчик онлайн///////////////////////////////////////////////
if($text[16]=='1'){
$data="data/online.dat"; 
$time=time(); 
$past_time=time()-300; 
$readdata=@fopen($data,"r") or die("Не могу открыть файл $data"); 
$data_array=file($data); 
@fclose($readdata); 
if (getenv('HTTP_X_FORWARDED_FOR')) 
        $user = getenv('HTTP_X_FORWARDED_FOR'); 
else 
        $user = getenv('REMOTE_ADDR'); 
$agent = getenv('HTTP_USER_AGENT'); 
$d=count($data_array); 
for($i=0;$i<$d;$i++) 
        { 
        list($live_agent,$live_user,$last_time)=explode("::","$data_array[$i]"); 
        if($live_user!=""&&$last_time!=""&&$live_agent!=""): 
        if($last_time<$past_time): 
                $live_user=""; 
                $last_time=""; 
                $live_agent=""; 
        endif; 
        if($live_user!=""&&$last_time!=""&&$live_agent!="") 
                { 
                        if($user==$live_user&&$agent==$live_agent) 
                                { 
                                $online_array[]="$agent::$user::$time\r\n"; 
                                } 
                        else 
                                $online_array[]="$live_agent::$live_user::$last_time"; 
                        } 
                endif; 
                } 
if(isset($online_array)): 
foreach($online_array as $i=>$str) 
        { 
                if($str=="$agent::$user::$time\r\n") 
                        { 
                        $ok=$i; 
                        break; 
                        } 
                } 
foreach($online_array as $j=>$str) 
        { 
        if($ok==$j) { $online_array[$ok]="$agent::$user::$time\r\n"; break;} 
        } 
        endif; 
$writedata=@fopen($data,"w") or die("Не могу открыть файл $data"); 
@flock($writedata,2); 
if($online_array=="") $online_array[]="$agent::$user::$time\r\n"; 
foreach($online_array as $str) 
        fputs($writedata,"$str"); 
@flock($writedata,3); 
@fclose($writedata); 
$readdata=@fopen($data,"r") or die("Не могу открыть файл $data"); 
$data="online.dat"; 
$data_array=@file($data); 
@fclose($readdata); 
$online=count($data_array);}}
////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////

?>