从10月26日起到此时历时10天编写了如下代码。这是一个枯燥的过程,不断的重新思考每一步骤,力求功能全面,操作可靠。其中不断的测试不断的失败……此时,总算是大体上完成了。由于对动网论坛的数据库结构不了解,只能将部分功能写死。匆匆而成,洋洋一千三百行,其中有许多可以改进可以取消的无效代码。公开源码希望有高手能给予斧正。
作用:online 方式清理动网论坛历史数据、自动分析清理数据后的无效图片,垃圾图片、独占方式压缩论坛数据库。 适用:动网论坛 V7-V8 ASP + ACCESS 版。
〈%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%〉 〈% '页面载入 'SESSION("PICTT")=累计DV_BBS表数 Server.ScriptTimeout=999999999 '超时时间设置到最大 Response.Buffer =true '打开页面缓存 On Error Resume Next 'ASP容错 USERNAME="datavip" '默认用户名 PASSWODR="XXXXX" '默认密码 PAGENAME="历史数据管理" '程序名称 COPYRIGHT="CopyRight To Red-13" URL=Request.ServerVariables("URL") '页面URL ServerIP=Request.ServerVariables("LOCAL_ADDR") '服务器IP Action=Request("Action") '提交标签 RootPath=Server.MapPath(".") '网站根路径 WWWRoot=Server.MapPath("/") '页面程序根路径 serveru=request.servervariables("http_host")&url '服务器路径 POSTPASS=TRIM(REQUEST.Form("PASSWODR")) '密码验证 IF POSTPASS〈〉"" THEN SESSION("WEBPASS")=POSTPASS END IF THISPAGE=TRIM(REQUEST("THISPAGE")) '取得图片处理页面页面数 IF IsNumeric(THISPAGE)=FALSE THEN THISPAGE=1 END IF PICDBPATH=TRIM(REQUEST.FORM("PICDBPATH")) '接收SQL字串 DelPicData=TRIM(REQUEST("DelPicData")) '清理数据 DelPicFile=TRIM(REQUEST("DelPicFILE")) '清理文件 SESSION("INPUTLOG")=TRIM(REQUEST.Form("INPUTLOGH")) '用户便签 page=cint(request("page")) '当前页面 if page="" or page〈=0 then page=1 end if TK=trim(cint(request("TK"))) '默认选项卡标签 IF TK="" OR TK〈0 THEN TK=0 END IF sqlinfo=trim(lcase(request.Form("sqlinfo"))) DBTN=trim(request("DBTN")) TableName=trim(request("Tablename")) IF DBTN="" THEN DBTN=TableName END IF DIM F_STR '======================================================================== '数据库链接 '======================================================================== DIM CONN,CONNSTR DIM DBPATH DBPATH="./数据库路径/数据库名称.MDB" '提交上来的数据库路径 c+server.mappath(""&DBPATH&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" set conn=server.createobject("ADODB.CONNECTION") if err then err.clear else conn.open connstr end if %〉 〈!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"〉 〈html xmlns="http://www.w3.org/1999/xhtml"〉 〈head〉 〈meta http-equiv="Content-Type" c /〉 〈title〉〈%=PAGENAME%〉------〈%=SERVERIP%〉〈/title〉 〈style type="text/css"〉 body{font-family:Arial, Helvetica, sans-serif; background-color:#666; line-height:1.2em; font-size:0.9em;} .TabbedPanels { margin: 0px; padding: 0px; float: left; clear: none; width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/ }
.TabbedPanelsTabGroup { margin: 0px; padding: 0px; }
.TabbedPanelsTab { position: relative; top: 1px; float: left; padding: 4px 10px; margin: 0px 1px 0px 0px; font: bold 0.7em sans-serif; background-color: #DDD; list-style: none; border-left: solid 1px #CCC; border-bottom: solid 1px #999; border-top: solid 1px #999; border-right: solid 1px #999; -moz-user-select: none; -khtml-user-select: none; cursor: pointer; }
.TabbedPanelsTabHover { background-color: #CCC; }
.TabbedPanelsTabSelected { background-color: #EEE; border-bottom: 1px solid #EEE; }
.TabbedPanelsTab a { color: black; text-decoration: none; }
.TabbedPanelsContentGroup { clear: both; border-left: solid 1px #CCC; border-bottom: solid 1px #CCC; border-top: solid 1px #999; border-right: solid 1px #999; background-color: #EEE; }
.TabbedPanelsContent { font-family:Arial, Helvetica, sans-serif; font-size:0.9em; color:#0F0; background-color:#000; padding: 4px; }
.TabbedPanelsContentVisible { }
.VTabbedPanels .TabbedPanelsTabGroup { float: left; width: 10em; height: 20em; background-color: #EEE; position: relative; border-top: solid 1px #999; border-right: solid 1px #999; border-left: solid 1px #CCC; border-bottom: solid 1px #CCC; }
.VTabbedPanels .TabbedPanelsTab { float: none; margin: 0px; border-top: none; border-left: none; border-right: none; }
.VTabbedPanels .TabbedPanelsTabSelected { background-color: #EEE; border-bottom: solid 1px #999; }
.VTabbedPanels .TabbedPanelsContentGroup { clear: none; float: left; padding: 0px; width: 30em; height: 20em; } #LOGIN{ padding:15px;margin:auto; margin-TOP:100PX; width:40%; border: solid 1px #999; text-align:center; background-color:#000; color:#0F0; } #INPUTCLASS{ margin:4PX; padding:0PX 4PX; border:none; background-color:#000; color:#0F0; } textarea{ width:95%; height:150px; color:#0F0; background-color:#000; border:1px #0F0 solid; overflow-x:hidden; overflow-y:auto; margin:3px;} A{COLOR: #fff; TEXT-DECORATION: none;} A:visited {COLOR: #fff;TEXT-DECORATION: none;} A:active {COLOR: #ffffff; TEXT-DECORATION: none;} A:hover { COLOR: #ff9900; TEXT-DECORATION: underline blink;} 〈/style〉 〈script type="text/javascript"〉 var Spry; if (!Spry) Spry = {}; if (!Spry.Widget) Spry.Widget = {}; Spry.Widget.TabbedPanels = function(element, opts) { this.element = this.getElement(element); this.defaultTab =〈%=TK%〉; this.tabSelectedClass = "TabbedPanelsTabSelected"; this.tabHoverClass = "TabbedPanelsTabHover"; this.tabFocusedClass = "TabbedPanelsTabFocused"; this.panelVisibleClass = "TabbedPanelsContentVisible"; this.focusElement = null; this.hasFocus = false; this.currentTabIndex = 0; this.enableKeyboardNavigation = true; this.nextPanelKeyCode = Spry.Widget.TabbedPanels.KEY_RIGHT; this.previousPanelKeyCode = Spry.Widget.TabbedPanels.KEY_LEFT;
Spry.Widget.TabbedPanels.setOptions(this, opts); if (typeof (this.defaultTab) == "number") { if (this.defaultTab 〈 0) this.defaultTab = 0; else { var count = this.getTabbedPanelCount(); if (this.defaultTab 〉= count) this.defaultTab = (count 〉 1) ? (count - 1) : 0;
}
this.defaultTab = this.getTabs()[this.defaultTab]; } if (this.defaultTab) this.defaultTab = this.getElement(this.defaultTab);
this.attachBehaviors(); };
Spry.Widget.TabbedPanels.prototype.getElement = function(ele) { if (ele && typeof ele == "string") return document.getElementById(ele); return ele; };
Spry.Widget.TabbedPanels.prototype.getElementChildren = function(element) { var children = []; var child = element.firstChild; while (child) { if (child.nodeType == 1 /* Node.ELEMENT_NODE */) children.push(child); child = child.nextSibling; } return children; };
Spry.Widget.TabbedPanels.prototype.addClassName = function(ele, className) { if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1)) return; ele.className += (ele.className ? " " : "") + className; };
Spry.Widget.TabbedPanels.prototype.removeClassName = function(ele, className) { if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)) return; ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), ""); };
Spry.Widget.TabbedPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps) { if (!optionsObj) return; for (var optionName in optionsObj) { if (ignoreUndefinedProps && optionsObj[optionName] == undefined) continue; obj[optionName] = optionsObj[optionName]; } };
Spry.Widget.TabbedPanels.prototype.getTabGroup = function() { if (this.element) { var children = this.getElementChildren(this.element); if (children.length) return children[0]; } return null; };
Spry.Widget.TabbedPanels.prototype.getTabs = function() { var tabs = []; var tg = this.getTabGroup(); if (tg) tabs = this.getElementChildren(tg); return tabs; };
Spry.Widget.TabbedPanels.prototype.getContentPanelGroup = function() { if (this.element) { var children = this.getElementChildren(this.element); if (children.length 〉 1) return children[1]; } return null; };
Spry.Widget.TabbedPanels.prototype.getContentPanels = function() { var panels = []; var pg = this.getContentPanelGroup(); if (pg) panels = this.getElementChildren(pg); return panels; };
Spry.Widget.TabbedPanels.prototype.getIndex = function(ele, arr) { ele = this.getElement(ele); if (ele && arr && arr.length) { for (var i = 0; i 〈 arr.length; i++) { if (ele == arr[i]) return i; } } return -1; };
Spry.Widget.TabbedPanels.prototype.getTabIndex = function(ele) { var i = this.getIndex(ele, this.getTabs()); if (i 〈 0) i = this.getIndex(ele, this.getContentPanels()); return i; };
Spry.Widget.TabbedPanels.prototype.getCurrentTabIndex = function() { return this.currentTabIndex; };
Spry.Widget.TabbedPanels.prototype.getTabbedPanelCount = function(ele) { return Math.min(this.getTabs().length, this.getContentPanels().length); };
Spry.Widget.TabbedPanels.addEventListener = function(element, eventType, handler, capture) { try { if (element.addEventListener) element.addEventListener(eventType, handler, capture); else if (element.attachEvent) element.attachEvent("on" + eventType, handler); } catch (e) {} };
Spry.Widget.TabbedPanels.prototype.cancelEvent = function(e) { if (e.preventDefault) e.preventDefault(); else e.returnValue = false; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; return false; }; Spry.Widget.TabbedPanels.prototype.onTabClick = function(e, tab) { this.showPanel(tab); return this.cancelEvent(e); };
Spry.Widget.TabbedPanels.prototype.onTabMouseOver = function(e, tab) { this.addClassName(tab, this.tabHoverClass); return false; };
Spry.Widget.TabbedPanels.prototype.onTabMouseOut = function(e, tab) { this.removeClassName(tab, this.tabHoverClass); return false; };
Spry.Widget.TabbedPanels.prototype.onTabFocus = function(e, tab) { this.hasFocus = true; this.addClassName(tab, this.tabFocusedClass); return false; };
Spry.Widget.TabbedPanels.prototype.onTabBlur = function(e, tab) { this.hasFocus = false; this.removeClassName(tab, this.tabFocusedClass); return false; };
Spry.Widget.TabbedPanels.KEY_UP = 38; Spry.Widget.TabbedPanels.KEY_DOWN = 40; Spry.Widget.TabbedPanels.KEY_LEFT = 37; Spry.Widget.TabbedPanels.KEY_RIGHT = 39;
Spry.Widget.TabbedPanels.prototype.onTabKeyDown = function(e, tab) { var key = e.keyCode; if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode)) return true;
var tabs = this.getTabs(); for (var i =0; i 〈 tabs.length; i++) if (tabs[i] == tab) { var el = false; if (key == this.previousPanelKeyCode && i 〉 0) el = tabs[i-1]; else if (key == this.nextPanelKeyCode && i 〈 tabs.length-1) el = tabs[i+1];
if (el) { this.showPanel(el); el.focus(); break; } }
return this.cancelEvent(e); };
Spry.Widget.TabbedPanels.prototype.preorderTraversal = function(root, func) { var stopTraversal = false; if (root) { stopTraversal = func(root); if (root.hasChildNodes()) { var child = root.firstChild; while (!stopTraversal && child) { stopTraversal = this.preorderTraversal(child, func); try { child = child.nextSibling; } catch (e) { child = null; } } } } return stopTraversal; };
Spry.Widget.TabbedPanels.prototype.addPanelEventListeners = function(tab, panel) { var self = this; Spry.Widget.TabbedPanels.addEventListener(tab, "click", function(e) { return self.onTabClick(e, tab); }, false); Spry.Widget.TabbedPanels.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(e, tab); }, false); Spry.Widget.TabbedPanels.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(e, tab); }, false);
if (this.enableKeyboardNavigation) { var tabIndexEle = null; var tabAnchorEle = null;
this.preorderTraversal(tab, function(node) { if (node.nodeType == 1 /* NODE.ELEMENT_NODE */) { var tabIndexAttr = tab.attributes.getNamedItem("tabindex"); if (tabIndexAttr) { tabIndexEle = node; return true; } if (!tabAnchorEle && node.nodeName.toLowerCase() == "a") tabAnchorEle = node; } return false; });
if (tabIndexEle) this.focusElement = tabIndexEle; else if (tabAnchorEle) this.focusElement = tabAnchorEle;
if (this.focusElement) { Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "focus", function(e) { return self.onTabFocus(e, tab); }, false); Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "blur", function(e) { return self.onTabBlur(e, tab); }, false); Spry.Widget.TabbedPanels.addEventListener(this.focusElement, "keydown", function(e) { return self.onTabKeyDown(e, tab); }, false); } } };
Spry.Widget.TabbedPanels.prototype.showPanel = function(elementOrIndex) { var tpIndex = -1; if (typeof elementOrIndex == "number") tpIndex = elementOrIndex; else // Must be the element for the tab or content panel. tpIndex = this.getTabIndex(elementOrIndex); if (!tpIndex 〈 0 || tpIndex 〉= this.getTabbedPanelCount()) return;
var tabs = this.getTabs(); var panels = this.getContentPanels();
var numTabbedPanels = Math.max(tabs.length, panels.length);
for (var i = 0; i 〈 numTabbedPanels; i++) { if (i != tpIndex) { if (tabs[i]) this.removeClassName(tabs[i], this.tabSelectedClass); if (panels[i]) { this.removeClassName(panels[i], this.panelVisibleClass); panels[i].style.display = "none"; } } }
this.addClassName(tabs[tpIndex], this.tabSelectedClass); this.addClassName(panels[tpIndex], this.panelVisibleClass); panels[tpIndex].style.display = "block";
this.currentTabIndex = tpIndex; };
Spry.Widget.TabbedPanels.prototype.attachBehaviors = function(element) { var tabs = this.getTabs(); var panels = this.getContentPanels(); var panelCount = this.getTabbedPanelCount();
for (var i = 0; i 〈 panelCount; i++) this.addPanelEventListeners(tabs[i], panels[i]);
this.showPanel(this.defaultTab); };
〈/script〉 〈/head〉
〈body 〉 〈% IF SESSION("WEBPASS")〈〉PASSWODR THEN %〉 〈div id="LOGIN"〉 〈strong〉〈%=pagename%〉〈/strong〉〈Br〉〈br〉 〈form name="login" action="〈%=url%〉" method="post"〉 密 码:〈input NAME="PASSWODR" type="password" MAXLENGTH="20" id="INPUTCLASS" style="ime-mode:disabled; border-bottom:#0F0 1px solid;"〉〈input TYPE="Submit" VALUE="登 录" /〉 〈BR〉〈BR〉〈span style="font-size:7pt;"〉〈%=COPYRIGHT%〉〈/span〉 〈/form〉 〈/div〉 〈%else%〉 〈div id="TabbedPanels1" class="TabbedPanels"〉 〈ul class="TabbedPanelsTabGroup"〉 〈li class="TabbedPanelsTab" tabindex="0"〉数据管理〈/li〉 〈li class="TabbedPanelsTab" tabindex="1"〉数据压缩〈/li〉 〈li class="TabbedPanelsTab" tabindex="2"〉文件处理〈/li〉 〈/ul〉 〈div class="TabbedPanelsContentGroup"〉 〈div class="TabbedPanelsContent"〉 〈script language="javascript"〉 function pagedefault(){ //页面初始提示内容 if(document.getElementById("inputlog").value==""){ document.getElementById("inputlog").value="步骤"+"\r\n"+"1: 查找 [Dv_Board] 取得版块 boardid ."+"\r\n"+"2: 浏览文章表 [Dv_bbs'X'] 取得时间字段 DateAndTime ."+"\r\n"+"3: 构建SQL语句 DELETE FROM [数据表] WHERE boardid 〈〉 YYY(保留版面ID) AND DateAndTime 〈 #2008/1/1#"+"\r\n"+"4: 依步骤3对论坛页面文章统计 [Dv_BestTopic],[Dv_Topic] 进行删除处理."+"\r\n"+"5: 建议先进行图片处理腾出空间后再对数据库进行压缩."+"\r\n"+"注: 数据表时间字段 DateAndTime"+"\r\n"+"剥离时间点:#2008/1/1#"; } } function GetSql(i){ //构建SQL语句 if(DbForm.Temp_TableName.value==""){ DbForm.Temp_TableName.value="请选择数据表"; DbForm.DBTN.value="请选择数据表"; } Str = new Array(5); Str[0]= "SELECT * FROM ["; Str[1]= "SELECT * FROM ["; Str[2]= "DELETE FROM ["; Str[3]= "UPDATE ["; Str[4]= "INSERT INTO ["; Str2 = new Array(5); Str2[0]= "]"; Str2[1]= "] WHERE ID 〈 100 " Str2[2]= "] WHERE ID = 100 "; Str2[3]= "] SET USER=\'RED13-:special:2:- WHERE ID = 100 "; Str2[4]= "](USER,PASS) VALUES(-:special:2:-RED13-:special:2:-,-:special:2:-ADMIN888-:special:2:-)"; if(i〈0){ DbForm.Temp_SqlStr1.value = ""; DbForm.Temp_SqlStr2.value = ""; DbForm.SqlInfo.value = ""; DbForm.GetLog.value="\r\n"+"〈%=now()%〉--请确认输入SQL操作命令语句."+"\r\n"+DbForm.GetLog.value; }else{ DbForm.Temp_SqlStr1.value = Str[i]; DbForm.Temp_SqlStr2.value = Str2[i]; DbForm.DBTN.value=DbForm.Temp_TableName.value; DbForm.Temp_TableName.value = DbForm.Temp_TableName.value; DbForm.SqlInfo.value = Str[i]+DbForm.Temp_TableName.value+Str2[i]; } var Temp_sqlstr; if(i==0){ Temp_sqlstr="完全显示"; }else if(i==1){ Temp_sqlstr="显示数据"; }else if(i==2){ Temp_sqlstr="删除数据"; }else if(i==3){ Temp_sqlstr="修改数据"; }else if(i==4){ Temp_sqlstr="添加数据"; } document.getElementById("GetLog").value="〈%=now()%〉--选择了 ( "+Temp_sqlstr+" )."+"\r\n"+document.getElementById("GetLog").value; DbForm.GetLogH.value=document.getElementById("GetLog").value; return true; } function GetTable(Table){ //构建SQL语句,数据表 DbForm.Temp_TableName.value=Table; if(DbForm.Temp_TableName.value==""){ DbForm.Temp_TableName.value=="请选择数据表"; DbForm.DBTN.value=DbForm.Temp_TableName.value; DbForm.SqlInfo.value=DbForm.Temp_SqlStr1.value+DbForm.Temp_TableName.value+DbForm.Temp_SqlStr2.value; document.getElementById("GetLog").value="〈%=now()%〉--请选择要进行SQL操作的数据表."+"\r\n"+document.getElementById("GetLog").value; }else{ DbForm.DBTN.value=DbForm.Temp_TableName.value; DbForm.SqlInfo.value=DbForm.Temp_SqlStr1.value+Table+DbForm.Temp_SqlStr2.value; if(DbForm.Temp_SqlStr1.value==""){ document.getElementById("GetLog").value="〈%=now()%〉--您选择了数据表"+Table+"请确认SQL操作方式."+"\r\n"+document.getElementById("GetLog").value; }else{ document.getElementById("GetLog").value="〈%=now()%〉--您选择了数据表"+Table+"确认语句无误后点击执行."+"\r\n"+document.getElementById("GetLog").value; } } DbForm.GetLogH.value=document.getElementById("GetLog").value; return true; } function yesok(){ if (confirm("确认要执行此操作吗?一但删除无法恢复!!")) if (DbForm.TName.value == "sysconfig") { alert("该表不允许删除记录!!"); return false; } else return true; else return false; } function FullSqlStr(str,pg,tn){ if(str.length〈10){ alert("请检查SQL语句是否正确!") return false; } DbForm.GetLogH.value=document.getElementById("GetLog").value; DbForm.inputlogH.value=document.getElementById("inputlog").value; //收集操作日记 DataS.inputlogH.value=document.getElementById("inputlog").value; //收集操作日记 DbForm.SqlInfo.value = str ; DbForm.Page.value = pg; DbForm.DBTN.value = tn;
DbForm.submit(); return true; }
function FullPicSql(sql,tpg,tk,ddc,dfc){ //图片处理翻页 DataPic.GetLogH.value = document.getElementById("GetLogPic").value; DataPic.inputlogH.value = document.getElementById("inputlogPic").value; if(ddc=="1"){ DataPic.DelPicData.checked=true ; }else{ DataPic.DelPicData.checked=false; } if(dfc=="1"){ DataPic.DelPicFile.checked=true ; }else{ DataPic.DelPicFile.checked=false; }
//DataPic.DelPicFile.value = dfc; DataPic.PICDBPATH.value = sql; DataPic.THISPAGE.value = tpg; DataPic.TK.value = tk; DataPic.submit(); return true; }
function CheckUP(){ //提交确认,暂时存在问题!! if(DbForm.SqlInfo.value==""){ if(DbForm.Temp_SqlStr1.value==""){ alert("请选择执行语句!"); return false; }else if(DbForm.Temp_TableName.value==""){ alert("请选择执行数据表!"); return false; }else if(DbForm.Temp_TableName.value=="请选择数据表"){ alert("请选择执行数据表!"); return false; } }else{ DbForm.GetLogH.value="〈%=now()%〉--执行语句:"+DbForm.SqlInfo.value+"\r\n"+document.getElementById("GetLog").value; //收集操作日记 document.getElementById("inputlog").value=DbForm.inputlogH.value; DataS.GetLogH.value=document.getElementById("GetLog").value; //收集操作日记 DbForm.submit(); return true; } } function DataS2(){ //提交确认,暂时存在问题!! DataS.GetLogH.value="〈%=now()%〉--进行了数据库压缩."+"\r\n"+document.getElementById("GetLogD").value; document.getElementById("GetLogD").value=DataS.GetLogH.value; DataS.inputlogH.value=document.getElementById("inputlogD").value; //收集操作日记
if(DataS.DBPATH2.value==""){ alert("请输入数据库路径!"); return false; }else{ DataS.submit(); return true; } }
function DataPicPOST(){ if(DataPic.DelPicData.checked==true){ if(DataPic.DelPicFile.checked==true){ DataPic.GetLogH.value="〈%=now()%〉--进行了删除无效数据与删除无效文件操作."+"\r\n"+document.getElementById("GetLogPic").value; }else{ DataPic.GetLogH.value="〈%=now()%〉--进行了删除无效数据操作."+"\r\n"+document.getElementById("GetLogPic").value; } }else if(DataPic.DelPicData.checked==false){ if(DataPic.DelPicFile.checked==true){ DataPic.GetLogH.value="〈%=now()%〉--进行了删除无效文件操作."+"\r\n"+document.getElementById("GetLogPic").value; }else{ DataPic.GetLogH.value="〈%=now()%〉--进行了[Dv_UpFile]数据表分析."+"\r\n"+document.getElementById("GetLogPic").value; } } DataPic.submit(); return true; } function CHECKDATA(){ if(DataPic.DelPicData.checked==true){ document.getElementById("GetLogPic").value="〈%=now()%〉--选择删除无效数据!"+"\r\n"+document.getElementById("GetLogPic").value; }else if(DataPic.DelPicData.checked==false){ document.getElementById("GetLogPic").value="〈%=now()%〉--取消删除无效数据!"+"\r\n"+document.getElementById("GetLogPic").value; } } function CHECKFILE(){ if(DataPic.DelPicFile.checked==true){ document.getElementById("GetLogPic").value="〈%=now()%〉--选择删除无效文件!"+"\r\n"+document.getElementById("GetLogPic").value; }else if(DataPic.DelPicFile.checked==false){ document.getElementById("GetLogPic").value="〈%=now()%〉--取消删除无效文件!"+"\r\n"+document.getElementById("GetLogPic").value; } } 〈/script〉
〈% SESSION("GetLog")=TRIM(REQUEST.Form("GETLOGH")) CALL SQL_MANAGE_PAGE() %〉 〈/div〉 〈div class="TabbedPanelsContent"〉
〈% CALL DATACLASS() SSS=SERVER.MapPath(DBPATH) QQQ=LEFT(SSS,INSTRREV(SSS,"\")) CALL FILE_LIST(QQQ,FALSE) DBPATH2=trim(lcase(request.Form("DBPATH2"))) if DBPATH2〈〉"" and instr(DBPATH2,".mdb")〉0 then CALL CompactDB(DBPATH2) end if DBPATH2="" %〉 〈/div〉 〈div class="TabbedPanelsContent"〉 〈%CALL PIC()%〉 〈% IF PICDBPATH〈〉"" THEN CALL checkpic(PICDBPATH,DelPicData,DelPicFile) END IF PICDBPATH="" DelPicData="" DelPicFile="" %〉 〈/div〉 〈/div〉 〈/div〉 〈script type="text/javascript"〉 〈!-- var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); //--〉 〈/script〉 〈%end if%〉 〈/body〉 〈/html〉
〈% SUB SQL_MANAGE_PAGE() TEMP_SQLPAGE=TEMP_SQLPAGE&"〈form name='DbForm' method='post' action='"&URL&"' 〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈input name='Page' value='"&page&"' type='hidden'〉〈input name='TK' value='0' type='hidden'〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈input name='DBTN' value='"&Temp_TableName&"' type='hidden'〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈input name='Temp_SqlStr1' value='"&Temp_SqlStr1&"' type='hidden'/〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈input name='Temp_TableName' value='"&Temp_TableName&"' type='hidden'/〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈input name='Temp_SqlStr2' value='"&Temp_SqlStr2&"' type='hidden'/〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈textarea name='GetLogH' style='display:none;'〉〈/textarea〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈textarea name='inputlogH' style='display:none;'〉〈/textarea〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈tbody〉〈tr valign='top'〉〈td width='60%'〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈TR〉〈td width='100'〉执行语句:〈/td〉〈td〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈select name='StrBtn' 〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈option value='-1'〉--SQL操作--〈/option〉〈option value='0'〉完全显示〈/option〉〈option value='1'〉显示数据〈/option〉〈option value='2'〉删除数据〈/option〉〈option value='3'〉修改数据〈/option〉〈option value='4'〉添加数据〈/option〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈/select〉 〈input name='Submit' type='submit' value='执 行'/〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈/td〉〈/TR〉〈tr〉〈td width='100'〉数据来源:〈/td〉〈td〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈select name='Table' 〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈option value=''〉--选择数据表--〈/option〉"
Set ADVRS=CONN.OpenSchema(20) ADVRS.MoveFirst PICTT=0 Do While Not ADVRS.Eof If ADVRS("TABLE_TYPE")="TABLE" then
TName=trim(ADVRS("TABLE_NAME")) '记初始DV_BBS表 IF LEFT(LCASE(TRIM(TName)),6)="dv_bbs" then '累计 DV_BBS 表数. IF IsNumeric(MID(TRIM(TNAME),7,LEN(TRIM(TName))))=TRUE THEN PICTT=PICTT+1 END IF end if SESSION("PICTT")=PICTT
TEMP_SQLPAGE=TEMP_SQLPAGE&"〈option value='"&TName&"'〉"&TName&"〈/option〉"
End If ADVRS.MoveNext Loop
TEMP_SQLPAGE=TEMP_SQLPAGE&"〈/select〉〈/td〉〈/TR〉〈TR〉〈td〉Command:\>〈/td〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈td〉〈input name='SqlInfo' value='"&SqlInfo&"' id='INPUTCLASS' style='width:95%; margin:3px; border-bottom:#F00 1px solid;'/〉〈/td〉〈/TR〉〈/form〉〈tr〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈td width='100'〉操作日志:〈/td〉〈td〉〈textarea name='GetLog' Id='GetLog' style='height:100px; overflow:hidden;'〉"&SESSION("GETLOG")&"〈/textarea〉〈/td〉"
'SESSION("GETLOG")=""
TEMP_SQLPAGE=TEMP_SQLPAGE&"〈/tr〉〈/table〉〈/td〉〈td width='40%'〉〈table width='100%' border='0' cellpadding='0' cellspacing='0'〉〈tr valign='top'〉〈td〉临时便签:〈/td〉〈/tr〉〈Tr valign='top'〉〈td〉" TEMP_SQLPAGE=TEMP_SQLPAGE&"〈textarea name='inputlog' id='inputlog'〉" SESSION("INPUTLOG")
TEMP_SQLPAGE=TEMP_SQLPAGE&"〈/textarea〉〈/td〉〈/tr〉〈/table〉〈/td〉〈/tr〉〈/tbody〉〈/table〉" RESPONSE.Write TEMP_SQLPAGE
'数据库操作 dim str
If sqlinfo〈〉"" and left(sqlinfo,6)="select" then SET SRS=SERVER.CreateObject("ADODB.RECORDSET") '数据流 SRS.OPEN sqlinfo,CONN,1,1 '打开 fn=srs.fields.count fr=srs.recordcount srs.pagesize=20 count=srs.pagesize pn=srs.pagecount if page〈〉"" then page=cint(page) end if if page="" or page=0 or page〈0 then page=1 end if if page〉pn then page=pn end if srs.absolutepage=page str=str&"〈table width='100%' bgcolor='#00FF00' border='0' cellpadding='0' cellspacing='0'〉〈td〉〈table width='100%' cellpadding='0' cellspacing='1' border='0'〉〈tr height='25' bgcolor='#333333'〉〈td〉X〈/td〉" for n=0 to fn-1 set fld=srs.fields.item(n) '字段名 str=str&"〈td align='center'〉 "&fld.name&" 〈/td〉" set fld=nothing next str=str&"〈/tr〉" bgcolor="#333333" do while not( srs.eof) and count〉0 count=count-1 if bgcolor="#333333" then bgcolor="#666666" else bgcolor="#333333" end if str=str&"〈tr bgcolor='"&bgcolor&"'〉" str=str&"〈td align=cetner〉〈a href='javascript:FullSqlStr(""DELETE FROM ["&DBTN&"] WHERE ID="&SRS(0)&""",1,"""&DBTN&""");yesok()' title='删除该条记录'〉〈font face='wingdings' COLOR='#ff9900'〉x〈/font〉〈/a〉〈/td〉" for i=0 to fn-1 if fr=1 then colinfo=htmlencode(srs(i)) else colinfo=htmlencode(left(srs(i),50)) end if str=str&"〈td bgcolor='"&bgcolor&"'〉"&colinfo&"〈/td〉" colinfo="" next str=str&"〈/tr〉" srs.movenext loop response.Write si:si="" sqlinfo=htmlencode(sqlinfo) str=str&"〈tr〉〈td bgcolor='"&bgcolor&"' colspan='"&fn+1&"'〉"&now()&" 执行语句:〈font color='#FF9900'〉"&sqlinfo&"〈/font〉 总记录数: "&FR&" 条 页码: "&Page&"/"&PN If PN〉1 Then str=str&" 〈a href='javascript:FullSqlStr("""&Sqlinfo&""",1,"""&DBTN&""")'〉首页〈/a〉 〈a href='javascript:FullSqlStr("""&Sqlinfo&""","&Page-1&","""&DBTN&""")'〉上一页〈/a〉 " If Page〉8 Then:Sp=Page-8:Else:Sp=1:End if For i=Sp To Sp+8 If i〉PN Then Exit For If i=Page Then str=str&i&" " Else str=str&"〈a href='javascript:FullSqlStr("""&Sqlinfo&""","&i&","""&DBTN&""")'〉"&i&"〈/a〉 " End If Next str=str&" 〈a href='javascript:FullSqlStr("""&Sqlinfo&""","&Page+1&","""&DBTN&""")'〉下一页〈/a〉 〈a href='javascript:FullSqlStr("""&Sqlinfo&""","&PN&","""&DBTN&""")'〉尾页〈/a〉" End If str=str&"〈/td〉〈/tr〉〈/table〉〈/td〉〈/table〉" SRS.Close Set SRS=Nothing Response.Write str:str="" Else IF LEFT(SQLINFO,6)="DELETE" OR LEFT(SQLINFO,6)="update" or LEFT(SQLINFO,6)="insert" then Conn.EXECUTE(sqlinfo) str=str&" 执行语句:〈font color='#FF9900'〉"&sqlinfo&"〈/font〉" end if Response.Write str:str="" End If END SUB
'========================================================================== '显示数据压缩页面 '========================================================================== SUB DATACLASS() F_STR=F_STR&"〈form name='DataS' method='post' action='"&URL&"' 〉" F_STR=F_STR&"〈input name='Page' value='"&page&"' type='hidden'〉" F_STR=F_STR&"〈input name='TK' value='1' type='hidden'〉" F_STR=F_STR&"〈textarea name='GetLogH' style='display:none;'〉〈/textarea〉" F_STR=F_STR&"〈textarea name='inputlogH' style='display:none;'〉〈/textarea〉" F_STR=F_STR&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈tbody〉〈tr valign='top'〉〈td width='60%'〉" F_STR=F_STR&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈TR〉〈td width='100'〉数据路径:〈/td〉〈td〉" F_STR=F_STR&"〈input name='DBPATH2' value='"&DBPATH&"' id='INPUTCLASS' style='width:75%; margin:3px; border-bottom:#F00 1px solid;'/〉 〈input name='Submit' type='submit' value='执 行' /〉" F_STR=F_STR&"〈/td〉〈/TR〉〈/form〉〈tr〉" F_STR=F_STR&"〈td width='100'〉操作日志:〈/td〉〈td〉〈textarea name='GetLog' id='GetLogD' style='height:140px; overflow:hidden;'〉"&SESSION("GETLOG")&"〈/textarea〉〈/td〉" F_STR=F_STR&"〈/tr〉〈/table〉〈/td〉〈td width='40%'〉〈table width='100%' border='0' cellpadding='0' cellspacing='0'〉〈tr valign='top'〉〈td〉临时便签:〈/td〉〈/tr〉〈Tr valign='top'〉〈td〉" F_STR=F_STR&"〈textarea name='inputlog' ID='inputlogD'〉"&SESSION("INPUTLOG")&"〈/textarea〉〈/td〉〈/tr〉〈/table〉〈/td〉〈/tr〉〈/tbody〉〈/table〉" RESPONSE.Write F_STR F_STR="" END SUB
'========================================================================== '显示数据库路径下文件列表 '========================================================================== FUNCTION FILE_LIST(FILE_PATH,UPPATH) DIM FSO,F_ITEM,F_FILE,F_FOLDER,FC,FD SET FSO = CREATEOBJECT("SCRIPTING.FILESYSTEMOBJECT") SET F_ITEM = FSO.GETFOLDER(FILE_PATH) SET F_FILE = F_ITEM.FILES SET F_FOLDER = F_ITEM.subfolders F_STR=F_STR&"〈style〉span{padding:0 5px;}〈/style〉" F_STR=F_STR&"〈table width='100%' bgcolor='#00FF00' border='0' cellpadding='0' cellspacing='0'〉" F_STR=F_STR&"〈td〉" F_STR=F_STR&"〈table width='100%' cellpadding='0' cellspacing='1' border='0'〉" F_STR=F_STR&"〈tr height='25' bgcolor='#333333' align='center'〉" F_STR=F_STR&"〈td WIDTH='35%'〉文件名〈/td〉" F_STR=F_STR&"〈td width='10%'〉文件类型〈/td〉" F_STR=F_STR&"〈td width=10%''〉文件大小〈/td〉" F_STR=F_STR&"〈td width='15%'〉创建时间〈/td〉" F_STR=F_STR&"〈td width='15%'〉访问时间〈/td〉" F_STR=F_STR&"〈td width='15%'〉修改时间〈/td〉" F_STR=F_STR&"〈/tr〉" IF UPPATH=TRUE then F_STR=F_STR&"〈tr height='25' bgcolor='#666666'〉" F_STR=F_STR&"〈td WIDTH='35%'〉〈span〉返回上层目录(../)〈/span〉〈/td〉" F_STR=F_STR&"〈td width='10%'〉 〈/td〉" F_STR=F_STR&"〈td width=10%''〉 〈/td〉" F_STR=F_STR&"〈td width='15%'〉 〈/td〉" F_STR=F_STR&"〈td width='15%'〉 〈/td〉" F_STR=F_STR&"〈td width='15%'〉 〈/td〉" F_STR=F_STR&"〈/tr〉" bgcolor="#666666" ELSE bgcolor="#333333" END IF
FOR EACH FD IN F_FOLDER '列出文件夹 if bgcolor="#333333" then bgcolor="#666666" else bgcolor="#333333" end if F_STR=F_STR&"〈TR height='25' bgcolor='"&bgcolor&"'〉" F_STR=F_STR&"〈TD〉〈span〉"&FD.NAME&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FD.TYPE&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FD.SIZE&" /B〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FD.DateCreated&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&fD.DateLastAccessed&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&fD.DateLastModified&"〈/span〉〈/td〉" F_STR=F_STR&"〈/TR〉" NEXT
FOR EACH FC IN F_FILE '列出文件 if bgcolor="#333333" then bgcolor="#666666" else bgcolor="#333333" end if F_STR=F_STR&"〈TR height='25' bgcolor='"&bgcolor&"'〉" F_STR=F_STR&"〈TD〉〈span〉"&FC.NAME&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FC.TYPE&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FC.SIZE&" /B〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&FC.DateCreated&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&fc.DateLastAccessed&"〈/span〉〈/td〉" F_STR=F_STR&"〈TD〉〈span〉"&fc.DateLastModified&"〈/span〉〈/td〉" F_STR=F_STR&"〈/TR〉" NEXT F_STR=F_STR&"〈/table〉〈/td〉〈/table〉" RESPONSE.Write F_STR F_STR="" END FUNCTION
'========================================================================== '数据库压缩操作 '========================================================================== Sub CompactDB(zip_DBPath) conn.close set conn=nothing
RESPONSE.Write "正在对 〈font color='#FF9900'〉"&ZIP_DBPATH&"〈/font〉 进行处理,请稍等...〈BR〉" ZIP_DBPATH=SERVER.MapPath(ZIP_DBPATH) Dim Fso2, Engine, strDBPath,JET_3X strDBPath = Left(ZIP_DBPATH,InstrRev(ZIP_DBPATH,"-:special:1:-)) Set Fso2 = CreateObject("Scripting.FileSystemObject") If Err.Number 〈〉 0 Then Err.Clear() response.write "当前站点可能不支持FSO组件,压缩操作跳过。" Exit Sub End If If Fso2.FileExists(ZIP_DBPATH) Then RESPONSE.Write "装载 〈font color='#FF9900'〉"&ZIP_DBPATH&"〈/font〉 ,请稍等...〈BR〉" Set Engine = CreateObject("JRO.JetEngine") Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "数据库名称.MDB", _ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "TempDB1.MDB" Fso2.DELETEFile(strDBPath & "数据库名称.MDB") Fso2.CopyFile strDBPath & "TempDB1.MDB",ZIP_DBPATH Fso2.DELETEFile(strDBPath & "TempDB1.MDB") Set Fso2 = nothing Set Engine = nothing If Err.Number 〈〉 0 Then Err.Clear() RESPONSE.Write "压缩失败,出错原因: 〈font color='#FF0000'〉"& Err.Description&"〈/font〉 ,压缩操作跳过.〈BR〉" ' response.write "〈tr〉〈td〉〈b〉出错原因" & Err.Description & "操作,压缩操作跳过。〈/b〉〈/td〉〈/tr〉" Exit Sub End If RESPONSE.Write "数据库: 〈font color='#FF9900'〉"&Replace(ZIP_DBPATH,"-:special:1:-,"\-:special:1:-)&"〈/font〉 ,压缩成功!〈BR〉" ' response.write "〈tr〉〈td〉你的数据库, " & Replace(ZIP_DBPATH,"-:special:1:-,"\-:special:1:-) & ", 已经压缩成功!〈/td〉〈/tr〉" Else RESPONSE.Write "〈font color='#FF0000'〉数据库名称或是路径不正确!请重试!!〈/font〉〈BR〉" End If End Sub
SUB PIC() Picstr1=Picstr1&"〈form name='DataPic' method='post' action='"&URL&"' 〉" Picstr1=Picstr1&"〈input name='THISPAGE' value='1' type='hidden'〉" Picstr1=Picstr1&"〈input name='TK' value='2' type='hidden'〉" Picstr1=Picstr1&"〈textarea name='GetLogH' style='display:none;'〉〈/textarea〉" Picstr1=Picstr1&"〈textarea name='inputlogH' style='display:none;'〉〈/textarea〉" Picstr1=Picstr1&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈tbody〉〈tr valign='top'〉〈td width='60%'〉" Picstr1=Picstr1&"〈table border='0' cellpadding='0' cellspacing='0' width='100%'〉〈TR〉〈td width='100'〉分析数据:〈/td〉〈td〉" Picstr1=Picstr1&"〈input value='SELECT * FROM [DV_UPFILE] ' id='INPUTCLASS' style='width:75%; margin:3px; border-bottom:#F00 1px solid;' disabled/〉〈input name='PICDBPATH' value='SELECT * FROM [DV_UPFILE] ' id='INPUTCLASS' style='width:75%; margin:3px; border-bottom:#F00 1px solid; display:none;'/〉 〈input name='Submit' type='submit' value='执 行' /〉" Picstr1=Picstr1&"〈/td〉〈/TR〉〈tr〉〈TD colspan='2'〉 〈input name='DelPicData' type='checkbox' value='1' 〉删除数据 〈input name='DelPicFile' type='checkbox' value='1' 〉删除无效文件〈/TD〉〈/TR〉〈/form〉〈tr〉" Picstr1=Picstr1&"〈td width='100'〉操作日志:〈/td〉〈td〉〈textarea name='GetLog' id='GetLogPic' style='height:140px; overflow:hidden;'〉"&SESSION("GETLOG")&"〈/textarea〉〈/td〉" Picstr1=Picstr1&"〈/tr〉〈/table〉〈/td〉〈td width='40%'〉〈table width='100%' border='0' cellpadding='0' cellspacing='0'〉〈tr valign='top'〉〈td〉临时便签:〈/td〉〈/tr〉〈Tr valign='top'〉〈td〉" Picstr1=Picstr1&"〈textarea name='inputlog' ID='inputlogPic'〉"&SESSION("INPUTLOG")&"〈/textarea〉〈/td〉〈/tr〉〈/table〉〈/td〉〈/tr〉〈/tbody〉〈/table〉" response.Write picstr1 end sub FUNCTION checkpic(SQLDATE,DELDATA,DELFILE) '〈!--删除图片部分--〉 PICstr=PICstr&"〈table width='100%' bgcolor='#00FF00' border='0' cellpadding='0' cellspacing='0'〉" PICstr=PICstr&"〈td〉" PICstr=PICstr&"〈table width='100%' cellpadding='0' cellspacing='1' border='0'〉" PICstr=PICstr&"〈tr height='25'〉" PICstr=PICstr&"〈td align='center' width='5%' bgcolor='#333333'〉〈B〉 ID 〈/B〉〈/td〉" PICstr=PICstr&"〈TD align='center' width='5%' bgcolor='#333333'〉〈B〉ROOTID〈/B〉〈/TD〉" PICstr=PICstr&"〈TD align='center' width='5%' bgcolor='#333333'〉〈B〉帖子ID〈/B〉〈/td〉" PICstr=PICstr&"〈TD align='center' width='10%' bgcolor='#333333'〉〈B〉所在版块〈/B〉〈/td〉" PICstr=PICstr&"〈TD align='center' width='15%' bgcolor='#333333'〉〈B〉上传人〈/B〉〈/td〉" PICstr=PICstr&"〈TD align='center' width='30%' bgcolor='#333333'〉〈B〉文件名〈/B〉〈/TD〉" PICstr=PICstr&"〈TD align='center' width='10%' bgcolor='#333333'〉〈B〉数据有效性〈/B〉〈/TD〉" PICstr=PICstr&"〈TD align='center' width='10%' bgcolor='#333333'〉〈B〉数据删除〈/B〉〈/TD〉" PICstr=PICstr&"〈TD align='center' width='10%' bgcolor='#333333'〉〈B〉文件删除〈/B〉〈/TD〉" PICstr=PICstr&"〈/tr〉" response.Write picstr picstr=""
DIM DRS,DELSQL SET DRS=SERVER.CreateObject("ADODB.RECORDSET") '数据流 DRS.OPEN SQLDATE,CONN,1,1 '打开 IF DRS.BOF AND DRS.EOF THEN RESPONSE.Write "没有找到数据!!" ELSE bgcolor="#666666" '分页 ALL_NUM=DRS.RECORDCOUNT MAXITEM=100 '为避免服务器负担过重,建议将值控制在100以内 DRS.PAGESIZE=MAXITEM IF ALL_NUM MOD MAXITEM = 0 THEN '分页数 ALLPAGE = ALL_NUM \ MAXITEM ELSE ALLPAGE = ALL_NUM \ MAXITEM + 1 end if IF THISPAGE〈〉"" THEN THISPAGE=CINT(THISPAGE) END IF IF THISPAGE〈=0 THEN THISPAGE=1 ELSEIF THISPAGE 〉 ALLPAGE THEN THISPAGE=ALLPAGE END IF DRS.ABSOLUTEPAGE = THISPAGE
X=0 DO WHILE NOT DRS.EOF '显示所有数据 if bgcolor="#333333" then bgcolor="#666666" else bgcolor="#333333" end if
Response.Write "〈TR height='25'〉" response.Write "〈td bgcolor='"&bgcolor&"'〉"&DRS("F_ID")&"〈/td〉" IF ISNULL(TRIM(DRS("F_AnnounceID")))=TRUE THEN '上传文件归档字段为空(一般为签名或是头像 帖子号|主题号 ) response.Write "〈td bgcolor='"&bgcolor&"'〉 〈/td〉" response.Write "〈td bgcolor='"&bgcolor&"'〉 〈/td〉" ELSE IF INSTR(DRS("F_AnnounceID"),"|")〉0 THEN TEMP_FAID=Split(DRS("F_AnnounceID"),"|") response.Write "〈td bgcolor='"&bgcolor&"'〉"&TEMP_FAID(0)&"〈/td〉" response.Write "〈td bgcolor='"&bgcolor&"'〉〈font color='#FF9900'〉"&TEMP_FAID(1)&"〈/font〉〈/td〉" END IF END IF response.Write "〈td ALIGN='CENTER' bgcolor='"&bgcolor&"'〉"&BORD(DRS("F_BoardID"))&"〈/td〉" response.Write "〈td bgcolor='"&bgcolor&"'〉"&DRS("F_Username")&"〈/td〉" response.Write "〈td bgcolor='"&bgcolor&"'〉"&DRS("F_Filename")&"〈/td〉" IF INSTR(DRS("F_AnnounceID"),"|")〉0 THEN TEMP_FAID2=Split(DRS("F_AnnounceID"),"|") PICMOD=CONTENT(TEMP_FAID2(0),TEMP_FAID2(1)) '取上传文件有效性 IF DelPicFile="1" AND (PICMOD="无效数据" or PICMOD="无效贴子ID值") THEN temp_picph="./UploadFile/"&trim(DRS("F_Filename")) DF=DPF(temp_picph) temp_picph="" ELSE DF="未处理" END IF IF DelPicData="1" AND (PICMOD="无效数据" or PICMOD="无效贴子ID值") THEN DD=DPD(DRS("F_ID")) ELSE DD="未处理" END IF response.Write "〈td bgcolor='"&bgcolor&"'〉"&CONTENT(TEMP_FAID2(0),TEMP_FAID2(1))&"〈/td〉" else DF=DPF(temp_picph) DD=DPD(DRS("F_ID")) response.Write "〈td bgcolor='"&bgcolor&"'〉垃圾数据〈/td〉" end if response.Write "〈td bgcolor='"&bgcolor&"'〉"&DD&"〈/td〉" response.Write "〈td bgcolor='"&bgcolor&"'〉"&DF&"〈/td〉" DD="" DF="" PICMOD="" Response.Write "〈/TR〉" X=X+1 IF X〉=MAXITEM THEN EXIT DO DRS.MOVENEXT LOOP DRS.CLOSE SET DRS=NOTHING
PICstr=PICstr&"〈tr〉〈td bgcolor='"&bgcolor&"' colspan='9'〉"&now()&" 执行语句:〈font color='#FF9900'〉查询文章图片数据有效性〈/font〉 总记录数: "&ALL_NUM&" 条 页码: "&THISPAGE&"/"&ALLPAGE If ALLPAGE〉1 Then PICstr=PICstr&" 〈a href='javascript:FullPicSql("""&SQLDATE&""",""1"","""&TK&""","""&DelPicData&""","""&DelPicFile&""")'〉首页〈/a〉 〈a href='javascript:FullPicSql("""&SQLDATE&""","&THISPAGE-1&","""&TK&""","""&DelPicData&""","""&DelPicFile&""")'〉上一页〈/a〉 " If THISPAGE〉8 Then:SpAGE=THISPAGE-8:Else:SpAGE=1:End if For Y=SpAGE To SpAGE+8 If Y〉ALLPAGE Then Exit For If Y=THISPAGE Then PICstr=PICstr&Y&" " Else PICstr=PICstr&"〈a href='javascript:FullPicSql("""&SQLDATE&""","&Y&","""&TK&""","""&DelPicData&""","""&DelPicFile&""")'〉"&Y&"〈/a〉 " End If Next PICstr=PICstr&" 〈a href='javascript:FullPicSql("""&SQLDATE&""","&THISPAGE+1&","""&TK&""","""&DelPicData&""","""&DelPicFile&""")'〉下一页〈/a〉 〈a href='javascript:FullPicSql("""&SQLDATE&""","&ALLPAGE&","""&TK&""","""&DelPicData&""","""&DelPicFile&""")'〉尾页〈/a〉" End If PICstr=PICstr&"〈/td〉〈/tr〉〈/table〉〈/td〉〈/table〉" THISPAGE="" END IF RESPONSE.Write PICstr PICstr="" END FUNCTION
function CONTENT(rootid,annid) FOR I=1 TO CINT(SESSION("PICTT")) if isnumeric(rootid)=true and isnumeric(annid)=true then CSQL="SELECT * FROM [DV_BBS"&I&"] WHERE AnnounceID = "&annid&" and rootid="&rootid&" " 'CSQL="SELECT * FROM [DV_BBS"&I&"] WHERE instr(AnnounceID,'"&xid&"')〉0" IF INDATA(CSQL)=1 THEN C EXIT FOR ELSE C END IF else c exit for end if NEXT END FUNCTION
FUNCTION INDATA(CSQL) set crs=SERVER.CreateObject("ADODB.RECORDSET") '数据流 CRS.OPEN CSQL,CONN,1,1 if not (crs.bof and crs.eof) then INDATA=1 else INDATA=2 end if CRS.CLOSE SET CRS=NOTHING end function
FUNCTION BORD(ID) '================================================ '作用:显示版块名 '返回:返回版块名 '================================================ BORDSQL="SELECT * FROM Dv_Board WHERE boardid="&ID&"" set BORDRS=SERVER.CreateObject("ADODB.RECORDSET") '数据流 BORDRS.OPEN BORDSQL,CONN,1,1 if not (BORDRS.bof and BORDRS.eof) then BORD=BORDRS("BoardType") else BORD="--ID[ "&ID&" ]失效--" end if BORDRS.CLOSE SET BORDRS=NOTHING end function
'删除数据 FUNCTION DPD(DPDID)
IF ISNUMERIC(DPDID)=TRUE THEN SQLL="DELETE FROM [DV_UPFILE] WHERE F_ID="&DPDID CONN.EXECUTE(SQLL) DPD="数据删除" ELSE DPD="未能处理" END IF
END FUNCTION
FUNCTION DPF(DPFID) DIM FSO3 IF DPFID〈〉"" THEN IF INSTR(DPFID,"./UploadFile")〉0 THEN DPFID=SERVER.MapPath(DPFID) Set FSO3 = CreateObject("Scripting.FileSystemObject") If Err.Number 〈〉 0 Then Err.Clear() DPF="FSO组件无效" Exit FUNCTION End If If FSO3.FileExists(DPFID) Then FSO3.DELETEFile(DPFID) DPF="图片删除成功" ELSE DPF="图片不存在" END IF ELSE DPF="路径错误" END IF ELSE DPF="未找到路径" END IF SET FSO3=NOTHING END FUNCTION Function HTMLEncode(S) if not isnull(S) then S = replace(S, "〉", ">") S = replace(S, "〈", "<") S = replace(S, CHR(39), "'") S = replace(S, CHR(34), """) S = replace(S, CHR(20), " ") HTMLEncode = S end if End Function %〉
|