View file wap-meet/index.php

File size: 3.5Kb
<?php
require_once('system/config.php');
require_once('system/functions.php');

echo head();

/* Реклама
$q = mysql_query("SELECT * FROM `reclam` ORDER BY `rid` ASC LIMIT 5");
echo '<div class="rekl">';
if ( mysql_num_rows($q) < 1 ) {
	echo 'Рекламных площадок <b>нет</b>.';
} else {
	while($url = mysql_fetch_assoc($q)) {
		echo '&#187; <a href="' . htmlentities($url['link']) . '">' . htmlentities($url['title']) . '</a><br />';
	}
}
*/
echo '</div>';

// Основной контент
if ($is_logged) {
	echo '<div class="menu2">Привет, <b>' . htmlentities($user_data['login']) . '</b>!</div>
<div class="menu">
&#187; Мой статус: <b>' . $user_data['status'] . '</b> [<a href="' . $config['site']['home'] .'profile.php?action=status">Изменить</a>]<br />
&#187; Авторитет: <span style="color:green"><b>' . $user_data['plus'] . '</b></span> / <span style="color:red"><b>' . $user_data['minus'] . '</b></span><br />
&#187; Счет: <b>' . $user_data['money'] . '</b> руб. [<a href="' . $config['site']['home'] .'money.php">Пополнить</a>]<br />
&#187; Анкета: [<a href="' . $config['site']['home'] .'users.php?action=info&amp;id=' . $user_data['user_id'] . '">См.</a> | <a href="' . $config['site']['home'] .'profile.php?action=edit">Изм.</a>]<br />';

	$mail = mysql_result(mysql_query("SELECT COUNT(*) FROM `mail` WHERE `mail_for` = '" . $user_data['login'] . "' "), 0);
	/* TODO: Написать функционал друзей и игнор листа
	$friends = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user` = '" . $user_data['user_id'] . "' "), 0);
	$ignor = mysql_result(mysql_query("SELECT COUNT(*) FROM `ignor` WHERE `user` = '" . $user_data['user_id'] ."' "), 0);
	echo '&#187; <a href="' . $config['site']['home'] .'friends.php">Друзья</a>[' . $friends . ']<br />';
	echo '&#187; <a href="' . $config['site']['home'] .'ignor.php">Список игнора</a>[' . $ignor . ']<br />
	*/
	echo '&#187; <a href="' . $config['site']['home'] .'mail.php">Сообщения</a> [' . $mail . ']<br />
&#187; <a href="' . $config['site']['home'] .'chat.php">Прямой эфир</a><br />
&#187; <a href="' . $config['site']['home'] .'search.php">Поиск</a><br />
&#187; <a href="' . $config['site']['home'] .'profile.php?action=exit">Выход</a></div>';
} else {
	echo '<div class="menu2">Привет, Гость: <a href="' . $config['site']['home'] .'auth.php">Вход</a> | <a href="' . $config['site']['home'] .'reg.php">Регистрация</a></div>';
}

$news = mysql_fetch_assoc(mysql_query("SELECT * FROM `news` ORDER BY `nid` LIMIT 1"));
$users = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0);
$new = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `reg_time` > '" . ($_SERVER['REQUEST_TIME'] - 60 * 24 * 7) . "' "), 0);
$men = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex` = '0' "), 0);
$women = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `sex` = '1' "), 0);
echo '<div class="menu">
&#187; <a href="' . $config['site']['home'] .'news.php">Новости</a> [' . ($news ? date('d.m.Y в H:i', $news['time']) : 'Нет') . ']<br />
&#187; <a href="' . $config['site']['home'] .'users.php?action=top">ТОР 10</a><br />
С нами уже: <b>' . $users . ' ' . ($new ? '<span style="color: red">+' . $new . '</span>' : '').'</b><br />
Парней: <b>'.($men ? $men : 'Нет').'</b> Девушек: <b>'.($women ? $women : 'Нет').'</b><br /></div>';
echo foot();