?? jjs.asp
字號:
<!--#include file="conn.asp" -->
<%
dim kind, path,classID,NclassID
jclassid=request("jclassid") '大分類
jnclassid=request("jnclassid") '小分類
kind=request("kind") '首頁調用類型hits表示瀏覽排行,downnum表示下載排行,pinglun表示評論排行,dateandtime表示最新
best=cint(request("best")) '為1是最新推薦
hots=cint(request("hots"))'hots為1的時候為精彩推薦
'主題最多顯示字數,字母算一個漢字算兩個
if request("max")="" then
maxlen=30
else
maxlen=request("max")
end if
'顯示小分類型的,默認為經濟型的
if request("show")="big" then
show="big"
end if
'顯示的行數
if request("list")="" then
listNum=10
else
listNum=cint(request("list"))
end if
const hitColor="red" '點擊數的顏色
const new_color="red" '新文章日期的顏色
const old_color="gray" '舊文章日期的顏色
dim rs,sql,str,str1,topicLen,topic
Path="http://"&request.servervariables("server_name")&replace(request.servervariables("script_name"),"jjs.asp","")
set rs=server.createObject("Adodb.recordset")
sql="select top "&listNum&" * from download"
if jnclassid<>"" then
sql=sql&" where nclassid="&jnclassid&""
elseif jclassid<>"" then
sql=sql&" where classid="&jclassid&""
end if
if hots=1 then
sql=sql&" where hots=1"
end if
if kind<>"" then
sql=sql&" order by "&kind&" desc"
else
sql=sql&" order by dateandtime desc"
end if
rs.MaxRecords =listnum
rs.open sql,conn,3,3
if rs.bof and rs.eof then
str=str+"<li> 未找到!"
else
i=1
rs.movefirst
do while not rs.eof
topic=left(rs("showname"),maxLen)
set rs1=server.createObject("Adodb.recordset")
set rs2=server.createObject("Adodb.recordset")
sql1="select class from Aclass where classid="&rs("classid")
rs1.open sql1,conn,3,3
classname=rs1("class")
rs1.close
sql2="select Nclass from Anclass where Nclassid="&rs("Nclassid")
rs2.open sql2,conn,3,3
nclass=rs2("Nclass")
rs2.close
if show="big" then
str=str &" <img src='"&imgurl&"'> ["&nclass&"]<a href='"&Path&"view.asp?id="+Cstr(rs("id"))+"' target='_blank' showname='"&replace(replace(server.HTMLencode(rs("showname"))," "," "),"'"," ")&"') ><u>"+Topic+"</u></a> "
else
str=str &"<img border='0' src='http://www.7k7k.com/images2/j2.gif' width='12' height='11'><a href='"&Path&"view.asp?id="+Cstr(rs("id"))+"' target='_blank' showname='"&replace(replace(server.HTMLencode(rs("showname"))," "," "),"'"," ")&"') >"+Topic+"</a>" end if
str=str & "<font color="
if rs("dateandtime")>=date-1 then
str=str & new_color
else
str=str & old_color
end if
'是否顯示時間 1為顯示
if request("time")=1 then
str=str &">("& Month(rs("DateAndTime"))&"."&Day(rs("DateAndTime"))&")</font><br>"
else
str=str&"></font>"
end if
rs.moveNext
i=i+1
if i>listNum then exit do
loop
end if
rs.close : conn.close
set rs=nothing : set conn=nothing
response.write "document.write ("&Chr(34)&str&Chr(34)&");"
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -