j_replies.vm
来自「一个简单的blog系统」· VM 代码 · 共 90 行
VM
90 行
##
## 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 replies
##
###############################################################################
#parse("/html/_sub/_global.vm")
#select_layout("p_diary.vm")
#set($page_title="所有日记评论")
###############################################################################
#set($LOGS_PER_PAGE = 10)
#set($p_page = $dlog.param("page",1))
#set($pre_page = $p_page - 1)
#set($next_page = $p_page + 1)
#set($log = 1) ## 用于控制_reply_bottom_bar.vm的行为
#set($reply_count = $DIARY_tool.diary_reply_count($g_site, $g_user))
#set($page_count = $dlog.page_count($reply_count, $LOGS_PER_PAGE))
<div class="page_top">
<div class="pagecontent">
<div class="pagecontent_left fleft">
日记中共有评论${reply_count}条 每页显示${LOGS_PER_PAGE}条 第${p_page}页 共${page_count}页
</div>
<div class="pagecontent_right fright">
#if($page_count > 1)
#if($p_page > 1)<a href="?sid=$g_site_id">首页</a>#end
#if($p_page>1)<a href="?sid=$g_site_id&page=$pre_page">上页</a>#end
#if($p_page < $page_count)<a href="?sid=$g_site_id&page=$next_page">下页</a>#end
#if($p_page < $page_count)<a href="?sid=$g_site_id&page=$page_count">尾页</a>#end
转到
<select name="page">
#foreach($p in [1..$page_count])
<option value="$p" #if($p_page==$p)selected#end>$p</option>
#end
</select> 页
#end
</div>
</div>
<div class="spacer_1"></div>
</div>
#set($replies = $DIARY_tool.list_diary_replies($g_site, $p_page, $LOGS_PER_PAGE, $g_user))
<div class="page_content">
#foreach($reply in $replies)
#set($show_log_url = "showlog.vm?sid=$g_site_id&log_id=${reply.diary.id}#${reply.id}")
<div class="comment">
<div class="comment_title"><a name="${reply.id}"></a>
<div class="fleft">
<b>#if($reply.authorURL)<a href="$reply.authorURL">#end$text.html($reply.author)#if($reply.authorURL)</a>#end</b>在<a href="$show_log_url"><b>$reply.diary.title</b></a>评论说:
#if($reply.client.type == 1)
$html.img("mobile.gif",null,"WAP","absmiddle",0)
#end
</div>
<div class="fright">
$date.format("yyyy/MM/dd HH:mm",${reply.replyTime})
#if($g_user && (${g_site.owner.id}==$g_user_id || (${reply.user} && ${reply.user.id}==$g_user_id)))
<a href="#" onclick="if(confirm('您真的要删除该评论吗?')) deleteRForm_${reply.id}.submit(); return false;"">
$html.img("icon_delete.gif",null,"del","absmiddle",0)
</a>
<a href="showlog.vm?sid=$g_site_id&log_id=${reply.diary.id}&reply_id=${reply.id}#reply">
$html.img("icon_edit.gif",null,"edit","absmiddle",0)
</a>
<form name="deleteRForm_${reply.id}" action="$link.setAction("html/reply")" method="post">
<input type="hidden" name="sid" value="${g_site_id}" />
<input type="hidden" name="log_id" value="${reply.diary.id}" />
<input type="hidden" name="fromPage" value="$dlog.get_request_url()" />
<input type="hidden" name="eventSubmit_DeleteDiaryReply" value="${reply.id}" />
</form>
#end
</div>
</div>
<div class="comment_content">
${reply.content}
</div>
</div>
<div class="spacer_5"></div>
#end
</div>
<div class="page_footer"></div>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?