问题描述
<!--#includefile="../inc/const.asp"--><!--#includefile="inc/char.asp"--><!--#includefile="../Template.Asp"--><!--#includefile="../inc/ubbcode.asp"--><%Server.ScriptTimeout=9999%><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title><%=site_info(0)%></title><linkhref="xfok.css"type="text/css"rel="stylesheet"><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><bodytext=#000000leftmargin=0topmargin=0marginheight="0"marginwidth="0"bgcolor="#E5E5E5"><br><%DimAction,Title,ContentIfNotCheckAdmin(ScriptName)ThenstrMsg="<Li>您没有管理本页面的权限。"CallMsg()ElseSelectCaseRequest("Action")Case"ArticleBatchDel"CallArticleBatchDel()Case"ArticleBatchMove"CallArticleBatchMove()Case"ArticleBatchCheck"CallArticleBatchCheck()Case"ArticleHtml"CallArticleHtml()Case""Response.RedirectUrlEndSelectEndIfSubArticleBatchDel()DimArticleID,arrArticleID,Mode,Rs2,Sql2,c_filepath,i,fso,foutArticleID=Request.Form("ArticleId")Mode=Request.Form("Mode")IfArticleID=""ThenResponse.RedirectUrlarrArticleID=Split(ArticleID,",")Fori=0toUBound(arrArticleID)IfMode="Check"ThenSql="DeleteFROM"&TableArticleNoCheck&"WhereID="&arrArticleID(i)ElseSql="DeleteFROM"&TableArticle&"WhereID="&arrArticleID(i)SetRs2=Server.CreateObject("ADODB.Recordset")Sql2="Selectc_filepathFrom"&TableArticle&"WhereID="&arrArticleID(i)Rs2.OpenSql2,Conn,1,1c_filepath=Rs2("c_filepath")Rs2.CloseSetRs2=NothingIfc_filepath<>""ThenSetfso=Server.CreateObject("Scripting.FileSystemObject")c_filepath=Server.MapPath(c_filepath)Iffso.FileExists(c_filepath)Thenfso.DeleteFile(c_filepath)Response.Writec_filepathEndIfSetfso=NothingEndIfEndIfConn.ExecuteSqlIfMode=""Then'删除相关评论Conn.Execute("DeleteFROM"&TableRemark&"WhereArticleID="&arrArticleID(i))EndIfNextDataClose()Response.RedirectUrlEndSubSubArticleBatchMove()DimArticleID,ClassID,NClassIDArticleID=Request.Form("ArticleId")ClassID=Request.Form("ClassID")NClassID=Request.Form("NClassID")IfClassID=""ThenClassID=0IfClassID=0ThenstrMsg="<li>请选择目的分类"CallMsg()ElseIfArticleID=""ThenResponse.RedirectUrlSQL="UPDATE"&TableArticle&"SETClassID="&ClassID&",NClassID="&NClassID&"WhereIdIn("&ArticleID&")"Conn.ExecuteSQLSetRs=NothingDataClose()Response.RedirectUrlEndIfEndSubSubArticleBatchCheck()DimArticleIDArticleID=Request.Form("ArticleId")IfArticleID=""ThenResponse.RedirectUrlSQL="InsertInto"&TableArticle&"(ClassID,NClassID,Title,Content,sKey,Author,WriteFrom,AddUser)"SQL=SQL&"SelectClassID,NClassID,Title,Content,sKey,Author,WriteFrom,AddUser"SQL=SQL&"FROM"&TableArticleNoCheck&"WhereIdIn("&ArticleID&")"Conn.Execute(SQL)Conn.Execute("DeleteFROM"&TableArticleNoCheck&"WhereIdIn("&ArticleID&")")DataClose()Response.RedirectUrlEndSubSubArticleHtml()DimArticleID,arrArticleID,RsHtml,SqlHtml,iDimID,ClassID,NClassID,sKey,Author,AddDate,Hits,WriteFrom,isHtml,AddUser,Editor,htmlIsNo,c_filepathDimrstem,sqltem,DefaultTemplate,fname,folder,htmlyear,htmlmonth,htmlcontent,fout,fso,folders,PageListArticleID=Request.Form("ArticleId")arrArticleID=Split(ArticleID,",")IfArticleID=""ThenResponse.RedirectUrlFori=0toUBound(arrArticleID)SetRsHtml=Server.CreateObject("ADODB.Recordset")SqlHtml="Select*from[Article]WhereID="&arrArticleID(i)'SqlHtml="Select*from[Article]wherec_filepath=''orderbyIDASC"'SqlHtml="Select*from[Article]orderbyIDASC"RsHtml.OpenSqlHtml,Conn,1,1dowhilenotRsHtml.eofID=RsHtml("ID")ClassID=RsHtml("ClassID")NClassID=RsHtml("NClassID")Title=RsHtml("Title")Content=RsHtml("Content")sKey=RsHtml("sKey")Author=RsHtml("Author")AddDate=RsHtml("AddDate")Hits=RsHtml("Hits")WriteFrom=RsHtml("WriteFrom")isHtml=RsHtml("isHtml")AddUser=RsHtml("AddUser")Editor=RsHtml("Editor")htmlIsNo=RsHtml("htmlIsNo")c_filepath=RsHtml("c_filepath")'RsHtml.close'setRsHtml=nothingifc_filepath<>""thenc_filepath=c_filepathelsefname=makefilename()'makefilename为自定义函数htmlyear=year(AddDate)htmlmonth=right("0"&month(AddDate),2)folder="../newsfile/"&htmlyear&"-"&htmlmonth&"/"c_filepath=folder&fname&ID&".html"endifsetrstem=Server.Createobject("Adodb.Recordset")ifNClassID=0thensqltem="SelectTemplateFROMClassWhereID="&ClassIDelsesqltem="SelectTemplateFROMNClassWhereID="&NClassIDendifrstem.Opensqltem,Conn,1,1DefaultTemplate=rstem("Template")rstem.closesetrstem=nothing164行错误Html=Head_Body_Html(DefaultTemplate)<<<----这里显示Head_Body_Html不匹配'Html=Html&DefaultTemplate'页面主体'页面主体Html=Html&ReadFile(DefaultTemplate,"disp")Html=Replace(Html,"{title}",Title)Content=Replace(Content,"UploadFile/ea_","../../UploadFile/ea_")IfisHtml=1ThenHtml=Replace(Html,"{content}",UbbCode(Content,2))ElseHtml=Replace(Html,"{content}",UbbCode(Content,1))EndIfHtml=Replace(Html,"{author}",author)Html=Replace(Html,"{datetime}",AddDate)Html=Replace(Html,"{writefrom}",writefrom)Html=Replace(Html,"{pagelist}",PageList)Html=Replace(Html,"{editor}",Editor)Html=Replace(Html,"{id}",ID)'Html=Replace(Html,"{classid}",ClassID)Html=Replace(Html,"{prvnextarticle}",PrvNextArticle(ID,ClassID,NClassID))Html=Replace(Html,"{other}",GetAboutArticle(sKey,ID))'Response.WriteHtmlHtml=Html&Bottom_Html(DefaultTemplate)Setfso=Server.CreateObject("Scripting.FileSystemObject")folders=Split(c_filepath,"/")folder=folders(0)&"/"&folders(1)&"/"&folders(2)folder=Server.MapPath(folder)IfFso.FolderExists(folder)=FalseThenfso.CreateFolder(folder)EndifSetfout=fso.CreateTextFile(Server.MapPath(c_filepath))fout.WriteLineHtmlfout.closeConn.execute("updateArticlesethtmlIsNo=True,c_filepath='"&c_filepath&"'whereID="&ID)RsHtml.movenextloopRsHtml.closesetRsHtml=nothingNextDataClose()Response.RedirectUrlEndSub
下面是包含文件Template.Asp代码:<%DimClassID,NClassID,strClass,strNClassClassID=CheckStr(Request.QueryString("ClassID"))NClassID=CheckStr(Request.QueryString("NClassID"))SubHead()Html=LoadTemplate("head")Html=Replace(Html,"{site_title}",Site_Info(0))Response.WriteHtmlEndSubSubHead_Body()Html=LoadTemplate("head")&LoadTemplate("head_body")Html=Replace(Html,"{site_title}",Site_Info(0))Html=Replace(Html,"{site_url}",Site_Info(1))Html=Replace(Html,"{site_logo}",Site_Info(3))Html=Replace(Html,"{site_mail}",Site_Info(2))Html=Replace(Html,"{site_banner}",AdRotator(Site_Info(4),Chr(10)))Response.WriteHtmlEndSubSubBottom()Html=LoadTemplate("bottom")ReplaceFoot()Response.WriteHtmlDataClose()EndSubSubGetCurrentTemplate()DimCurrTemplate,cRsIfNClassID=""ThenSQL="SELECTClass,TemplateFROM"&TableClass&"WHEREID="&ClassIDElseSQL="SELECTNClass,TemplateFROM"&TableNClass&"WHEREID="&NClassIDEndIfSetcRs=Conn.Execute(SQL)IfcRs.EOFOrcRs.BOFThenResponse.Redirect"Index.Asp"ElseCurrTemplate=cRs(1)IfCurrTemplate<>""ThenDefaultTemplate=CurrTemplatestrClass=cRs(0)EndIfSetcRs=NothingEndSubSubWriteTitle(Title)Html=Html&"<script>document.title='"&Site_Info(0)&"-"&Title&"'</script>"EndSubFunctionTop_List(Order)DimTitle,TitleColor,Result,ClassID,NClassID,Rs,arrResult,nRowsDimSqlStrSqlStr=NullClassID=CheckStr(Request.QueryString("ClassID"))NClassID=CheckStr(Request.QueryString("NClassID"))IfClassID=""ThenClassID=0IfNClassID=""ThenNClassID=0IfClassID<>0ThenSqlStr="WhereClassID="&ClassIDIfNClassID<>0AndClassID<>0ThenSqlStr="WHEREClassID="&ClassID&"ANDNClassID="&NClassIDSelectCaseOrderCase"top_hotlist"SqlStr=SqlStr&"OrderByHitsDesc,ID"Case"recommendlist"IfClassID<>0ThenSqlStr=SqlStr&"AndisRecommend=1OrderByIDDesc"ElseSqlStr="WhereisRecommend=1OrderByIDDesc"EndIfCaseElseSqlStr="OrderByIDDesc"EndSelectSQL="SelectTop"&Site_Info(10)&"ID,Title,Hits,TitleColorFROM"&TableArticle&""&SqlStrSetRs=Conn.Execute(SQL)IfNot(Rs.EOFOrRs.BOF)ThenarrResult=Rs.GetRows()nRows=UBound(arrResult,2)Fori=0tonRowsTitle=CutStr(arrResult(1,i),22)TitleColor=arrResult(3,i)IfTitleColor<>""ThenTitle="<fontstyle=""color:"&TitleColor&";"">"&Title&"</font>"Result=Result&"<imgsrc='images/jt0.gif'align='absmiddle'border='0'><ahref=""dispArticle.Asp?ID="&arrResult(0,i)&"""Title="""&arrResult(1,i)&"<br>"&"点击:"&arrResult(2,i)&"""target=""_blank"">"&Title&"</a><br>"NextElseResult="<tr><td>尚未添加</td></tr>"EndIfTop_List=ResultSqlStr=""SetRs=NothingEndFunction%>
解决方案
本帖最后由 muksun 于 2011-11-01 20:50:24 编辑
解决方案二:
错误提示是哪一行呢?这么多代码,看起来费时间。问题要描述清楚点。
解决方案三:
是这里有错误,用红色标注的,没有显示出来164行错误Html=Head_Body_Html(DefaultTemplate)<<<----这里显示Head_Body_Html不匹配'Html=Html&DefaultTemplate'页面主体'页面主体
解决方案四:
Head_Body_Html这个函数名称估计弄错了,检查下。
解决方案五:
贴:Head_Body_Html函数出来看看。