www.gusucode.com > 栽豆迷你博客 MiniBlog 3.0 正式版源码程序 > Index.asp
<!--#include file="include/conn.asp" --> <!--#include file="include/char.asp" --> <!--#include file="include/cb_main.asp" --> <!--#include file="include/function.asp" --> <% Dim StrHtml Caluoob.Herder Caluoob.SystemName&" | 迷你博客 随时随地说点" StrHtml=Caluoob.Loadskins("index_table.txt") StrHtml=Replace(StrHtml,"$table_content",Caluoob.Loadskins("index_newing.txt")) StrHtml=Replace(StrHtml,"$table_index_content",Caluoob.Loadskins("index_rinfo.txt")) StrHtml=Replace(StrHtml,"$IndexLogin",Caluoob.IndexLogin()) StrHtml=Replace(StrHtml,"$CommendUsers",Caluoob.CommendUsers()) StrHtml=Replace(StrHtml,"$NewUsers",Caluoob.NewUsers()) StrHtml=Replace(StrHtml,"$IndexIngs",IndexIngs()) StrHtml=Replace(StrHtml,"$TopIng",TopIng()) Response.Write StrHtml Caluoob.Footer Response.Flush() Function TopIng() Dim myrs Set myrs = Caluoob.Execute("select top 3 cb_ing.*,cb_user.id,cb_user.nicknames from [cb_ing] inner join [cb_user] on cb_ing.userid=cb_user.id where issue=1 order by cb_ing.id desc") TopIng="" if myrs.Eof or myrs.bof then TopIng=TopIng&"还没有任何信息!" else Do while not myrs.eof TopIng=TopIng&"<li><a href=hi.asp?u="&myrs("cb_user.id")&">"&myrs("nicknames")&"</a>:"&myrs("Content")&"</li>" myrs.movenext If myrs.EOF Then Exit do loop myrs.close set myrs=nothing end if End Function Function IndexIngs() Dim myrs,timedifference Set myrs = Caluoob.Execute("select top 10 cb_ing.*,cb_user.id,cb_user.userface,cb_user.nicknames from [cb_ing] inner join [cb_user] on cb_ing.userid=cb_user.id order by cb_ing.id desc") IndexIngs="<ol class=wa>" if myrs.Eof or myrs.bof then IndexIngs=IndexIngs&"还没有任何信息!" else Do while not myrs.eof IndexIngs=IndexIngs&"<li><a class=avatar href=hi.asp?u="&myrs("cb_user.id")&"><img src=face/"&myrs("userface")&"></a><a class=author href=hi.asp?u="&myrs("cb_user.id")&">"&myrs("nicknames")&"</a> <span class=content>"&myrs("Content")&"</span> <span class=stamp><span class=time>" If DateDiff("s", myrs("addtime"), Now) <60 then IndexIngs=IndexIngs&"约 "&DateDiff("s", myrs("addtime"), Now)&"秒前" ElseIf DateDiff("s", myrs("addtime"), Now) <60*60 then IndexIngs=IndexIngs&"约 "&DateDiff("s", myrs("addtime"), Now)\60&"分钟前" ElseIf DateDiff("s", myrs("addtime"), Now) <60*60*24 then IndexIngs=IndexIngs&"约 "&DateDiff("s", myrs("addtime"), Now)\3600&"小时前" ElseIf DateDiff("s", myrs("addtime"), Now) <60*60*60*24 then IndexIngs=IndexIngs&"约 "&DateDiff("s", myrs("addtime"), Now)\86400&"天前" Else IndexIngs=IndexIngs&"很久以前" End If IndexIngs=IndexIngs&"</span> <span class=method>" if myrs("IsMethod")=0 then IndexIngs=IndexIngs&"通过网页" elseif myrs("IsMethod")=1 then IndexIngs=IndexIngs&"通过WAP" end if IndexIngs=IndexIngs&"</span></span> <span class=op><a href=statuses.asp?id="&myrs("cb_ing.id")&" class=reply title=回复该信息>"&myrs("ReNum")&"回复</a></span></li>" myrs.movenext If myrs.EOF Then Exit do loop IndexIngs=IndexIngs&"</ol>" myrs.close set myrs=nothing end if End Function %>