Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 4 Ответов
  • 4782 Просмотров
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Как выровнять по центру...
« : 04.02.2010, 17:18:05 »
Сделал навигацию внизу на сайте, но она судя по всему по левому краю, а мне нужно выровнять её по центру... А то не красиво смотрится
Вот скриншот http://s3.sendpic.ru/i/1024/i/Ov.jpeg.html

Знаю, что это можно изменить в plagins/content/pagenavigation.php    Но какие именно строки нужно изменить или добавить ? Вроде элементарно, но не могу найти...

Код
<?php
/**
 * @version $Id: pagination.php 10822 2009-10-09 16:16:00Z tcp $
 * @package Joomla
 * @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
 * @license GNU/GPL, see LICENSE.php
 */

// no direct access
defined('_JEXEC') or die('Restricted access');
/**
 * This is a file to add template specific chrome to pagination rendering.
 *
 * pagination_list_footer
 * Input variable $list is an array with offsets:
 * $list[limit] : int
 * $list[limitstart] : int
 * $list[total] : int
 * $list[limitfield] : string
 * $list[pagescounter] : string
 * $list[pageslinks] : string
 *
 * pagination_list_render
 * Input variable $list is an array with offsets:
 * $list[all]
 * [data] : string
 * [active] : boolean
 * $list[start]
 * [data] : string
 * [active] : boolean
 * $list[previous]
 * [data] : string
 * [active] : boolean
 * $list[next]
 * [data] : string
 * [active] : boolean
 * $list[end]
 * [data] : string
 * [active] : boolean
 * $list[pages]
 * [{PAGE}][data] : string
 * [{PAGE}][active] : boolean
 *
 * pagination_item_active
 * Input variable $item is an object with fields:
 * $item->base : integer
 * $item->link : string
 * $item->text : string
 *
 * pagination_item_inactive
 * Input variable $item is an object with fields:
 * $item->base : integer
 * $item->link : string
 * $item->text : string
 *
 * This gives template designers ultimate control over how pagination is rendered.
 *
 * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
 */

function pagination_list_footer($list)
{
// Initialize variables
$lang =& JFactory::getLanguage();
$html = "<div class=\"list-footer\">\n";

if ($lang->isRTL())
{
$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
$html .= $list['pageslinks'];
$html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
}
else
{
$html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
$html .= $list['pageslinks'];
$html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
}

$html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
$html .= "\n</div>";

return $html;
}

function pagination_list_render($list)
{
// Initialize variables
$numlr = 3; //колличество позиций страниц в начале ленты и в конце
$numpos = 10; //колличество позиций ленты вообще
$lang =& JFactory::getLanguage();
$html = '<table class="contentpagination"><tr>';
// Reverse output rendering for right-to-left display
if($lang->isRTL()){ $list['pages'] = array_reverse( $list['pages'] ); }
$html .= '<td align="right" width="49%">';
// $html .= '&laquo;';
// $html .= '&#171;';
// $html .= $list['start']['data'];
$html .= $list['previous']['data'];
$html .= '</td>';
$html .= '<td align="center">';
if(count($list['pages'])>$numpos) { // если страниц больше чем позиций в ленте - разбиваем троеточием
for($i=1; $i<=count($list['pages']); $i++){
if(!$list['pages'][$i]['active']) {
if($i > $numlr){
for($j=1; $j<=$numlr; $j++){ $html .= $list['pages'][$j]['data']; }
}else{
for($j=1; $j<$i; $j++){ $html .= $list['pages'][$j]['data']; }
}
if(($numlr+1) < ($i-1)){ $html .= '...'; }
if((count($list['pages']) - $numlr) <= $i){
for($j=(count($list['pages'])-$numlr-2); $j<$i; $j++){ $html .= $list['pages'][$j]['data']; }
}else{
if($i > ($numlr+1)){ $html .= $list['pages'][$i-1]['data']; }
}
$html .= '<span class="activ">';
$html .= $list['pages'][$i]['data'];
$html .= '</span>';
if(($numlr+1) >= $i){
for($j=($i+1); $j<=($numlr+3); $j++){ $html .= $list['pages'][$j]['data']; }
}else{
if($i < (count($list['pages'])-$numlr)){ $html .= $list['pages'][$i+1]['data']; }
}
if((count($list['pages']) - $numlr) > ($i+1)){ $html .= '...'; }
if($i <= (count($list['pages'])-$numlr)){
for($j=(count($list['pages'])-$numlr+1); $j<=count($list['pages']); $j++){ $html .= $list['pages'][$j]['data']; }
}else{
for($j=$i+1; $j<=count($list['pages']); $j++){ $html .= $list['pages'][$j]['data']; }
}
}
}
} else {
foreach( $list['pages'] as $page ){
if(!$page['active']) {
$html .= '<span class="activ">';
}
$html .= $page['data'];
if(!$page['active']) {
$html .= '</span>';
}
}
}
$html .= '</td>';
$html .= '<td align="left" width="49%">';
$html .= $list['next']['data'];
// $html .= $list['end']['data'];
// $html .= '&raquo;';
$html .= '</td>';
$html .= '</tr></table>';
return $html;
}

