帝國cms修改[!--show.listpage--]分頁頁碼所生成的html標簽


在使用帝國cms系統時,我們用[!--show.page--]和[!--show.listpage--]來生成頁碼

其中[!--show.listpage--]所生成的html頁碼代碼為:

QQ截圖20130713160030

<a title="Total record">&nbsp;<b>9</b> </a>&nbsp;&nbsp;

<a href="/dg/news/china/index.html">首頁</a>&nbsp;

<a href="/dg/news/china/index.html">上一頁</a>&nbsp;

<a href="/dg/news/china/index.html">1</a>&nbsp;

<b>2</b>&nbsp;

<a href="/dg/news/china/index_3.html">3</a>&nbsp;

<a href="/dg/news/china/index_3.html">下一頁</a>&nbsp;

<a href="/dg/news/china/index_3.html">尾頁</a>

 

現在我們來修改其樣式

帝國的分頁樣式在e>class>下的t_functions.php這個文件里

列表頁模板[!--show.listpage--]:分頁導航(列表式) 在90-149行

一,總頁碼數

大概在118行找到$firststr='<a title="Total record">&nbsp;<b>'.$num.'</b> </a>&nbsp;&nbsp;';

比較一下

$firststr='<a title="Total record">&nbsp;<b>'.$num.'</b> </a>&nbsp;&nbsp;';

              <a title="Total record">&nbsp;<b>9</b> </a>&nbsp;&nbsp;

這里也就是說明,總頁碼“9” 所對應的變量為 '.$num.'  $firststr 是總頁碼的變量名稱

二,首頁

我們再找到$toppage='<a href="'.$dolink.'index'.$type.'">'.$fun_r['startpage'].'</a>&nbsp;';

比較一下

  $toppage='<a href="'.$dolink.'index'.$type.'">'.$fun_r['startpage'].'</a>&nbsp;';

                  <a href="/dg/news/china/index.html">首頁</a>&nbsp;

這里我們能看出來 首頁所對應的“首頁”代碼為“'.$fun_r['startpage'].'”  其鏈接所對應“'.$dolink.'index'.$type.'

三.上一頁

我們再找到$prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';

比較一下

$prepage='<a href="'.$dolink.$prido.'">'.$fun_r['pripage'].'</a>';

                 <a href="/dg/news/china/index.html">上一頁</a>&nbsp;

四,下一頁和尾頁

這里所對應的代碼為每一頁的頁碼標簽

找到

$nextpage='&nbsp;<a href="'.$dolink.'index_'.$pagenex.$type.'">'.$fun_r['nextpage'].'</a>';
$lastpage='&nbsp;<a href="'.$dolink.'index_'.$totalpage.$type.'">'.$fun_r['lastpage'].'</a>';

這里所對應的代碼為 下一頁和尾頁

<a href=" /dg/news/china/index_3.html">下一頁</a>&nbsp;

<a href=" /dg/news/china/index_3.html">尾頁</a>

五,所在頁面  前面頁碼和  所在頁面的后頁代碼

$starti=$page-$snum<1?1:$page-$snum;
    $no=0;
    for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)
    {
        $no++;
        if($page==$i)
        {
            $is_1="<b>";
            $is_2="</b>";

        elseif($i==1)
        {
            $is_1='<a href="'.$dolink.$add[filename].$type.'">';
           $is_2="</a>
";
        }
        else
        {
            $is_1='<a href="'.$dolink.$add[filename].'_'.$i.$type.'">';
           $is_2=" </a>
";
        }
        $returnstr.='&nbsp;'.$is_1.$i.$is_2;

1.所在頁面的代碼

            $is_1="<b>";
            $is_2="</b>";

意思為所在頁面標簽為<b>所在頁面</b>

2.所在頁面之后的頁碼

          elseif($i==1)
        {
            $is_1='<a href="'.$dolink.$add[filename].$type.'">';
           $is_2="</a>
";

意思為所在頁面

為<a>之前頁面</a>  

3.所在頁面之后的頁碼

        else
        {
            $is_1='<a href="'.$dolink.$add[filename].'_'.$i.$type.'">';
           $is_2=" </a>
";

意思為所在頁面之后的頁面

為<a>之后的頁面</a>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM