灵活运用缓存类的例子
发表于:2007-06-30来源:作者:点击数:
标签:
% ‘’--------------------------显示供应信息 ‘’jz_cid=分类ID ‘’jz_type=信息类型 ‘’jz_tree=目录层次 ‘’jz_tr=显示多少行 ‘’jz_ td =显示多少列 ‘’jz_txt=每列显示多少个字 ‘’jz_target=打开链接方式 ‘’jz_order=排序方式 ‘’jz_date=是
<%
‘’--------------------------显示供应信息
‘’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}")
jz.cache=rows_b(1)(1,0)
jz.replace_000("{$jz_1}")
jz.cache=rows_a(1)(2,0)
jz.replace_000("{$jz_2}")
jz.cache=jz_show_00_04(rows_A(1)(3,0))
jz.replace_000("{$jz_3}")
jz.cache=rows_A(1)(4,0)
jz.replace_000("{$jz_4}")
jz.cache=jz_show_00_05(rows_A(1)(5,0))
jz.replace_000("{$jz_5}")
jz.cache=rows_A(1)(6,0)
jz.replace_000("{$jz_6}")
jz.cache=rows_A(1)(7,0)
jz.replace_000("{$jz_7}")
jz.cache=rows_A(1)(8,0)
jz.replace_000("{$jz_8}")
jz.cache=rows_A(1)(9,0)
jz.replace_000("{$jz_9}")
jz.cache=rows_A(1)(10,0)
jz.replace_000("{$jz_10}")
jz.cache=rows_A(1)(11,0)
jz.replace_000("{$jz_11}")
jz.cache=rows_A(1)(12,0)
jz.replace_000("{$jz_12}")
jz.cache=rows_A(1)(13,0)
jz.replace_000("{$jz_13}")
jz.cache=rows_A(1)(14,0)
jz.replace_000("{$jz_14}")
jz.cache=rows_A(1)(15,0)
jz.replace_000("{$jz_15}")
jz.cache=rows_A(1)(16,0)
jz.replace_000("{$jz_16}")
jz.cache=rows_A(1)(17,0)
jz.replace_000("{$jz_17}")
jz.cache=rows_A(1)(19,0)
jz.replace_000("{$jz_20}")
end function
‘’------------------
‘’str_0=交易类别Id
Private function jz_show_00_04(str_0)
SELECT CASE str_0
CASE 1
jz_show_00_04="采购"
CASE 2
jz_show_00_04="供应"
CASE 3
jz_show_00_04="合作"
CASE 4
jz_show_00_04="代理"
CASE ELSE
jz_show_00_04="未知......"
END SELECT
end function
‘’------------------
‘’str_0=有效期Id
Private function jz_show_00_05(str_0)
SELECT CASE str_0
CASE 1
jz_show_00_05="一周"
CASE 2
jz_show_00_05="半月"
CASE 3
jz_show_00_05="一月"
CASE 4
jz_show_00_05="三月"
CASE 5
jz_show_00_05="半年"
CASE 6
jz_show_00_05="一月"
CASE 7
jz_show_00_05="长期"
END SELECT
end function
‘’-------------------------供应、采购
‘’str_0=子类id
‘’str_1=子类名称
‘’str_2=子类信息总数
‘’str_3=子类采购信息总数
‘’str_4=子类求购信息总数
‘’str_5=子类合作信息总数
‘’str_6=子类代理信息总数
‘’str_7=打开链接方式
‘’str_8=信息模板
‘’str_9=网站目录层次
‘’str_10=栏目ID
Private function jz_show_00_06(str_0,str_1,str_2,str_3,str_4,str_5,str_6,str_7,str_8,str_9,str_10)
jz_show_00_06="<li>"
jz_show_00_06=jz_show_00_06&"<a href="""&str_9&str_8&"?cid="&str_10&"&tid="&str_0&""" "&str_7&">"&str_1&"</a>"
jz_show_00_06=jz_show_00_06&"( 采购:"&str_3&" 求购:"&str_4&" 合作:"&str_5&" 代理:"&str_6&" )"
jz_show_00_06=jz_show_00_06&"</li>"
end function
‘’----------------------
‘’-------------------------供应、采购
‘’str_0=栏目id
‘’str_1=项目id
‘’str_2=显示类别
‘’str_3=打开链接方式
Private function jz_show_00_07(str_0,str_1,str_2,str_3)
dim rows_A(1),rows_b(1),reval,i
dim jz_temp(1,1),jz_tree
jz_tree=jz.tree_00(tree)
str_3=jz.target(str_3)
jz.sql(0)="SELECT [jz_01],[jz_14] from Jz_news_class where jz_01="&str_0
‘’Response.Write(jz.sql(0))
call jz.conn_00(0,2)
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 [jz_00],[jz_01],[jz_02],[jz_08],[jz_09],[jz_10],[jz_11],[jz_12] from Jz_Trade_Class where jz_02="&int(str_1)
‘’Response.Write(jz.sql(0))
call jz.c_r_o(0,0,1)
if not jz.rs(0).eof then
rows_b(1)=jz.rs(0).GetRows
call jz.c_r_e(0,true,true)
rows_b(0)=ubound(rows_b(1),2)
else
call jz.c_r_e(0,true,true)
rows_b(0)=0
end if
if rows_b(0)>=1 then
reval = reval & "<div id=""b"">" &
vbCrlf
reval = reval & " <div class=""list_ul_09""><ul>" & vbCrlf
for i=0 to rows_b(0)
reval=reval&jz_show_00_06(rows_b(1)(0,i),rows_b(1)(1,i),rows_b(1)(2,i),rows_b(1)(3,i),rows_b(1)(4,i),rows_b(1)(5,i),rows_b(1)(6,i),str_3,rows_a(1)(1,0),jz_tree,str_0)
next
reval = reval & " </ul><div class=""interval_00""></div>" & vbCrlf
reval = reval & " </div>" & vbCrlf
reval = reval & " <div class=""interval_03""> </div>" & vbCrlf
reval = reval & " </div>" & vbCrlf
end if
jz_show_00_07=reval
end function
%>
原文转自:http://www.ltesting.net