Pjblog implements homepage calls similar to CMS

Source: Internet
Author: User

Haha more interesting can see http://5e8.com/blog/index.asp
The effect is that transferred from the http://pjblog.yyld.net/article.asp? Id = 31
Modify default. asp. We recommend that you copy a copy as a backup before modification.

Find:
<Div class = "Content-top"> <div class = "ContentLeft"> </div>

Change

<Div class = "Content-top"> <div class = "ContentLeft"> </div>

The total code after modification isCopy codeThe Code is as follows: <! -- # 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">
<% 'Main part! %>
<%
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 ("failed to read server data! ")
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>

<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 (" <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 'Process System sidebar module information %>
<Div id = "sidebar">
<Div id = "innersidebar">
<Div id = "sidebar-topimg"> <! -- Image at the top of the toolbar --> </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" -->

Did you notice that

SQL = "Select * FROM blog_Content where log_cateId =" & CateRS ("cate_id") & "order by log_posttime desc"

Set
SQL = "Select * FROM blog_Content where log_cateId =" & CateRS ("cate_id ")
Replace
SQL = "Select * FROM blog_Content where log_cateId =" & CateRS ("cate_id") & "order by log_posttime desc"

This is a random display method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.