- 爱易网页
-
ASP教程
- 灵活运用缓存类的例子
日期:2011-12-07 浏览次数:20934 次
<%
'--------------------------显示供应信息
'jz_cid=分类ID
'jz_type=信息类型
'jz_tree=目录层次
'jz_tr=显示多少行
'jz_td=显示多少列
'jz_txt=每列显示多少个字
'jz_target=打开链接方式
'jz_order=排序方式
'jz_date=是否显示时间
Private function jz_show_00_00(jz_cid,jz_type,jz_tree,jz_tr,jz_td,jz_txt,jz_target,jz_order,jz_date)
dim rows_A(1),rows_b(1),reval,i
dim jz_temp(1,1)
jz_temp(0,0)=jz_tr*jz_td'算出显示多少条记录
jz_tree=jz.tree_00(jz_tree)
jz_target=jz.target(jz_target)
'Response.Write(jz_target)
jz.sql(0)="SELECT jz_01,jz_15 from Jz_News_Class where jz_01="&jz_cid
call jz.conn_00(0,1)
call jz.c_r_s(0,true,true)
call jz.c_r_o(0,0,1)
rows_A(1)=jz.rs(0).GetRows
jz.rs(0).close
jz.sql(0)="SELECT distinct top "&jz_temp(0,0)&" jz_0,jz_2,jz_3,jz_18 from Jz_Trade_message where jz_3='"&jz_type&"' ORDER BY jz_0 desc"
call jz.c_r_o(0,0,1)
rows_b(1)=jz.rs(0).GetRows
call jz.c_r_e(0,true,true)
rows_b(0)=ubound(rows_b(1),2)
if rows_b(0)>0 then
'Response.Write(rows_b(0))
reval=reval&"<ul><div class=""interval_00""> </div>"
if rows_b(0)>=jz_temp(0,0) then
for i=0 to jz_temp(0,0)-1
reval=reval&jz_show_00_01(rows_A(1)(0,0),rows_A(1)(1,0),jz_tree,rows_b(1)(0,i),rows_b(1)(1,i),rows_b(1)(3,i),jz_txt,jz_target,jz_date)
next
else
for i=0 to rows_b(0)
reval=reval&jz_show_00_01(rows_A(1)(0,0),rows_A(1)(1,0),jz_tree,rows_b(1)(0,i),rows_b(1)(1,i),rows_b(1)(3,i),jz_txt,jz_target,jz_date)
next
jz_temp(1,0)=jz_temp(0,0)-1-rows_b(0)
for i=1 to jz_temp(1,0)
reval=reval&jz_show_00_02()
next
end if
reval=reval&"</ul>"
end if
jz_show_00_00=reval
end function
'-------------
'str_0=分类ID
'str_1=信息模板
'str_2=网站目录层次
'str_3=信息ID
'str_4=信息标题
'str_5=信息时间
'str_6=每列显示多少个字
'str_7=打开链接方式
'str_8=是否显示时间
Private function jz_show_00_01(str_0,str_1,str_2,str_3,str_4,str_5,str_6,str_7,str_8)
dim jz_title
jz_title=str_4
if len(str_4)>=str_6 then str_4=(strLeft(str_4,str_6*2-3)&"..")
jz_show_00_01="<li><a href="""&str_2&str_1&"?cid="&str_0&"&id="&str_3&""" title="""&jz_title&""" "&str_7&">"
jz_show_00_01=jz_show_00_01&str_4
jz_show_00_01=jz_show_00_01&"</a>"
if str_8 then jz_show_00_01=jz_show_00_01&"("&str_5&")"
jz_show_00_01=jz_show_00_01&"</li>"
end function
'------------------
Private function jz_show_00_02()
jz_show_00_02="<li><a href=""#姚海涛"" >暂无资料......</a></li>"
end function
'---------------------信息显示.....
'str_0=信息ID号
'str_1=路径层次
Private function jz_show_00_03(str_0,str_1)
dim rows_A(1),rows_b(1),reval,i
dim jz_temp(1,1)
jz.sql(0)="SELECT * from Jz_Trade_message where jz_0="&str_0
call jz.conn_00(0,tree)
call jz.c_r_s(0,true,true)
Application.Lock
jz.Conn(0).execute("update Jz_Trade_message set jz_20=jz_20+1 where jz_0="&str_0)
Application.Unlock
call jz.c_r_o(0,3,3)
Application.Lock
jz_temp(0,0)=jz.rs(0)("jz_20")
if jz_temp(0,0)="" or jz_temp(0,0)=empty or jz_temp(0,0)<100 then
jz.rs(0)("jz_20")=688
jz.rs(0).update
end if
Application.unLock
rows_A(1)=jz.rs(0).GetRows
jz.rs(0).close
jz.sql(0)="SELECT jz_00,jz_01 from Jz_trade_Class where jz_00="&rows_A(1)(1,0)
call jz.c_r_o(0,0,1)
rows_b(1)=jz.rs(0).GetRows
call jz.c_r_e(0,true,true)
jz.cache=rows_A(1)(2,0)
jz.replace_000("{$title}")