function pagination_item_active(&$item) {
return "&nbsp;<a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>&nbsp;";
}

function pagination_item_inactive(&$item) {
return "&nbsp;<span>".$item->text."</span>&nbsp;";
}
?>

Помогите пожалуйста выровнять навигацию по центру
*

theo_

  • Захожу иногда
  • 115
  • 2 / 0
Re: Как выровнять по центру...
« Ответ #1 : 06.02.2010, 00:24:19 »
Код
$html = '<table class="contentpagination"><tr>';
попробуй заменить на
Код
$html = '<div style="width: 100%; text-align: center;"><table class="contentpagination"><tr>';

а внизу
Код
$html .= '</tr></table>';
на
Код
$html .= '</tr></table></div>';

а вообще лучше бы ссылку на страницу скинуть
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Re: Как выровнять по центру...
« Ответ #2 : 06.02.2010, 01:16:46 »
Сделал, увы но никаких изменений не произошло  :(

Вот ссылка на сайт magiyasvitla.com.ua  Выбери любой раздел (люстры, бра, торшеры и т.д.) и увидишь, что навигация по прежнему выровнена по левому краю... Или не выровнена, вобщем не по центру  :'(
*

theo_

  • Захожу иногда
  • 115
  • 2 / 0
Re: Как выровнять по центру...
« Ответ #3 : 06.02.2010, 01:55:04 »
в файле
Код
http://magiyasvitla.com.ua/templates/siteground-j15-92/css/template.css
пропиши
.pagenavbar {
  text-align: center;
}
*

Romanych

  • Захожу иногда
  • 98
  • 3 / 0
Re: Как выровнять по центру...
« Ответ #4 : 06.02.2010, 13:18:24 »
Сработало !  :D ;D Огромное СПАСИБО !
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Как выровнять блоки в модуле?

Автор arkady

Ответов: 4
Просмотров: 848
Последний ответ 14.10.2019, 23:24:14
от AlekVolsk
Как все выровнять?

Автор Gromz

Ответов: 3
Просмотров: 817
Последний ответ 30.07.2019, 06:06:16
от Stasweb
Как сделать меню по центру?

Автор NAaTa

Ответов: 14
Просмотров: 1643
Последний ответ 10.08.2018, 11:09:11
от lexxbry
Выровнять меню по центру

Автор Fetka

Ответов: 1
Просмотров: 1061
Последний ответ 02.06.2018, 20:33:21
от Fetka
Разобраться с меню, нужно выставить красиво, по центру!

Автор KirillDragon

Ответов: 4
Просмотров: 1190
Последний ответ 28.02.2018, 12:49:44
от KirillDragon