Шаблон «XenForo White»

Шаблон «XenForo White» 1.0.0

Совместимость
требуется адаптация
Автор
ChihPyh, DarkMod
Общественное достояние
да
Описание: шаблон, являющийся аналогом стандартного шаблона XenForo (белый стиль).
Инструкция по установке
1) Загрузить файлы на сервер
2) Открываем config.php
Ищем:
PHP:
$bb_cfg['text_buttons']       = false;
Заменяем на:
PHP:
$bb_cfg['text_buttons']       = true;
Ищем:
PHP:
$bb_cfg['user_signature_start'] = '<div class="signature"><br />_________________<br />';
Заменяем на:
PHP:
$bb_cfg['user_signature_start'] = '<div class="signature">';
Ищем:
PHP:
$bb_cfg['show_rank_text']     = false;
$bb_cfg['show_rank_image']    = true;
Заменяем на:
PHP:
$bb_cfg['show_rank_text']     = true;
$bb_cfg['show_rank_image']    = false;
3) Открываем viewforum.php
Ищем:
PHP:
'DL_CLASS'         => isset($topic['dl_status']) ? $dl_link_css[$topic['dl_status']] : '',
После добавляем:
PHP:
'TOPIC_TIME'       => bb_date($topic['topic_time'], 'd M Y'),
'TOPIC_AVATAR'     => get_avatar($topic['first_user_avatar'], $topic['first_user_avatar_type'], !bf($topic['first_user_opt'], 'user_opt', 'allow_avatar'), 36, 36),
Ищем:
PHP:
u1.user_rank as first_user_rank,
После добавляем:
PHP:
u1.user_avatar AS first_user_avatar, u1.user_avatar_type AS first_user_avatar_type,
u1.user_opt AS first_user_opt,
4) Открываем templates/default/page_header.tpl
Ищем:
PHP:
<script type="text/javascript" src="{#BB_ROOT}misc/js/main.js?v={$bb_cfg['js_ver']}"></script>
После добавляем:
PHP:
<script type="text/javascript" src="{#BB_ROOT}misc/js/xenforo.js?v={$bb_cfg['js_ver']}"></script>
<script type="text/javascript" src="{#BB_ROOT}misc/js/discussion_list.js?v={$bb_cfg['js_ver']}"></script>
5) Открываем includes/functions.php
Ищем:
PHP:
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
{
    global $lang, $template;

// Pagination Mod
    $begin_end = 3;
    $from_middle = 1;
/*
    By default, $begin_end is 3, and $from_middle is 1, so on page 6 in a 12 page view, it will look like this:

    a, d = $begin_end = 3
    b, c = $from_middle = 1

"begin"        "middle"           "end"
    |              |                 |
    |     a     b  |  c     d        |
    |     |     |  |  |     |        |
    v     v     v  v  v     v        v
    1, 2, 3 ... 5, 6, 7 ... 10, 11, 12

    Change $begin_end and $from_middle to suit your needs appropriately
*/

    $total_pages = ceil($num_items/$per_page);

    if ( $total_pages == 1 || $num_items == 0 )
    {
        return '';
    }

    $on_page = floor($start_item / $per_page) + 1;

    $page_string = '';
    if ( $total_pages > ((2*($begin_end + $from_middle)) + 2) )
    {
        $init_page_max = ( $total_pages > $begin_end ) ? $begin_end : $total_pages;
        for($i = 1; $i < $init_page_max + 1; $i++)
        {
            $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
            if ( $i <  $init_page_max )
            {
                $page_string .= ", ";
            }
        }
        if ( $total_pages > $begin_end )
        {
            if ( $on_page > 1  && $on_page < $total_pages )
            {
                $page_string .= ( $on_page > ($begin_end + $from_middle + 1) ) ? ' ... ' : ', ';

                $init_page_min = ( $on_page > ($begin_end + $from_middle) ) ? $on_page : ($begin_end + $from_middle + 1);

                $init_page_max = ( $on_page < $total_pages - ($begin_end + $from_middle) ) ? $on_page : $total_pages - ($begin_end + $from_middle);

                for($i = $init_page_min - $from_middle; $i < $init_page_max + ($from_middle + 1); $i++)
                {
                    $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
                    if ( $i <  $init_page_max + $from_middle )
                    {
                        $page_string .= ', ';
                    }
                }
                $page_string .= ( $on_page < $total_pages - ($begin_end + $from_middle) ) ? ' ... ' : ', ';
            }
            else
            {
                $page_string .= '&nbsp;...&nbsp;';
            }
            for($i = $total_pages - ($begin_end - 1); $i < $total_pages + 1; $i++)
            {
                $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>'  : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
                if( $i <  $total_pages )
                {
                    $page_string .= ", ";
                }
            }
        }
    }
    else
    {
        for($i = 1; $i < $total_pages + 1; $i++)
        {
            $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
            if ( $i <  $total_pages )
            {
                $page_string .= ', ';
            }
        }
    }

    if ( $add_prevnext_text )
    {
        if ( $on_page > 1 )
        {
            $page_string = ' <a href="' . $base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) . '">' . $lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
        }

        if ( $on_page < $total_pages )
        {
            $page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ( $on_page * $per_page ) . '">' . $lang['NEXT'] . '</a>';
        }

    }

    $pagination = ($page_string) ? '<a class="menu-root" href="#pg-jump">'. $lang['GOTO_PAGE'] .'</a> :&nbsp;&nbsp;'. $page_string : '';
    $pagination = str_replace('&amp;start=0', '', $pagination);

    $template->assign_vars(array(
        'PAGINATION'   => $pagination,
        'PAGE_NUMBER'  => sprintf($lang['PAGE_OF'], ( floor($start_item/$per_page) + 1 ), ceil( $num_items / $per_page )),
        'PG_BASE_URL'  => $base_url,
        'PG_PER_PAGE'  => $per_page,
    ));

    return $pagination;
}
Меняем на:
PHP:
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
{
    global $lang, $template;

// Pagination Mod
    $begin_end = 3;
    $from_middle = 1;
/*
    By default, $begin_end is 3, and $from_middle is 1, so on page 6 in a 12 page view, it will look like this:

    a, d = $begin_end = 3
    b, c = $from_middle = 1

"begin"        "middle"           "end"
    |              |                 |
    |     a     b  |  c     d        |
    |     |     |  |  |     |        |
    v     v     v  v  v     v        v
    1, 2, 3 ... 5, 6, 7 ... 10, 11, 12

    Change $begin_end and $from_middle to suit your needs appropriately
*/

    $total_pages = ceil($num_items/$per_page);

    if ( $total_pages == 1 || $num_items == 0 )
    {
        return '';
    }

    $on_page = floor($start_item / $per_page) + 1;

    $page_string = '';
    if ( $total_pages > ((2*($begin_end + $from_middle)) + 2) )
    {
        $init_page_max = ( $total_pages > $begin_end ) ? $begin_end : $total_pages;
        for($i = 1; $i < $init_page_max + 1; $i++)
        {
            $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
            if ( $i <  $init_page_max )
            {
                $page_string .= " ";
            }
        }
        if ( $total_pages > $begin_end )
        {
            if ( $on_page > 1  && $on_page < $total_pages )
            {
                $page_string .= ( $on_page > ($begin_end + $from_middle + 1) ) ? ' ... ' : ', ';

                $init_page_min = ( $on_page > ($begin_end + $from_middle) ) ? $on_page : ($begin_end + $from_middle + 1);

                $init_page_max = ( $on_page < $total_pages - ($begin_end + $from_middle) ) ? $on_page : $total_pages - ($begin_end + $from_middle);

                for($i = $init_page_min - $from_middle; $i < $init_page_max + ($from_middle + 1); $i++)
                {
                    $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
                    if ( $i <  $init_page_max + $from_middle )
                    {
                        $page_string .= ' ';
                    }
                }
                $page_string .= ( $on_page < $total_pages - ($begin_end + $from_middle) ) ? ' ... ' : ', ';
            }
            else
            {
                $page_string .= '&nbsp;...&nbsp;';
            }
            for($i = $total_pages - ($begin_end - 1); $i < $total_pages + 1; $i++)
            {
                $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>'  : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
                if( $i <  $total_pages )
                {
                    $page_string .= " ";
                }
            }
        }
    }
    else
    {
        for($i = 1; $i < $total_pages + 1; $i++)
        {
            $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) . '">' . $i . '</a>';
            if ( $i <  $total_pages )
            {
                $page_string .= ' ';
            }
        }
    }

    if ( $add_prevnext_text )
    {
        if ( $on_page > 1 )
        {
            $page_string = ' <a href="' . $base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) . '">' . $lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
        }

        if ( $on_page < $total_pages )
        {
            $page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ( $on_page * $per_page ) . '">' . $lang['NEXT'] . '</a>';
        }

    }

    $pagination = ($page_string) ? '<a class="menu-root" href="#pg-jump">'. $lang['GOTO_PAGE'] .'</a> :&nbsp;&nbsp;'. $page_string : '';
    $pagination = str_replace('&amp;start=0', '', $pagination);

    $template->assign_vars(array(
        'PAGINATION'   => $pagination,
        'PAGE_NUMBER'  => sprintf($lang['PAGE_OF'], ( floor($start_item/$per_page) + 1 ), ceil( $num_items / $per_page )),
        'PG_BASE_URL'  => $base_url,
        'PG_PER_PAGE'  => $per_page,
    ));

    return $pagination;
}
  • 1.PNG
    1.PNG
    228.8 KB · Просмотры: 472
  • Снимок.PNG
    Снимок.PNG
    233.5 KB · Просмотры: 464
Автор
Exile
Скачивания
55
Просмотры
360
Первый выпуск
Обновление
Оценка
0.00 звёзд 0 оценок

Другие ресурсы пользователя Exile

Сверху