Skip to content

分类: 资源技巧

pjblog tags添加为关键字

把每篇文章tags属性添加为网页的关键字,从而提高我们的网站被搜索引擎搜到的概率。具体的操作:
首先打开article.asp,找到
[code]if blog_postFile then
SQL="Select top 1 log_ID,log_CateID,log_title,Log_IsShow,log_ViewNums,log_Author,log_comorder,log_DisComment FROM blog_Content Where log_ID="&id&" and log_IsDraft=false"
else
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 FROM blog_Content Where log_ID="&id&" and log_IsDraft=false"
end if[/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 FROM blog_Content Where log_ID="&id&" and log_IsDraft=false"

然后打开header.asp,找到

程序代码 程序代码

这一句,改成:
[code] <%dim tmpTag,tmp_tags,len_name len_name=Len(SiteName) If Left(Title,len_name)=SiteName Then %>

<%else set tmpTag=new tag tmp_tags=tmpTag.filterKeys(log_ViewArr(19,0)) %>

<%end if%>[/code]
最后打开common\library.asp,找到
[code]Public function filterHTML(str) '过滤标签
If isEmpty(str) or isNull(str) or len(str)=0 Then
Exit Function
filterHTML=str
else
dim log_Tag,log_TagItem
For Each log_TagItem IN Arr_Tags
log_Tag=Split(log_TagItem,"||")
str=replace(str,"{"&log_Tag(0)&"}",""&log_Tag(1)&""&log_Tag(1)&" ")
Next
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="\{(\d)\}"
str=re.Replace(str,"")
filterHTML=str
end if
end function[/code]
在其后添加如下代码
[code] Public function filterKeys(str) 'Theosoft (C) 2001-2006
If isEmpty(str) or isNull(str) or len(str)=0 Then
Exit Function
filterKeys=str
else
dim log_Tag,log_TagItem
For Each log_TagItem IN Arr_Tags
log_Tag=Split(log_TagItem,"||")
str=replace(str,"{"&log_Tag(0)&"}",log_Tag(1)&",")
Next
Dim re
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern="\{(\d)\}"
str=re.Replace(str,"")
filterKeys=str
end if
end function[/code]

PJBlog日历添加背景

1、把附件calendar文件夹拷贝到images文件夹下,images/calendar
 点击下载此文件
2、修改common文件夹下的library.asp;找到第18行附近的代码:
[code] C_Year=Cint(C_Year)
C_Month=Cint(C_Month)
C_Day=Cint(C_Day)
C_YM=C_Year & "-" & C_Month[/code]
在其后面加入以下代码:
[code] Dim Month_Name(12)
Month_Name(0)=""
Month_Name(1)="1"
Month_Name(2)="2"
Month_Name(3)="3"
Month_Name(4)="4"
Month_Name(5)="5"
Month_Name(6)="6"
Month_Name(7)="7"
Month_Name(8)="8"
Month_Name(9)="9"
Month_Name(10)="10"
Month_Name(11)="11"
Month_Name(12)="12"[/code]
3、继续查找以下代码:

 程序代码

Calendar="

"&C_Year&"年"&C_Month&"月

"

将其替换为:

 程序代码

Calendar="

"&C_Year&"年"&C_Month&"月

"