Provides a superb PHP file paging code for the previous page, which is the paging program code when dedecms generates the page. Provides a superb php file paging code for the previous page, which is the paging program code when dedecms generates the page.
Script ec (2); script
Function GetPagebreakDM ($ totalPage, $ nowPage, $ aid)
{
Global $ pai_rewrite;
If ($ totalPage = 1)
{
Return "";
}
$ PageList ="
Total ". $ totalPage." pages:";
$ NPage = $ nowPage-1;
$ LPage = $ nowPage + 1;
If ($ nowPage = 1)
{
$ PageList. ="
Previous Page";
}
Else
{
If ($ nPage = 1)
{
$ PageList. ="
Previous Page";
If ($ response _rewrite = 'y ')
{
$ PageList = preg_replace ("/. php? Aid = (d +)/I ", '-\ 1-1.html', $ PageList );
}
}
Else
{
$ PageList. ="
Previous Page";
If ($ response _rewrite = 'y ')
{
$ PageList = str_replace (". php? Aid = ","-", $ PageList );
$ PageList = preg_replace ("/& pageno = (d +)/I", '-\ 1.html', $ PageList );
}
}
}
For ($ I = 1; $ I <= $ totalPage; $ I ++)
{
If ($ I = 1)
{
If ($ nowPage! = 1)
{
$ PageList. ="
1";
If ($ response _rewrite = 'y ')
{
$ PageList = preg_replace ("/. php? Aid = (d +)/I ", '-\ 1-1.html', $ PageList );
}
}
Else
{
$ PageList. ="
1";
}
}
Else
{
$ N = $ I;
If ($ nowPage! = $ I)
{
$ PageList. ="
". $ N ."";
If ($ response _rewrite = 'y ')
{
$ PageList = str_replace (". php? Aid = ","-", $ PageList );
$ PageList = preg_replace ("/& pageno = (d +)/I", '-\ 1.html', $ PageList );
}
}
Else
{
$ PageList. ="
{$ N}";
}
}
}
If ($ lPage <= $ totalPage)
{
$ PageList. ="
Next Page";
If ($ response _rewrite = 'y ')
{
$ PageList = str_replace (". php? Aid = ","-", $ PageList );
$ PageList = preg_replace ("/& pageno = (d +)/I", '-\ 1.html', $ PageList );
}
}
Else
{
$ PageList. ="
Next Page";
}
Return $ PageList;
}