📄 index.asp
字号:
<!--#INCLUDE FILE="conn.asp" -->
<!--#include file="ubbcode.asp" -->
<!--#include file="log_lib.asp" -->
<script>
function check(theForm) {
if(theForm.key.value == "" ) {
alert("关键词不能为空");
return false;
}
}
</script>
<%
sql="select * from moban where m_id="&cint(m_id)&""
set rs=conn.EXECUTE(sql)
if rs.eof or rs.bof then
sql="select * from moban where m_id=1"
set rs=conn.EXECUTE(sql)
end if
mb_code=rs("m_html")
rs.close
set rs=nothing
'=====================================写入登陆信息
checkuser()
mb_code=replace(mb_code,"$checkuser$",check_user)
'=======================================写入日历
calenda l_year,l_month,l_day
mb_code=replace(mb_code,"$calenda$",ccode)
'=======================================写入Top10
getTop()
mb_code=replace(mb_code,"$top10$",tcode)
'=======================================写入RSS
getRss()
mb_code=replace(mb_code,"$rss$",rsscode)
'=======================================写入日志信息
getloginfo()
mb_code=replace(mb_code,"$log_info$",icode)
'=======================================写入分类列表
getcatlist()
mb_code=replace(mb_code,"$log_cat_list$",lcode)
'=======================================写入搜索表单
getsearchcode()
mb_code=replace(mb_code,"$search_form$",sccode)
'=======================================写入内容
dim viewtype,ASPLOG,sql_view,urladd,oyear,omonth,oday,bdate,Mcode
dim plist,maxpages,mypage
sub getmaincode
viewtype=request("vt")
viewtype=replace(viewtype, "'", "''")
if not isempty(request("page")) then
Mypage=cint(Request("page"))
else
Mypage=1
end if
set ASPLOG = Server.CreateObject("ADODB.Recordset")
select case viewtype
case "search"
if cat_id=0 then
sadd=" "
else
sadd=" and cat_id="&cat_id&" "
end if
key=trim(request.form("key"))
sql_view="SELECT * FROM log WHERE (log_tittle like '%"&key&"%' or log_content like '%"&key&"%') "&sadd&" ORDER BY log_id desc"
urladd="vt=search&key="&key
txtadd="关键词[<b>"&key&"</b>] 得到"
case "bycat"
sql_view="SELECT * FROM log WHERE cat_id="&cat_id&" ORDER BY log_id desc"
urladd="vt=bycat&cat_id="&cat_id
set rsnowcat = conn.execute("select cat_name from log_cat where id="&cat_id)
if not (rsnowcat.bof and rsnowcat.eof) then
nowcat = rsnowcat(0)
set rsnowcat = nothing
end if
txtadd="分类 ["&nowcat&"] 中"
case "byday"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" AND l_month="&l_month&" AND l_day="&l_day&" ORDER BY log_id desc"
urladd="vt=byday&l_year="&l_year&"&l_month="&l_month&"&l_day="&l_day
txtadd="在"&l_year&"年"&l_month&"月"&l_day&"日中"
case "bymonth"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" AND l_month="&l_month&" ORDER BY log_id desc"
urladd="vt=bymonth&l_year="&l_year&"&l_month="&l_month
txtadd="在"&l_year&"年"&l_month&"月中"
case "byyear"
sql_view="SELECT * FROM log WHERE l_year="&l_year&" ORDER BY log_id desc"
urladd="vt=byyear&l_year="&l_year
txtadd="在"&l_year&"年中"
case "byct"
sql_view="SELECT * FROM log WHERE lr_count>0 ORDER BY log_id desc"
urladd="vt=byct"
txtadd="有评论的日志"
case "byview"
sql_view="SELECT * FROM log where lv_count>0 ORDER BY lv_count desc"
urladd="vt=byview"
txtadd="按有查看数排列的日志"
case "bycomment"
sql_view="SELECT * FROM log where lr_count>0 ORDER BY lr_count desc"
urladd="vt=bycomment"
txtadd="按有评论数排列的日志"
end select
if sql_view="" then
sql_view="SELECT * FROM log ORDER BY log_id desc"
urladd="vt=default"
txtadd="共有"
'sql_view="SELECT top 5 * FROM log ORDER BY log_id desc"
'txtadd="本页显示最新添加的 "
end if
'set ASPLOG=conn.EXECUTE(sql_view)
ASPLOG.open sql_view,conn,1,1
if ASPLOG.eof then
mcode=mcode&"<div id='Loginfo'>"
mcode=mcode&txtadd&"零篇日志记录"
mcode=mcode&"</div>"
exit sub
end if
ASPLOG.pagesize=Mypagesize
maxpages=cint(ASPLOG.pagecount)
totalsize=cint(Mypagesize)
ASPLOG.absolutepage=Mypage
GuestTotal=ASPLOG.RecordCount
if cint(Mypage) >1 then
if cint(Mypage) > maxpages then
mcode=mcode&"嘿嘿,所翻到的这一页是空白的,请不要捣乱"
exit sub
end if
end if
pagelink GuestTotal
mcode=mcode&"<div id=""Loginfo""><ul><li>"&txtadd&""&GuestTotal&"篇日志 | 每页显示"&MyPageSize&"篇 | 第"&cint(Mypage)&"页 [共"&maxpages&"页] </li></ul><div id=""ListNum"">"&plist&"</div></div>"
total = 0
do until ASPLOG.Eof or total = totalsize
if oyear=ASPLOG("l_year") and omonth=ASPLOG("l_month") and oday=ASPLOG("l_day") then
bdate="false"
else
bdate="true"
oyear=ASPLOG("l_year")
omonth=ASPLOG("l_month")
oday=ASPLOG("l_day")
end if
checkhide(ASPLOG("cat_id"))
'====================属于隐藏分类中的日志文章过滤
'if noneshow="true" AND not (ULogin="true" and isad<0) then
'mcode=mcode&"<table border='0' cellspacing='0' cellpadding='2' width='100%'><tr><td> [ 此处一篇日志属于隐藏的分类中,所以对于非管理员,内容将不可见 ]"
'if bdate="true" then
'mcode=mcode&" <font style='font-size:10px' class='log_date'>["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]</font>"
'else
'mcode=mcode&"<font style='font-size:10px' class='log_date'>["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]</font>"
'end if
'mcode=mcode&"</td></tr></table>"
'else
'=====================================================
if noneshow<>"true" or (ULogin="true" and isad<0) then
mcode=mcode&"<div id='content'>"
mcode=mcode&"<div id='contentTitle'>"
if log_view_type=-1 then
title_link_1="<a href='showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_id="&ASPLOG("log_id")&"'>"
title_link_2="</a>"
else
title_link_1=""
title_link_2=""
end if
mcode=mcode&" <a href=showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_id="&ASPLOG("log_id")&"><img src='images/TitleIco.gif' alt='' align='bottom' id='linkimg'/> <strong>"&ASPLOG("log_tittle")&"</a></strong>"
if bdate="true" then
mcode=mcode&"["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]</div>"
mcode=mcode&"<div id='weather' align='right'><IMG src='images/hn2_t_"&ASPLOG("log_weather")&".gif' /> <img src='images/hn2_"&ASPLOG("log_weather")&".gif' align='absmiddle' /> <img src='images/face"&ASPLOG("face")&".gif' alt='心情指数#"&ASPLOG("face")&"' /></div>" '加入心情指数 by Poorfish
else
mcode=mcode&" ["&ASPLOG("l_year")&"-"&ASPLOG("l_month")&"-"&ASPLOG("l_day")&"]</div>"
mcode=mcode&"<div id='weather' align='right'><IMG src='images/hn2_t_"&ASPLOG("log_weather")&".gif' /> <img src='images/hn2_"&ASPLOG("log_weather")&".gif' align='absmiddle' /> <img src='images/face"&ASPLOG("face")&".gif' alt='心情指数#"&ASPLOG("face")&"' /></div>" '加入心情指数 by Poorfish
end if
mcode=mcode&"<div id='contentText'>"
if log_view_type=1 or log_view_type=0 then
realcontent=ASPLOG("log_content")
if ASPLOG("log_type")=1 then
realcontent=realcontent
else
realcontent=unhtml(realcontent)
if ASPLOG("allows")=0 then realcontent=Smilies(realcontent)
if ASPLOG("allowubb")=0 then realcontent=ubb(realcontent)
end if
if log_view_type=1 then
realcontent=splitLines(realcontent,log_cut_line,ASPLog("log_id"),ASPLog("cat_id"))
end if
mcode=mcode&realcontent
end if
mcode=mcode&"</div>"
mcode=mcode&"<div id='contentI'>"
if viewtype<>"bycat" then
getcatname(ASPLOG("cat_id"))
inwhichcatcode=" in [<a href='index.asp?vt=bycat&cat_id="&ASPLOG("cat_id")&"'>"&incat&"</a>] "
end if
''读出引用数
sql = "select count(*) from trackback where blogArId="&ASPLOG("log_ID")
set rs = conn.Execute(sql)
dim tbCount
tbCount = rs(0)
''end 读出引用数
mcode=mcode&"By [<a href='usermdb.asp?un="&ASPLOG("log_author")&"'>"&ASPLOG("log_author")&"</a>] "&inwhichcatcode&" at "& TimeValue(ASPLOG("written_time"))&" | <a href='showlog.asp?cat_id="&ASPLOG("cat_id")&"&log_id="&ASPLOG("log_id")&"'>Comment</a>["&ASPLOG("lr_count")&"] | <a href='showTB.asp?log_id="&ASPLOG("log_id")&"' target=_blank>TrackBack</a>["&tbCount&"] | "&ASPLOG("lv_count")&" views"
if username=ASPLOG("log_author") or isad=-1 then
if ASPLOG("log_type")=1 Then
mcode=mcode&" <a href='edit_log.asp?log_id="&ASPLOG("log_id")&"'><img src='images/icon_edit.gif' alt='编辑或删除此日志' align='middle' id='linkimg'></a>"
else
mcode=mcode&" <a href='edit_log_ubb.asp?log_id="&ASPLOG("log_id")&"'><img src='images/icon_edit.gif' alt='编辑或删除此日志' align='middle' id='linkimg'></a>"
end if
end if
mcode=mcode&"</div>"
mcode=mcode&"</div>"
end if
ASPLOG.MoveNext
total = total + 1
loop
'底部分页
mcode=mcode&"<div id='Loginfo'><div align='right' >"&plist&"</div></div>"
ASPLOG.close
set ASPLOG=nothing
end sub
'===================================================内容结束
getmaincode
mb_code=replace(mb_code,"$main_content$",mcode)
response.write mb_code
%>
<%
function PageLink (GuestTotal)
PageShowSize = 10
Scriptname=Request.Servervariables("script_name")
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((GuestTotal-1)/MyPageSize)+1
if Maxpages > 1 then
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & PagePrev & "'>[<<]</a>-"
end if
if Mypage-1 > 0 then
Prev_Page = MyPage - 1
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & Prev_Page & "'>[<]</a> "
end if
if maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
end if
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*10)-10
if PageLink <> cint(Mypage) then
plist=plist&"<a href='" & Scriptname & "?"&urladd&"&page=" & PageLink & "'>[" & PageLink & "]</a> "
else
plist=plist&PageLink & " "
end if
next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
plist=plist& "<a href='" & Scriptname & "?"&urladd&"&page=" & Next_Page & "'>[>]</a>"
end if
if maxpages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
plist=plist& "-<a href='" & Scriptname & "?"&urladd&"&page=" & PageNext & "'>[>>]</a>"
end if
else
plist=plist&"[1]"
end if
END function
conn.close
set conn=nothing
%>
<!--#include file="bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -