📄 create_article_default.asp
字号:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<!-- #include file="inc/function.asp" -->
<HTML><HEAD><TITLE>后台管理 </TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="admin.css" type=text/css rel=stylesheet>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<!-- #include file="admin_header.asp" -->
<table width="100%" border="0" cellspacing="2">
<tr>
<td width="20%" align="center" valign="top" class="tdbgleft"><!-- #include file="Admin_Left.asp" --></td>
<td class="b1" valign="top">
<% if Trim(Request.Form("SoftNum"))<>"" then session("SoftNum")=Trim(Request.Form("SoftNum"))
if isnull(session("SoftNum")) or session("SoftNum")="" then session("SoftNum")=500
MaxPerPage=cint(session("SoftNum"))
msgtitle="生成软件学院默认首页"
if not isnull(cUserName) or cUserName<>"" then
if chkMaster(cUserName) then
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set Rs=server.createobject("adodb.recordset")
'读取默认模板
sql="select ID,Article_Head,Article_default,Article_foot from SoftDown_Template where isActive=true"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "您没有添加模板,或者没有设置默认模板。"
response.end
else
HtmlTemplate=rs("Article_Head")&rs("Article_default")&rs("Article_foot")
end if
rs.close
call action1()
call Sysmsg(msgtitle,"操作成功!")
Set Rs=nothing
Set fso=nothing
else
msginfo="<li>操作错误,你不是系统管理员,没有权限进行此项操作!</li>"
call Sysmsg(msgtitle,msginfo)
end if
else
msginfo="<li>操作错误,你没有登录系统!<li><a href=""User.Asp"">点此登录系统</a></li>"
call Sysmsg(msgtitle,msginfo)
end if
sub action1()
'----变量申明
dim strAll_Update,strMessages,strTitle,strNewsInfo,strNewsInfo1,strNewsInfo2,strNewsInfo3,strNewsInfo4,strNewsInfo5,strNewsInfo6,strNewsInfo7,strNewsInfo8
'----变量赋值
strAll_update=article_update(0,15,50,7,0) '显示15篇文章,根据实际情况进行调整
strMessages=GetMessages(5,1)
strTitle=System_info(0)&" → 网络学院首页"
strNewsInfo1=article_update(1,10,40,0,1)
strNewsInfo2=article_update(2,10,40,0,1)
strNewsInfo3=article_update(3,10,40,0,1)
strNewsInfo4=article_update(4,10,40,0,1)
strNewsInfo5=article_update(5,10,40,0,1)
strNewsInfo6=article_update(6,10,40,0,1)
strNewsInfo7=article_update(7,10,40,0,1)
strNewsInfo8=article_update(8,10,40,0,1)
HtmlContent=HtmlTemplate
'----将模板中的“用户标记”替换成赋值后的变量值。
HtmlContent=replace(HtmlContent,"$All_Update$",""&strAll_Update&"")
HtmlContent=replace(HtmlContent,"$Messages$",""&strMessages&"")
HtmlContent=replace(HtmlContent,"$Title$",""&strTitle&"")
HtmlContent=replace(HtmlContent,"$Catalog1$",""&strNewsInfo1&"")
HtmlContent=replace(HtmlContent,"$Catalog2$",""&strNewsInfo2&"")
HtmlContent=replace(HtmlContent,"$Catalog3$",""&strNewsInfo3&"")
HtmlContent=replace(HtmlContent,"$Catalog4$",""&strNewsInfo4&"")
HtmlContent=replace(HtmlContent,"$Catalog5$",""&strNewsInfo5&"")
HtmlContent=replace(HtmlContent,"$Catalog6$",""&strNewsInfo6&"")
HtmlContent=replace(HtmlContent,"$Catalog7$",""&strNewsInfo7&"")
HtmlContent=replace(HtmlContent,"$Catalog8$",""&strNewsInfo8&"")
HtmlContent=replace(HtmlContent,"../","./")
HtmlFileName=Server.MapPath("default_study.html")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine HtmlContent
fout.close:set fout = nothing
end sub
%>
</td>
</tr>
</table>
<!-- #include file="admin_footer.asp" -->
</BODY></HTML>
<% CloseDatabase %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -