博客升级更新日志
作者:stone 日期:2007-11-25
思来想去,我还是得把我的对代码的更新和增加的一些功能整理一下
重装系统应该备份的文件:
①.备份blogDB目录下的数据库
②.备份attachments目录下的文件,这个目录里都是上传的附件
③.备份Plugins目录下的文件,这里面都是BLOG的插件
④.备份skins目录下的文件,这里面都是皮肤文件
⑤.备份根目录下的plugins.asp文件
1、登录后马上立刻退出,无法发表日志,后来根本无法管理
操作步骤:
1.首先修改common/checkUser.asp
将以下原码
'进行MD5密码验证,转换旧帐户密码验证方式
dim strSalt
strSalt=randomStr(6)
memLogin("mem_salt")=strSalt
memLogin("mem_LastIP")=getIP()
memLogin("mem_lastVisit")=now()
memLogin("mem_hashKey")=HashKey
memLogin("mem_Password")=SHA1(Password&strSalt)
Response.Cookies(CookieName)("memName")=memLogin("mem_Name")
Response.Cookies(CookieName)("memHashKey")=HashKey
if Request.Form("KeepLogin")="1" then Response.Cookies(CookieName).Expires=Date+365
memLogin.Update
ReInfo(0)="登录成功"
ReInfo(1)="<b>"&memLogin("mem_Name")&"</b>,欢迎你的再次光临。<br/><a href=""default.asp"">点击返回主页</a>"
ReInfo(2)="MessageIcon"
ReInfo(3)=true
End IF
else
if memLogin("mem_Password")<>SHA1(Password&memLogin("mem_salt")) then
ReInfo(0)="错误信息"
ReInfo(1)="<b>用户名与密码错误</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
logout(false)
else
memLogin("mem_LastIP")=getIP()
memLogin("mem_lastVisit")=now()
memLogin("mem_hashKey")=HashKey
Response.Cookies(CookieName)("memName")=memLogin("mem_Name")
Response.Cookies(CookieName)("memHashKey")=HashKey
if Request.Form("KeepLogin")="1" then Response.Cookies(CookieName).Expires=Date+365
memLogin.Update
ReInfo(0)="登录成功"
ReInfo(1)="<b>"&memLogin("mem_Name")&"</b>,欢迎你的再次光临。<br/><a href=""default.asp"">点击返回主页</a><meta http-equiv=""refresh"" c3;url=default.asp""/>"
ReInfo(2)="MessageIcon"
ReInfo(3)=true
end if
end if
memLogin.Close
Set memLogin=Nothing
login=ReInfo
end function
修改成
'进行MD5密码验证,转换旧帐户密码验证方式
dim strSalt
strSalt=randomStr(6)
memLogin("mem_salt")=strSalt
memLogin("mem_LastIP")=getIP()
memLogin("mem_lastVisit")=now()
memLogin("mem_hashKey")=HashKey
memLogin("mem_Password")=SHA1(Password&strSalt)
Response.Cookies(CookieName)("memName")=memLogin("mem_Name")
Response.Cookies(CookieName)("memHashKey")=HashKey
if Cint(Request.Form("KeepLogin"))<>0 then Response.Cookies(CookieName).Expires=Date+Cint(Request.Form("KeepLogin"))
memLogin.Update
ReInfo(0)="登陆成功"
ReInfo(1)="<b>"&memLogin("mem_Name")&"</b>,欢迎你的再次光临。<br/><a href=""default.asp"">点击返回主页</a>"
ReInfo(2)="MessageIcon"
ReInfo(3)=true
End IF
else
if memLogin("mem_Password")<>SHA1(Password&memLogin("mem_salt")) then
ReInfo(0)="错误信息"
ReInfo(1)="<b>用户名与密码错误</b><br/><a href=""javascript:history.go(-1);"">请返回重新输入</a>"
ReInfo(2)="ErrorIcon"
logout(false)
else
memLogin("mem_LastIP")=getIP()
memLogin("mem_lastVisit")=now()
memLogin("mem_hashKey")=HashKey
Response.Cookies(CookieName)("memName")=memLogin("mem_Name")
Response.Cookies(CookieName)("memHashKey")=HashKey
if Cint(Request.Form("KeepLogin"))<>0 then Response.Cookies(CookieName).Expires=Date+Cint(Request.Form("KeepLogin"))
memLogin.Update
ReInfo(0)="登陆成功"
ReInfo(1)="<b>"&memLogin("mem_Name")&"</b>,欢迎你的再次光临。<br/><a href=""default.asp"">点击返回主页</a><meta http-equiv=""refresh"" c3;url=default.asp""/>"
ReInfo(2)="MessageIcon"
ReInfo(3)=true
end if
end if
memLogin.Close
Set memLogin=Nothing
login=ReInfo
end function
然后搜索
memLogin("mem_LastIP")=getIP()
有三处!将其删除...
再搜索
if CheckCookie("mem_LastIP")<>Guest_IP or isNull(CheckCookie("mem_LastIP")) then
logout(true)
else
memName=CheckStr(Request.Cookies(CookieName)("memName"))
memStatus=CheckCookie("mem_Status")
end if
替换为
memName=CheckStr(Request.Cookies(CookieName)("memName"))
memStatus=CheckCookie("mem_Status")
2.修改login.asp:(这个也可能会显示不正常,请谨慎,其实也不用修改了!!修改了common/checkUser.asp就已经解决了问题哦!)
将以下代码替换<form name="checkUser" action="login.asp" method="post">至</form>断
<form name="checkUser" action="login.asp" method="post">
<div id="MsgContent">
<div id="MsgHead">用户登录</div>
<div id="MsgBody">
<input name="action" type="hidden" value="login"/>
<label>用户名:<input name="username" type="text" size="18" class="userpass" maxlength="24"/></label><br/>
<label>密 码:<input name="password" type="password" size="18" class="userpass"/></label><br/>
<%if blog_useCode then%><label>验证码:<input name="validate" type="text" size="4" class="userpass" maxlength="4"/> <%=getcode()%></label><br/><%end if%>
<label>记住登陆: <select name="KeepLogin" id="KeepLogin" class="userpass">
<option value="1" selected="selected">一天</option>
<option value="30" >一個月</option>
<option value="365">一年</option>
<option value="0">不用記住</option>
</select>
</label>
<br/>
<input type="submit" value="登 录" class="userbutton"/> <input type="button" value="用户注册" class="userbutton" />
</div>
</div>
</form>
2、去掉原验证码,换成了随机加法运算
操作步骤:
1. 打开common目录下的function.asp,在大约50行左右可以找到以下代码:
'*************************************
'获得注册码
'*************************************
Function getcode()
getcode= "<img src=""common/getcode.asp"" alt="""" style=""margin-right:40px;""/>"
End Function
2. 将其替换为以下代码:
'*************************************
'获得注册码
'*************************************
'Function getcode()
'getcode= "<img src=""common/getcode.asp"" alt="""" style=""margin-right:40px;""/>"
'End Function
'*************************************
'获得注册码,运算问题
'更新时间: 2007-8-14
'*************************************
Function getcode()
Dim QuesionNum
QuesionNum=10 '控制计算数的位数,此数必须大于10,不然全为0.如果想一位数相加,请用10,两位数相加,请用100,混合位数相加,11~99.其它类推
Dim Num1
Dim Num2
Dim Dis_Num
Dim Sum
Randomize
Num1 = Int(QuesionNum * Rnd)
Num2 = Int(QuesionNum * Rnd)
Dis_Num = "=" & Num1 & "+" & Num2
Sum = Num1 + Num2
Session("GetCode") = Sum
getcode = "<span style=""margin-right:40px;"">" & Dis_Num & "</span>"
End Function
3、打开footer.asp放了我要啦统计代码
4、从PJBlog2 v2.7 Build04升级到PJBlog2 v2.7 Build05
5、加了向导2.0相册
操作步骤:安装插件,出现错误,打开conn.asp文件代码
call createConnection(AccessFile)
在下面加入代码 on error resume next
6、修改了网站的favicon.ico
7、加入了播放器
8、换了几款皮肤
9、给文章添加“收藏到网摘”的代码
操作步骤:
1.下载文件上传到images里面,就是wj.js和wz这个文件夹的一些收藏到的小图片
2.修改Template文件下的Article.asp文件(class下的class_article.asp),找到下面这段代码
<img src="images/icon_trackback.gif" style="margin:0px 2px -4px 0px" alt=""/><strong>引用通告地址:</strong> <a href="<$trackback$>" target="_blank"><$trackback$></a><br/>
在后面加上
<img src="images/icon_edit.gif" style="margin:0px 2px -4px 0px" alt=""/><strong>收藏到网摘:</strong> <SCRIPT language="javascript" src="images/wj.js"></SCRIPT><br/>
3.复盖Article.asp文件到空间,
4.登陆后台,在"站点基本设置 - 初始化数据"里进行"重新生成所有日志到文件"的操作就可以把收藏的代码应用到所有你已经发表的日志中。
10、后台增加日志管理功能,可以实现单个日志转移分类
11、增加了Google自定义搜索
12、增加了奥运倒计时牌
13、Support栏目增加了排名和收录查询
14、日志增加了推荐给你的好友并加强了文章日志的防盗功能
15、增加了alimama广告
以上更新时间日期不详。
16、2007年12月5日,增加了日志评分功能(直接上传插件到服务器,在后台安装此插件即可)
17、2007年12月8日,更改FCK编辑模式为Ewebeditor模式,增加图片自动上传功能。
步骤一:更改发帖页面blogpost.asp,共计更改四处。
第一处: 编辑器选择 原文件:
<label title="ewebeditor编辑器" for="ET2" accesskey="K">
<input name="log_editType" type="radio" id="ET2" value="0" />
ewebeditor</label></td>
更改为:
<label title="ewebeditor编辑器" for="ET2" accesskey="K">
<input name="log_editType" type="radio" id="ET2" value="0" />
ewebeditor</label></td>
第二处: 发表内容区 原文件:
if log_editType=0 then
Dim sBasePath
sBasePath = "fckeditor/"
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = sBasePath
oFCKeditor.Config("AutoDetectLanguage") = False
oFCKeditor.Config("DefaultLanguage") = "zh-cn"
oFCKeditor.Value = ""
oFCKeditor.Create "Message"
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBBeditor("Message")
end if
更改为:
if log_editType=0 then %>
<input type="hidden" name="message" id="message" value="" />
<iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.htm?id=message&style=gray" frameborder="0" scrolling="no" width="580" HEIGHT="350"></iframe>
<%
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBBeditor("Message")
end if
第三处: 编辑摘要区 原文件:
<%
if log_editType=0 then
Dim oFCKeditor1
Set oFCKeditor1 = New FCKeditor
oFCKeditor1.BasePath = sBasePath
oFCKeditor1.Height="150"
oFCKeditor1.ToolbarSet="Basic"
oFCKeditor1.Config("AutoDetectLanguage") = False
oFCKeditor1.Config("DefaultLanguage") = "zh-cn"
oFCKeditor1.Value = ""
oFCKeditor1.Create "log_Intro"
else
%>
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;"></textarea>
更改为:
<%
if log_editType=0 then
%>
<input type="hidden" name="log_Intro" id="log_Intro" value="" />
<iframe ID="eWebEditor2" src="ewebeditor/ewebeditor.htm?id=log_Intro&style=mini" frameborder="0" scrolling="no" width="580" HEIGHT="150"></iframe>
<%
else
%>
第四处: 附件上传区 原文件:
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
更改为:
<% if log_editType<>0 then %>
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
<%end if%>
步骤二:postedit.asp文件的修改,共三处
第一处: 原文件:
if log_editType=0 then
Dim sBasePath
sBasePath = "fckeditor/"
Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath = sBasePath
oFCKeditor.Config("AutoDetectLanguage") = False
oFCKeditor.Config("DefaultLanguage") = "zh-cn"
oFCKeditor.Value = UnCheckStr(lArticle.logMessage)
oFCKeditor.Create "Message"
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBB_Msg_Value=UBBFilter(UnCheckStr(lArticle.logMessage))
UBBeditor("Message")
end if
更改为:
if log_editType=0 then %>
<input type="hidden" name="message" id="message" value="<%=server.HTMLEncode(lArticle.logMessage)%>" />
<iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.htm?id=message&style=gray" frameborder="0" scrolling="no" width="580" HEIGHT="350"></iframe>
<%
else
UBB_TextArea_Height="200px;"
UBB_AutoHidden=False
UBB_Msg_Value=UBBFilter(UnCheckStr(lArticle.logMessage))
UBBeditor("Message")
end if
第二处: 原文件:
<%
if log_editType=0 then
Dim oFCKeditor1
Set oFCKeditor1 = New FCKeditor
oFCKeditor1.BasePath = sBasePath
oFCKeditor1.Height="150"
oFCKeditor1.ToolbarSet="Basic"
oFCKeditor1.Config("AutoDetectLanguage") = False
oFCKeditor1.Config("DefaultLanguage") = "zh-cn"
oFCKeditor1.Value = UnCheckStr(lArticle.logIntro)
oFCKeditor1.Create "log_Intro"
else
%>
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;"><%=UBBFilter(HTMLDecode(UnCheckStr(lArticle.logIntro)))%></textarea>
<%
end if
更该为:
<% if log_editType=0 then %>
<input type="hidden" name="log_Intro" id="log_Intro" value="<%=server.HTMLEncode((UnCheckStr(lArticle.logIntro))%>" />
<iframe ID="eWebEditor2" src="ewebeditor/ewebeditor.htm?id=log_Intro&style=mini" frameborder="0" scrolling="no" width="580" HEIGHT="150"></iframe><%
else
%>
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;"><%=UBBFilter(HTMLDecode(UnCheckStr(lArticle.logIntro)))%></textarea>
<%
end if
第三处: 原文件:
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
更改为:
<% if log_editType<>0 then %>
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
<%end if%>
至此ok!
关于上传文件的路径最好设为attachments文件夹,可以在pj的后台进行附件管理。方法可以参照ewebeditor的使用方法。
18、2007年12月9日,增加提交日志的时候同时复制到剪贴板功能。
操作步骤:
1、common\common.js
在
//PBlog2 公用JS代码
//Author:PuterJam
后面加入:
/*功能:提交时自动复制到剪贴板 */
//复制评论文本框
function copyit(){
document.all.Message.select();
document.execCommand("copy");
alert("已经将您的发表的内容拷贝至剪贴板,如果在提交过程中不慎丢失可以使用Ctrl+C找回")
}
2、class\cls_article.asp
程序代码
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S"/>
修改为:
程序代码
<input name="submit2" type="submit" class="userbutton" value="发表评论" accesskey="S" onclick="copyit();"/>
3、因为现在是把函数加入PBlog2 公用JS代码文件的,所以其他的地方也可以类似的修改
比如在发表网志的地方加入这段代码只要再修改:
blogpost.asp里面找到
程序代码
<input name="SaveArticle" type="submit" class="userbutton" value="提交日志" accesskey="S"/>
修改为
程序代码
<input name="SaveArticle" type="submit" class="userbutton" value="提交日志" accesskey="S" onclick="copyit();"/>
19、2007年12月9日,增加了lightbox特效。(此功能有异常,已自杀)
操作步骤:
1、header.asp
这段代码插入</head>前
<link rel="stylesheet" href="lightbox/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox/prototype.js"></script>
<script type="text/javascript" src="lightbox/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="lightbox/lightbox.js"></script>
2、common/ubbcode.asp
将以下代码
IF Not DisUBB=1 Then
IF Not DisIMG=1 Then
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<img src="""&tmpStr1&""" border=""0"" alt=""""/>",1,-1,0)
Next
修改为
IF Not DisUBB=1 Then
IF Not DisIMG=1 Then
re.Pattern="(\[img\])(.[^\]]*)\[\/img\]"
Set strMatchs=re.Execute(strContent)
For Each strMatch in strMatchs
tmpStr1=(strMatch.SubMatches(1))
strContent=replace(strContent,strMatch.Value,"<a href="""&tmpStr1&""" rel=""lightbox[roadtrip]"" title=""石头记""><img src="""&tmpStr1&""" border=""0"" alt=""""/></a>",1,-1,0)
Next
3、修改common/common.js,pjblog会把宽大于500PX的图片缩小,变成500PX的图片,然后这个图片可以新开窗口打开,而小于500PX的图片保持原状,并且不可以新窗口打开。
将以下代码
//查找网页内宽度太大的图片进行缩放以及PNG纠正
function ReImgSize(){
for (i=0;i<document.images.length;i++)
{
if (document.all){
if (document.images[i].width>550)
{
document.images[i].width="550"
try{
document.images[i].outerHTML='<a href="'+document.images[i].src+'" target="_blank" title="在新窗口打开图片">'+document.images[i].outerHTML+'</a>'
}catch(e){}
}
}
else{
if (document.images[i].width>400) {
document.images[i].title="在新窗口打开图片"
document.images[i].style.cursor="pointer"
document.images[i].onclick=function(e){window.open(this.src)}
}
}
}
}
修改为
//查找网页内宽度太大的图片进行缩放以及PNG纠正
function ReImgSize(){
for (i=0;i<document.images.length;i++)
{
if (document.all){
if (document.images[i].width>400)
{
document.images[i].width="450"
}
}
else{
if (document.images[i].width>400) {
document.images[i].title="在新窗口打开图片"
document.images[i].style.cursor="pointer"
document.images[i].onclick=function(e){window.open(this.src)}
}
}
}
}
20、2007年12月18日,去掉日志尾部的编辑时间。
操作步骤:class\cls_logAction.asp文件
将以下代码:
if logIsDraft=false then weblog("log_Modify")="[本日志由 "&memName&" 于 "&DateToStr(now(),"Y-m-d H:I A")&" 编辑]"
改为:
if logIsDraft=false then weblog("log_Modify")=""
将字段附予空值,这样的话也便于以后想改回来的时候容易查找到此句的位置。
21、增加日志文章“来自网络”选项
操作步骤:备份我们接下来要修改的文件:blogpost.asp和blogedit.asp
1、打开blogpost.asp文件,找到
<input name="log_From" type="text" id="log_From" value="本站原创" size="12" class="inputBox" />
把它改成:
<select name="log_From" id="log_From" style="width:100px" class="inputBox">
<option value="本站原创">本站原创</option>
<option value="来自网络">来自网络</option>
</select>
2、打开blogedit.asp,找到
<input name="log_From" type="text" id="log_From" size="12" class="inputBox" value="<%=lArticle.logFrom%>" />
把它改成:
<select name="log_From" id="log_From" style="width:100px" class="inputBox">
<option value="本站原创" <%if lArticle.logFrom="本站原创" then%>selected<%end if%>>本站原创</option>
<option value="来自网络" <%if lArticle.logFrom="来自网络" then%>selected<%end if%>>来自网络</option>
</select>
OK!搞定!
22、增加了公告栏。
只需要将此插件上传到相应目录安装此插件即可。
23、2008年1月18日,增加了AboutMe。
只需要将此插件上传到相应目录安装此插件即可。
24、2008年02月15日,为置顶日志添加“[置顶]”标识。
方法:打开class/cls_default.asp,找到“<%=HtmlEncode(webLogArr(3,PageCount))%>”(共两处,一个普通模式的,一个列表模式的),分别在其前面添加“<%if webLogArr(9,PageCount) then response.Write "[置頂]"%>”即可。
25、2008年02月15日,修改标签云集显示。
①打开tag.asp,找到下列代码:
<a href="default.asp?tag=<%=Server.URLEncode(log_Tag(1))%>" title="共包含 <%=log_Tag(2)%> 篇日志"><span style="font-size:<%=getTagSize(log_Tag(2))%>px"><%=log_Tag(1)%></span></a>
将其改为:
<a href="default.asp?tag=<%=Server.URLEncode(log_Tag(1))%>" style="font-size:12px;line-height:250%" title="共包含 <%=log_Tag(2)%> 篇日志"><%=log_Tag(1)%><span style="font-size:11px;color:#ccc">[<%=log_Tag(2)%>]</span></a>
②在common文件夹下找到cache.asp,在“写入标签Tag缓存”中找到:
Select tag_id,tag_name,tag_count FROM blog_tag
将其改为
Select tag_id,tag_name,tag_count FROM blog_tag orDER BY tag_count DESC,tag_id ASC
③进入后台管理→初始化数据→重建数据缓存。
26、2008年02月15日,修改友情链接为上下滚动。
进入后台管理→界面与插件→设置模块→BlogLinksSubItem1模块→编辑html,将代码改为:
<MARQUEE onmouseover=stop() onmouseout=start() scrollAmount=1 direction=up width=170
height=100>
<div class="LinkTable">$Link_Code$ </div>
</div>
</MARQUEE>
<a href="bloglink.asp">欢迎交换本站链接...</a>
27、2008年02月18日,增加了相关日志。
上传插件,进入后台管理直接安装插件。
OK!
28、2008年07月17日,升级到PJ3。
29、2008年07月28日,增加了highslide效果。
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: