
推荐文章首页调用
第一步:
打开indexnew.asp文件,在最后加上下面代码(注意,在最后一个%>符的里边): '=================================================
'过程名:index_bestart
'作 用:推荐文章
'参 数:num-调用条数,nn-显示长度
' NewWindows-----是否新窗打开,True为是,False为否
'Web: http://www.65vv.com
'=================================================
sub index_bestart(num,nn,NewWindows)
Response.Write "<ul class=""list"">"
dim nnn
if NewWindows=True then
nnn="target='_blank'"
else
nnn=""
end if
set RsHxcms=server.createobject("adodb.recordset")
set RsHxcms=conn.execute("select top "&num&" * from art where passed=0 and isbest=1 order by art_id desc")
do while not RsHxcms.eof
Response.Write "<li><span>"&Right("0"&month(RsHxcms("art_date")),2)&"-"&right("0"&day(RsHxcms("art_date")),2)&"</FONT></span>"
Response.Write "<a class=""a50""></a><a href=Art/show.asp?id="&RsHxcms("art_id")&" title="&RsHxcms("art_title")&" "& nnn &">"&gotTopic(RsHxcms("art_title"),nn)&"</a></li>" & vbCrLf
RsHxcms.movenext
loop
if RsHxcms.bof and RsHxcms.eof then
Response.Write "<li>暂时没有推荐文章!</li>"
end if
RsHxcms.close
set RsHxcms=nothing
Response.Write "</ul>"
end sub
第二步:在你首页需要调用的地方,推荐//用<%call index_bestart(5,28,False)%> 标签调用,即可.
>>相关资讯:
上篇文章:HxCmsV8.0本站首页{图片文字}分类调用 下篇文章:HxCmsV8.0本站首页留言调控方法
网友评论
以下网友评论只代表其个人观点,不代表临沂广播网的观点或立场

加载中……
- 没有相关文章
