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

📄 adminup.asp

📁 仿搜狐NBA网站源码,仿搜狐NBA网站源码全站生成HTML静态页面
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=conn.asp-->
<%
if session("adminname")="" then
    response.write "<script language='javascript'>" & chr(13)
    response.write "window.document.location.href='login.asp';"&Chr(13)
    response.write "</script>" & Chr(13)
    Response.End
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="images/style.css" type=text/css rel=stylesheet>
<p>&nbsp;</p>
<p>&nbsp;</p>
<%
Set rs=Server.CreateObject("ADODB.RecordSet") 
Set rz=Server.CreateObject("ADODB.RecordSet")
Set ra=Server.CreateObject("ADODB.RecordSet")
'获取网站基本信息
sql="SELECT * from mi222sit" 
rs.Open sql,conn,1,1
if not rs.bof and not rs.eof then
mi222_name=rs("mi222_name")
mi222_key=rs("mi222_key")
mi222_url=rs("mi222_url")
mi222_bq=rs("mi222_bq")
mi222_qq=rs("mi222_qq")
mi222_email=rs("mi222_email")
end if
rs.close
'获取网站分类列表
function mi222_class()
sqls="SELECT * from mi222class where smaclass='mi222'" 
ra.Open sqls,conn,1,1
if not ra.bof and not ra.eof then
  for i=1 to ra.recordcount
    mi222_class=" <a href=sort_"&ra("id")&"_1.htm>"&ra("bigclass")&"</a> | "&mi222_class
  if ra.eof then exit for
  ra.movenext
  next
end if
ra.close
if mi222_class="" then
  mi222_class="暂无分类!"
end if
end function
'获取网站广告信息
sql="SELECT * from mi222ads" 
rs.Open sql,conn,1,1
if not rs.bof and not rs.eof then
  mi222_ads_1=rs("mi222_body")
  rs.movenext
  mi222_ads_2=rs("mi222_body")
  rs.movenext
  mi222_ads_3=rs("mi222_body")
  rs.movenext
  mi222_ads_4=rs("mi222_body")
  rs.movenext
  mi222_ads_5=rs("mi222_body")
  rs.movenext
  mi222_ads_6=rs("mi222_body")
  rs.movenext
  mi222_ads_7=rs("mi222_body")
  rs.movenext
  mi222_ads_8=rs("mi222_body")
  rs.movenext
  mi222_ads_9=rs("mi222_body")
  rs.movenext
  mi222_ads_10=rs("mi222_body")
end if
rs.close
'函数代码
function FSOFileRead(filename)
Dim objFSO,objCountFile,FiletempData
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(Server.MapPath(filename),1,True)
FSOFileRead = objCountFile.ReadAll
objCountFile.Close
Set objCountFile=Nothing
Set objFSO = Nothing
End Function
'文章列表函数
function news_list(bigclass,num)
  news_list="<TABLE cellSpacing=1 width='100%' border=0><TBODY>"
  if bigclass="0" then
    sql="SELECT * from news order by id desc" 
  else
    sql="SELECT * from news where mi222_bigclass='"& bigclass &"' order by id desc"
  end if
  rs.Open sql,conn,1,1
  if not rs.bof and not rs.eof then
    if num>rs.recordcount then
	  num=rs.recordcount
	end if
	for i=1 to num
      if bigclass="0" then
	    news_list=news_list&"<TR><TD>&nbsp;<A title="&rs("mi222_title")&" href=news/news_"&rs("id")&".htm target=_blank>"&left(rs("mi222_title"),12)&"</A></TD></TR>"
	  else
	    news_list=news_list&"<TR><TD>· <A title="&rs("mi222_title")&" href=news/news_"&rs("id")&".htm target=_blank>"&left(rs("mi222_title"),14)&"</A> ["&rs("mi222_time")&"]</TD></TR>"
	  end if
	rs.movenext
    next
  else
    news_list=news_list&"暂无文章!"
  end if
  rs.close
  news_list=news_list&"</TBODY></TABLE>"
