Файл: users.php
Строк: 64
<?php
define('CMS',TRUE);
require('core/inc.php');
$id = !empty($_GET['id']) ? num($_GET['id']) : 0;
$mod = !empty($_GET['m']) ? check($_GET['m']) : '';
$page = !empty($_GET['page']) ? num($_GET['page']) : 1;
$user_id = !empty($_GET['user_id']) ? num($_GET['user_id']) : 0;
# Путь к папке с фото
if (!defined('USERS_PHOTOS_DIR')) define('USERS_PHOTOS_DIR', ROOT . 'upload/photos/');
# Отключили рекламу для юзеров
define('EMPTY_ADS',TRUE);
# Кеширование списка стран
$countries = get_vars('country');
if (!$countries || !is_array($countries)) {
$countries = array();
$rows = $db->select("SELECT `tld`,`name` FROM ?_country ORDER BY `name` ASC;");
foreach($rows as $row) $countries[$row['tld']] = $row['name'];
set_vars('country', $countries);
}
# Кеширование статических страниц
$static_pages = get_vars('static_pages');
if (!$static_pages || !is_array($static_pages)) {
$rows = $db->select( "SELECT `name`,`title` FROM ?_pages WHERE `active` = '1' ORDER BY `views` DESC, `id` DESC;" );
$static_pages = array();
if (!empty($rows)) {
foreach( $rows as $row ) {
$static_pages[$row['name']] = $row['title'];
}
}
set_vars('static_pages', $static_pages);
}
# Проверка пользователей на бан и подтверждение реги
if ($is_logged) {
if (!empty($uset['users_ban'])) {
redirect($config['ban'] . DS . gen_uri('ban', '', RND));
}
if ($config['allow_regkeys'] > 0 && $uset['users_confirmreg'] > 0 && empty($uset['users_ban'])) {
redirect($config['home'] . DS . gen_uri('key', '', RND));
}
}
switch($mod):
case 'account':
include( MODULES_PATH . 'users_account.php' );
break;
case 'anketa':
include( MODULES_PATH . 'users_anketa.php' );
break;
case 'avatars': case 'buy_avatars': case 'upload_avatars':
include( MODULES_PATH . 'users_avatars.php' );
break;
case 'blogs':
include( MODULES_PATH . 'users_blogs.php' );
break;
case 'dialog':
include( MODULES_PATH . 'users_dialog.php' );
break;
case 'logs':
include( MODULES_PATH . 'users_logs.php' );
break;
case 'nick': case 'nick_color':
include( MODULES_PATH . 'users_nick.php' );
break;
case 'privat': case 'inbox': case 'outbox': case 'trash': case 'add_privat': case 'spam_privat': case 'history':
include( MODULES_PATH . 'users_privat.php' );
break;
case 'profil':
include( MODULES_PATH . 'users_profil.php' );
break;
case 'setting':
include( MODULES_PATH . 'users_setting.php' );
break;
case 'rating':
include( MODULES_PATH . 'users_rating.php' );
break;
case 'rating_history':
include( MODULES_PATH . 'users_ratingh.php' );
break;
case 'wall':
include( MODULES_PATH . 'users_wall.php' );
break;
default: case 'index':
include( MODULES_PATH . 'users_index.php' );
break;
endswitch;
show_footer();
?>