睡蓮‧池水間

Guest
2012-May-23  
0 位會員和 8 位訪客在線上

文章 :: xoops

解決lcx區塊歸零時的無數字狀態

睡蓮
 
池水間 


logcounterx 模組的網站計數器區塊,統計數字欄若採用文字模式,當「今天」、「本週」或「本月」歸零的時候,便會出現空空如上圖箭頭所示的沒有數字狀態,要讓它顯示「0」,可以用如下的修改法。

以下是modules/logcounterx/templates/block/lcx_block_display.html 的檔案內容。統計數字若採用文字模式,會顯示下面橘色部份的語法;用圖片模式的話便顯示黑色這部份。

<table>
<{foreach item=count from=$block.counts}>
<{if $block.use_char}>
<{* Display Counter by Letters   from here *}>
<tr><td nowrap="nowrap"><{$count.title}></td>
<td align="right" nowrap="nowrap"><span style="<{$block.style}>"><{$count.count}></span></td></tr>
<{* Display Counter by Letters    end here *}>
<{else}>
<{* Display Counter by Images      from here *}>
<tr><td nowrap="nowrap"><{$count.title}></td>
<td align="right" nowrap="nowrap"><{foreach item=digit from=$count.digits}><img src="<{$xoops_url}>/modules/logcounterx/images/<{$block.imagedir}><{$digit}>.gif" alt="<{$count.count}>" border="0" <{$block.imageattr}>/><{/foreach}></td></tr>
<{* Display Counter by Images       end here *}>
<{/if}>
<{/foreach}>
</table>


要讓文字模式下歸零時顯示「0」,可以在文字模式的smarty語法裡加入如下橘色的變數修飾字:

<tr><td nowrap="nowrap"><{$count.title}></td>
<td align="right" nowrap="nowrap"><span style="<{$block.style}>"><{$count.count|default:0}></span></td></tr>



這樣當歸零時便會顯示「0」了。

    «« 新域名池水間正式啟用 你見過史上最牛驗的極限證碼嗎? »»    

引用

  • 文章地址: http://waterlily-lsl.com/modules/article/view.article.php/c11/122
  • 引用地址: http://waterlily-lsl.com/modules/article/trackback.php/122

評分

10
9
8
7
6
5
4
3
2
1


 

API: RSS | RDF | ATOM

回覆及設定

    關閉


 

最 新 發 表 及 資 訊 區

此為池水間 banner ,需要安裝 Adobe Flash Player 才能觀看內容。

最新留言

最新留言:2012-Jan-6 11:13am
留言編號:76
留言者: wuji888
網主回覆:
總留言數: 71

前往萍踪留影

造訪統計

今天:60
昨天:362
本週:1894
本月:11910
總計:433147
平均:311

連結

Powered By XOOPS
Valid XHTML 1.1
Valid CSS 3
除另有註明外,本站內容均採用 Creative Commons 姓名標示-非商業性-相同方式分享 3.0 授權條款授權
登 入