end function
'首页生成函数
function index_htm()
 mi222_cn=FSOFileRead("mi222mb/index.html")
 sql1="SELECT * from mi222class where smaclass='mi222'"
 rz.Open sql1,conn,1,1
 if not rz.bof and not rz.eof then
   for j=1 to rz.recordcount
     mi222_cn=replace(mi222_cn,"※"&rz("bigclass")&"※",news_list(rz("bigclass"),10))
	 rz.movenext
   next
 end if
 rz.close
 sql1="SELECT * from mi222link where mi222_logo<>'mi222'"
 rz.Open sql1,conn,1,1
 if not rz.bof and not rz.eof then
   for j=1 to rz.recordcount
     link_logo_list=link_logo_list&"<p><A href="&rz("mi222_url")&" target='_blank' title="&rz("mi222_about")&"><IMG alt="&rz("mi222_about")&" src="&rz("mi222_logo")&" border=0></A></p>"
	 rz.movenext
   next
 end if
 rz.close
 sql1="SELECT * from mi222link where mi222_logo='mi222'"
 rz.Open sql1,conn,1,1
 if not rz.bof and not rz.eof then
   for j=1 to rz.recordcount
     link_word_list=link_word_list&"<p><A href="&rz("mi222_url")&" target='_blank' title="&rz("mi222_about")&">"&rz("mi222_name")&"</A></p>"
	 rz.movenext
   next
 end if
 rz.close
 sql1="SELECT * from mi222gg"
 rz.Open sql1,conn,1,1
 if not rz.bof and not rz.eof then
   for j=1 to rz.recordcount
     gg_list=gg_list&"<strong>【"&rz("mi222_title")&"】</strong>"&rz("mi222_body")&" 『发布时间』["&rz("mi222_time")&"]&nbsp;&nbsp;"
	 rz.movenext
   next
 end if
 rz.close
 mi222_cn=replace(mi222_cn,"※网站名称※",mi222_name)
 mi222_cn=replace(mi222_cn,"※关键词※",mi222_key)
 mi222_cn=replace(mi222_cn,"※最新文章※",news_list("0",10))
 mi222_cn=replace(mi222_cn,"※网站网址※",mi222_url)
 mi222_cn=replace(mi222_cn,"※网站公告※",gg_list)
 mi222_cn=replace(mi222_cn,"※分类列表※",mi222_class())
 mi222_cn=replace(mi222_cn,"※网站版权※",mi222_bq)
 mi222_cn=replace(mi222_cn,"※LOGO链接※",link_logo_list)
 mi222_cn=replace(mi222_cn,"※文字链接※",link_word_list)
 mi222_cn=replace(mi222_cn,"※站长QQ※",mi222_qq)
 mi222_cn=replace(mi222_cn,"※网站Email※",mi222_email)
 if mi222_ads_1<>"" then
   mi222_cn=replace(mi222_cn,"※广告1※",mi222_ads_1)
 end if
 if mi222_ads_2<>"" then
   mi222_cn=replace(mi222_cn,"※广告2※",mi222_ads_2)
 end if
 if mi222_ads_3<>"" then
   mi222_cn=replace(mi222_cn,"※广告3※",mi222_ads_3)
 end if
 if mi222_ads_4<>"" then
   mi222_cn=replace(mi222_cn,"※广告4※",mi222_ads_4)
 end if
 if mi222_ads_5<>"" then
   mi222_cn=replace(mi222_cn,"※广告5※",mi222_ads_5)
 end if
 if mi222_ads_6<>"" then
   mi222_cn=replace(mi222_cn,"※广告6※",mi222_ads_6)
 end if
 if mi222_ads_7<>"" then
   mi222_cn=replace(mi222_cn,"※广告7※",mi222_ads_7)
 end if
 if mi222_ads_8<>"" then
   mi222_cn=replace(mi222_cn,"※广告8※",mi222_ads_8)
 end if
 if mi222_ads_9<>"" then
   mi222_cn=replace(mi222_cn,"※广告9※",mi222_ads_9)
 end if
 if mi222_ads_10<>"" then
   mi222_cn=replace(mi222_cn,"※广告10※",mi222_ads_10)
 end if
 FilePath="../index.htm"
 Set fso = Server.CreateObject("Scripting.FileSystemObject")
 Set fout = fso.Createtextfile(server.mappath(FilePath),true)
 Fout.WriteLine mi222_cn
