View file zabor/temps/index.php

File size: 3.26Kb
<?php
#-----------------------------------------------------#
#          ********* WAP-MOTORS *********             #
#             Made by   :  VANTUZ                     #
#               E-mail  :  [email protected]         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#-----------------------------------------------------#	
//require_once"../template/start.php";
//require_once"../template/regglobals.php";
//require_once"../template/config.php";
//require_once"../template/functions.php";
//require_once"../template/antidos.php";
//require_once"../template/cookies.php";
//require_once"../template/gzip.php";
//require_once"../template/header.php";
//require_once"../template/referer.php";


//////////////////////////////////////////////////////////////////////////////////////////

//include_once"../template/isset.php";


$rand = rand(100,999); 
if (isset($_GET['start'])){$start = (int)$_GET['start'];} else {$start = 0;}
if (isset($_GET['imja'])){$imja = check($_GET['imja']).', ';} else {$imja = "";}
echo '<div class="a"></div>';
echo' <b>Забор)</b><br>';



if ($action=="") {

//--------------------------------------------------------//
$file=file(BASEDIR."zabor/temps/base.dat"); 
$i = count($file);
if ($i>=$config_maxpostchat) {
$fp=fopen(BASEDIR."zabor/temps/base.dat","w");
flock ($fp,LOCK_EX);
unset($file[0],$file[1],$file[2],$file[3],$file[4]);
fputs($fp, implode("",$file));
flock ($fp,LOCK_UN);
fclose($fp);}


//--------------------------------------------------------//


$file = file(BASEDIR."zabor/temps/base.dat");
$file = array_reverse($file);
$total = count($file);    

if($total<1){echo'<img src="../images/img/reload.gif" alt=""> <b>Сообщений нет, будь первым!</b><br>';}
$start=0;
//$start = (int)$_GET['start'];
if($start < 0 || $start > $total){$start = 0;}
if ($total < $start +5){ $end = $total; }
else {$end = $start + 5; }


for ($i = $start; $i < $end; $i++){

$data = explode("|",$file[$i]);

$data[0]=bb_code($data[0]);


echo '<div class="b"><b>'.nickname($data[1]).' </a></b>   <small> ('.date_fixed($data[3]).')   </small></div>';

echo ''.$data[0].'';
if ($dostup==101 || $dostup==102 || $dostup==103 || $dostup==105){
echo '<a href="index.php?action=del&rd='.($total-$i-1).'"> <font color="red"> [Del]</font></a> ';
}
echo '<br><div class="a">'; 
echo '</div>';
//echo '<font color="#CC00CC"><small>('.$data[4].', '.$data[5].')</small></font></div>';

}


echo '<a href="../zabor/say.php?'.SID.'">Нацарапать на заборе</a> <br>';
echo '<div class="a"></div>';   


}

//////////////////////
if ($action=="del") {
if ($dostup==101 || $dostup==102 || $dostup==103 || $dostup==105){

if (isset($rd))  {
$file=file(BASEDIR."zabor/temps/base.dat");	
$fp=fopen(BASEDIR."zabor/temps/base.dat","w");
flock ($fp,LOCK_EX);
for ($i=0;$i< sizeof($file);$i++) { if ($i==$rd) {unset($file[$i]);} }
fputs($fp, implode($file));
flock ($fp,LOCK_UN);
fclose($fp);
}
header ("Location: index.php?isset=delpriv&".SID);	


}}




?>