pjblog实现类似CMS的首页调用
2018-09-06 12:23
  呵呵比较有意思可以看
效果就是那样的转自
修改default.asp,建议修改前先复制一份作为备份。 
找到: 
<divclass=Content-top><divclass=ContentLeft></div><h1class=ContentTitle><ahref=default.asp?ID=&CateRS(cate_id)&><%=CateRS(cate_Name)%></a></h1></div> 
修改为 
<divclass=Content-top><divclass=ContentLeft></div><h1class=ContentTitle><ahref=default.asp?cateID=<%=CateRS(cate_id)%>><%=CateRS(cate_Name)%></a></h1></div> 
修改完成后的总代码是 
复制代码 代码如下:
<!--#includefile=BlogCommon.asp--> 
<!--#includefile=header.asp--> 
<!--#includefile=common/ModSet.asp--> 
<!--#includefile=plugins.asp--> 
<!--#includefile=class/cls_default.asp--> 
<!--#includefile=class/cls_logAction.asp--> 
<divid=Tbody> 
<divid=mainContent> 
<divid=innermainContent> 
<divid=mainContent-topimg></div> 
<%=content_html_Top_default%> 
<divid=Content_ContentListclass=content-width> 
<%主體部分!%> 
<% 
ifrequest(cateid)=then%> 
<tablewidth=100%><% 
DimCateRS 
DimTrd 
SetCateRS=Server.CreateObject(Adodb.RecordSet) 
SQL=Select*FROMblog_categorywherecate_outlink=0 
CateRS.OpenSQL,Conn,1,1 
IfCateRS.EofAndCateRS.BofThen 
Response.Write(服务器数据读取失败!) 
Else 
Response.Write(<tr>) 
DoWhileNotCateRS.Eof 
Ifint(trd/2)=trd/2andtrd<>0thenResponse.Write(</tr><tr>) 
%> 
<tdwidth=50%valign=topstyle=padding-right:5px;> 
<divclass=Content> 
<divclass=Content-top><divclass=ContentLeft></div><h1class=ContentTitle><ahref=default.asp?cateID=<%=CateRS(cate_id)%>><%=CateRS(cate_Name)%></a></h1></div> 
<divclass=Content-body> 
<%DimRS,row 
row=0 
SetRS=Server.CreateObject(Adodb.RecordSet) 
SQL=Select*FROMblog_Contentwherelog_cateId=&CateRS(cate_id)&orderbylog_posttimedesc 
RS.OpenSQL,Conn,1,1 
SQLQueryNums=SQLQueryNums+1 
IfRS.EofAndRS.BofThen 
Response.Write(None) 
Else 
Dimlog_Weather,log_ID 
DoWhileNotRS.Eof 
log_ID=RS(log_ID) 
Response.Write(<imgsrc=images/code.gif><ahref=default.asp?ID=&log_ID&>&HTMLEncode(cutStr(RS(log_Title),42))&</a>) 
Response.Write(<br>) 
RS.Movenext 
row=row+1 
ifrow=10then 
Exitdo 
endif 
Loop 
EndIf 
RS.Close 
SetRS=Nothing%><br></div></td> 
<% 
trd=trd+1 
iftrd=10then 
Exitdo 
endif 
CateRS.Movenext 
Loop 
Endif 
CateRS.Close 
SetCateRS=Nothing 
%> 
</table> 
<%else%><%ContentList%> 
<%endif%></div> 
<%=content_html_Bottom_default%> 
<divid=mainContent-bottomimg></div> 
</div> 
</div> 
<%Side_Module_Replace处理系统侧栏模块信息%> 
<divid=sidebar> 
<divid=innersidebar> 
<divid=sidebar-topimg><!--工具条顶部图象--></div> 
<%=side_html_default%> 
<divid=sidebar-bottomimg></div> 
</div> 
</div> 
<divstyle=clear:both;height:1px;overflow:hidden;margin-top:-1px;></div> 
</div> 
<!--#includefile=footer.asp--> 
大家是不是注意到 
SQL=Select*FROMblog_Contentwherelog_cateId=&CateRS(cate_id)&orderbylog_posttimedesc 
把 
SQL=Select*FROMblog_Contentwherelog_cateId=&CateRS(cate_id) 
替换成 
SQL=Select*FROMblog_Contentwherelog_cateId=&CateRS(cate_id)&orderbylog_posttimedesc 
这是随机显示方法