Пример #1
0
<?php

require 'classes/core.php';
empty($_GET['page']) ? $page = 1 : ($page = (int) $_GET['page']);
$title = ' - Пользователи';
$rss_link = 'rss';
require 'header.php';
$templatesC = new templates();
$templatesC->set_theme($uinfo['theme']);
$templatesC->set_file('users.tpl');
$templatesC->draw('top');
$users_on_page = 20;
$users_count = $usersC->get_users_count();
$pages_count = ceil($users_count / $users_on_page);
$pages_count > 1 ? $begin = $users_on_page * ($page - 1) : ($begin = 0);
if ($pages_count > 1) {
    if ($page > 1) {
        $pg = $page - 1;
        $pages = $pages . '<a href="users_page_1" title="В начало">←</a>&nbsp;';
        $pages = $pages . '<a href="users_page_' . $pg . '" title="Назад">≪</a>&nbsp;';
    }
    if ($pages_count > 10) {
        if ($page < 5) {
            $start_page = 1;
        } else {
            $start_page = $page - 4;
        }
        if ($page > $pages_count - 4) {
            $end_page = $pages_count;
        } else {
            $end_page = $page + 4;