View file chat/enter.php

File size: 3.97Kb
<?php
include "./header.php";
//ўЄ«оз Ґ¬ д ©« Є®­дЁЈга жЁЁ
include "./ini.php";
print '<card title="'.$lang['holl'].'">'.
'<p align="center">';
//Ґб«Ё ­Ґ ЇҐаҐ¤ « «®ЈЁ­, г§­ Ґ¬ Ё¤ Ё§ Ў §л
if(!empty($login))
$q = @mysql_query("select `id` from `".$px.$utable."` where `login`='".$login."';");
if(empty($id)) {
//§ Їа®б ў ¬ ббЁў
$data = @mysql_fetch_array($q);
//Ё¤ Ї®«м§®ў вҐ«п
$id = $data['id']; 
}
// ўв®аЁ§ жЁп
$login = autorize();
if($login) {
	if(!$login['ip']) { @mysql_query("update `".$px.$utable."` set `ip`='".getenv(REMOTE_ADDR)."' where `id`='".$id."';"); }
	if(!$login['soft']) { @mysql_query("update `".$px.$utable."` set `soft`='".getenv(HTTP_USER_AGENT)."' where `id`='".$id."';"); }
	//гбв ­ ў«Ёў Ґ¬ а §¬Ґа иаЁдв 
	if($login['fsize'] == "small") { $fsize1 = "<small>"; $fsize2 = "</small>"; }
	elseif($login['fsize'] == "big") { $fsize1 = "<big>"; $fsize2 = "</big>"; }
	else { $fsize1 = ""; $fsize2 = ""; }
	print $fsize1;
	ustatus();	//®Ў­®ў«пҐ¬ бв вгбл
	@mysql_query("update `".$px.$utable."` set `ltime`='".time()."', `room`='$room' where `id`='".$id."';");
	$q_letters_in = @mysql_query("select count(*) from `".$px.$ltable."` where `to_user`='".$login['login']."' and `new`=1;");
	$num_in=@mysql_fetch_array($q_letters_in);	//г§­ Ґ¬ Є®«ЁзҐбвў® ўе®¤пйЁе ­®ўле ЇЁбҐ¬
	$q_letters_in_all = @mysql_query("select count(*) from `".$px.$ltable."` where `to_user`='".$login['login']."'");
	$num_in_all=@mysql_fetch_array($q_letters_in_all);	//г§­ Ґ¬ Є®«ЁзҐбвў® ўе®¤пйЁе ЇЁбҐ¬
	//Ґб«Ё Ї®«м§®ў вҐ«м  ¤¬Ё­
	if($login['admin']) print "<a href=\"./admin.php?id=$id&amp;pass=$pass\">".$lang['admining']."</a><br/>$divide";
	//Ґб«Ё Ї®«м§®ў вҐ«м ¬®¤Ґа
	if($login['moder']) print "<a href=\"./moder.php?id=$id&amp;pass=$pass\">".$lang['modering']."</a><br/>$divide";
	///////////////////////////////////////////////////////
	$q_num_meets = @mysql_query("select count(*) from `".$px.$meettable."` where 1");
	$num_meets=@mysql_fetch_array($q_num_meets);	//г§­ Ґ¬ Є®«ЁзҐбвў® ўбваҐз
	//print '<b><a href="new.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['marryed'].'</a></b><br/>';
	print '<a href="./letters/index.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['letters'].'('.$num_in['count(*)'].'/'.$num_in_all['count(*)'].')</a><br/>'.
	'<a href="./meets.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['meets'].'('.$num_meets['count(*)'].')</a><br/>'.
	'<a href="./search.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['search'].'</a><br/>'.
	'<a href="./online.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['who_online'].'</a><br/>'.
	$divide;
	//Є®¤ ўлў®¤  ббл«®Є ­  Є®¬­ вл
	$q = @mysql_query("select `var`,`val1` from `".$px.$stable."` where `mod`='room' order by val3;");
	//ў жЁЄ«Ґ ЇҐз в Ґ¬ ббл«ЄЁ
	while($droom = @mysql_fetch_array($q)) {
		$q_count = @mysql_query("SELECT count(*) FROM `".$px.$utable."` WHERE `ltime`>'".intval(time()-$offline)."' AND `room`='".$droom['var']."';");
		$dcount = @mysql_fetch_array($q_count);
		print '<a href="room.php?id='.$id.'&amp;pass='.$pass.'&amp;room='.$droom['var'].'">'.$droom['val1'].'('.$dcount['count(*)'].')</a><br/>';
	}
	print $divide.
	'<a href="./statistic.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['stats'].'</a><br/>'.
	'<a href="./help.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['help'].'</a><br/>'.
	'<a href="./ignor.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['ignor'].'</a><br/>'.
	'<a href="./setup.php?id=$id&amp;id='.$id.'&amp;pass='.$pass.'">'.$lang['settings'].'</a><br/>'.
	'<a href="./profile.php?id='.$id.'&amp;pass='.$pass.'">'.$lang['profile'].'</a><br/>'.
	$divide.
	'<a href="/">'.$lang['main'].'</a>';
	//§ Їа®б ­  Є®«ЁзҐбвў® ®­« ©­ ў ЇаЁе®¦Ґ©
	$pr_count = @mysql_query("SELECT count(*) FROM `".$px.$utable."` WHERE ltime>'".intval(time()-$offline)."' AND room='';");	
	//ЇЁе Ґ¬ ў ¬ ббЁў
	$pdc = @mysql_fetch_array($pr_count);
	//ўлў®¤Ё¬ ў Ўа г§Ґа
	print '<br/>'.$lang['people_in_holl'].': '.$pdc['count(*)'].'<br/>';
	print $fsize2;
} else { print $lang['not_loged']; }

print '</p>'.
'</card>'.
'</wml>';
@mysql_close();
?>