你的系统不支持 function getXMLDOM() 。。。
今天看到PJBLOG,出了新的版本,本来想全面升级。
可在网上看到说这还是测试版,且不少用户反应问题不
少,所以就不想换了,不过最版的引用防垃圾功能不错
所以想把这部分先升级了。
common/common.js
在后边加入以下代码:
程序代码function getTrackbackURL(id){
var strHTML = "";
strHTML = '<span id="tbSpan">请输入验证码 <input id="vCode" maxLength="4" size="4" style="border:1px solid #999;"/> <img id="tbCode" src="about:blank" onerror="src=\'common/getCode.asp?s='+Math.random()+'\'" onclick="src=\'common/getCode.asp?s='+Math.random()+'\'" style="margin-bottom:-4px;height:20px;width:40px;cursor:pointer" title="看不清楚?换一张" alt="加载中…"/> <input type="button" value="获取" onclick="getTB('+id+')"/></span><input id="getTBURL" style="border:1px solid #999;width:100%;display:none">';
showPopup("获取引用地址",strHTML,250,200);
}
function getTB(id){
if (document.getElementById("vCode").value.length <4){
alert("请输入验证码");
document.getElementById("vCode").select();
return;
}
window._tBID = id;
var tJS = document.getElementById("tbJS");
if (!tJS){
tJS = document.createElement("script");
tJS.id = "tbJS";
document.getElementsByTagName("HEAD")[0].appendChild(tJS);
}
tJS.src = "getValidateKey.asp?tbID=" + id + "&type=trackback&vcode=" + document.getElementById("vCode").value;
}
function setTBKey(code){
if (!code || code == "codeError"){
alert("验证码错误");
document.getElementById("vCode").select();
document.getElementById("tbCode").src = 'common/getCode.asp?s='+Math.random();
return;
}
var tURL = document.getElementById("getTBURL");
var pBody = document.getElementById("popBody");
pBody.style.width = "400px";
document.getElementById("tbSpan").style.display = "none";
tURL.style.display = "";
tURL.value = /(.+\/)/i.exec(location.href)[0] + "trackback.asp?tbID=" + window._tBID + "&action=addtb&tbKey=" + code;
}
//popup support
function showMask(){
var mask = document.getElementById("webMask");
if (!mask){
mask = document.createElement("div");
mask.id = "webMask";
mask.style.cssText = "position:absolute;width:100%;left:0px;top:0px;background:#000;filter:Alpha(opacity=50);-moz-opacity:0.5";
document.body.appendChild(mask);
}
var h = document.documentElement.scrollHeight;
mask.style.display = "";
mask.style.height = h + "px";
}
function hideMask(){
var mask = document.getElementById("webMask");
if (mask) mask.style.display = "none";
var vImg = document.getElementById("vcodeImg");
if (vImg) vImg.src="common/getCode.asp?s="+Math.random();
}
function showPopup(title,html,width){
showMask();
displaySelect(false);
var pContent = document.getElementById("popContent");
if (!pContent){
pContent = document.createElement("div");
pContent.id = "popContent";
pContent.style.cssText = "position:absolute;width:100%;left:0px;top:0px;text-align:center";
document.body.appendChild(pContent);
}
var pBody = document.getElementById("popBody");
if (!pBody){
pBody = document.createElement("div");
pBody.id = "popBody";
pBody.style.cssText = "background:#fff;margin:auto;padding:3px;text-align:left;-moz-border-radius:5px;";
pContent.appendChild(pBody);
}
pBody.style.width = width + "px";
var closeButton = isIE()?'<font style="float:right;font-family:webdings;cursor:pointer;margin-top:-3px" onclick="hidePopup()">r</font>':'<font style="float:right;cursor:pointer;margin-top:-2px" onclick="hidePopup()"><u>close</u></font>';
var strHTML = '<h4 style="color:#000;font-size:14px;margin:4px;margin-bottom:2px">'+ closeButton + (title?title:'无标题窗口') + '</h4>';
strHTML += '<div style="background:#e5e5e5;margin:4px;padding:4px;color:#333">'+html+'</div>'
pBody.innerHTML = strHTML;
var height = pContent.offsetHeight;
var bodyHeight = isIE()?document.documentElement.offsetHeight:document.documentElement.clientHeight;
pContent.style.display = "";
pContent.style.top = document.documentElement.scrollTop + ((bodyHeight – height)/2)+ "px";
}
function hidePopup(){
hideMask();
displaySelect(true);
var pContent = document.getElementById("popContent");
if (pContent) pContent.style.display = "none";
}
function displaySelect(status){
var s = document.getElementsByTagName("select");
for (var i=0;i<s.length;i++
){
s[i].style.display = (status)?"":"none";
}
}
common/Function.asp
加入以下代码:
程序代码function getServerKey
dim serverTime,diffDay
if len(Application(CookieName&"_server_Time"))>0 then '判断是否要更新serverKey
serverTime = Application(CookieName&"_server_Time")
diffDay = DateDiff("h",now,serverTime)
if diffDay > 0 or diffDay<0 then updateServerKey '每个1个小时更新一次 serverKey
else
updateServerKey
end if
dim exc
exc = Split(Application(CookieName&"_server_excursion"),"|")
dim sKey
sKey = exc(0) & Request.ServerVariables("INSTANCE_META_PATH") & Request.ServerVariables("APPL_PHYSICAL_PATH") & Request.ServerVariables("SERVER_SOFTWARE")
getServerKey = mid(sha1(sKey),exc(1) + 1,10)
end function
function updateServerKey
Randomize
Application.Lock
Application(CookieName&"_server_Time") = now
Application(CookieName&"_server_excursion") = int(rnd*10000000) & "|" & int(rnd*26)
Application.UnLock
end function
function getTempKey
getTempKey = randomStr(20)
session(CookieName&"tempKey") = getTempKey
end function
%>
class/cls_article.asp
找到[引用通告]所在行
更改为:
程序代码<img src="images/icon_trackback.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>引用通告:</strong> <a href="<%="trackback.asp?tbID="&id&"&action=view"%>" target="_blank">查看所有引用</a> | <a href="javascript:;" title="获得引用文章的链接" onclick="getTrackbackURL(<%=id%>)">我要引用此文章</a><br/>
Template/Article.asp [静态网页]
程序代码 <img src="images/icon_trackback.gif" style="margin:0px 2px -4px 0px" alt=""/><strong>引用通告地址:</strong> <a href="<$trackback$>" target="_blank"><$trackback$></a>
换成以下内容:
程序代码<img src="images/icon_trackback.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>引用通告:</strong> <a href="trackback.asp?tbID=<$LogID$>&action=view" target="_blank">查看所有引用</a> | <a href="javascript:;" title="获得引用文章的链接" onclick="getTrackbackURL(<$LogID$>)">我要引用此文章</a><br/>
最后用最近的trackback.asp覆盖原来的文件。
把getValidateKey.asp文件复制到根目录下。
这两个文件我已打包,
点击下载此文件
如果直接用最新版的function.asp 覆盖原来的文件,在后台点:“界面管理”时。会出现如下错误:
你的系统不支持 function getXMLDOM() 。。。