в этой строчке:
*** скрытое содержание ***
нужно править с соотвествии Вашим ЧПУ.
Кстати учтите, что страницы через этот плагин могут не индексится поисковиками. Хотя вроде google нрмально с JavaScript справляется.
ЧПУ - стандартное, без изменений
Все ссылки в таком виде:
Для просмотра ссылки Войди или Зарегистрируйся
Тело пациента:
<?php
/**
* @version $Id: pagination.php 14401 2010-01-26 14:10:00Z louis $
* @package Joomla
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// 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_render($list)
{
// Initialize variables
global $mainframe;
$paginator_next = 'Next';
$paginator_prev = 'Prev';
$paginator_first = 'First';
$paginator_last = 'Last';
$pattern = '#limitstart=([0-9]*)#s';
$pattern_url = '#href="(.*?)"#s';
$path = JURI::base().'/templates/'.$mainframe->setTemplate.'/html/plg_paginator3000/';
$i=0;
foreach( $list['pages'] as $page ) //find current page
{
if(!$page['active']){$curpage=$i;}
$i++;
}
// $route=$_SERVER["REQUEST_URI"];
if($list['pages'][2]['active']){
preg_match ($pattern,$list['pages'][2]['data'],$match);
$count = intval ($match[1]);
preg_match ($pattern_url,$list['pages'][2]['data'],$match);
$subj = urlencode($match[1]);
$route = urldecode(str_replace('limitstart%3D'.$count,'',$subj));
}
else {
preg_match ($pattern,$list['pages'][3]['data'],$match);
$count = intval ($match[1])/2;
if (count($list['pages']) > 2){
preg_match ($pattern_url,$list['pages'][3]['data'],$match);
$route = str_replace('limitstart='.($count*2),'',$match[1]);
}
else {
preg_match ($pattern_url,$list['pages'][1]['data'],$match);
$match1 = $match[1];
$match[1]=str_replace('limitstart=0','',$match[1]);
if( $match[1] != $match1){$route = $match[1];}
else {
if( strpos($match[1],'?')){$route=$match[1].'&';}
else {$route=$match[1].'?';}
}
}
}
$script_tag = '
<link href="'.$path.'paginator-blue.css" rel="stylesheet" media="all" />
<script type="text/javascript" src="'.$path.'jquery-1.3.2.pack.js"></script>
<script type="text/javascript" src="'.$path.'paginator.js"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery(document).bind("ready", function (){
jQuery("#paginator3000").paginator({
pagesTotal:'.count($list['pages']).',
pagesSpan:10,
pageCurrent:'.($curpage+1).',
baseUrl: "'.$route.'limitstart=%number%",
builCounter : function (page){ return (page-1)*'.$count.';},
lang: {
next : "'.$paginator_next.'",
last : "'.$paginator_last.'",
prior : "'.$paginator_prev.'",
first : "'.$paginator_first.'",
arrowRight : String.fromCharCode(8594),
arrowLeft : String.fromCharCode(8592)
}
});
});
});
</script>
';
$mainframe->addCustomHeadTag($script_tag);
$html = "<div id='paginator3000' class='paginator'></div>";
return $html;
}
function pagination_item_active(&$item) {
return "<a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>";
}
function pagination_item_inactive(&$item) {
return "<span>".$item->text."</span>";
}
?>