新闻和文章频道首页两列列表For 1.2
作者:cmscn 日期:2005-07-23
新闻:
include/con_news_main.asp后面添加:
复制内容到剪贴板 程序代码
sub news_main_list2(n_num,c_num)
%><table width='100%' valign='top'><%
dim ncid,ncname,crs,csql,sqla,n_username,n_topic,n_tim
i=0
csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
set crs=joekoe_cms.exec(csql,1)
do while not crs.eof
ncid=crs("c_id")
ncname=crs("c_name")
sqla=" and c_id="&ncid
if i mod 2=0 then
%>
<tr>
<%
end if
%>
<td width='50%' valign='top'>
<%
response.write vbcrlf&news_bar_top(ncname,1,(i mod 2)+1,"news_list.asp?action=more&c_id="&ncid)
sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&ncid&" order by id desc"
set rs=conn.execute(sql)
do while not rs.eof
n_username=rs("username")
n_topic=rs("topic")
n_tim=rs("tim")
n_tim=joekoe_cms.time_type(n_tim,1)
response.write vbcrlf&news_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),2)
rs.movenext
loop
rs.close
response.write vbcrlf&news_bar_end("<a href='news_list.asp?action=more&c_id="&ncid&"'>浏览更多…</a>",1)
%>
</td>
<%
if i+1 mod 2=0 then
%>
</tr>
<%
end if
if i=1 then
%>
<tr><td height=1></td></tr>
<%
end if
crs.movenext
i=i+1
loop
crs.close
set crs=nothing
%></table><%
end sub
%><table width='100%' valign='top'><%
dim ncid,ncname,crs,csql,sqla,n_username,n_topic,n_tim
i=0
csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
set crs=joekoe_cms.exec(csql,1)
do while not crs.eof
ncid=crs("c_id")
ncname=crs("c_name")
sqla=" and c_id="&ncid
if i mod 2=0 then
%>
<tr>
<%
end if
%>
<td width='50%' valign='top'>
<%
response.write vbcrlf&news_bar_top(ncname,1,(i mod 2)+1,"news_list.asp?action=more&c_id="&ncid)
sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&ncid&" order by id desc"
set rs=conn.execute(sql)
do while not rs.eof
n_username=rs("username")
n_topic=rs("topic")
n_tim=rs("tim")
n_tim=joekoe_cms.time_type(n_tim,1)
response.write vbcrlf&news_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),rs("ispic"),2)
rs.movenext
loop
rs.close
response.write vbcrlf&news_bar_end("<a href='news_list.asp?action=more&c_id="&ncid&"'>浏览更多…</a>",1)
%>
</td>
<%
if i+1 mod 2=0 then
%>
</tr>
<%
end if
if i=1 then
%>
<tr><td height=1></td></tr>
<%
end if
crs.movenext
i=i+1
loop
crs.close
set crs=nothing
%></table><%
end sub
news.asp中
call news_main_list(6,30)
改为
call news_main_list2(6,15)
文章
include/con_article_main.asp后面添加:
复制内容到剪贴板 程序代码
sub article_main_list2(n_num,c_num)
%><table width='100%' valign='top'><%
dim ncid,ncname,crs,csql,sqla,n_username,n_topic,n_tim
i=0
csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
set crs=joekoe_cms.exec(csql,1)
do while not crs.eof
ncid=crs("c_id")
ncname=crs("c_name")
sqla=" and c_id="&ncid
if i mod 2=0 then %><tr><%end if
%><td width='50%' valign='top'><%
response.write vbcrlf&article_bar_top(ncname,1)
sql="select top "&n_num&" id,topic,tim,username,counter,emoney,power from article where hidden=1 and c_id="&ncid&" order by id desc"
set rs=conn.execute(sql)
do while not rs.eof
n_username=rs("username")
n_topic=rs("topic")
n_topic=joekoe_cms.code_js(n_topic,1)
n_tim=rs("tim")
n_tim=joekoe_cms.time_type(n_tim,1)
response.write vbcrlf&article_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),false,2,rs("emoney"),rs("power"))
rs.movenext
loop
rs.close
response.write vbcrlf&article_bar_end("<a href='article_list.asp?action=more&c_id="&ncid&"'>浏览更多…</a>",1)
%></td><%
if i+1 mod 2=0 then %></tr><%end if
if i=1 then %><tr><td height=1></td></tr><%end if
crs.movenext
i=i+1
loop
crs.close
set crs=nothing
%></table><%
end sub
%><table width='100%' valign='top'><%
dim ncid,ncname,crs,csql,sqla,n_username,n_topic,n_tim
i=0
csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
set crs=joekoe_cms.exec(csql,1)
do while not crs.eof
ncid=crs("c_id")
ncname=crs("c_name")
sqla=" and c_id="&ncid
if i mod 2=0 then %><tr><%end if
%><td width='50%' valign='top'><%
response.write vbcrlf&article_bar_top(ncname,1)
sql="select top "&n_num&" id,topic,tim,username,counter,emoney,power from article where hidden=1 and c_id="&ncid&" order by id desc"
set rs=conn.execute(sql)
do while not rs.eof
n_username=rs("username")
n_topic=rs("topic")
n_topic=joekoe_cms.code_js(n_topic,1)
n_tim=rs("tim")
n_tim=joekoe_cms.time_type(n_tim,1)
response.write vbcrlf&article_topic_type(c_num,rs("id"),n_username,n_topic,n_tim,rs("counter"),false,2,rs("emoney"),rs("power"))
rs.movenext
loop
rs.close
response.write vbcrlf&article_bar_end("<a href='article_list.asp?action=more&c_id="&ncid&"'>浏览更多…</a>",1)
%></td><%
if i+1 mod 2=0 then %></tr><%end if
if i=1 then %><tr><td height=1></td></tr><%end if
crs.movenext
i=i+1
loop
crs.close
set crs=nothing
%></table><%
end sub
article.asp中
call article_main_list(6,30)
改为
call article_main_list2(6,15)
评论: 6 | 引用: 0 | 查看次数: 813
发表评论