pjblog實(shí)現(xiàn)類似CMS的首頁調(diào)用
更新時(shí)間:2007年02月05日 00:00:00 作者:
呵呵比較有意思可以看http://5e8.com/blog/index.asp
效果就是那樣的轉(zhuǎn)自http://pjblog.yyld.net/article.asp?id=31
修改default.asp,建議修改前先復(fù)制一份作為備份。
找到:
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle"><a href=""default.asp?ID="&CateRS("cate_id")&"""><%=CateRS("cate_Name")%></a></h1> </div>
修改為
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle""><a href="default.asp?cateID=<%=CateRS("cate_id")%>"><%=CateRS("cate_Name")%></a></h1> </div>
修改完成后的總代碼是
<!--#include file="BlogCommon.asp" -->
<!--#include file="header.asp" -->
<!--#include file="common/ModSet.asp" -->
<!--#include file="plugins.asp" -->
<!--#include file="class/cls_default.asp" -->
<!--#include file="class/cls_logAction.asp" -->
<div id="Tbody">
<div id="mainContent">
<div id="innermainContent">
<div id="mainContent-topimg"></div>
<%=content_html_Top_default%>
<div id="Content_ContentList" class="content-width">
<%'主體部分!%>
<%
if request("cateid")="" then%>
<table width=100%><%
Dim CateRS
Dim Trd
Set CateRS=Server.CreateObject("Adodb.RecordSet")
SQL="Select * FROM blog_category where cate_outlink=0"
CateRS.Open SQL,Conn,1,1
If CateRS.Eof And CateRS.Bof Then
Response.Write("服務(wù)器數(shù)據(jù)讀取失??!")
Else
Response.Write("<tr>")
Do While Not CateRS.Eof
If int(trd/2)=trd/2 and trd<>0 then Response.Write("</tr><tr>")
%>
<td width=50% valign="top" style="padding-right:5px;">
<div class="Content">
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle""><a href="default.asp?cateID=<%=CateRS("cate_id")%>"><%=CateRS("cate_Name")%></a></h1> </div>
<div class="Content-body">
<%Dim RS,row
row=0
Set RS=Server.CreateObject("Adodb.RecordSet")
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
RS.Open SQL,Conn,1,1
SQLQueryNums=SQLQueryNums+1
If RS.Eof And RS.Bof Then
Response.Write("None")
Else
Dim log_Weather,log_ID
Do While Not RS.Eof
log_ID=RS("log_ID")
Response.Write("<img src=""images/code.gif""> <a href=""default.asp?ID="&log_ID&""">"&HTMLEncode(cutStr(RS("log_Title"),42))&"</a>")
Response.Write("<br>")
RS.Movenext
row=row+1
if row=10 then
Exit do
end if
Loop
End If
RS.Close
Set RS=Nothing%><br></div></td>
<%
trd=trd+1
' if trd=10 then
' Exit do
'end if
CateRS.Movenext
Loop
End if
CateRS.Close
Set CateRS=Nothing
%>
</table>
<%else%><%ContentList%>
<%end if%></div>
<%=content_html_Bottom_default%>
<div id="mainContent-bottomimg"></div>
</div>
</div>
<%Side_Module_Replace '處理系統(tǒng)側(cè)欄模塊信息%>
<div id="sidebar">
<div id="innersidebar">
<div id="sidebar-topimg"><!--工具條頂部圖象--></div>
<%=side_html_default%>
<div id="sidebar-bottomimg"></div>
</div>
</div>
<div style="clear: both;height:1px;overflow:hidden;margin-top:-1px;"></div>
</div>
<!--#include file="footer.asp" -->
大家是不是注意到
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
把
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")
替換成
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
這是隨機(jī)顯示方法
效果就是那樣的轉(zhuǎn)自http://pjblog.yyld.net/article.asp?id=31
修改default.asp,建議修改前先復(fù)制一份作為備份。
找到:
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle"><a href=""default.asp?ID="&CateRS("cate_id")&"""><%=CateRS("cate_Name")%></a></h1> </div>
修改為
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle""><a href="default.asp?cateID=<%=CateRS("cate_id")%>"><%=CateRS("cate_Name")%></a></h1> </div>
修改完成后的總代碼是
復(fù)制代碼 代碼如下:
<!--#include file="BlogCommon.asp" -->
<!--#include file="header.asp" -->
<!--#include file="common/ModSet.asp" -->
<!--#include file="plugins.asp" -->
<!--#include file="class/cls_default.asp" -->
<!--#include file="class/cls_logAction.asp" -->
<div id="Tbody">
<div id="mainContent">
<div id="innermainContent">
<div id="mainContent-topimg"></div>
<%=content_html_Top_default%>
<div id="Content_ContentList" class="content-width">
<%'主體部分!%>
<%
if request("cateid")="" then%>
<table width=100%><%
Dim CateRS
Dim Trd
Set CateRS=Server.CreateObject("Adodb.RecordSet")
SQL="Select * FROM blog_category where cate_outlink=0"
CateRS.Open SQL,Conn,1,1
If CateRS.Eof And CateRS.Bof Then
Response.Write("服務(wù)器數(shù)據(jù)讀取失??!")
Else
Response.Write("<tr>")
Do While Not CateRS.Eof
If int(trd/2)=trd/2 and trd<>0 then Response.Write("</tr><tr>")
%>
<td width=50% valign="top" style="padding-right:5px;">
<div class="Content">
<div class="Content-top"><div class="ContentLeft"></div><h1 class="ContentTitle""><a href="default.asp?cateID=<%=CateRS("cate_id")%>"><%=CateRS("cate_Name")%></a></h1> </div>
<div class="Content-body">
<%Dim RS,row
row=0
Set RS=Server.CreateObject("Adodb.RecordSet")
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
RS.Open SQL,Conn,1,1
SQLQueryNums=SQLQueryNums+1
If RS.Eof And RS.Bof Then
Response.Write("None")
Else
Dim log_Weather,log_ID
Do While Not RS.Eof
log_ID=RS("log_ID")
Response.Write("<img src=""images/code.gif""> <a href=""default.asp?ID="&log_ID&""">"&HTMLEncode(cutStr(RS("log_Title"),42))&"</a>")
Response.Write("<br>")
RS.Movenext
row=row+1
if row=10 then
Exit do
end if
Loop
End If
RS.Close
Set RS=Nothing%><br></div></td>
<%
trd=trd+1
' if trd=10 then
' Exit do
'end if
CateRS.Movenext
Loop
End if
CateRS.Close
Set CateRS=Nothing
%>
</table>
<%else%><%ContentList%>
<%end if%></div>
<%=content_html_Bottom_default%>
<div id="mainContent-bottomimg"></div>
</div>
</div>
<%Side_Module_Replace '處理系統(tǒng)側(cè)欄模塊信息%>
<div id="sidebar">
<div id="innersidebar">
<div id="sidebar-topimg"><!--工具條頂部圖象--></div>
<%=side_html_default%>
<div id="sidebar-bottomimg"></div>
</div>
</div>
<div style="clear: both;height:1px;overflow:hidden;margin-top:-1px;"></div>
</div>
<!--#include file="footer.asp" -->
大家是不是注意到
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
把
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")
替換成
SQL="Select * FROM blog_Content where log_cateId="&CateRS("cate_id")&" order by log_posttime desc"
這是隨機(jī)顯示方法
相關(guān)文章
ASP語言實(shí)現(xiàn)對(duì)SQL SERVER數(shù)據(jù)庫的操作
目前有很多介紹用ASP開發(fā)網(wǎng)絡(luò)數(shù)據(jù)庫的程序例子,但絕大部分是利用ACCESS作底層數(shù)據(jù)庫。相對(duì)于ACCESS而言,SQL SERVER數(shù)據(jù)庫系統(tǒng)要復(fù)雜得多,因此在程序開發(fā)中需要多做一些工作。筆者結(jié)合自己開發(fā)管理信息系統(tǒng)的經(jīng)驗(yàn),在此試舉一例,與感興趣的朋友共同交流2015-09-09ASP 微信公共平臺(tái)接口實(shí)現(xiàn)代碼
bluedidea看到的ASP 微信公共平臺(tái)接口實(shí)現(xiàn)代碼,需要的朋友可以參考下2014-01-01通過MSXML2自動(dòng)獲取QQ個(gè)人頭像及在線情況(給初學(xué)者)
通過MSXML2自動(dòng)獲取QQ個(gè)人頭像及在線情況(給初學(xué)者)...2007-03-03asp IsValidEmail 驗(yàn)證郵箱地址函數(shù)(email)
驗(yàn)證郵箱很多在js客戶端驗(yàn)證了,但是那樣很容易被人破了,我們?cè)诜?wù)器上用asp進(jìn)行驗(yàn)證的話就應(yīng)該沒有問題了。2010-05-05