Response.Write ("操作结果:网站首页生成成功!<br>文件名称:index.htm<br>文件路径:网站目录\index.htm<br>")
set htmlwrite=Nothing  
set fso=Nothing 
end function
'按类生成文章页面函数
function news_htm(id,bigclass,smaclass)
sql="SELECT * from mi222class where smaclass='mi222'" 
rs.Open sql,conn,1,1
if not rs.bof and not rs.eof then
  for i=1 to rs.recordcount
    mi222_news_class=" <a href=../sort_"&rs("id")&"_1.htm>"&rs("bigclass")&"</a> | "&mi222_news_class
  if rs.eof then exit for
  rs.movenext
  next
end if
rs.close
if mi222_class="" then
  mi222_class="暂无分类!"
end if
 mi222_cn=FSOFileRead("mi222mb/news.html")
 if id<>"0" then
   sql="SELECT * from news where cstr(id)='"& id &"'"
 elseif bigclass="0" then
   sql="SELECT * from news"
 elseif smaclass="mi222" then
   sql="SELECT * from news where mi222_bigclass='"& bigclass &"'"
 else
   sql="SELECT * from news where mi222_bigclass='"& bigclass &"' and mi222_smaclass='"& smaclass &"'"
 end if
 rs.Open sql,conn,1,1
 if not rs.bof and not rs.eof then
  for i=1 to rs.recordcount
   mi222_cn=FSOFileRead("mi222mb/news.html")
   news_bigclass=rs("mi222_bigclass")
   news_smaclass=rs("mi222_smaclass")
   if news_smaclass="" then
     sqlup="SELECT * from news where mi222_bigclass='"& news_bigclass &"' and clng(id)<'"&clng(rs("id"))&"'order by id"
     sqldown="SELECT * from news where mi222_bigclass='"& news_bigclass &"' and clng(id)>'"&clng(rs("id"))&"'order by id"
   else
     sqlup="SELECT * from news where mi222_bigclass='"& news_bigclass &"' and mi222_smaclass='"& news_smaclass &"' and clng(id)<'"&clng(rs("id"))&"'order by id"
     sqldown="SELECT * from news where mi222_bigclass='"& news_bigclass &"' and mi222_smaclass='"& news_smaclass &"' and clng(id)>'"&clng(rs("id"))&"'order by id"
   end if
   rz.Open sqlup,conn,1,1
   if rz.bof or rz.eof then
     news_up_down="· 上一篇:<A href='#'>没有了!</A><br>"
   else
     news_up_down="· 上一篇:<A href='news_"&rz("id")&".htm' title="&rz("mi222_title")&">"&left(rz("mi222_title"),20)&"</A><br>"
   end if
   rz.close
   rz.Open sqldown,conn,1,1
   if rz.bof or rz.eof then
     news_up_down=news_up_down&"· 下一篇:<A href='#'>没有了!</A><br>"
   else
     news_up_down=news_up_down&"· 下一篇:<A href='news_"&rz("id")&".htm' title="&rz("mi222_title")&">"&left(rz("mi222_title"),20)&"</A><br>"
   end if
   rz.close
   sqllj="SELECT * from mi222class where bigclass='"& rs("mi222_bigclass") &"'"
   rz.Open sqllj,conn,1,1
   if not rz.eof and not rz.bof then
     news_lj=" <a href='../sort_"&rz("id")&"_1.htm'>"&rz("bigclass")&"</a> → "
   end if
   rz.close
   if rs("mi222_smaclass")<>"" then
     sqllj="SELECT * from mi222class where bigclass='"& rs("mi222_bigclass") &"' and smaclass='"& rs("mi222_smaclass") &"'"
     rz.Open sqllj,conn,1,1
     if not rz.eof and not rz.bof then
       news_lj=news_lj&" <a href='../sort_"&rz("id")&"_1.htm'>"&rz("smaclass")&"</a> → "
     end if
     rz.close
   end if
   mi222_pt="../news/news_"&rs("id")&".htm"
   news_key=rs("mi222_key")&" "&mi222_key
   if rs("mi222_smaclass")<>"mi222" and rs("mi222_smaclass")<>"" then
     class_name=rs("mi222_smaclass")&"—"&rs("mi222_bigclass")
   else
     class_name=rs("mi222_bigclass")
   end if
   mi222_cn=replace(mi222_cn,"※文章标题※",rs("mi222_title"))
   mi222_cn=replace(mi222_cn,"※网站名称※",mi222_name)
   mi222_cn=replace(mi222_cn,"※关键词※",news_key)
   mi222_cn=replace(mi222_cn,"※网站网址※",mi222_url)
   mi222_cn=replace(mi222_cn,"※文章分类※",class_name)
   mi222_cn=replace(mi222_cn,"※文章路径※",news_lj)
   mi222_cn=replace(mi222_cn,"※分类列表※",mi222_news_class)
   mi222_cn=replace(mi222_cn,"※文章正文※",rs("mi222_body"))
   mi222_cn=replace(mi222_cn,"※作者※",rs("mi222_writer"))
   mi222_cn=replace(mi222_cn,"※浏览次数※","<iframe name='top' scrolling='no' src='../count.asp?id="&rs("id")&"' height='20' width='120' frameborder='0'>浏览次数</iframe>")
   mi222_cn=replace(mi222_cn,"※发表时间※",rs("mi222_time"))
   mi222_cn=replace(mi222_cn,"※文章路径※",mi222_pt)
   mi222_cn=replace(mi222_cn,"※相邻文章※",news_up_down)
   mi222_cn=replace(mi222_cn,"※网站版权※",mi222_bq)
   mi222_cn=replace(mi222_cn,"※站长QQ※",mi222_qq)
   mi222_cn=replace(mi222_cn,"※网站Email※",mi222_email)
   if mi222_ads_1<>"" then
     mi222_cn=replace(mi222_cn,"※广告1※",mi222_ads_1)
   end if
   if mi222_ads_2<>"" then
     mi222_cn=replace(mi222_cn,"※广告2※",mi222_ads_2)
   end if
   if mi222_ads_3<>"" then
     mi222_cn=replace(mi222_cn,"※广告3※",mi222_ads_3)
   end if
   if mi222_ads_4<>"" then
     mi222_cn=replace(mi222_cn,"※广告4※",mi222_ads_4)
   end if
   if mi222_ads_5<>"" then
     mi222_cn=replace(mi222_cn,"※广告5※",mi222_ads_5)
   end if
   if mi222_ads_6<>"" then
     mi222_cn=replace(mi222_cn,"※广告6※",mi222_ads_6)
   end if
   if mi222_ads_7<>"" then
     mi222_cn=replace(mi222_cn,"※广告7※",mi222_ads_7)
   end if
   if mi222_ads_8<>"" then
     mi222_cn=replace(mi222_cn,"※广告8※",mi222_ads_8)
   end if
   if mi222_ads_9<>"" then
     mi222_cn=replace(mi222_cn,"※广告9※",mi222_ads_9)
   end if
   if mi222_ads_10<>"" then
     mi222_cn=replace(mi222_cn,"※广告10※",mi222_ads_10)
   end if
   FilePath=mi222_pt
   Set fso = Server.CreateObject("Scripting.FileSystemObject")
   Set fout = fso.Createtextfile(server.mappath(FilePath),true)
   Fout.WriteLine mi222_cn
   rs.movenext
   if rs.eof then
    exit for
   end if
  next
 end if
 news_count=rs.recordcount
 rs.close
Response.Write "操作结果:文章页生成成功!<br>生成数量:"& news_count &"篇。<br>文件路径:网站目录\news\<br>"
set htmlwrite=Nothing  
set fso=Nothing
end function
'生成分类页面函数
function sort_htm(bigclass,smaclass,page_size)
  mi222_cn=FSOFileRead("mi222mb/sort.html")
  if page_size="" then
    page_size=20
  end if
  sql="SELECT * from mi222class where bigclass='"& bigclass &"' and smaclass='"& smaclass &"'"
  rs.Open sql,conn,1,1
  if rs.bof or rs.eof then
    rs.close
	response.Write("没有此文章分类!")
	response.End()
  else
    sort_id=rs("id")
	class_key=rs("classkey")&" "&mi222_key
	rs.close
	sql="SELECT * from mi222class where bigclass='"& bigclass &"' and smaclass='mi222'"
	rs.Open sql,conn,1,1
	if rs.bof or rs.eof then
	  rs.close
	  response.Write("没有此文章分类!")
	  response.End()
	else

⌨️ 快捷键说明

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