logs.vm
来自「一个简单的blog系统」· VM 代码 · 共 56 行
VM
56 行
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Library General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
##
## show all diarys
##
###############################################################################
#parse("/wml/_sub/_global.vm")
#set($PAGE_SIZE = 10)
#set($p_page = $dlog.param("p", 1))
#set($cat_id = $dlog.param("cat_id", -1))
#set($catalog = $DIARY_tool.catalog($g_site, $g_user, $cat_id))
#if($catalog)
#set($page_title=${catalog.name})
#else
#set($page_title="所有日记")
#end
#set($pre_page = $p_page - 1)
#set($next_page = $p_page + 1)
#set($log_count = $DIARY_tool.diary_count($g_site, $g_user, $cat_id, -1,-1,-1))
#set($page_count = $dlog.page_count($log_count, $PAGE_SIZE))
<p>
#invoke("_diary_bar.vm")
$text.html($!{catalog.name})共有${log_count}篇日记<br/>
第${p_page}页,共${page_count}页,每页${PAGE_SIZE}条.<br/>
#macro(diary_page_navigator)
#if($page_count > 1)
#if($p_page>1)
<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id&cat_id=$cat_id">首页</a>
<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id&cat_id=$cat_id&p=$pre_page">上页</a>
#end
#if($p_page < $page_count)
<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id&cat_id=$cat_id&p=$next_page">下页</a>
<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id&cat_id=$cat_id&p=$page_count">尾页</a>
#end
<br/>
#end
#end
#diary_page_navigator()
#set($logs = $DIARY_tool.list_diary($g_site, $g_user, $cat_id, -1,-1,-1, $p_page, $PAGE_SIZE, false))
#foreach($log in $logs)
${velocityCount}.<a href="$dlog.root()/wml/diary/show.vm?sid=$g_site_id&log_id=${log.id}">$escape.html(${log.title})</a>(<a href="diary_rpls.vm?sid=$g_site_id&log_id=${log.id}">${log.replyCount}</a>评/${log.viewCount}阅/$date.format("yy-MM-dd HH:mm",${log.writeTime}))<br/>
#end
#diary_page_navigator()
</p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?