pjblog实现类似CMS的首页调用

所属分类: 网络编程 / ASP编程 阅读数: 1102
收藏 0 赞 0 分享
呵呵比较有意思可以看http://5e8.com/blog/index.asp
效果就是那样的转自http://pjblog.yyld.net/article.asp?id=31
修改default.asp,建议修改前先复制一份作为备份。

找到:
<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("服务器数据读取失败!")
   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 '处理系统侧栏模块信息%>
   <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"

这是随机显示方法 
更多精彩内容其他人还在看

asp知识整理笔记4(问答模式)

这是关于asp知识整理的最后一份笔记,希望大家仔细阅读。
收藏 0 赞 0 分享

ASP基础知识VBScript基本元素讲解

这篇文章主要介绍了ASP基础知识VBScript基本元素的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP编码和解码函数详解

这篇文章主要介绍了ASP编码和解码函数的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP显示页面执行时间的方法

这篇文章主要介绍了ASP显示页面执行时间的方法,在本地测试一下输出页面需要多少时间,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP基础入门第一篇(ASP技术简介)

本文将以 Active Server Pages 为中心,向你全面展示制作动态商业网站的步骤和技巧并通过大量的实例,让你在不断的理论和实践之中笑傲“网络”……
收藏 0 赞 0 分享

ASP基础入门第二篇(ASP基础知识)

这篇文章是ASP基础入门第二篇,第一篇展示了ASP动态网站设计的一些最基本的方法,相信通过实践各位对 ASP 已经有了最基本的了解,本文将进一步介绍ASP动态网站的一些基本技巧,需要的朋友可以参考下
收藏 0 赞 0 分享

ASP基础入门第三篇(ASP脚本基础)

通过前两篇的学习,相信各位已经对 ASP 的动态网站设计有了一个基本的概念和整体的印象。从本篇开始作者将从脚本语言的使用着手,由浅入深地带领大家探索 ASP 动态网站设计的真正奥秘。
收藏 0 赞 0 分享

ASP基础入门第四篇(脚本变量、函数、过程和条件语句)

大家在学习了脚本语言 VBScript 的变量、常量和过程的基本概念后,本期将继续向各位介绍 VBScript 的函数和语法。
收藏 0 赞 0 分享

ASP基础入门第五篇(ASP脚本循环语句)

在本文上两篇中,我们学习了脚本语言 VBScript 的变量、函数、过程和条件语句,本篇将继续给大家介绍 VBScipt 的循环语句,并对脚本语言在 ASP 中的应用加以总结。  
收藏 0 赞 0 分享

ASP基础入门第六篇(ASP内建对象Request)

从本篇开始作者从 ASP 内建对象着手,为大家详细剖析 ASP 的六个内建对象和各种组件的特性和方法,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多