⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 info_function.asp

📁 CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。
💻 ASP
字号:
<%
'-----取得城市的相关资料存放在数组-----
dim mycity,myleibie,city(5),rs
mycity=strchange(trim(request.QueryString("ct")))
myleibie=strchange(trim(request.QueryString("lb")))
if len(mycity)=0 or len(mycity)>citynamemax then response.redirect "error.asp?v=city_error"&mycity


set rs=server.CreateObject("adodb.recordset")
rs.open "select * from 城市 where 审核=1 and 城市='"& mycity &"'",conn,1,1
if rs.eof or rs.bof or rs.recordcount<>1 then response.redirect "error.asp?v=city_no"  end if
city(0)=rs("省份")
city(1)=rs("城市")
city(2)=rs("简介")
city(3)=rs("推荐数")
city(4)=rs("公告")
rs.close
set rs=nothing

'-----推荐资讯-----
sub tuijian()
  dim rstui,count_tui,tuipl,count_tuipl
  set rstui=server.CreateObject("adodb.recordset")
  rstui.open "select * from 资讯 where 审核=1 and 推荐=1 and 城市='"& mycity &"' order by 排名 asc,推荐指数 desc,人气 desc",conn,1,1
  if rstui.eof or rstui.bof then
	response.write no_tuijian
  else
	count_tui=city(3)
	Do while not rstui.eof and not rstui.bof and count_tui>0
	  response.write "<TABLE cellSpacing=0 cellPadding=0 width=500 bgColor=#ffffff border=0 style='border-collapse: collapse'><TR><TD width=6 height=9 background=images/info_tuijian_11.gif></TD><TD background=images/info_tuijian_12.gif></TD><TD width=12 background=images/info_tuijian_13.gif></TD></TR><TR><TD background=images/info_tuijian_22.gif></TD><TD height=130 width=482 vAlign=top align=center>"
	  response.write "<table border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' width=475>"
	  response.write "<tr><td width=300 height=28><b><img border=0 src='images/arrow.gif' width=25 height=11><a alt='查看〖"&rstui("名称")&"〗的详细信息' onmouseover=""window.status='点击查看〖"&rstui("名称")&"〗的详细信息'; return true;"" onmouseout=""window.status='';return true;"" href=javascript:openwin('infomore.asp?id="&rstui("编号")&"')>" &rstui("名称")&"</a></b></td>"
	  response.write "<td width=175>推荐指数<img border=0 src='images/arrow1.gif' width=20 height=9><img border=0 src='images/info_tui_"&rstui("推荐指数")&".gif' width=55 height=12></td></tr>"
      response.write "<tr><td width=300 height=70 align=left valign=top><font color='#008000'>介绍</font><img height=9 src='images/arrow1.gif' width=20 border=0>"
      response.write "" &left(rstui("介绍"),100) &"... <a alt='查看详细信息' style='color: #FF0000' href=""javascript:openwin('infomore.asp?id="&rstui("编号")&"')"">更多&gt;&gt;</a>"
      response.write "</td><td width=175 height=70 align=center>"
      response.write "<IFRAME name=pic align=default marginWidth=0 marginHeight=0  src='pic.asp?id="&rstui("编号")&"&w=100&h=70' frameBorder=0 width=160 scrolling=no height=70></IFRAME>"
      response.write "</td></tr><tr><td width=475 colspan=2><font color='#008000'>评论</font><img height=9 src='images/arrow1.gif' width=20 border=0>"
      dim rs_tuipl
      set rs_tuipl=server.CreateObject("adodb.recordset")
	  rs_tuipl.open "select * from 资讯评论 where 审核=1 and 资讯编号=" & rstui("编号") &" order by 编号 desc",conn,1,1
	  tuipl=rs_tuipl.recordcount
	  if rs_tuipl.recordcount=0 then 
        response.write no_pl
      else
        response.write "<marquee width='400' scrollamount=2 scrolldelay=50 onmouseover='this.stop()' onmouseout='this.start()'>"
        count_tuipl=5
	    Do while not rs_tuipl.eof and not rs_tuipl.bof and count_tuipl>0
		  response.write "<font color='#FF3300'>"&left(rs_tuipl("发言内容"),12)&"...</font><font color='#999999'>"&left(rs_tuipl("发言者姓名"),5)&"</font>&nbsp;&nbsp;&nbsp;&nbsp;"
		  count_tuipl=count_tuipl-1
		  rs_tuipl.movenext
		Loop
		response.write "</marquee>"
	  end if
	  rs_tuipl.close
	  set rs_tuipl=nothing
      response.write "</td></tr><tr><td><marquee behavior='alternate' width='60' scrollamount='2' scrolldelay='100' onmouseover='this.stop()' onmouseout='this.start()'><a href=""javascript:openwin('infomore.asp?id="&rstui("编号")&"')"" style='text-decoration: none' onmouseover=""window.status='点击查看〖"&rstui("名称")&"〗的详细信息'; return true;"" onmouseout=""window.status='';return true;""><font color='#FF0000'>详</font><font color='#00CC00'>细</font><font color='#FF9900'>信</font><font color='#0000FF'>息</font></a></marquee>&nbsp;"
	  if rstui("网站")<>"" and rstui("网站")<>"http://" then response.write ("网址<img height=9 src='images/arrow1.gif' width=20 border=0><a target='_blank' href='" &rstui("网站")& "'>" &rstui("网站")& "</a>") end if
	  response.write "</td><td align='right'></td></tr>"
	  response.write "</table></TD><TD background=images/info_tuijian_23.gif></TD></TR><TR><TD width=6 height=12 background=images/info_tuijian_31.gif></TD><TD background=images/info_tuijian_32.gif></TD><TD width=12 background=images/info_tuijian_33.gif></TD></TR></TABLE>"
      rstui.movenext
      count_tui=count_tui-1
  	Loop
  end if
  rstui.close
  set rstui=nothing
