PJBlog3 发布版本 v2.8.3.127 里程碑

查看完整版本: 给日志标题添加多种显示效果(6月6日优化更新)

四川-果果 2008-6-10 16:06

给日志标题添加多种显示效果(6月6日优化更新)

很早去过WBC的BLOG,对PJ的代码改动的真大,对其彩色标题的效果很喜欢,开始只是添加了一个自己喜欢的样式!
原文:[url=http://www.bblv.net/blog/article.asp?id=58]http://www.bblv.net/blog/article.asp?id=58[/url] 此法BY WBC
(更新前修改的,请参照:[url=http://www.bblv.net/blog/article.asp?id=68]http://www.bblv.net/blog/article.asp?id=68[/url] 改动)
演示:[url=http://www.bblv.net]http://www.bblv.net[/url]

代码改动比较多,望改动之前做好备份!

修改文件有blogedit.asp、blogpost.asp、class\cls_logAction.asp、class\cls_default.asp、article.asp、class\cls_article.asp
(静态日志的可以跳过class\cls_default.asp、article.asp、class\cls_article.asp的修改!)

本修改针对PJ2.7B5原版修改,如有修改,请参照本修改稍作改动

[color=red]6月6日更新:有朋友反应,标题彩色不支持静态日志。于是大改了一番。

结果看了一下WBC的方法,对修改进行了一次优化(这里感谢戒聊的Select Case 提醒,于是引用了WBC的功能)[/color]

已经修改过的,注意3.6,4.3,4.4,4.6,6步对应修改

1.打开blogedit.asp
1.1找到[code] lArticle.logPublishTimeType = request.form("PubTimeType")[/code]换行插入[code]lArticle.logthestyle = request.form("log_thestyle")[/code]1.2找到[code]<input name="title" type="text" class="inputBox" id="title" size="50" maxlength="50" value="<%=lArticle.logTitle%>"/>[/code]换行输入[code]              <select name="log_thestyle">
                        <option value="1" <%if lArticle.logthestyle=1 then response.Write "selected"%>>默认效果</option>
                        <option value="5" <%if lArticle.logthestyle=5 then response.Write "selected"%> >彩色闪光</option>
                        <option value="6" <%if lArticle.logthestyle=6 then response.Write "selected"%>>來回波浪</option>
                        <option value="7" <%if lArticle.logthestyle=7 then response.Write "selected"%>>霓虹醒目</option>
                        <option value="8" <%if lArticle.logthestyle=8 then response.Write "selected"%>>逐字突出</option>
                        <option value="9" <%if lArticle.logthestyle=9 then response.Write "selected"%>>红色背景</option>
                        <option value="10 <%if lArticle.logthestyle=10 then response.Write "selected"%>">蓝色背景</option>
                        <option value="11" <%if lArticle.logthestyle=11 then response.Write "selected"%>>绿色背景</option>
                        <option value="12" <%if lArticle.logthestyle=12 then response.Write "selected"%>>红框醒目</option>
                        <option value="13" <%if lArticle.logthestyle=13 then response.Write "selected"%>>蓝框醒目</option>
                        <option value="14" <%if lArticle.logthestyle=14 then response.Write "selected"%>>绿框醒目</option>
                        <option value="15" <%if lArticle.logthestyle=15 then response.Write "selected"%>>淡蓝空心</option>
                        <option value="16" <%if lArticle.logthestyle=16 then response.Write "selected"%>>红色阴影</option>
                        <option value="17" <%if lArticle.logthestyle=17 then response.Write "selected"%>>交替变色</option>
                 </select>[/code]2.打开blogpost.asp 找到
2.1找到[code]lArticle.logPublishTimeType = request.form("PubTimeType")[/code]换行输入[code]lArticle.logthestyle = request.form("log_thestyle")[/code]2.2找到[code]<input name="title" type="text" class="inputBox" id="title" size="50" maxlength="50"/>[/code]换行输入[code]<select name="log_thestyle">
                   <option value="1" selected>默认效果</option>
                        <option value="5">彩色闪光</option>
                        <option value="6">来回波浪</option>
                        <option value="7">霓虹醒目</option>
                        <option value="8">逐字突出</option>
                        <option value="9">红色背景</option>
                        <option value="10">蓝色背景</option>
                        <option value="11">绿色背景</option>
                        <option value="12">红框醒目</option>
                        <option value="13">蓝框醒目</option>
                        <option value="14">绿框醒目</option>
                        <option value="15">淡蓝空心</option>
                        <option value="16">红色阴影</option>
                        <option value="17">交替变色</option>
                 </select>[/code]3.打开class\cls_logAction.asp 以下要注意修改
3.1找到[code]public logIsShow,logIsDraft,logWeather,[/code]替换成[code]public logIsShow,logIsDraft,logWeather,logthestyle,[/code]3.2找到[code] logPublishTimeType="now"[/code]换行输入[code]logthestyle = ""[/code]3.3找到(有两处,全部修改)[code] weblog("log_edittype")=logEditType [/code]换行输入[code]weblog("log_thestyle")=logthestyle[/code]3.4找到[code] logEditType = weblog("log_edittype")[/code]换行添加[code]logthestyle = Trim(weblog("log_thestyle"))[/code]3.5找到[code]sqlString="Select top 1 log_CateID,log_Author,log_Title,log_edittype,log_ubbFlags,log_Intro,log_weather,log_Level,log_comorder,log_DisComment,log_IsShow,log_IsTop,log_IsDraft,log_From,log_FromURL,log_Content,log_tag,log_PostTime,log_CommNums,log_QuoteNums,log_ViewNums[/code]在后面加上[code] ,log_thestyle[/code]3.6找到[code]"<$log_Title$>",HtmlEncode(log_View("log_Title"))[/code]替换成[code]"<$log_Title$>",showStyle(log_View("log_thestyle"),HtmlEncode(log_View("log_Title")))[/code]4.打开 class\cls_default.asp 注意参数所对应的序号!
4.1找到[code]strSQL="log_ID,log_CateID,log_Author,log_Title,log_PostTime,log_IsShow,log_CommNums,log_QuoteNums,log_ViewNums,log_IsTop[/code]在后面加入[code],log_thestyle[/code]4.2找到[code]strSQL="log_ID,log_CateID,log_Author,log_Title,log_PostTime,log_IsShow,log_CommNums,log_QuoteNums,log_ViewNums,log_IsTop,log_Intro,log_Content,log_edittype,log_DisComment,log_ubbFlags,log_tag[/code]在后面加入[code],log_thestyle[/code][color=red]4.3找到(其中数字16,根据你修改的情况对应读取编号)[/color][code]<a class="titleA" href="article.asp?id=<%=webLogArr(0,PageCount)%>"><%=HtmlEncode(webLogArr(3,PageCount))%></a>[/code]替换成[code]<a class="titleA" href="article.asp?id=<%=webLogArr(0,PageCount)%>"><%= showStyle(webLogArr(16,PageCount),HtmlEncode(webLogArr(3,PageCount)))%></a>[/code][color=red]4.4找到[/color][code]<a href="<%=logLink%>" title="作者:<%=webLogArr(2,PageCount)%> 日期:<%=DateToStr(webLogArr(4,PageCount),"Y-m-d")%>"><%=HtmlEncode(webLogArr(3,PageCount))%></a>[/code]替换成[code]          <a href="<%=logLink%>" title="作者:<%=webLogArr(2,PageCount)%> 日期:<%=DateToStr(webLogArr(4,PageCount),"Y-m-d")%>">
                   <%= showStyle(webLogArr(10,PageCount),HtmlEncode(webLogArr(3,PageCount)))%></a>[/code]5.打开article.asp 找到[code]SQL="Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment,log_Content,log_PostTime,log_edittype,log_ubbFlags,log_CommNums,log_QuoteNums,log_weather,log_level,log_Modify,log_FromUrl,log_From,log_tag[/code]在后面添加[code],log_thestyle[/code][color=red]6.打开class\cls_article.asp 找到[/color][code]<%=HtmlEncode(log_ViewArr(2,0))%>[/code]替换成[code]<%= showStyle(log_ViewArr(20,0),HtmlEncode(log_ViewArr(2,0)))%>[/code][color=red]7.打开common/function.asp在头部<%  后面添加[/color][code]'*************************************
'彩色标题
'*************************************
Function showStyle(color,thename)
  dim rndNo
  rndNo=int((rnd()*10000))
  if color<>"" and thename<>"" then
                 Select Case Cint(color)
                   case 0: showStyle=thename
           case 1,2,3,4: showStyle=thename
           case 5: showStyle="<!--[if IE]><span style=behavior:url(thestyle/font.htc)><![endif]--> " &thename& "<!--[if IE]></span><![endif]-->"
           case 6: showStyle="<!--[if IE]><span textoffset1=-4 textoffset2=-2 speed=100 letters1=1 letters2=1 pause=1000 style='behavior:url(thestyle/z_WaveText.htc);color:#FF6600;background-color:transparent'><![endif]--> " &thename& "<!--[if IE]></span><![endif]-->"
           case 7: showStyle="<!--[if IE]><span textcolor1=#FFFF00 textbkcolor1=transparent textcolor2=#FFCC99 textbkcolor2=transparent speed=100 letters1=1 letters2=1 pause=500 style='behavior:url(thestyle/z_FlashText.htc);color:#c000c0;background-color:transparent'><![endif]-->" &thename& "<!--[if IE]></span><![endif]-->"
           case 8: showStyle="<!--[if IE]><span textcolor=#ff0000 basesize=12 textsize1=14 textsize2=14 speed=100 letters1=1 letters2=1 pause=500 style='behavior:url(thestyle/z_ResizeText.htc);color:#993300;background-color:transparent;'><![endif]--> " &thename& "<!--[if IE]></span><![endif]-->"
           case 9: showStyle="<span Style='font-weight: bold;color: #FFFFFF;background-color: red;'>" &thename& "</Span>"
           case 10: showStyle="<span Style='font-weight: bold;color: #FFFFFF;background-color: blue;'>" &thename& "</Span>"
           case 11: showStyle="<span Style='font-weight: bold;color: #FFFFFF;background-color: #55AA55;'>" &thename& "</Span>"
           case 12: showStyle="<span style='border:solid 1px red;border-left-width:5px;border-left-color:red;background:#ffffff;padding:1px 6px 2px 6px;font-size: 8pt'>" &thename& "</span>"
           case 13: showStyle="<span style='border:solid 1px blue;border-left-width:5px;border-left-color:blue;background:#ffffff;padding:1px 6px 2px 6px;font-size: 8pt'>" &thename& "</span>"
           case 14: showStyle="<span style='border:solid 1px #55AA55;border-left-width:5px;border-left-color:#55AA55;background:#ffffff;padding:1px 6px 2px 6px;font-size: 8pt'>" &thename& "</span>"
           case 15: showStyle="<span style='PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FILTER: glow(color=BLUE,strength=3); PADDING-BOTTOM: 2px; COLOR: white; PADDING-TOP: 2px; HEIGHT: 10px' >" &thename& "</span>"
                         session("styleadd")=session("styleadd")+3.6
           case 16: showStyle="<!--[if IE]><span color=red><span style='height:1;filter:shadow(color=-87cefa;d9d9d9,direction=5)'><![endif]--> <B>" &thename& "</B><!--[if IE]></span></span><![endif]--> "
           case 17: showStyle="<span id='k"&rndNo&"'>" &thename& "</span><img src='' width='0' height='0' onerror=setInterval(""document.getElementById('k"&rndNo&"').style.color=Math.random()*255*255*255"",300) border=0>"
                 End Select
    Else
        showStyle=thename
  End if
End function[/code]8.下载升级文件解压到BLOG根目录
9.运行update.asp,运行后删除该文件 到后台重建数据缓存!完成

如有疑问,请跟帖说明!

PS:最近学车,没什么时间的,有问题的,大家相互帮助一下。版主事务做的不到位的最近还望见谅!:loveliness:

[[i] 本帖最后由 四川-果果 于 2008-9-7 23:34 编辑 [/i]]

Rison 2008-6-10 16:08

8错!居然被我强到沙发!呵呵~~~
有时间试试!

Vip.Alan 2008-6-10 16:09

不错.支持..哈哈.学车吖..加油了噢.
我也是今年年初拿了证.HOHO.

a6289510 2008-6-10 16:37

9.运行updata.asp,运行后删除该文件 到后台重建数据缓存!完成

应该是运行 update.asp

a6289510 2008-6-10 16:41

AD嫌疑,地址被屏蔽

PS 四川-果果:请注意版规!

a6289510 2008-6-10 16:41

500服务器内部错错, 无法显示!

四川-果果 2008-6-10 16:41

[quote]原帖由 [i]a6289510[/i] 于 2008-6-10 16:37 发表 [url=http://bbs.pjhome.net/redirect.php?goto=findpost&pid=256436&ptid=35640][img]http://bbs.pjhome.net/images/common/back.gif[/img][/url]
9.运行updata.asp,运行后删除该文件 到后台重建数据缓存!完成

应该是运行 update.asp [/quote]
这都被你看到了:loveliness:

a6289510 2008-6-10 16:44

我刚刚装上去测试了,服务器错误。

fittecc 2008-6-30 11:28

先試試看看。感謝樓主的分享。。。

wenjing365 2008-7-20 18:39

完了 出问题了   我改了以后  以前的日志不能编辑了! 其他问题还没发现 :cry:  再试试看还有什么问题

pinksky 2008-7-21 14:32

看其来很不错啊!感谢提供!

loris520 2008-9-5 23:52

更改项目太多了..
好像出错了...
楼主把改好的东西打个包发给我吧..
[email]loris520@gmail.com[/email]

[[i] 本帖最后由 loris520 于 2008-9-5 23:53 编辑 [/i]]
页: [1]
查看完整版本: 给日志标题添加多种显示效果(6月6日优化更新)