File size: 7.98Kb
<?php
// by Mike O. (mides), coolcms.mobi
$title = 'Информация, FAQ';
require_once 'system/sys.php';
require_once 'system/cache.php';
require_once 'system/header.php';
switch ($act) {
default:
tp($lang['info']);
echo '<a href="index.php?act=faq">'.$lang['faq'].'</a><br />';
echo '<a href="index.php?act=terms">'.$lang['terms'].'</a><br />';
echo '<a href="?act=stat">Общая статистика</a><br />';
echo '<a href="?act=bb">'.$lang['bb_codes'].'</a><br />';
echo '<a href="?act=smiles">'.$lang['smiley_faces'].'</a><br />';
echo '<a href="?act=users">'.$lang['users'].'</a> '.stats_users().'<br />';
echo '<a href="?act=newcomers">Новички</a> ('.stats_newcomers().')<br />';
echo '<a href="?act=admins">Администрация</a> ('.stats_admins().')<br />';
echo '<a href="?act=styles">Популярные стили</a><br />';
nav_main();
break;
case 'stat':
tp('Статистика сайта');
echo stats_site();
nav('?');
break;
case 'styles':
tp('Популярные стили');
if ($u['id']){
echo 'Ваш стиль: <b>'.$u['style'].'</b><br /><br />';
}
$styles_r = mysql_query("SELECT COUNT(`style`) AS `used_by`, `style` FROM `users` GROUP BY `style` ORDER BY `used_by` DESC");
while ($style = mysql_fetch_assoc($styles_r)) {
$link = empty($u['id']) ? $style['style'] : '<a href="?act=styles&st='.$style['style'].'">'.$style['style'].'</a>';
echo '<div class="main">'.$link.' - '.$style['used_by'].' чел.</div>';
}
if ($u['id']) {
if (isset($_GET['st'])) {
$st = check($_GET['st']);
if (file_exists('inc/styles/'.$st.'/style.css')) {
mysql_query("UPDATE `users` SET `style` = '$st' WHERE `id` = '$u[id]'");
redirect('?act=styles');
}
}
}
nav('?');
break;
case 'newcomers':
tp('Новички');
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users` WHERE `regtime` > '".(time()- 86400 * 3)."'"), 0);
if ($total > 0) {
$pages = ceil($total / $config['onpage']);
if ($page > $pages or $page == 0) {
$page = 1;
}
$begin = ($page - 1) * $config['onpage'];
$usersnew_r = mysql_query("SELECT `id`, `regtime` FROM `users` WHERE `regtime` > '".(time()- 86400 * 3)."' ORDER BY `regtime` DESC LIMIT $begin, $config[onpage]");
while ($usernew = mysql_fetch_assoc($usersnew_r)) {
echo '<a href="profile.php?id='.$usernew['id'].'">'.username($usernew['id']).'</a> (рег.: '.ccdate($usernew['regtime'], 0).')<br />';
}
navig($page, '?act=newcomers&', $pages);
} else {
echo 'Новичков нет';
}
nav('?');
break;
case 'admins':
tp('Администрация ('.stats_admins().')');
$admin_r = mysql_query("SELECT `id`, `username` FROM `users` WHERE `access` > 0 ORDER BY `access` DESC");
while ($admin = mysql_fetch_assoc($admin_r)) {
echo '<a href="profile.php?id='.$admin['id'].'">'.$admin['username'].'</a> ('.access2($admin['id']).')<br />';
}
if ($u['id']) {
echo '<br /><b>Написать в приват</b><br /><form name="form" action="main.php?act=send&ok=1" method="post" name="form"><select name="username">';
$admin_pm_r = mysql_query("SELECT `id`, `username` FROM `users` WHERE `access` > 0 ORDER BY `access` DESC");
while ($admin_pm = mysql_fetch_assoc($admin_pm_r)) {
echo '<option value="'.$admin_pm['username'].'">'.$admin_pm['username'].'</option>';
}
echo '</select><br />
Сообщение(max250):<br />
<textarea name="text" cols="" rows="4"></textarea><br />
<input name="submit" type="submit" value="Ok" />
</form>';
}
nav('?');
break;
case 'bb':
tp($lang['bb_codes']);
echo '[red]'.bb('[red]'.$lang['red_font'].'[/red]').'[/red]<br />
[blue]'.bb('[blue]'.$lang['blue_font'].'[/blue]').'[/blue]<br />
[black]'.bb('[black]'.$lang['black_font'].'[/black]').'[/black]<br />
[green]'.bb('[green]'.$lang['green_font'].'[/green]').'[/green]<br />
[orange]'.bb('[orange]'.$lang['orange_font'].'[/orange]').'[/orange]<br />
[pink]'.bb('[pink]'.$lang['pink_font'].'т[/pink]').'[/pink]<br />
[gray]'.bb('[gray]'.$lang['gray_font'].'[/gray]').'[/gray]<br />
[big]'.bb('[big]'.$lang['big_font'].'[/big]').'[/big]<br />
[small]'.bb('[small]'.$lang['small_font'].'[/small]').'[/small]<br />
[b]'.bb('[b]'.$lang['bold_font'].'[/b]').'[/b]<br />
[u]'.bb('[u]'.$lang['underline_font'].'[/u]').'[/u]<br />
[i]'.bb('[i]'.$lang['incline_font'].'[/i]').'[/i]<br />
[strike]'.bb('[strike]'.$lang['strike_font'].'[/strike]').'[/strike]<br /><br />
'.$lang['link_with_a_name'].': [url=http://'.$lang['link'].']'.$lang['name'].'[/url]';
nav('?');
break;
case 'smiles':
echo '<div class="title">'.$lang['smiley_faces'].'</div><div class="list">';
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `smiles`"), 0);
$pages = ceil($total / $config['onpage']);
if ($page > $pages or $page == 0) {
$page = 1;
}
$begin = ($page - 1) * $config['onpage'];
$smiles_r = mysql_query("SELECT * FROM `smiles` ORDER BY `id` DESC LIMIT $begin, $config[onpage]");
while ($smile = mysql_fetch_assoc($smiles_r)) {
if (!isset($num) ) $num = 1;
$num++;
$row_class = (!($num % 2)) ? 'row1' : 'row2';
echo '<div class="'.$row_class.'">'.bb($smile['code']).' '.$smile['code'].'</div>';
}
navig($page, '?act=smiles&', $pages);
nav('?');
break;
case 'users':
tp($lang['users'].' '.stats_users());
note();
echo '<form name="form" action="?act=search" method="post" name="form">
<input name="username" type="text" maxlength="12" size="10" />
<input name="submit" type="submit" value="Найти" />
</form><br />';
$total = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users`"), 0);
$pages = ceil($total / $config['onpage']);
if ($page > $pages or $page == 0) {
$page = 1;
}
$begin = ($page - 1) * $config['onpage'];
$users_r = mysql_query("SELECT `id`, `karma` FROM `users` ORDER BY `karma` DESC LIMIT $begin, $config[onpage]");
while ($user = mysql_fetch_assoc($users_r)) {
echo '<a href="profile.php?id='.$user['id'].'">'.login($user['id']).'</a> ('.$user['karma'].')<br />';
}
navig($page, '?act=users&', $pages);
nav('?');
break;
case 'search':
if ($ok) {
$id = empty($_POST['username']) ? 0 : abs(intval($_POST['username']));
redirect('profile.php?id='.$id);
} else {
if (!empty($_POST['username'])) {
$username = check($_POST['username']);
$users_r = mysql_query("SELECT `id`, `username` FROM `users` WHERE `username` LIKE '%$username%'");
if (mysql_num_rows($users_r)) {
tp('Результат поиска');
echo '<form name="form" action="?act=search&ok=1" method="post" name="form"><select name="username">';
while ($user = mysql_fetch_assoc($users_r)) {
echo '<option value="'.$user['id'].'">'.$user['username'].'</option>';
}
echo '</select><br />
<input name="submit" type="submit" value="Okay" />
</form>';
nav('?act=users');
} else {
$_SESSION['note'] = 'Ничего не найдено.';
redirect('?act=users');
}
} else {
redirect('?act=users');
}
}
break;
}
require_once 'system/tail.php';
?>