end sub

'-----所有资讯-----
sub suoyou()
  dim rssy,count_sy,sypl,count_sypl
  set rssy=server.CreateObject("adodb.recordset")
  if len(myleibie)=0  then
    rssy.open "select * from 资讯 where 审核=1 and 推荐=0 and 城市='"& mycity &"' order by 排名 asc,推荐指数 desc,人气 desc",conn,1,1
  else
    rssy.open "select * from 资讯 where 审核=1 and 推荐=0 and 城市='"& mycity &"' and 类别="& myleibie &" order by 排名 asc,推荐指数 desc,人气 desc",conn,1,1
  end if
  if rssy.eof or rssy.bof then
	response.write no_suoyou
  else
    count_sy=1
    response.write "<TABLE cellSpacing=0 cellPadding=0 width=760  height=28 border=0><tr><td width=420 valign='bottom'>&nbsp;"&gonggao&"</td><td width=340 background='images/turnpage_bg.gif'>"
    Call TurnPage(rssy,RowCount)
    response.write "</td></tr></table><TABLE cellSpacing=0 cellPadding=0 width=760 height=8 border=0><tr><td></td></tr></table>"
    response.write "<table border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' width=759><tr><td width=253 height=168 vAlign=top align=center>"
	Do while not rssy.eof and not rssy.bof  and  RowCount>0
	  response.write "<TABLE cellSpacing=0 cellPadding=0 width=250 height=31 border=0 background='images/info_suoyou_1.gif'><TR><TD width=250 class=t2><b><a alt='查看〖"&rssy("名称")&"〗的详细信息' href=""javascript:openwin('infomore.asp?id="&rssy("编号")&"')"" onmouseover=""window.status='点击查看〖"&rssy("名称")&"〗的详细信息'; return true;"" onmouseout=""window.status='';return true;"">" &left(rssy("名称"),20)&"</a></b></TD></TR></TABLE>"
	  response.write "<TABLE cellSpacing=0 cellPadding=0 width=250 border=0 height=123><TR><TD width=4></TD><TD width=1 bgColor=#c7c7c7></TD><TD width=3></TD><TD vAlign=top width=234 background='images/info_suoyou_2.gif'>"
	  response.write "<table border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' width=230><tr><td height=70 class=t3 colspan=3>"
      response.write "介绍<img height=9 src='images/arrow1.gif' width=20 border=0>"
      if len(rssy("介绍"))>70 then
        response.write left(rssy("介绍"),64) &"... <a alt='查看〖"&rssy("名称")&"〗的详细信息' style='color: #FF0000' href=javascript:openwin('infomore.asp?id="&rssy("编号")&"')>更多&gt;&gt;</a>"
      else
        response.write left(rssy("介绍"),68)
      end if
	  response.write "</td></tr><tr><td height=1 background=images/info_suoyou_4.gif colspan=3></td></tr><tr><td height=32 class=t3 colspan=3>"
      dim rs_sypl
      set rs_sypl=server.CreateObject("adodb.recordset")
	  rs_sypl.open "select * from 资讯评论 where 审核=1 and 资讯编号=" & rssy("编号") &" order by 编号 desc",conn,1,1
	  sypl=rs_sypl.recordcount
	  if rs_sypl.recordcount=0 then 
        response.write no_pl
      else
        count_sypl=2
	    Do while not rs_sypl.eof and not rs_sypl.bof and count_sypl>0 and RowCount>0
		  response.write "<font color='#FF3300'>"&left(rs_sypl("发言内容"),12)&"...</font><font color='#999999'>"&left(rs_sypl("发言者姓名"),5)&"</font><br>"
		  count_sypl=count_sypl-1
		  rs_sypl.movenext
		Loop
	  end if
	  rs_sypl.close
	  set rs_sypl=nothing
	  response.write "</td></tr><tr><td width=100 height=19><marquee behavior='alternate' width='60' scrollamount='2' scrolldelay='100' onmouseover='this.stop()' onmouseout='this.start()'><a href=""javascript:openwin('infomore.asp?id="&rssy("编号")&"')"" style='text-decoration: none' onmouseover=""window.status='点击查看〖"&rssy("名称")&"〗的详细信息'; return true;"" onmouseout=""window.status='';return true;""><font color='#FF0000'>详</font><font color='#00CC00'>细</font><font color='#FF9900'>信</font><font color='#0000FF'>息</font></a></marquee></td>"
	  response.write "<td width=130 align=center>"
	  
	  dim rslb
      set rslb=server.CreateObject("adodb.recordset")
	  rslb.open "select * from 资讯类别 where 类别编号=" & rssy("类别"),conn,1,1
	  if rslb.recordcount=1 then response.write "<a style='color: #0000FF' href='?ct="&mycity&"&lb="&rssy("类别")&"' title='查看该类别所有资讯'>"&rslb("类别名")&"</a>"
	  rslb.close
	  set rslb=nothing
	  
	  response.write "</td><td width=100 align='right'><img border=0 title='推荐指数→"&rssy("推荐指数")&"级' src='images/info_tui_"&rssy("推荐指数")&".gif' width=55 height=12></td></tr></table>"
	  response.write "</TD><TD width=3></TD><TD width=1 bgColor='#c7c7c7'></TD><TD width=4></TD></TR></TABLE>"
	  response.write "<TABLE cellSpacing=0 cellPadding=0 width=250 height=7 border=0 background='images/info_suoyou_3.gif'><TR><TD></TD></TR></TABLE>"
	  response.write "</td><td width=253 height=168 vAlign=top align=center>"
	  if count_sy mod 3=0 then response.write("</tr></table><table border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' width=759><tr><td width=253 vAlign=top align=center>") end if
      count_sy=count_sy+1
      RowCount=RowCount-1
      rssy.movenext
	Loop
    response.write "</td></tr></table>"
    response.write "<TABLE cellSpacing=0 cellPadding=0 width=760 border=0><tr height=31><td width=420></td><td width=340 background='images/info_suoyou_1.gif' valign='bottom' style='border-right:1px solid #B4B4B4;'><script>document.write(cutpage.innerHTML)</script></td></tr><tr height=2><td colspan=2></td></tr></table>"
  end if
  rssy.close
  set rssy=nothing
end sub

'---------------管理员---------------------
sub admin()
  dim rs_admin
  set rs_admin=server.CreateObject("adodb.recordset")
  rs_admin.open "select * from 管理员 where 审核=1 and 城市='"&mycity&"' order by 级别 desc",conn,1,1
  if rs_admin.recordcount=0 then 
    response.write no_admin
  else
    Do while not rs_admin.eof and not rs_admin.bof
	  response.write "<a target='_blank' href='#'>"&rs_admin("管理名")&"</a>&nbsp;"
	  rs_admin.movenext
    Loop
  end if
  rs_admin.close
  set rs_admin=nothing
end sub
%>

⌨️ 快捷键说明

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