
HxCmsV8.0本站首页{图片文字}分类调用
___图片文字分类调用____
第一步:
打开indexnew.asp文件,在最后加上下面代码(注意,在最后一个%>符的里边):
'=================================================
'过程名:index_pic2
'作 用:首页网页图片调用
'参 数:num-------------调用条数
' fontnum---------标题长度
' classid---------一级分类调用id,0为全部
' classyes--------是否显示分类,True为是,False为否
' NewWindows------是否新窗打开,True为是,False为否
'Web: http://www.65vv.com
'=================================================
sub index_pic2(num,fontnum,classid,classyes,NewWindows)
dim nnn
if NewWindows=True then nnn="target='_blank'"
Response.Write "<ul class=""list"">"
if classid=0 then
sql="select top "&num&" * from pic where passed=0 ORDER by pic_id DESC"
else
sql="select top "&num&" * from pic where passed=0 and (piccat_id="&classid&" or piccat_id in(select piccat_id from piccat where sid="&classid&")) order by pic_id DESC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
sql="select piccat_id,piccat_name from piccat where piccat_id="&rs("piccat_id")
set rscat=server.createobject("adodb.recordset")
rscat.open sql,conn,1,1
Response.Write "<li><span>" & vbCrLf
Response.Write ""&Right("0"&month(rs("pic_date")),2)&"-"&right("0"&day(rs("pic_date")),2)&"</span>"
if classyes=True then Response.Write "<a href='pic/List.asp?cat_id="&rs("piccat_id")&"'>『"&left(rscat("piccat_name"),10)&"』</a>"
Response.Write"<a href='pic/show.asp?id="&rs("pic_id")&"' Title='图片名称:"&rs("pic_name")&"
查看次数:"&rs("pic_count")&"
上传时间:"&rs("pic_date")&"' "& nnn &">"&gotTopic(rs("pic_name"),fontnum)&"</a></li>"& vbCrLf
rscat.close
set rscat=nothing
rs.movenext
loop
if rs.eof and rs.bof then
Response.Write "<li>暂时没有图片</li>"
end if
rs.close
set rs=nothing
Response.Write "</ul>"
end sub
第二步:在你首页需要调用的地方,推荐//用<%call index_pic2(10,30,0,True,False)%> 标签调用,即可
>>相关资讯:
上篇文章:复制内容后自动加入转载本文来自出处 下篇文章:推荐文章首页调用
网友评论
以下网友评论只代表其个人观点,不代表临沂广播网的观点或立场

加载中……
