Файл: muzxit.ru/qchat/index.php
Строк: 77
<?php
define('_IN_JOHNCMS', 1);
$rootpath = '../';
$textl = 'Suhbatxona';
require_once ('../incfiles/core.php');
require_once ('../incfiles/head.php');
if (!$user_id) {
echo functions::display_error($lng['access_guest_forbidden']);
require('../incfiles/end.php');
exit;
}else{
$array = array (
'new' => '',
'del' => '',
'clean' => ''
);
$path = !empty($array[$act]) ? $array[$act] . '/' : '';
if (array_key_exists($act, $array) && file_exists($path . $act . '.php')) {
require_once($path . $act . '.php');
}else{
echo '<div class="phdr">Suhbatxona</div><div class="gmenu"><form action="?" method="post"><input type="submit" value="Yangilash" /></form><br /><form name="form" action="index.php?act=new" method="POST">';
if (!$is_mobile) echo bbcode::auto_bb('form', 'msg');
echo '<textarea rows="' . $set_user['field_h'] . '" name="msg"></textarea><br /><input type="submit" name="submit" value="Xabar qoldirish" /></form></div>';
$total = @mysql_result(mysql_query("SELECT COUNT(*) FROM `qchat`"), 0);
if ($total < 1){
echo '<div class="menu">Xozircha Suhbatxonada xabarlar yo'q. Sen birinchi bo'l !!!</div>';
}else{
if ($total > $kmess) echo '<div class="topmenu">' . functions::display_pagination('index.php?', $start, $total, $kmess) . '</div>';
$res = mysql_query("SELECT * FROM `qchat` ORDER BY `time` DESC LIMIT $start,$kmess");
$i=0;
while ($arr=mysql_fetch_array($res)){
$avtor=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='" . $arr['avtor'] . "'"));
echo $i % 2 ? '<div class="list1">' : '<div class="list2">';
$text=functions::checkout($arr['msg'], 2, 1);
if ($set_user['smileys'])
$text = functions::smileys($text, $rights > 1 ? 1 : 0);
$on = time() > $avtor['lastdate'] + 300 ? '<span class="red"> [ OFF ] </span>' : '<span class="green"> [ ON ] </span>';
$new = $avtor['datereg'] > time() - 86400 ? '_new' : '';
$sex = $avtor['sex'] == 'm' ? 'm' : 'w';
$rank = array(
0 => '',
1 => '(GMod)',
2 => '(CMod)',
3 => '(FMod)',
4 => '(DMod)',
5 => '(LMod)',
6 => '(Smd)',
7 => '(Adm)',
9 => '(SV!)'
);
echo '<img src="' . $set['homeurl'] . '/theme/' . $set_user['skin'] . '/images/' . $sex . $new . '.png" width="16" height="16" align="middle" alt="' . ($avtor['sex'] == 'm' ? 'М' : 'Ж') . '" /> <b><a href="../users/profile.php?user=' . $arr['avtor'] . '">' . $avtor['name'] . '</a></b> ' . $rank[$avtor['rights']] . $on . '<span class="gray">(' . functions::display_date($arr['time']) . ')</span> ';
if ($user_id != $arr['avtor']) echo ' <a href="index.php?act=new&' . $arr['id'] . '"> [отв] </a>';
echo '<br />' . $text;
if ($rights >= 6) echo '<br /><a href="index.php?act=del&id=' . $arr['id'] . '">O'chirish</a>';
echo'</div>';
$i++;
}
echo '<div class="phdr">Barchasi : ' . $total . '</div>';
if ($total > $kmess) echo '<div class="topmenu">' . functions::display_pagination('index.php?', $start, $total, $kmess) . '</div>';
if ($rights > 8) echo '<div class="menu"><a href="index.php?act=clean">Очистить мини чат</a></div>';
}
require_once ('../incfiles/end.php');
}}