<?php

if (isset($pagination) && $pagination['total_pages'] > 1) {
    //$vURL = GetPOSTorGETValue('_url');
    //$vURLWithPage = $vURL.'/?page=';
    $vURL = GetURLPath();
    //$vURLWithPage = $vURL.'?page=';
    $vURLArgs = GetURLArguments(array('page'));
    if (isset($pagination['urladdargs']) && !empty($pagination['urladdargs'])) {
        if (empty($vURLArgs)) {
            $vURLArgs = $pagination['urladdargs'];
        } else {
            $vURLArgs = $vURLArgs . '&' . $pagination['urladdargs'];
        }
    }
    if (empty($vURLArgs)) {
        $vURLWithPage = $vURL . '?page=';
    } else {
        $vURLWithPage = $vURL . '?' . $vURLArgs . '&page=';
    }
    echo '<div class="mypagination"><ul style="display: inline; padding: 0;">';
    // <li class="first"><a href="< ?php echo ($pagination['current'] == 1) ? '#' : $vURLWithPage.'1'; ? >"><<</a></li>
    if ($pagination['current'] == 1) {
        echo '<li class="prev isdisabled"><a>< Пред.</a></li>';
    } else {
        echo '<li class="prev"><a href="' . $vURLWithPage . ($pagination['current'] - 1) . '">< Пред.</a></li>';
    }
    if ($pagination['total_pages'] <= 7) {
        for ($i = 1; $i <= $pagination['total_pages']; $i++) {
            $ActiveClass = $i == $pagination['current'] ? "active" : "normal";
            echo '<li class="' . $ActiveClass . '"><a href="' . $vURLWithPage . $i . '">' . $i . '</a></li>';
Beispiel #2
0
<?php

try {
    ini_set('display_errors', 1);
    error_reporting(E_ALL & ~E_NOTICE);
    session_start();
    define('PATH_SITE_ROOT', __DIR__ . '/');
    require_once 'config.php';
    require_once 'connection.php';
    require_once 'core/global.php';
    InitDebugLog();
    GetUnknownUserGUID();
    // Создание GUID для каждого пользователя и сохранение его в cookies (для идентификации незалогинившихся пользователей)
    $context = new stdClass();
    $path = explode('/', GetURLPath());
    if (!empty($path[1]) && strtolower($path[1]) == 'index.php') {
        array_splice($path, 1, 1);
    }
    //AddDebugLog('Start block 1');
    // Основная база данных проекта
    $context->db = GetMainConnection();
    //AddDebugLog('Start block 2');
    // Register files
    require_once DIR_CORE . 'Model.php';
    require_once DIR_CORE . 'View.php';
    require_once DIR_CORE . 'Controller.php';
    require_once DIR_CORE . 'Tools.php';
    //AddDebugLog('Start block 3');
    /*if (DIR_MODELS != null && is_dir(DIR_MODELS)) {
            $dir = opendir(DIR_MODELS);