<?
ob_start();
require'sys/head.php';
require'sys/conf.php';
require'sys/sess.php';
?></div><div class="knews"><?echo'<a href="game.php?der='.$key.'">В страну</a>';
echo'<a href="smil.php?der='.$key.'">|Смайлы</a>';echo'<a href="us.php?der='.$key.'">|УС</a><br/>';
 if(!empty($_GET['make'])){$make = $_GET['make'];} else {$make= '';}
 switch($make){
default:
?><div class="knews"><?
echo'<FORM ACTION="ass.php?der='.$key.'&make=2" METHOD="POST">';?>
Сообщение<br/><input type="text" name="mess" maxlength="1000"><br/>
<input type="checkbox" name="tran" value="1" >транслит<br/>
<input type="submit"   value="Написать"></FORM><br/>
</div><div class="knews"><?
///////////////////////////////////////////////////////////////
/////////*подсчёт
$ps1=file('hk777.txt');$p9 = explode("|",$ps1[0]);
$ps2=count($ps1,$p9[8]!=1 and $p9[6]==$re1[strana] or $p9[7]==$re1[strana]);
$ps3=$re0[n4];
$ps4=ceil($ps2/$ps3);
/////////*вывод
if(empty($_GET[s])){$ps5=1;}else{$ps5=(int)$_GET[s];}
$ps6=($ps2-1)-(($ps5-1)*$ps3);$ps7=$ps6-$ps3;if(!empty($_GET[s])){$r=$ps3*($_GET[s]-1);}else{$r=0;}
for(;$ps7<$ps6 && $ps6>=0;$ps6--){$r++;$ps9 = explode("|",$ps1[$ps6]);$pp=$ps2-$r;
$mod=mysql_fetch_array(mysql_query("SELECT status,ignor FROM users WHERE login=(SELECT login FROM gos WHERE strana ='$ps9[2]')"));
if($mod[status]>0){
if($re0[tema]==1){$strana="<u>$ps9[2]</u>";}
if($re0[tema]==2){$strana="<font color=darkorange>$ps9[2]</font>";}
if($re0[tema]==3){$strana="<font color=darkorange>$ps9[2]</font>";}
if($re0[tema]==4){$strana="<font color=purple>$ps9[2]</font>";}
if($re0[tema]==5){$strana="<font color=darkorange>$ps9[2]</font>";}
}else{$strana=$ps9[2];}
if($re0[status]>0){$adm='<a href="ass.php?make=4&w='.$pp.'&der='.$key.'">[<b>+</b>]</a>';}else{$adm="";}
if($re0[status]==1 or $re0[status]==2){$del="<a href=ass.php?make=3&w=$pp&der=$key>[<b>-</b>]</a>";}else{$del="";}
$ank='<a href="anket.php?der='.$key.'&f='.$ps9[2].'">[<b>?</b>]</a>';$send="<a href='ass.php?make=1&der=$key&n=$ps9[2]'>>></a>";
///////////////////////////////////////////////////////
$v[] = 'эта цива лучше всех!';
$v[] = 'спасибо админу за эту игру!';
$v[] = 'люблю модеров!';
srand ((double) microtime()*1000000); 
$random_number = rand (0,count($v)-1); $c=($v[$random_number] );
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////
if($mod[ignor]==0){$text=$ps9[4];}else{$text=$c;}
if($ps9[3]==$re1[strana]){
if($re0[tema]==1){$text="<font color=brown>$text</font>";}
if($re0[tema]==2){$text="<font color=aqua>$text</font>";}
if($re0[tema]==3){$text="<font color=white>$text</font>";}
if($re0[tema]==4){$text="<font color=purple>$text</font>";}
if($re0[tema]==5){$text="<font color=yellow>$text</font>";}
}
if($ps9[8]==1 and $ps9[6]==$re1[strana] or $ps9[7]==$re1[strana]){
echo"<font color=red><b>(P!)</b></font>$adm [<b>$ps9[1]</b>]$ank($strana)$send<br/>$text$del<br/>-----<br/>";}else{
if($ps9[8]==0 or empty($ps9[8]) or $ps9[8]=''){echo"$adm [<b>$ps9[1]</b>]$ank($strana)$send<br/>$text$del<br/>-----<br/>";}

}}
///////////////////////////////////////////////////////////////
///////*навигация
if($_GET[s]>1){$ps8=$ps5-1;echo "<a href=ass.php?s=$ps8&der=$key><b> <<< </b></a>";}
if($ps4>$_GET[s]){$ps8=$ps5+1;echo "<a href=ass.php?s=$ps8&der=$key><b> >>> </b></a>";}
///
break;
case 4:
$ps1=file('hk777.txt');
$ps2=count($ps1);$ps9 = explode("|",$ps1[$_GET[w]]);
$mod1=mysql_fetch_array(mysql_query("SELECT strana,login FROM gos WHERE strana='$ps9[2]'"));
$mod2=mysql_fetch_array(mysql_query("SELECT status FROM users WHERE login='$mod1[login]'"));
if($mod2[status]==0){
qw("UPDATE users SET `ignor` ='1' WHERE login='$mod1[login]'");
$tim=time();$c=date("H");$d=date("i");$dd=$_GET[f];
$file = fopen('hk777.txt', 'a+');
fputs ($file,"|$c:$d|{ИнквизитоР}||$mod1[strana]  в игноре!|$tim||||\r\n"); 
fflush ($file); fclose ($file);
header("Location: ass.php?der=$key");
}else{
echo"НЕЛЬЗЯ давать игнор АДМИНИСТРАЦИИ";
}
break;
case 3:
if($re0[status]==1 or $re0[status]==2){
$num_stroka = $_GET[w]; //Удалим 1 строку из файла
$file = file("hk777.txt"); // Считываем весь файл в массив
for($i = 0; $i < sizeof($file); $i++)
if($i == $num_stroka) unset($file[$i]);
$fp = fopen("hk777.txt", "w");
fputs($fp, implode("", $file));
fclose($fp);
header("Location: ass.php?der=$key");
}else{
header("Location: ass.php?der=$key");
}
break;
case 1:
?><style type="text/css">
 .s_checkbox {width:20px; height:20px}
  </style><?
$a1=$_GET['n'];
$a=htmlspecialchars($a1);
echo'<FORM ACTION="ass.php?make=11&der='.$key.'&n='.$a1.'" METHOD="POST">';?>
Сообщение<br/> <INPUT TYPE='text' NAME='mess'VALUE="<?=$a;?>," size="35"><br>
<input type="checkbox" name="tran" value="1" class="s_checkbox">тран.
<input type="checkbox" name="priv" value="1" class="s_checkbox">прив.<br>
<INPUT TYPE='submit'VALUE='Написать'>
</FORM><br/><?
break;
case 11:
/////////////////////////////////////////////////////////////
$text=$_POST['mess'];$str=$re1[strana];$komu=$_GET[n];if(empty($str) or empty($text) or empty($komu)){header("Location: ass.php");echo"ZERO<br/>";}else{
function encode_html($str,$type='code'){
if($type=='code'){return htmlspecialchars($str,ENT_QUOTES);}
if($type=='encode'){
$trans=get_html_translation_table(HTML_ENTITIES,ENT_QUOTES);
$trans=array_flip($trans);;
return strtr($str, $trans);
}
}
$text=encode_html($text);$c=date("H");$d=date("i");
function translit($str)
{
$tr = array(
"A"=>"А","B"=>"Б","V"=>"В","G"=>"Г",
"D"=>"Д","E"=>"Е","J"=>"Ж","Z"=>"З","I"=>"И",
"Y"=>"Й","K"=>"К","L"=>"Л","M"=>"М","N"=>"Н",
"O"=>"О","P"=>"П","R"=>"Р","S"=>"С","T"=>"Т",
"U"=>"У","F"=>"Ф","H"=>"Х","C"=>"Ц","CH"=>"Ч",
"W"=>"Ш","SC"=>"Щ",";"=>"Ь","X"=>"Ы",";;"=>"Ъ",
"YE"=>"Э","YU"=>"Ю","YA"=>"Я","Q"=>"Ё","a"=>"а","b"=>"б",
"v"=>"в","g"=>"г","d"=>"д","e"=>"е","q"=>"ё","j"=>"ж",
"z"=>"з","i"=>"и","y"=>"й","k"=>"к","l"=>"л",
"m"=>"м","n"=>"н","o"=>"о","p"=>"п","r"=>"р",
"s"=>"с","t"=>"т","u"=>"у","f"=>"ф","h"=>"х",
"c"=>"ц","ch"=>"ч","w"=>"ш","sc"=>"щ",";"=>"ь",
"x"=>"ы",";;"=>"ъ","ye"=>"э","yu"=>"ю","ya"=>"я"
);
return strtr($str,$tr);
}
$ps1=file('hk777.txt');
$ps2=count($ps1);$ps9 = explode("|",$ps1[$ps2]);
if ($ps9[4] == $text){
header("Location: ass.php?der=$key");}else{
if($re0[ignor]==0){
header("Location: ass.php?der=$key&d=2");
require'sys/smiles.php';
///////////////*$text=smile($text);*//////
if($_POST['tran']==1){$text=translit($text);$text=smile($text);}else{$text=smile($text);}
if($_POST['priv']==1){$p1=$re1[strana];$p2=$komu;$p3=1;}else{$p1='';$p2='';$p3=0;}
$c=date("H");$d=date("i");
if(eregi("({CENS})",$text)){
$log = mysql_fetch_array(mysql_query("SELECT login FROM gos WHERE strana='$re1[strana]'"));
mysql_query("UPDATE users SET `ignor` ='1' WHERE login='$log[login]'");
$tim=time();$c=date("H");$d=date("i");$dd=$_GET[f];
$file = fopen('hk777.txt', 'a+');
fputs ($file,"|$c:$d|{ИнквизитоР}||$mod1[strana]  в игноре!|$tim||||\r\n"); 
fflush ($file); fclose ($file);
}else{
$tim=time();$c=date("H");$d=date("i");$dd=$_GET[f];
$file = fopen('hk777.txt', 'a+');
fputs ($file,"|$c:$d|$re1[strana]|$komu|$text|$tim|$p1|$p2|$p3|\r\n"); 
fflush ($file); fclose ($file);
}
}else{echo"Вы в игноре и не можете писать в ассамблее!<br/>";}
}
}
/////////////////////////////////////////////////////////////
break;
case 2:
$text=$_POST['mess'];$str=$re1[strana];if(empty($str) or empty($text)){header("Location: ass.php?der=$key");echo"ZERO<br/>";}else{
function encode_html($str,$type='code'){
if($type=='code'){return htmlspecialchars($str,ENT_QUOTES);}
if($type=='encode'){
$trans=get_html_translation_table(HTML_ENTITIES,ENT_QUOTES);
$trans=array_flip($trans);;
return strtr($str, $trans);
}
}
$text=encode_html($text);$c=date("H");$d=date("i");
function translit($str)
{
$tr = array(
"A"=>"А","B"=>"Б","V"=>"В","G"=>"Г",
"D"=>"Д","E"=>"Е","J"=>"Ж","Z"=>"З","I"=>"И",
"Y"=>"Й","K"=>"К","L"=>"Л","M"=>"М","N"=>"Н",
"O"=>"О","P"=>"П","R"=>"Р","S"=>"С","T"=>"Т",
"U"=>"У","F"=>"Ф","H"=>"Х","C"=>"Ц","CH"=>"Ч",
"W"=>"Ш","SC"=>"Щ",";"=>"Ь","X"=>"Ы",";;"=>"Ъ",
"YE"=>"Э","YU"=>"Ю","YA"=>"Я","Q"=>"Ё","a"=>"а","b"=>"б",
"v"=>"в","g"=>"г","d"=>"д","e"=>"е","q"=>"ё","j"=>"ж",
"z"=>"з","i"=>"и","y"=>"й","k"=>"к","l"=>"л",
"m"=>"м","n"=>"н","o"=>"о","p"=>"п","r"=>"р",
"s"=>"с","t"=>"т","u"=>"у","f"=>"ф","h"=>"х",
"c"=>"ц","ch"=>"ч","w"=>"ш","sc"=>"щ",";"=>"ь",
"x"=>"ы",";;"=>"ъ","ye"=>"э","yu"=>"ю","ya"=>"я"
);
return strtr($str,$tr);
}
$ps1=file('hk777.txt');
$ps2=count($ps1);$ps9 = explode("|",$ps1[$ps2]);
if ($ps9[4] == $text){
header("Location: ass.php?der=$key");}else{
if($re0[ignor]==0){
header("Location: ass.php?der=$key&d=2");
require'sys/smiles.php';
///////////////*$text=smile($text);*//////
if($_POST['tran']==1){$text=translit($text);$text=smile($text);}else{$text=smile($text);}
$c=date("H");$d=date("i");
if(eregi("({CENS})",$text)){
$log = mysql_fetch_array(mysql_query("SELECT login FROM gos WHERE strana='$re1[strana]'"));
mysql_query("UPDATE users SET `ignor` ='1' WHERE login='$log[login]'");
$tim=time();$c=date("H");$d=date("i");$dd=$_GET[f];
$file = fopen('hk777.txt', 'a+');
fputs ($file,"|$c:$d|{ИнквизитоР}||$mod1[strana]  в игноре!|$tim||||\r\n"); 
fflush ($file); fclose ($file);
}else{
$tim=time();$c=date("H");$d=date("i");$dd=$_GET[f];
$file = fopen('hk777.txt', 'a+');
fputs ($file,"|$c:$d|$re1[strana]||$text|$tim|||0|\r\n"); 
fflush ($file); fclose ($file);
}
}else{echo"Вы в игноре и не можете писать в ассамблее!<br/>";}
}
}
break;
}
echo'<br/><a href="game.php?der='.$key.'">В страну</a><br/>';
echo'</div><div class="knews"><a href="out.php?der='.$key.'">Выход</a><br/>';
require'sys/foot.php';
?>