index.vm
来自「一个简单的blog系统」· VM 代码 · 共 48 行
VM
48 行
##
## 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.
##
## diary
##
###############################################################################
#parse("/wml/_sub/_global.vm")
#set($page_title="$text.diary($g_site)")
#set($catalog_id = $dlog.param("cat_id", -1))
#set($catalogs = $DIARY_tool.catalogs($g_site, $g_user, false))
<p>
#invoke("_diary_bar.vm")
##显示最新日记
<b>+最新日记</b>(<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id">$text.wml("more")</a>)<br/>
#set($diarys = $DIARY_tool.list_diary($g_site, $g_user, -1, -1,-1,-1, 1, 3))
#foreach($log in $diarys)
${velocityCount}.<a href="$dlog.root()/wml/diary/show.vm?sid=$g_site_id&log_id=${log.id}">$text.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
</p>
<p>
## 显示所有日记分类
<b><a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id">+$text.wml("catalog_all")</a></b><br/>
#foreach($cat in $catalogs)
${velocityCount}.<a href="$dlog.root()/wml/diary/logs.vm?sid=$g_site_id&cat_id=$cat.id">$text.html(${cat.name})(${cat.articleCount})</a><br/>
#end
</p>
<p>
##显示最新评论
<b>+$text.wml("newest_comment")</b>(<a href="$dlog.root()/wml/diary/rpls.vm?sid=$g_site_id">$text.wml("more")</a>)<br/>
#set($replies = $DIARY_tool.list_diary_replies($g_site, 1, 5, $g_user))
#foreach($reply in $replies)
#set($rc = $dlog.abbreviate($dlog.plain_text(${reply.content}), 14))
#if($dlog.is_empty($rc))#set($rc="[无文本内容]")#end
${velocityCount}.<a href="$dlog.root()/wml/diary/rpl.vm?sid=$g_site_id&log_id=${reply.diary.id}&rpl_id=${reply.id}">$text.html($rc)</a> ($text.wml("comment_author")$text.html(${reply.author}),$date.format("M-d HH:mm",${reply.replyTime}))<br/>
#end
</p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?