html_make_sorturl.asp
来自「完整的网址站」· ASP 代码 · 共 283 行
ASP
283 行
<!--#include file="config.asp"-->
<%
dim founderr,errmsg
founderr=false
errmsg=""
if session("adminlogin")<>sessionvar then
founderr=true
errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='index.asp'>重新登录</a>!"
call diserror()
response.end
end if
if session("flag")>1 then
errmsg=errmsg+"<br>"+"<li>你的管理权限不够!!</a>!"
call diserror()
response.end
end if%>
<html>
<head>
<title>在线导航 - 管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"><script>if(top==self)top.location="index.asp" </script>
<TABLE WIDTH="99%" BORDER="0" CELLPADDING="2" CELLSPACING="0" BGCOLOR="#0099CF" class="HeaderTdStyle" >
<TR BGCOLOR="#0099CF"> <TD HEIGHT="22"
COLSPAN="2" ALIGN="center"><B>按分类更新前台HTML页面</B></TD></TR> <TR>
<TD WIDTH="80" HEIGHT="30" BGCOLOR=""#0099CF""><B>管理导航:</B></TD>
<TD
HEIGHT="30" BGCOLOR="#ffffff" width="921">您只需选择一个分类便可以更新该分类所在的上级和下级全部分类页面</TD>
</TR>
</TABLE><BR><%if Request("action")="" then%>
<DIV ALIGN="CENTER">
<table width="75%" border="0" cellspacing="1" cellpadding="0" bgcolor="#0099CF">
<tr bgcolor="#0099CF">
<td height="26">请选择一个分类</td>
</tr> <form name="form1" method="post" action="?action=makesorthtm">
<tr bgcolor="#ffffff">
<td bgcolor="#ffffff" height="50" valign="middle">
<select name="sortid">
<%
sql="select * from happywz_SORT order by bigid,orders"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
do while not rs.eof
%>
<option value="<%=rs("sortid")%>">
<%if rs("sortstep")>0 then
for i=1 to rs("sortstep")%>
→
<%next
end if%>
<%=rs("sort")%></option>
<%
rs.movenext
loop
rs.Close()
set rs=nothing
%>
</select>
<input type="submit" name="Submit" value="更新前台分类页面">
</td>
</tr></form>
<tr bgcolor="#ffffffe">
<td> </td>
</tr>
</table></DIV>
<BR>
<BR> <% end if
if Request("action")="makesorthtm" then
%> <table cellspacing="1" cellpadding="3" width="96%" class="table1" align="CENTER" >
<tr bgcolor="#0099CF">
<td height="25" class="title"><b>分类名称(所在目录)(更新数据)</b></td>
<td class="title"><b>更新日期</b></td>
<td class="title"><b>操作提示</b></td>
</tr>
<%dim sml
newsday=""&year(date())&"年"&month(date())&"月"&day(date())&"日"
set rs0000=server.createobject("adodb.recordset")
sql0000="select sortid,sort,reid,bigid,sml,ymgjc from happywz_SORT where sortid="&Request("sortid")
rs0000.open sql0000,conn,1,1
if not rs0000.eof then
sml=rs0000("sml")
sql="select * from happywz_SORT where bigid="&cint(rs0000("bigid"))&" order by sortstep,orders"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.eof then
sml=rs0000("sml")
Response.Write("<tr bgcolor=""#B0CBE6"">")
Response.Write("<td colspan=""6"" height=""50"">目前还没有分类,请<a href=""admin_class_edit.asp?a=add"">添加一个分类</a></td>")
Response.Write("</tr>")
end if
do while not rs.eof %>
<tr bgcolor="#ffffff">
<td height="22" width="40%" >
<%
dim sortitle1,sortitle,sortstep
if rs("reid")="0" then
sortitle1=" >> "&rs("sort")
sortitle=""
classlink1=" >> <a href="&sml&".htm class=title>"&rs("sort")&"</a>"
classlink=""
Response.write sortitle1
sortstep=rs("sortstep")
titlename=sortitle1
classname=classlink1
else
if rs("sortstep")=sortstep then
sortitle=sortitle1&" >> "&rs("sort")
classlink=classlink1&" >> <a href="&sml&".htm class=title>"&rs("sort")&"</a>"
else
sortitle=sortitle1&""&sortitle&" >> "&rs("sort")
classlink=classlink1&""&classlink&" >> <a href="&sml&rs("sortid")&".htm class=title>"&rs("sort")&"</a>"
end if
Response.write sortitle
sortstep=rs("sortstep")
titlename=sortitle
classname=classlink
end if
%>
<font color="#666666">(<%=rs("sml")%>)(</font><font color="#FF0000"><b><%=rs("sjsum")%></b></font>)</td>
<td><%=newsday%></td>
<% '--------写出下级分类列表
set rs_0001=server.createobject("adodb.recordset")
sqls_0001="select sortid,sort,reid from happywz_SORT where reid= " &rs("sortid")
rs_0001.open sqls_0001,conn,1,1
do while not rs_0001.eof
classlist=classlist&"<b> <A HREF="&sml&rs_0001("sortid")&".htm>"&rs_0001("sort")&"</a></b> |"
rs_0001.movenext
if rs_0001.eof then exit do
loop
rs_0001.close
set rs_0001=nothing
if classlist<>"" then classlist=left(classlist,len(classlist)-1)
'response.write classlist
'----完成%>
<%
'-----------生成数据列表
urllist="<table width='100%' cellpadding='4' cellspacing='0' bordercolorlight='#CAE9FF' bordercolordark='#FFFFFF' border='1' align='center'><tbody>"
set rs_url=server.createobject("adodb.recordset")
sql_url="select wwwid,wwwurl,wwwweb,addtime,isok,hits from happywz_WEB where wwwsort='"&rs("sort")&"' order by addtime desc"
rs_url.open sql_url,conn,1,1
jishu=1
while not rs_url.eof
if rs_url("addtime")>Now()-7 then
xin="<FONT COLOR=#FF0000>[新]</FONT>"
else
xin=""
end if
if rs_url("isok")=true then
jian="<FONT COLOR=#FF0000>√</FONT>"
else
jian=""
end if
if jishu=1 or jishu mod 4 = 1 then
urllist=urllist&"<TR><TD WIDTH='25%' "&webxs20gg&"><a href='../error.asp?id="&rs_url("wwwid")&"' title='网址报错' target=_blank>◇</a><A HREF='"&rs_url("wwwurl")&"' TARGET=_blank>"&rs_url("wwwweb")&"</A>"&xin&" "&jian&"<a href=http://www.baidu.com/baidu?tn=xs20&word="&rs_url("wwwweb")&" title='更多关于"&rs_url("wwwweb")&"的网站' target=_blank>☆</a></TD>"
else
urllist=urllist&"<TD WIDTH='25%' "&webxs20gg&"><a href='../error.asp?id="&rs_url("wwwid")&"' title='网址报错' target=_blank>◇</a><A HREF='"&rs_url("wwwurl")&"' TARGET=_blank>"&rs_url("wwwweb")&"</A>"&xin&" "&jian&"<a href=http://www.baidu.com/baidu?tn=xs20&word="&rs_url("wwwweb")&" title='更多关于"&rs_url("wwwweb")&"的网站' target=_blank>☆</a></TD>"
end if
if jishu mod 4=0 then urllist=urllist&"</tr>"
jishu=jishu+1
rs_url.movenext
wend
rs_url.close
set rs_url=nothing
urllist=urllist&"<tr align=center><td colspan=4 "&webxs20gg&"><b><a href=http://www.baidu.com/baidu?tn=xs20&word="&rs("sort")&" target=_blank>请点击访问:更多关于"&rs("sort")&"的网址</a></b></td></tr></TBODY></TABLE>"
'-----------数据列表完成
'response.write urllist
menu="| "
set rs_u=server.createobject("adodb.recordset")
sql_u="select title,url from happywz_URL where space=5 order by id"
rs_u.open sql_u,conn,1,1
while not rs_u.eof
menu=menu+"<a class='Channel' href='"&rs_u("url")&"' target='_blank'>"&rs_u("title")&"</a> | "
rs_u.movenext
wend
rs_u.close
set rs_u=nothing
'读出模版文件
set rs_2 = server.CreateObject ("Adodb.recordset")
sql_2="select * from happywz_DEMO where ifuse=1 and demoid="&cint(rs("demoid"))
rs_2.open sql_2,conn,1,1
if rs_2.eof then
errmsg=errmsg+"<br>"+"<li>该分类模版未绑定!!</a>!"
call diserror()
response.end
end if
okfile=rs_2("demohtml")
rs_2.close
set rs_2=nothing
wzdl="../addurl.asp?sort="&rs("sort")
ymgjc=rs("ymgjc")
sortkk=""
set rs_u=server.createobject("adodb.recordset")
sql_u="select sort,sml from happywz_SORT where sortstep=0"
rs_u.open sql_u,conn,1,1
jishu=1
while not rs_u.eof
if jishu=1 or jishu mod 2 = 1 then
sortkk=sortkk+"<TR bgColor=#ffffff><TD align=center "&webxs20gg&"><a href='../html/"&rs_u("sml")&".htm' title='"&rs_u("sort")&"'>"&rs_u("sort")&"</a></TD>"
else
sortkk=sortkk+"<TD align=center "&webxs20gg&"><a href='../html/"&rs_u("sml")&".htm' title='"&rs_u("sort")&"'>"&rs_u("sort")&"</a></TD></tr>"
end if
jishu=jishu+1
rs_u.movenext
wend
rs_u.close
set rs_u=nothing
sort1=rs("sort")
'---------替换模板数据
okfile = replace(okfile,"#classname#",classname)
okfile = replace(okfile,"#newsday#",newsday)
okfile = replace(okfile,"#classlist#",classlist)
okfile = replace(okfile,"#urllist#",urllist)
okfile = replace(okfile,"#titlename#",titlename)
okfile = replace(okfile,"#url#",weburl)
okfile = replace(okfile,"#email#",webemail)
okfile = replace(okfile,"#webtitle#",webtitle)
okfile = replace(okfile,"#webstat#",webstat)
okfile = replace(okfile,"#memo#",webdescription)
okfile = replace(okfile,"#logo2#",weblogo2)
okfile = replace(okfile,"#keywords#",webkeywords)
okfile = replace(okfile,"#menu#",menu)
okfile = replace(okfile,"#gao#",webgao)
okfile = replace(okfile,"#sortkk#",sortkk)
okfile = replace(okfile,"#sort1#",sort1)
'----定义目录文件夹和分类文件名称
dim fpath
dim filename
fpath="../html"
'----生成分类文件名称
if rs("sortstep")=0 then
filename=sml&".htm"
else
filename=sml&rs("sortid")&".htm"
end if
Set fso = Server.CreateObject(""&fsoset&"")
Set fout = fso.Createtextfile(server.mappath(fpath&"/"&filename),true)
fout.writeline okfile
fout.close
%>
<td><font color="#0000FF">更新完成</font> <a href="<%response.write fpath&"\"&filename%>" target="_blank"><font color="#FF0000">点击查看生成文件</font></a></td>
</tr>
<%
rs.movenext
urllist=""
classlist=""
loop
rs.close
set rs=nothing
end if
rs0000.close
set rs0000=nothing
conn.close
set conn=nothing
end if%>
</table>
<TABLE WIDTH="99%" BORDER="0" CELLPADDING="2" CELLSPACING="1" BGCOLOR="#0099CF" >
<TR BGCOLOR="#0099CF"> <TD HEIGHT="22"
COLSPAN="2" ALIGN="center"><B>操作说明</B></TD></TR> <TR BGCOLOR="#ffffff"> <TD WIDTH="87" HEIGHT="30"><B>操作说明:</B></TD><TD
HEIGHT="30">
<LI>您只需选择一个分类便可以更新该分类所在的上级和下级全部分类页面
</TD></TR> </TABLE>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?