config_news.asp

来自「漂亮的企业网站系统v11 1、整体修改了上一版的一些BUG。 2、修改了」· ASP 代码 · 共 296 行 · 第 1/2 页

ASP
296
字号
    temp1=temp1&vbcrlf&"<tr><td align=center><a href='news_view.asp?id="&nid&"'"&atb&"><img src='"&web_var(web_upload,1)&rs("pic")&"' title='"&code_html(topic,1,0)&"' border=0 width="&web_var(web_num,7)&" height="&web_var(web_num,8)&"></a></td></tr>" & _
	  vbcrlf&"<tr><td align=center height=25><a href='news_view.asp?id="&nid&"'"&atb&" class=red_3><b>"&code_html(topic,1,c_num)&"</b></a></td></tr>"
    rs.movenext
  loop
  temp1=temp1&"</table>"
  response.write kong & "<table border=0 width='96%' cellspacing=0 cellpadding=0 align=center><tr><td align=center>"&format_bar("<font class="&sk_class&"><b>图片新闻</b></font>",temp1,sk_bar,0,0,"|"&web_var(web_color,pc)&"|","")&"</td></tr></table>"
end sub

sub news_main(n_jt,n_num,c_num,et,ct,tt,pn,pl,pc)
  dim ccid,ccname,sqla,crs,csql,nn,temp1,tim,cnum:nn=0
  csql="select c_id,c_name from jk_class where nsort='"&n_sort&"' order by c_order"
  set crs=conn.execute(csql)
  do while not crs.eof
    temp1="<table border=0 width='100%'><tr><td height=1></td><td wdith=50></td></tr>"
    ccid=crs("c_id"):ccname=crs("c_name"):sqla=" and c_id="&ccid
    sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&ccid&" order by id desc"
    set rs=conn.execute(sql)
    do while not rs.eof
      cnum=c_num:ispic="":topic=rs("topic"):tim=rs("tim")
      if rs("ispic")=true then cnum=cnum-2:ispic=news_tu
      temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&img_small(n_jt)&"<a href='news_view.asp?id="&rs("id")&"'"&atb&" title='新闻标题:"&code_html(topic,1,0)&"<br>发 布 人:"&rs("username")&"<br>浏览人次:"&rs("counter")&"<br>整理时间:"&tim&"'>"&code_html(topic,1,cnum)&"</a>"&ispic&"</td><td>"&format_end(et,time_type(tim,tt))&"</td></tr>"
      rs.movenext
    loop
    rs.close
    temp1=temp1&vbcrlf&"</table>"
    response.write vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=0><tr valign=top>"
    if nn=0 then
      response.write vbcrlf&"<td width='67%'>"
      response.write kong&format_bar("<a href='news_list.asp?c_id="&ccid&"'><b><font class="&sk_class&">"&ccname&"</font></b></a>",temp1,sk_bar,0,0,"||","<a href='news_list.asp?c_id="&ccid&"&action=more'><font class="&sk_class&">more</font></a>")
      response.write vbcrlf&"</td><td width='1%'></td><td width='32%'>"
      call news_pic(sqla,pn,pl,pc)
      nn=1
    else
      response.write vbcrlf&"<td width='32%'>"
      call news_pic(sqla,pn,pl,pc)
      response.write vbcrlf&"</td><td width='1%'></td><td width='67%'>"
      response.write kong&format_bar("<a href='news_list.asp?c_id="&ccid&"'><b><font class="&sk_class&">"&ccname&"</font></b></a>",temp1,sk_bar,0,0,"||","<a href='news_list.asp?c_id="&ccid&"&action=more'><font class="&sk_class&">more</font></a>")
      nn=0
    end if
    response.write vbcrlf&"</td></tr></table>"
    crs.movenext
  loop
  crs.close:set crs=nothing
end sub

sub news_more(n_jt,c_num,et,ct,tt,pn,pl,pc)
  dim temp1,tim,cnum,sql2,mhead
  pageurl="?action=more&"
  keyword=code_form(request.querystring("keyword"))
  sea_type=trim(request.querystring("sea_type"))
  if sea_type<>"username" then sea_type="topic"
  call cid_sid_sql(2,sea_type)
  
  temp1="<table border=0 width='100%'><tr><td height=1 width='5%'></td><td width='77%'></td><td wdith='18%'></td></tr>"
  sql="select id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&cid
  if sid<>0 then
    sql=sql&" and s_id="&sid
    sql2="select jk_class.c_name,jk_sort.s_name from jk_sort inner join jk_class on jk_sort.c_id=jk_class.c_id where jk_sort.c_id="&cid&" and jk_sort.s_id="&sid
  else
    sql2="select c_name from jk_class where c_id="&cid
  end if
  sql=sql&" order by id desc"
  
  set rs=conn.execute(sql2)
  if rs.eof and rs.bof then
    call news_main("jt0",16,20,1,6,33,2,10,1)
    exit sub
  end if
  mhead="<a href='news_list.asp?c_id="&cid&"'><b><font class="&sk_class&">"&rs("c_name")&"</font></b></a>"
  if sid<>0 then mhead=mhead&"&nbsp;<font class="&sk_class&">→</font>&nbsp;<a href='news_list.asp?c_id="&cid&"&s_id="&sid&"'><b><font class="&sk_class&">"&rs("s_name")&"</font></b></a>"
  rs.close
  set rs=server.createobject("adodb.recordset")
  rs.open sql,conn,1,1
  if rs.eof and rs.bof then
    rssum=0
  else
    rssum=rs.recordcount
  end if
  call format_pagecute()
  if int(viewpage)>1 then
    rs.move (viewpage-1)*nummer
  end if
  for i=1 to nummer
    if rs.eof then exit for
    cnum=c_num:ispic="":topic=rs("topic"):tim=rs("tim")
    if rs("ispic")=true then cnum=cnum-2:ispic=news_tu
    temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&i+(viewpage-1)*nummer&".</td><td><a href='news_view.asp?id="&rs("id")&"'"&atb&" title='新闻标题:"&code_html(topic,1,0)&"<br>发 布 人:"&rs("username")&"<br>浏览人次:"&rs("counter")&"<br>整理时间:"&tim&"'>"&code_html(topic,1,cnum)&"</a>"&ispic&"</td><td>"&format_end(et,time_type(tim,tt))&"</td></tr>"
    rs.movenext
  next
  rs.close
  temp1=temp1&vbcrlf&"</table>"
  response.write kong&format_bar(mhead,temp1,sk_bar,0,0,"||","<a href='news_list.asp?c_id="&cid&"&s_id="&sid&"&action=more'><font class="&sk_class&">more</font></a>")
