if IsInteger(titleLength)=false then titleLength=20 if IsInteger(authorLength)=false then authorLength=6
FeedCate=False
IF IsInteger(TagID) = True Then SQLFiltrate="log_tag LIKE '%{"&TagID&"}%' AND " Else SQLFiltrate="" End IF
IF IsInteger(cate_ID) = False Then SQL="Select TOP 10 L.log_ID,L.log_Title,l.log_Author,L.log_PostTime,C.cate_Name,C.cate_ID FROM blog_Content AS L,blog_Category AS C Where "&SQLFiltrate&" C.cate_ID=L.log_cateID AND L.log_IsShow=true AND L.log_IsDraft=false and C.cate_Secret=false orDER BY log_PostTime DESC" Else SQL="Select TOP 10 L.log_ID,L.log_Title,l.log_Author,L.log_PostTime,C.cate_Name,C.cate_ID FROM blog_Content AS L,blog_Category AS C Where log_cateID="&cate_ID&" AND "&SQLFiltrate&" C.cate_ID=L.log_cateID AND L.log_IsShow=true AND L.log_IsDraft=false and C.cate_Secret=false orDER BY log_PostTime DESC" FeedCate=True End IF
Dim RS,DisIMG,i Set RS=Conn.ExeCute(SQL) if RS.EOF or RS.BOF then ReDim FeedRows(0,0) else if FeedCate then FeedTitle=SiteName & " - " & RS("cate_Name") FeedRows=RS.getrows() end if RS.close set RS=nothing Conn.Close Set Conn=Nothing
if ubound(FeedRows,1)=0 then %> document.write ("没有找到任何日志") <% else for i=0 to ubound(FeedRows,2) select case showType case 1: %> document.write ("<div><span style=/"float:right/"><%=DateToStr(FeedRows(3,i),"Y-m-d")%></span>[<a href=/"<%=SiteURL&"default.asp?cateID="&FeedRows(5,i)%>/" target=/"_blank/"><%=toUnicode(FeedRows(4,i))%></a>]<a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% case 2: %> document.write ("<div><span style=/"float:right/"><a href=/"<%=SiteURL%>/" title=/"<%=toUnicode(FeedRows(2,i))%>/"><%=toUnicode(CutStr(FeedRows(2,i),authorLength))%></a></span><a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% case 3: %> document.write ("<div><span style=/"float:right/"><%=DateToStr(FeedRows(3,i),"Y-m-d")%></span><a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% case 4: %> document.write ("<div><a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% case 5: %> document.write ("<div><a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% case else: %> document.write ("<div><span style=/"float:right/"><a href=/"<%=SiteURL%>/" title=/"<%=toUnicode(FeedRows(2,i))%>/"><%=toUnicode(CutStr(FeedRows(2,i),authorLength))%></a></span>[<a href=/"<%=SiteURL&"default.asp?cateID="&FeedRows(5,i)%>/" target=/"_blank/"><%=toUnicode(FeedRows(4,i))%></a>]<a href=/"<%=SiteURL&"default.asp?id="&FeedRows(0,i)%>/" target=/"_blank/" title=/"<%=toUnicode(FeedRows(1,i))%>/"><%=toUnicode(CutStr(FeedRows(1,i),titleLength))%></a></div>") <% end select
next end if
function toUnicode(str) 'To Unicode dim i, unicodeF, getUnicode for i=1 to len(str) unicodeF=Mid(str,i,1) getUnicode=getUnicode & chr(38) & chr(35) & chr(120) & Hex(ascw(unicodeF)) & chr(59) next toUnicode=getUnicode end function %>
记住,文件格式是UTF-8。 如果像我的博客调用一篇日志就找到代码select top 部分,把10改为1就可以了。