新闻调用
作者:cmscn 日期:2005-09-23
<%
function yong_newlist_2(m_title,m_n,m_cid,m_m,m_table,m_t)
'说明:
'm_title:调用栏目名称,如"社会新闻"、"国际新闻"……
'm_n:调用文章的条数
'm_cid:栏目编号,如"3","1,36,23"
'm_m:每条显示的最多字数
'm_table:调用文章为1,调用新闻为2
'm_t:调用一级栏目为1,调用二级栏目为2
'我要调用新闻板块中一级栏目的10条社会新闻,该栏目编号为3:call ying_newlist_2("社会新闻",10,"3",15,2,1)
'我要调用文章板块中二级栏目的8条武侠小说,该栏目编号为24:call ying_newlist_2("武侠小说",8,"24",15,1,2)
response.write "<table cellspacing=1 cellpadding=4 class=table>"&vbcrlf
response.write "<tr><td class=td0>"&m_title&"</td></tr>"&vbcrlf
response.write "<tr class=td00><td align=center><table border=0 cellspacing=0 cellpadding=2 width='100%'><tr>"&vbcrlf
dim cid_str,id,topic,tablename,new_win
cid_str=" s_id"
tablename="ying"
if m_t=1 then cid_str=" c_id"
if instr(m_cid,",")>0 then
cid_str=cid_str&" in ("&m_cid&") "
else
cid_str=cid_str&"="&int(m_cid)&" "
end if
if m_table=2 then tablename="news"
sql="select top "&m_n&" id,topic from "&tablename&" where hidden=1 and "&cid_str&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
id=rs("id")
topic=rs("topic")
response.write vbcrlf&" <tr><td height='"&dim_num(6)&"'><img src='skin/"&joekoe_cms.web_skin&"/small/h_ying.gif' border=0 align=absMiddle> <a href='ying_view.asp?id="&id&"' target=_blank alt='"&joekoe_cms.code_html(topic,1,0)&"'>"&joekoe_cms.code_html(topic,1,m_m)&"</a></td></tr>"
rs.movenext
loop
rs.close
response.write "</tr></table></td></tr></table>"
end function
评论: 8 | 引用: 0 | 查看次数: 769
发表评论