<?php
define('_IN_JOHNCMS', 1);
$headmod = 'users';
require('../incfiles/core.php');

/*
-----------------------------------------------------------------
Закрываем от неавторизованных юзеров
-----------------------------------------------------------------
*/
if (!$user_id && !$set['active']) {
    require('../incfiles/head.php');
    echo functions::display_error($lng['access_guest_forbidden']);
    require('../incfiles/end.php');
    exit;
}

/*
-----------------------------------------------------------------
Переключаем режимы работы
-----------------------------------------------------------------
*/
$array = array(
    'admlist'  => 'includes',
    'birth'    => 'includes',
    'online'   => 'includes',
    'search'   => 'includes',
    'top'      => 'includes',
    'userlist' => 'includes'
);
$path = !empty($array[$act]) ? $array[$act] . '/' : '';
if (array_key_exists($act, $array) && file_exists($path . $act . '.php')) {
    require_once($path . $act . '.php');
} else {
    /*
    -----------------------------------------------------------------
    Актив сайта
    -----------------------------------------------------------------
    */
    $textl = $lng['community'];
    require('../incfiles/head.php');
    $brth = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `dayb` = '" . date('j', time()) . "' AND `monthb` = '" . date('n', time()) . "' AND `preg` = '1'"), 0);
    $count_adm = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `rights` > 0"), 0);
    echo '<div class="phdr"><b>' . $lng['community'] . '</b></div>' .
        '<div class="list1"><img src="../images/search.png" width="16" height="16" class="left" />&#160;<a href="search.php">' . $lng['search_user'] . '</a></div>' .
        '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="index.php?act=userlist">' . $lng['users'] . '</a> (' . counters::users() . ')</div>' .
        '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="index.php?act=admlist">' . $lng['administration'] . '</a> (' . $count_adm . ')</div>' .
        ($brth
            ? '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="index.php?act=birth">' . $lng['birthday_men'] . '</a> (' . $brth . ')</div>'
            : '') .
        '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="album.php">' . $lng['photo_albums'] . '</a> (' . counters::album() . ')</div>' .
        '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="index.php?act=top">' . $lng['users_top'] . '</a></div>' .
      '<div class="menu"><img src="../theme/' . $set_user['skin'] . '/images/li.png" alt="*"/><a href="index.php?act=online">Кто на сайте</a></div>' .
        '<div class="phdr"><a href="index.php">' . $lng['back'] . '</a></div>';
}

require_once('../incfiles/end.php');