首页 » Blog » 博客相关 ✿ weblog » 浏览内容

WBC的相关日志插件

2008-02-22 06:33 798 0 发表评论

PJBLOG也好,还是其他的BLOG也好,日志本身的索引功能太可怜了。来访者很难找到某咱感兴趣的相关日志,虽然有分类,但只能到此而已,在细找就麻烦了。与普通网页相比较这大大减少了来访者浏览页面数和深度。添加上了最新日志、随机日志、最热日志,虽然加大了某些日志的曝光率,但解决不了这个问题。怎么能把站内相关的日志做目录或者索引,方便来访者的阅读呢?香港的PJ爱好者WBC就做出这样一个插件。首先谢谢WBC。

这里只修改了动态模式下的修改方法
修改文件:class/cls_article.asp(以添加了IP地址文件为修改对象)
查找(第192行)

<img src="images/tag.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>Tags:</strong> <%=getTag.filterHTML(log_ViewArr(19,0))%><br/>

在此代码之后添加以下代码

<!–相关日志–>
<%
Dim wbc_tag,nnickk_tag,Rs,i,RsT,OutPut
Set Rs=conn.execute("Select * from blog_Content where log_ID="&id&"")
OutPut=""
if not rs.eof then
wbc_tag=rs("log_tag")
if wbc_tag<>empty then
   wbc_tag=replace(wbc_tag,"{","")
wbc_tag=split(wbc_tag,"}")
   i=0
   DO until i>Ubound(wbc_tag)
  
    nnickk_tag=""
    if wbc_tag(i)<>empty then
     Set Rs=conn.execute("Select * from blog_tag where tag_ID="&wbc_tag(i)&"")
     if not rs.eof then
      nnickk_tag=rs("tag_name")
     end if
    end if
    
    Randomize
    Set RsT=conn.execute("Select TOP 5 log_Title,log_id,log_ViewNums from blog_Content where (log_tag like '%"&wbc_tag(i)&"%' or log_title like '%"&nnickk_tag&"%') and log_ID<>"&id&" order by Rnd(-(log_id+"&Rnd()&"))")
    if not RsT.eof then
     Do until Rst.eof
      If instr(OutPut,RsT(0))=0 and wbc_tag(i)<>"" then
        OutPut=OutPut&"  <font face='Wingdings'>n</font> <a href='article.asp?id="&RsT(1)&"'>"&RsT(0)&"["&RsT(2)&"]</a><br>"
      End if
      Rst.movenext
     Loop
    End if
    i=i+1
Loop
End if
  
  if output="" then
Randomize
   Set RsT=conn.execute("Select TOP 5 log_Title,log_id,log_ViewNums from blog_Content where log_ID<>"&id&" order by Rnd(-(log_id+"&Rnd()&"))")
if not RsT.eof then
Do until Rst.eof
       If instr(OutPut,RsT(0))=0 then
         OutPut=OutPut&"  <font face='Wingdings'>n</font> <a href='article.asp?id="&RsT(1)&"'>"&RsT(0)&"["&RsT(2)&"]</a><br>"
       End if
       Rst.movenext
Loop
End if
  end if
End if
OutPut=replace(OutPut,chr(39),chr(34))
Set rs=nothing
%>
       <img src="images/tag.gif" style="margin:4px 2px -4px 0px" alt=""/><strong>相关日志:</strong><br/>
<%=OutPut%>
<div class="Content-body" id="wbc_tag"></div><br/>
<!–/相关日志–>

相关日志取样规则,
每个tag随机选取五则相关的日志标题或日志tag。
这里为了简单快速修改,
只修改为无tag自动随机挑五则。

评论 共0条 (RSS 2.0) 发表评论

  1. 暂无评论,快抢沙发吧。

发表评论

联系我 Contact Me

十一假期后,会间接性整顿博客。如果发现有图片叉叉地,版面凌乱地,文字模糊不清地、相片太可爱地、请告之站长。绝对有惊喜!!……另外,给大家推荐一部好片:《三个傻瓜大闹宝莱坞》,站长最近比较痴迷男主角。~(≧▽≦)/~。
回到页首