给新闻加一个“街谈巷议”栏目
作者:cmscn 日期:2006-11-01
把下面代码复制制作成news_review.asp文件就可以了:
Code:<!-- #include file="include/con_news.asp" -->
<!-- #include file="include/jk_pagecute.asp" -->
<!-- #include file="include/jk_page_cute.asp" -->
<!-- #include file="include/jk_review.asp" -->
<%
dim rsort,re_id,rid,ruser,rurl,errs,nummer,nums,rssum,page,viewpage,thepages
nummer=15
nums=nummer
tit_nav="街谈巷议"
tit=tit&tit_nav
call web_head(0,0,0,0,0)
'----------------------------左边 开始----------------------------
call news_load(0,0,0)
call news_label("新闻链接")
call news_left("hot",10,10,"热门新闻")
call news_left("good",10,10,"推荐新闻")
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
call review_list()
'----------------------------中间 结束----------------------------
call news_end()
call web_end(0,0)
sub review_list()
dim topic,ri,bgs,rusername,remail,rtype,rtim,retim,reword,pageurl
pageurl="?"
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td0 colspan=2> <%response.write img_skin("m_")&tit_nav%></td></tr>
<%
sql="select count(rid) from review where rsort='news' "
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then rssum=rs(0)
rs.close
call format_pagecute()
sql="select top "&nummer*viewpage&" review.re_id,review.rusername,review.remail,review.rtype,review.rtim,review.retim,review.reword,review.rword,news.topic from review,news where review.rsort='news' and news.id=review.re_id order by review.rid desc"
call joekoe_cms.exec("",-1)
rs.open sql,conn,1,1
if int(viewpage)>1 then rs.move (viewpage-1)*nummer
if int(viewpage*nummer)>int(rssum) then nums=nummer-(viewpage*nummer-rssum)
for i=1 to nums
bgs=""
if (ri+1) mod 2=0 then bgs="_td"
rusername=rs(1)
remail=rs(2)
rtype=rs(3)
rtim=rs(4)
retim=rs(5)
reword=rs(6)
topic=rs(8)
if var_null(remail)<>"" then remail="<a href='mailto:"&remail&"'><img src='"&joekoe_cms.web_dir_skin&"small/email.gif' border=0 align=absmiddle alt='"&rusername&" 的电子邮件:"&remail&"'></a>"
if rtype=1 then rusername=format_user_name(rusername,0,"")
rtim="<font class=tims alt='"&joekoe_cms.time_type(rtim,2)&"'>"&joekoe_cms.time_type(rtim,4)&"</font>"
%>
<tr class=bg<%response.write bgs%>><td><a href='news_view.asp?id=<% response.write rs(0) %>'><b><% response.write joekoe_cms.code_html(topic,1,40) %></b></a>
</td></tr>
<tr class=bg<%response.write bgs%>><td>
<table border=0 cellspacing=0 cellpadding=2 width='90%' class=tf align=right>
<tr><td class=bw><%response.write img_skin("h_review")
response.write rtim&" "&rusername&" "&remail
%></td></tr>
<tr><td class=bw><font class=blue><b>评:</b></font><%response.write joekoe_cms.code_html(rs(7),2,0)%></td></tr>
<%
if var_null(reword)<>"" then
response.write " <tr><td class=bw><font class=red2><b>回:</b></font>"&joekoe_cms.code_html(reword,2,0)&"</td></tr>"
end if
%>
</table>
</td></tr>
<%
rs.movenext
ri=ri+1
next
rs.close
%>
<tr class=bg_tds height=30><td>共有<font class=red><%response.write rssum%></font>条评论 页次:<font class=red><%response.write viewpage&"</font>/<font class=red>"&thepages%></font> 分页:<% response.write jk_pagecute(nummer,thepages,viewpage,pageurl,3,"#ff0000") %></td></tr>
</table>
<%
end sub
%>
评论: 6 | 引用: 0 | 查看次数: 800
发表评论