phpcms伪静态分页,tag和搜索列表页的分页函数处理
直接在模板调用时,这么写:
<?php
$current_page = $_GET['page'];
$pages = str_replace('?page=','/',$pages);
$pages = str_replace('?&page=','/',$pages);
if($current_page){
$pages = str_replace($current_page.'/','',$pages);
}
echo $pages;?>
其实伪静态规则这么写:
RewriteRule ^tag/(.*)/([0-9]+)$ index.php?m=content&c=tag&a=lists&tag=$1&page=$2
RewriteRule ^tag/(.*)$ index.php?m=content&c=tag&a=lists&tag=$1
RewriteRule ^search/(.*)/([0-9]+)$ index.php?m=search&c=index&a=init&siteid=1&typeid=1&q=$1&page=$2
RewriteRule ^search/(.*)$ index.php?m=search&c=index&a=init&siteid=1&typeid=1&q=$1