photos.vm

来自「一个简单的blog系统」· VM 代码 · 共 86 行

VM
86
字号
##
##  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 photos
##
###############################################################################
#parse("/wml/_sub/_global.vm")
#set($PAGE_SIZE = 5)
#set($p_page = $dlog.param("p", 1))
#set($album_id = $dlog.param("aid", -1))
#set($album = ${g_site.album($album_id)})
#if($album)
	#set($page_title=${album.name})
#else
	#set($page_title="所有照片")
#end
#set($vc_key = "ALBUM_${album_id}")
#set($verify_code = $request.getSession(false).getAttribute($vc_key))
<p>
#if($album && ${album.type}==2 && !$dlog.is_owner($g_site,$g_user))
	##私有分类,但却不是站长
	此相册只有站长本人可以查看!!
#elseif($album && ${album.type}==1 && !$PHOTO_tool.can_access_album($g_site,$g_user,$album,$request))
	##密码验证,但是用户还没输入密码
	#invoke("_album_verify.vm")
#else
    #set($pre_page = $p_page - 1)
    #set($next_page = $p_page + 1)
#if($album)
	#set($photo_count = ${album.photoCount})
#else
    #set($photo_count = $PHOTO_tool.photo_count($g_site, $g_user, -1, -1))
#end
    #set($page_count = $dlog.page_count($photo_count, $PAGE_SIZE))
	#invoke("_photo_bar.vm")
    #if($album)
		#if(${album.parent})<a href="photos.vm?sid=$g_site_id&amp;aid=${album.parent.id}">$escape.html(${album.parent.name})</a>&gt;#end
		$escape.html(${album.name})
		#if($album.childs.size()>0)
		(#foreach($abm in $album.childs)#if($velocityCount>1),#end<a href="photos.vm?sid=$g_site_id&amp;aid=${abm.id}">$escape.html(${abm.name})</a> #end)
		#end
	#end 
	共有${photo_count}张照片.<br/>
	#if($page_count>1)
	第${p_page}页,共${page_count}页,每页${PAGE_SIZE}条.<br/>
	#end
	#if($page_count > 1)
    	#if($p_page>1)
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id">首页</a>
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$pre_page">上页</a>
    	#end
    	#if($p_page < $page_count)
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$next_page">下页</a>
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$page_count">尾页</a>
    	#end
    	<br/>
	#end
    #set($photos = $PHOTO_tool.list_photos($g_site, $g_user, $album_id, -1, $p_page, $PAGE_SIZE))
    #foreach($photo in $photos)
    	${velocityCount}.<img src="$dlog.root()${photo.previewURL}" alt=""/><a href="$dlog.root()/wml/photo/show.vm?sid=$g_site_id&amp;aid=$album_id&amp;pid=${photo.id}">$text.html(${photo.name})</a>(<a href="photo_rpls.vm?sid=$g_site_id&amp;pid=${photo.id}">${photo.replyCount}</a>评/${photo.viewCount}阅/$date.format("yy-MM-dd HH:mm",${photo.createTime}))<br/>
    #end
	#if($page_count > 1)
    	#if($p_page>1)
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id">首页</a>
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$pre_page">上页</a>
    	#end
    	#if($p_page < $page_count)
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$next_page">下页</a>
    		<a href="photos.vm?sid=$g_site_id&amp;aid=$album_id&amp;p=$page_count">尾页</a>
    	#end
    	<br/>
	#end
#end
</p>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?