%>
<table border=0 width='100%' align=center>
<tr><td align=center><table border=0 width='100%'><tr><td height=1 background='images/bg_dian.gif'></td></tr></table></td></tr>
<tr><td>&nbsp;
本栏共有&nbsp;<font class=red><%response.write rssum%></font>&nbsp;条新闻&nbsp;
页次:<font class=red><%response.write viewpage%></font>/<font class=red><%response.write thepages%></font>&nbsp;
分页:<%response.write jk_pagecute(nummer,thepages,viewpage,pageurl,8,"#ff0000")%>
</td></tr>
</table>
<%
end sub

sub news_list(n_jt,n_num,c_num,et,ct,tt,pn,pl,pc)
  dim ssid,ssname,sqla,srs,ssql,nn,temp1,tim,cnum,keyword,sea_type:nn=0
  keyword=code_form(request.querystring("keyword"))
  sea_type=trim(request.querystring("sea_type"))
  if sea_type<>"username" then sea_type="topic"
  call cid_sid_sql(2,sea_type)  
  ssql="select s_id,s_name from jk_sort where c_id="&cid
  if sid<>0 then ssql=ssql&" and s_id="&sid
  ssql=ssql&" order by s_order"
  set srs=conn.execute(ssql)
  do while not srs.eof
    temp1="<table border=0 width='100%'><tr><td height=1></td><td wdith=50></td></tr>"
    ssid=srs("s_id"):ssname=srs("s_name"):sqla=" and c_id="&cid&" and s_id="&ssid
    sql="select top "&n_num&" id,topic,tim,username,counter,ispic from news where hidden=1 and c_id="&cid&" and s_id="&ssid&" and "&sea_type&" like '%"&keyword&"%' order by id desc"
    set rs=conn.execute(sql)

    do while not rs.eof
      cnum=c_num:ispic="":topic=rs("topic"):tim=rs("tim")
      if rs("ispic")=true then cnum=cnum-2:ispic=news_tu
      temp1=temp1&vbcrlf&"<tr><td height="&space_mod&">"&img_small(n_jt)&"<a href='news_view.asp?id="&rs("id")&"'"&atb&" title='新闻标题:"&code_html(topic,1,0)&"<br>发 布 人:"&rs("username")&"<br>浏览人次:"&rs("counter")&"<br>整理时间:"&tim&"'>"&code_html(topic,1,cnum)&"</a>"&ispic&"</td><td>"&format_end(et,time_type(tim,tt))&"</td></tr>"
      rs.movenext
    loop
    rs.close
    temp1=temp1&vbcrlf&"</table>"
    response.write vbcrlf&"<table border=0 width='100%' cellspacing=0 cellpadding=0><tr valign=top>"
    if nn=0 then
      response.write vbcrlf&"<td width='67%'>"
      response.write kong&format_bar("<a href='news_list.asp?c_id="&cid&"&s_id="&ssid&"'><b><font class="&sk_class&">"&ssname&"</font></b></a>",temp1,sk_bar,0,0,"||","<a href='news_list.asp?c_id="&cid&"&s_id="&ssid&"&action=more'><font class="&sk_class&">more</font></a>")
      response.write vbcrlf&"</td><td width='1%'></td><td width='32%'>"
      call news_pic(sqla,pn,pl,pc)
      nn=1
    else
      response.write vbcrlf&"<td width='32%'>"
      call news_pic(sqla,pn,pl,pc)
      response.write vbcrlf&"</td><td width='1%'></td><td width='67%'>"
      response.write kong&format_bar("<a href='news_list.asp?c_id="&cid&"&s_id="&ssid&"'><b><font class="&sk_class&">"&ssname&"</font></b></a>",temp1,sk_bar,0,0,"||","<a href='news_list.asp?c_id="&cid&"&s_id="&ssid&"&action=more'><font class="&sk_class&">more</font></a>")
      nn=0
    end if
    response.write vbcrlf&"</td></tr></table>"
    srs.movenext
  loop
  srs.close:set srs=nothing
end sub
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?