SysProduct3.asp
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 30k
Development Platform:

VBScript

  1. <%
  2. dim strFileName,MaxPerPage,ShowSmallClassType
  3. dim totalPut,CurrentPage,TotalPages
  4. dim BeginTime,EndTime
  5. dim founderr, errmsg
  6. dim BigClassName,SmallClassName,SpecialName,keyword,strField
  7. dim rs,sql,sqlArticle,rsArticle,sqlSearch,rsSearch,sqlBigClass,rsBigClass,sqlSpecial,rsSpecial
  8. dim SpecialTotal
  9. BeginTime=Timer
  10. BigClassName=Trim(request("BigClassName"))
  11. SmallClassName=Trim(request("SmallClassName"))
  12. SpecialName=trim(request("SpecialName"))
  13. keyword=trim(request("keyword"))
  14. if keyword<>"" then 
  15. keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
  16. end if
  17. strField=trim(request("Field"))
  18. if request("page")<>"" then
  19.     currentPage=cint(request("page"))
  20. else
  21. currentPage=1
  22. end if
  23. sqlBigClass="select * from PrBigClasss order by BigClassID"
  24. Set rsBigClass= Server.CreateObject("ADODB.Recordset")
  25. rsBigClass.open sqlBigClass,conn,1,1
  26. '=================================================
  27. '过程名:ShowSmallClass_Tree
  28. '作  用:树形目录方式显示栏目
  29. '参  数:无
  30. '=================================================
  31. Sub ShowSmallClass_Tree()
  32. %>
  33. <SCRIPT language=javascript>
  34. function opencat(cat,img){
  35. if(cat.style.display=="none"){
  36. cat.style.display="";
  37. img.src="../img/class2.gif";
  38. } else {
  39. cat.style.display="none"; 
  40. img.src="../img/class1.gif";
  41. }
  42. }
  43. </Script>
  44. <TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
  45. <%
  46. dim i
  47. if rsBigClass.eof and rsBigClass.bof then
  48. Response.Write "栏目正在建设中……"
  49. else
  50. i=1
  51. do while not rsBigClass.eof
  52. %>
  53. <TR>
  54. <TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=32 height=24 align=center><IMG id=img10<%=i%>000 src="../img/class1.gif" width=20 height=20></TD>
  55. <TD class='ML_Tdbg'><a href='Product.asp?BigClassName=<%=rsBigClass("BigClassName")%>'><%=rsBigClass("BigClassName")%></a></TD>
  56. </TR>
  57. <TR>
  58. <TD id=cat10<%=i%>000 style="DISPLAY: none" bgColor=#fefdf5 colspan="2">
  59. <%
  60. dim rss,sqls,j
  61. set rss = server.CreateObject ("adodb.recordset")
  62. sqls="select * from PrSmallClass where BigClassName='" & rsBigClass("BigClassName") & "'order by SmallClassID"
  63. rss.open sqls,conn,1,1
  64. if rss.eof and rss.bof then
  65. Response.Write "没有小分类"
  66. else
  67. j=1
  68. do while not rss.eof
  69. %>
  70. &nbsp;<IMG height=20 src="../img/class3.gif" width=26 align=absMiddle border=0><a href="Product.asp?BigClassName=<%=rss("BigClassName")%>&Smallclassname=<%=rss("SmallClassName")%>"><%=rss("SmallClassName")%></a><BR>
  71. <%
  72. rss.movenext
  73. j=j+1
  74. loop
  75. end if
  76. rss.close
  77. set rss=nothing
  78. %>
  79. </TD>
  80. </TR>
  81. <%
  82. rsBigClass.movenext
  83. i=i+1
  84. loop
  85. end if
  86. %>
  87. </TABLE>
  88. <%
  89. end Sub 
  90. '=================================================
  91. '过程名:ShowVote
  92. '作  用:显示网站调查
  93. '参  数:无
  94. '=================================================
  95. sub ShowVote()
  96. dim sqlVote,rsVote,i
  97. sqlVote="select top 1 * from Vote where IsSelected=True"
  98. Set rsVote= Server.CreateObject("ADODB.Recordset")
  99. rsVote.open sqlVote,conn,1,1
  100. if rsVote.bof and rsVote.eof then 
  101. response.Write "&nbsp;没有任何调查"
  102. else
  103. response.write "<form name='VoteForm'method='post'action='vote.asp'target='_blank'><td>"
  104. response.write "&nbsp;&nbsp;&nbsp;&nbsp;"& rsVote("Title") &"<br>"
  105. if rsVote("VoteType")="Single" then
  106. for i=1 to 8
  107. if trim(rsVote("Select"& i) &"")="" then exit for
  108. response.Write "<input type='radio'name='VoteOption'value='"& i &"'>" & rsVote("Select" & i) &"<br>"
  109. next
  110. else
  111. for i=1 to 8
  112. if trim(rsVote("Select"& i) &"")="" then exit for
  113. response.Write "<input type='checkbox'name='VoteOption'value='"& i &"'>"& rsVote("Select" & i) &"<br>"
  114. next
  115. end if
  116. response.write "<br><input name='VoteType'type='hidden'value='"& rsVote("VoteType") &"'>"
  117. response.write "<input name='Action'type='hidden'value='Vote'>"
  118. response.write "<input name='ID'type='hidden'value='"& rsVote("ID") &"'>"
  119. response.write "<div align='center'>"
  120. response.write "<a href='javascript:VoteForm.submit();'><img src='../images/voteSubmit.gif' width='52'height='18'border='0'></a>&nbsp;&nbsp;"
  121.         response.write "<a href='Vote.asp?Action=Show'target='_blank'><img src='../images/voteView.gif' width='52'height='18'border='0'></a>"
  122. response.write "</div></td></form>"
  123. end if
  124. rsVote.close
  125. set rsVote=nothing
  126. end sub
  127. '=================================================
  128. '过程名:ShowClassGuide
  129. '作  用:显示栏目导航位置
  130. '参  数:无
  131. '=================================================
  132. sub ShowClassGuide()
  133. response.write  "<a href='Product.asp'>产品展示</a>&nbsp;&gt;&gt;"
  134. if BigClassName="" and SmallClassName="" then
  135. response.write "&nbsp;所有产品"
  136. else
  137. if BigClassName<>"" then
  138. response.write "&nbsp;<a href='Product.asp?BigClassName="& BigClassName &"'>"& BigClassName &"</a>&nbsp;&gt;&gt;&nbsp;"
  139. if SmallClassName<>"" then
  140. response.write "<a href='Product.asp?BigClassName="& BigClassName &"&SmallClassName="& SmallClassName &"'>"& SmallClassName &"</a>"
  141. else
  142. response.write "所有小类"
  143. end if
  144. end if
  145. end if
  146. end sub
  147. '=================================================
  148. '过程名:ShowArticleTotal
  149. '作  用:显示文章总数
  150. '参  数:无
  151. '=================================================
  152. sub ShowArticleTotal()
  153. dim sqlTotal
  154. dim rsTotal
  155. sqlTotal="select Count(*) from Product where Passed=True "
  156. if BigClassName<>"" then
  157. sqlTotal=sqlTotal &" and BigClassName='"& BigClassName &"'"
  158. if SmallClassName<>"" then
  159. sqlTotal=sqlTotal &" and SmallClassName='"& SmallClassName &"'"
  160. end if
  161. else
  162. if SpecialName<>"" then
  163. sqlTotal=sqlTotal &" and SpecialName='"& SpecialName &"'"
  164. end if
  165. end if
  166. Set rsTotal= Server.CreateObject("ADODB.Recordset")
  167. rsTotal.open sqlTotal,conn,1,1
  168. if rsTotal.eof and rsTotal.bof then
  169. totalPut=0
  170. response.write "共有 0 个产品"
  171. else
  172. totalPut=rsTotal(0)
  173. response.Write "共有 "& totalPut &" 个产品"
  174. end if
  175. rsTotal.close
  176. set rsTotal=nothing
  177. end sub
  178. '=================================================
  179. '过程名:ShowArticle
  180. '=================================================
  181. sub ShowArticle(TitleLen)
  182. if TitleLen<0 or TitleLen>200 then
  183. TitleLen=50
  184. end if
  185.     if currentpage<1 then
  186.     currentpage=1
  187.     end if
  188. if (currentpage-1)*MaxPerPage>totalput then
  189. if (totalPut mod MaxPerPage)=0 then
  190.     currentpage= totalPut  MaxPerPage
  191. else
  192.     currentpage= totalPut  MaxPerPage + 1
  193. end if
  194.     end if
  195. if currentPage=1 then
  196.         sqlArticle="select top "& MaxPerPage
  197. else
  198. sqlArticle="select "
  199. end if
  200. sqlArticle=sqlArticle &" ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Spec,Size,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
  201. if BigClassName<>"" then
  202. sqlArticle=sqlArticle &" and BigClassName='" & BigClassName &"'"
  203. if SmallClassName<>"" then
  204. sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "'"
  205. end if
  206. else
  207. if SpecialName<>"" then
  208. sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "'"
  209. end if
  210. end if
  211. sqlArticle=sqlArticle & " order by ArticleID desc"
  212. Set rsArticle= Server.CreateObject("ADODB.Recordset")
  213. rsArticle.open sqlArticle,conn,1,1
  214. if rsArticle.bof and  rsArticle.eof then
  215. response.Write("<br><li>没有任何产品</li>")
  216. else
  217. if currentPage=1 then
  218. call ArticleContent(TitleLen)
  219. else
  220. if (currentPage-1)*MaxPerPage<totalPut then
  221.               rsArticle.move  (currentPage-1)*MaxPerPage
  222.           dim bookmark
  223.             bookmark=rsArticle.bookmark
  224.              call ArticleContent(TitleLen)
  225.          else
  226.          currentPage=1
  227.             call ArticleContent(TitleLen)
  228.      end if
  229. end if
  230. end if
  231. rsArticle.close
  232. set rsArticle=nothing
  233. end sub
  234. sub ArticleContent(intTitleLen)
  235.     dim i,lb
  236.     i=0
  237. do while not rsArticle.eof
  238. lb=""
  239. lb=lb & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
  240. lb=lb & "<tr>"
  241. lb=lb & "<td width=30% rowspan=6>"
  242. lb=lb & "<div align=center><a href='ProductShow.asp?ArticleID=" & rsArticle("articleid") & "'>" 
  243. lb=lb & "<img border=0 src='"& rsArticle("DefaultPicUrl") &"' width=120 height=120>" 
  244. lb=lb & "</a></div></td>"
  245. lb=lb & "<td width=12% height=12>产品名称:</td>"
  246. lb=lb & "<td><a href='ProductShow.asp?ArticleID="& rsArticle("articleid") &"'>"& rsArticle("Title") &"</a></td>"
  247. lb=lb & "</tr>"
  248. lb=lb & "<tr>"
  249. lb=lb & "<td width=12% height=12>产品规格:</td>"
  250. lb=lb & "<td>"& rsArticle("Spec") &"</td>"
  251. lb=lb & "</tr>"
  252. lb=lb & "<tr>"
  253. lb=lb & "<td width=12% height=12>尺  寸:</td>"
  254. lb=lb & "<td>"& rsArticle("Size") &"</td>"
  255. lb=lb & "</tr>"
  256. lb=lb & "<tr>"
  257. lb=lb & "<td height=12>产品类别:</td>"
  258. lb=lb & "<td><a href='Product.asp?BigClassName="& rsArticle("BigClassName") &"'>"& rsArticle("BigClassName") &"</a> → "
  259. lb=lb & "<a href='Product.asp?BigClassName="& rsArticle("BigClassName") &"&SmallClassName="& rsArticle("SmallClassName") &"'>"& rsArticle("SmallClassName") &""
  260. lb=lb & "</a></td>"
  261. lb=lb & "</tr>" 
  262. ' lb=lb & "<tr>"
  263. ' lb=lb & "<td height=18>产品编号:</td>"
  264. ' lb=lb & "<td>"& rsArticle("Product_Id") &"</td>"
  265. ' lb=lb & "</tr>"
  266. lb=lb & "<tr>"
  267. lb=lb & "<td height=12>产品信息:</td>"
  268. lb=lb & "<td><a href='ProductShow.asp?ArticleID="& rsArticle("articleid") &"'><img src='../Img/arrow_7.gif'border=0></a></td>"
  269. lb=lb & "</tr>"
  270. lb=lb & "<tr>"
  271. lb=lb & "<td colspan=2>"
  272. lb=lb & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
  273. lb=lb & "<tr>" 
  274. lb=lb & "<td width=50% height=12>"
  275. lb=lb & "<div align=center></div></td>"
  276. lb=lb & "<td width=50% height=12>"
  277. lb=lb & "<div align=center><a href='javascript:eshop("& rsArticle("Product_Id") &")'><img border=0 src='../img/addtocart.gif' width=95 height=17>"
  278. lb=lb & "</a></div></td>"
  279. lb=lb & "</tr>"
  280. lb=lb & "</table>"
  281. lb=lb & "</td>"
  282. lb=lb & "</tr>" 
  283. lb=lb & "<tr>" 
  284. lb=lb & "<td height=1 colspan=3 background='../img/kropki_poziom_naBialym.gif'><IMG height=1 src='../img/1x1_pix.gif' width=1></td>"
  285. lb=lb & "</tr>"
  286. lb=lb & "</table>"
  287. response.write lb
  288. rsArticle.movenext
  289. i=i+1
  290. if i>=MaxPerPage then exit do
  291. loop
  292. end sub 
  293. '=================================================
  294. '过程名:ShowSearchTerm
  295. '作  用:显示搜索条件信息
  296. '参  数:无
  297. '=================================================
  298. sub ShowSearchTerm()
  299. response.write "产品搜索&nbsp;&gt;&gt; "
  300. if BigClassName<>"" then
  301. response.write "<a href='Product.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  302. if SmallClassName<>"" then
  303. response.write "<a href='Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  304. else
  305. response.write "所有小类&nbsp;&gt;&gt;&nbsp;"
  306. end if
  307. end if
  308. if keyword<>"" then
  309.   select case strField
  310. case "Title"
  311. response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
  312. case "Content"
  313. response.Write "说明含有 <font color=red>"&keyword&"</font> 的产品"
  314. case else
  315. response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
  316.   end select
  317. else
  318.   response.write "&nbsp;所有产品"
  319. end if
  320. end sub
  321. '=================================================
  322. '过程名:SearchResultTotal
  323. '作  用:显示搜索结果总数
  324. '参  数:无
  325. '=================================================
  326. sub SearchResultTotal()
  327. dim rsTotal,sqlTotal
  328. sqlTotal="select count(*) from Product where Passed=True "
  329. if BigClassName<>"" then
  330. sqlTotal=sqlTotal & " and BigClassName='" & BigClassName & "'"
  331. if SmallClassName<>"" then
  332. sqlTotal=sqlTotal & " and SmallClassName='" & SmallClassName & "'"
  333. end if
  334. else
  335. if SpecialName<>"" then
  336. sqlTotal=sqlTotal & " and SpecialName='" & SpecialName & "'"
  337. end if
  338. end if
  339. if keyword<>"" then
  340. select case strField
  341. case "Title"
  342. sqlTotal=sqlTotal & " and Title like '%" & keyword & "%'"
  343. case "Content"
  344. sqlTotal=sqlTotal & " and Content like '%" & keyword & "%'"
  345. case else
  346. sqlTotal=sqlTotal & " and Title like '%" & keyword & "%'"
  347. end select
  348. end if
  349. Set rsTotal= Server.CreateObject("ADODB.Recordset")
  350. rsTotal.open sqlTotal,conn,1,1
  351. if rsTotal.eof and rsTotal.bof then
  352. totalPut=0
  353. response.write "共有 0 个产品"
  354. else
  355. totalPut=rsTotal(0)
  356. response.Write "共找到 " & totalPut & " 个产品"
  357. end if
  358. end sub
  359. '=================================================
  360. '过程名:ShowSearchResult
  361. '作  用:分页显示搜索结果
  362. '参  数:无
  363. '=================================================
  364. sub ShowSearchResult()
  365.     if currentpage<1 then
  366.     currentpage=1
  367.     end if
  368. if (currentpage-1)*MaxPerPage>totalput then
  369. if (totalPut mod MaxPerPage)=0 then
  370.     currentpage= totalPut  MaxPerPage
  371. else
  372.     currentpage= totalPut  MaxPerPage + 1
  373. end if
  374.     end if
  375. if currentPage=1 then
  376.         sqlSearch="select top " & MaxPerPage
  377. else
  378. sqlSearch="select "
  379. end if
  380. sqlSearch=sqlSearch & " * from Product where Passed=True "
  381. if BigClassName<>"" then
  382. sqlSearch=sqlSearch & " and BigClassName='" & BigClassName & "'"
  383. if SmallClassName<>"" then
  384. sqlSearch=sqlSearch & " and SmallClassName='" & SmallClassName & "'"
  385. end if
  386. else
  387. if SpecialName<>"" then
  388. sqlSearch=sqlSearch & " and SpecialName='" & SpecialName & "'"
  389. end if
  390. end if
  391. if keyword<>"" then
  392. select case strField
  393. case "Title"
  394. sqlSearch=sqlSearch & " and Title like '%" & keyword & "%'"
  395. case "Content"
  396. sqlSearch=sqlSearch & " and Content like '%" & keyword & "%'"
  397. case else
  398. sqlSearch=sqlSearch & " and Title like '%" & keyword & "%'"
  399. end select
  400. end if
  401. sqlSearch=sqlSearch & " order by articleid desc"
  402. Set rsSearch= Server.CreateObject("ADODB.Recordset")
  403. rsSearch.open sqlSearch,conn,1,1
  404.   if rsSearch.eof and rsSearch.bof then 
  405.         response.write "<p align='center'><br><br>没有或没有找到任何产品</p>" 
  406.     else 
  407.     if currentPage=1 then 
  408.         call SearchResultContent()
  409.     else 
  410.         if (currentPage-1)*MaxPerPage<totalPut then 
  411.         rsSearch.move  (currentPage-1)*MaxPerPage 
  412.         dim bookmark 
  413.         bookmark=rsSearch.bookmark 
  414.         call SearchResultContent()
  415.        else 
  416.          currentPage=1 
  417.         call SearchResultContent()
  418.        end if 
  419.     end if 
  420.     end if 
  421.     rsSearch.close 
  422.     set rsSearch=nothing   
  423. end sub
  424. sub SearchResultContent()
  425.     dim i,strTemp,content
  426. i=1
  427. do while not rsSearch.eof
  428. strTemp=""
  429. strTemp=strTemp & cstr(i) & ".<a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "'>"
  430. if strField="Title" then
  431. strTemp=strTemp & "<b>" & replace(rsSearch("title"),""&keyword&"","<font color=red>"&keyword&"</font>") & "</b></font></a>"
  432. else
  433. strTemp=strTemp & "<b>" & rsSearch("title") & "</b></a>"
  434. end if
  435. strTemp=strTemp & " [" & FormatDateTime(rsSearch("UpdateTime"),1) & "]"
  436. content=left(nohtml(rsSearch("content")),200)
  437. if strField="Content" then
  438. strTemp=strTemp & "<div style='padding:10px 20px'>" & replace(content,""&keyword&"","<font color=red>"&keyword&"</font>") & "……</div>"
  439. else
  440. strTemp=strTemp & "<div style='padding:10px 20px'>" & content & "……</div>"
  441. end if
  442. 'strTemp=strTemp & "</a>"
  443. response.write strTemp
  444. i=i+1
  445. if i>MaxPerPage then exit do
  446. rsSearch.movenext
  447. loop
  448. end sub 
  449. '=================================================
  450. '过程名:ShowSearch
  451. '作  用:显示文章搜索表单
  452. '参  数:ShowType ----显示方式。1为纵向,2为横向
  453. '=================================================
  454. sub ShowSearch(ShowType)
  455. dim count
  456. if ShowType<>1 and ShowType<>2 then
  457. ShowType=1
  458. end if
  459. set rs=server.createobject("adodb.recordset")
  460. sql = "select * from PrSmallClass order by SmallClassID asc"
  461. rs.open sql,conn,1,1
  462. %>
  463. <script language = "JavaScript">
  464. var onecount;
  465. subcat = new Array();
  466.         <%
  467.         count = 0
  468.         do while not rs.eof 
  469.         %>
  470. subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
  471.         <%
  472.         count = count + 1
  473.         rs.movenext
  474.         loop
  475.         rs.close
  476.         %>
  477. onecount=<%=count%>;
  478. function changelocation(locationid)
  479.     {
  480.     document.myform.SmallClassName.length = 1; 
  481.     var locationid=locationid;
  482.     var i;
  483.     for (i=0;i < onecount; i++)
  484.         {
  485.             if (subcat[i][1] == locationid)
  486.             { 
  487.                 document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
  488.             }        
  489.         }
  490.     }    
  491. </script>
  492. <table border="0" cellpadding="2" cellspacing="0" align="center">
  493.   <form method="Get" name="myform" action="Search.asp">
  494.     <tr>
  495.       <td height="28"> <select name="Field" size="1">
  496.         <option value="Title" selected>产品名称</option>
  497.         <option value="Content">产品说明</option>
  498.        </select>
  499.        <%if ShowType=1 then%>
  500.      </td>
  501.    </tr>
  502.    <tr>
  503.      <td height="28">
  504. <%end if%>
  505. <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
  506. <option selected value="">所有大类</option>
  507. <%
  508. if not (rsBigClass.bof and rsBigClass.eof) then
  509. rsBigClass.movefirst
  510. do while not rsBigClass.eof
  511.         response.Write "<option value='" & trim(rsBigClass("BigClassName")) & "'>" & trim(rsBigClass("BigClassName")) & "</option>"
  512.     rsBigClass.movenext
  513. loop
  514. end if
  515. %>
  516.       </select>
  517.       <%if ShowType=1 then%>
  518.     </td>
  519.   </tr>
  520.   <tr>
  521.     <td height="28">
  522.       <%end if%>
  523.       <select name="SmallClassName">                  
  524.         <option selected value="">所有小类</option>
  525.       </select>
  526.       <%if ShowType=1 then%>
  527.     </td>
  528.   </tr>
  529.   <tr>
  530.     <td height="28">
  531.       <%end if%>
  532.       <input type="text" name="keyword"  size=15 value="关键字" maxlength="50" onFocus="this.select();">
  533.       <input type="submit" name="Submit"  value="搜索"> </td>
  534.   </tr>
  535. </form>
  536. </table>
  537. <%
  538. end sub
  539. '=================================================
  540. '过程名:ShowAllClass
  541. '作  用:显示所有栏目(栏目导航)
  542. '参  数:无
  543. '=================================================
  544. sub ShowAllClass()
  545. if rsBigClass.bof and rsBigClass.eof then 
  546. response.Write "&nbsp;没有任何栏目"
  547. else
  548. dim sqlClass,rsClass,strClassName
  549. rsBigClass.movefirst
  550. do while not rsBigClass.eof
  551. strClassName= "【<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") & "'><b>" & rsBigClass("BigClassName") & "</b></a>】<br><br>"
  552. sqlClass="select * from PrSmallClass where BigClassName='" & rsBigClass("BigClassName") & "'Order by SmallClassID"
  553. Set rsClass= Server.CreateObject("ADODB.Recordset")
  554. rsClass.open sqlClass,conn,1,1
  555. do while not rsClass.eof
  556. strClassName=strClassName & "&nbsp;<a href='Product.asp?BigClassName=" & rsClass("BigClassName") & "&SmallClassName=" & rsClass("SmallClassName") & "'>" & rsClass("SmallClassName") & "</a>&nbsp;"
  557. rsClass.movenext
  558. loop
  559. response.write strClassName & "<br><br>"
  560. rsBigClass.movenext
  561. loop
  562. rsClass.close
  563. set rsClass=nothing
  564. end if
  565. end sub
  566. '=================================================
  567. '过程名:ShowArticleContent
  568. '作  用:显示文章具体的内容,可以分页显示
  569. '参  数:无
  570. '=================================================
  571. sub ShowArticleContent()
  572. dim ArticleID,strContent,CurrentPage
  573. dim ContentLen,MaxPerPage,pages,i,lngBound
  574. dim BeginPoint,EndPoint
  575. ArticleID=rs("ArticleID")
  576. strContent=rs("Content")
  577. ContentLen=len(strContent)
  578. CurrentPage=trim(request("ArticlePage"))
  579. if ShowContentByPage="No" or ContentLen<=200000 then
  580. response.write strContent
  581. if ShowContentByPage="Yes" then
  582. response.write "</p><p align='center'></p>"
  583. end if
  584. else
  585. if CurrentPage="" then
  586. CurrentPage=1
  587. else
  588. CurrentPage=Cint(CurrentPage)
  589. end if
  590. pages=ContentLenMaxPerPage_Content
  591. if MaxPerPage_Content*pages<ContentLen then
  592. pages=pages+1
  593. end if
  594. lngBound=MaxPerPage_Content          '最大误差范围
  595. if CurrentPage<1 then CurrentPage=1
  596. if CurrentPage>pages then CurrentPage=pages
  597. dim lngTemp
  598. dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3
  599. dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2
  600. dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2
  601. dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2
  602. dim lngTemp5,lngTemp5_1,lngTemp5_2
  603. dim lngTemp6,lngTemp6_1,lngTemp6_2
  604. if CurrentPage=1 then
  605. BeginPoint=1
  606. else
  607. BeginPoint=MaxPerPage_Content*(CurrentPage-1)+1
  608. lngTemp1_1_1=instr(BeginPoint,strContent,"</table>",1)
  609. lngTemp1_1_2=instr(BeginPoint,strContent,"</TABLE>",1)
  610. lngTemp1_1_3=instr(BeginPoint,strContent,"</Table>",1)
  611. if lngTemp1_1_1>0 then
  612. lngTemp1_1=lngTemp1_1_1
  613. elseif lngTemp1_1_2>0 then
  614. lngTemp1_1=lngTemp1_1_2
  615. elseif lngTemp1_1_3>0 then
  616. lngTemp1_1=lngTemp1_1_3
  617. else
  618. lngTemp1_1=0
  619. end if
  620. lngTemp1_2_1=instr(BeginPoint,strContent,"<table",1)
  621. lngTemp1_2_2=instr(BeginPoint,strContent,"<TABLE",1)
  622. lngTemp1_2_3=instr(BeginPoint,strContent,"<Table",1)
  623. if lngTemp1_2_1>0 then
  624. lngTemp1_2=lngTemp1_2_1
  625. elseif lngTemp1_2_2>0 then
  626. lngTemp1_2=lngTemp1_2_2
  627. elseif lngTemp1_2_3>0 then
  628. lngTemp1_2=lngTemp1_2_3
  629. else
  630. lngTemp1_2=0
  631. end if
  632. if lngTemp1_1=0 and lngTemp1_2=0 then
  633. lngTemp1=BeginPoint
  634. else
  635. if lngTemp1_1>lngTemp1_2 then
  636. lngtemp1=lngTemp1_2
  637. else
  638. lngTemp1=lngTemp1_1+8
  639. end if
  640. end if
  641. lngTemp2_1_1=instr(BeginPoint,strContent,"</p>",1)
  642. lngTemp2_1_2=instr(BeginPoint,strContent,"</P>",1)
  643. if lngTemp2_1_1>0 then
  644. lngTemp2_1=lngTemp2_1_1
  645. elseif lngTemp2_1_2>0 then
  646. lngTemp2_1=lngTemp2_1_2
  647. else
  648. lngTemp2_1=0
  649. end if
  650. lngTemp2_2_1=instr(BeginPoint,strContent,"<p",1)
  651. lngTemp2_2_2=instr(BeginPoint,strContent,"<P",1)
  652. if lngTemp2_2_1>0 then
  653. lngTemp2_2=lngTemp2_2_1
  654. elseif lngTemp2_2_2>0 then
  655. lngTemp2_2=lngTemp2_2_2
  656. else
  657. lngTemp2_2=0
  658. end if
  659. if lngTemp2_1=0 and lngTemp2_2=0 then
  660. lntTemp2=BeginPoint
  661. else
  662. if lngTemp2_1>lngTemp2_2 then
  663. lngtemp2=lngTemp2_2
  664. else
  665. lngTemp2=lngTemp2_1+4
  666. end if
  667. end if
  668. lngTemp3_1_1=instr(BeginPoint,strContent,"</ur>",1)
  669. lngTemp3_1_2=instr(BeginPoint,strContent,"</UR>",1)
  670. if lngTemp3_1_1>0 then
  671. lngTemp3_1=lngTemp3_1_1
  672. elseif lngTemp3_1_2>0 then
  673. lngTemp3_1=lngTemp3_1_2
  674. else
  675. lngTemp3_1=0
  676. end if
  677. lngTemp3_2_1=instr(BeginPoint,strContent,"<ur",1)
  678. lngTemp3_2_2=instr(BeginPoint,strContent,"<UR",1)
  679. if lngTemp3_2_1>0 then
  680. lngTemp3_2=lngTemp3_2_1
  681. elseif lngTemp3_2_2>0 then
  682. lngTemp3_2=lngTemp3_2_2
  683. else
  684. lngTemp3_2=0
  685. end if
  686. if lngTemp3_1=0 and lngTemp3_2=0 then
  687. lngTemp3=BeginPoint
  688. else
  689. if lngTemp3_1>lngTemp3_2 then
  690. lngtemp3=lngTemp3_2
  691. else
  692. lngTemp3=lngTemp3_1+5
  693. end if
  694. end if
  695. if lngTemp1<lngTemp2 then
  696. lngTemp=lngTemp2
  697. else
  698. lngTemp=lngTemp1
  699. end if
  700. if lngTemp<lngTemp3 then
  701. lngTemp=lngTemp3
  702. end if
  703. if lngTemp>BeginPoint and lngTemp<=BeginPoint+lngBound then
  704. BeginPoint=lngTemp
  705. else
  706. lngTemp4_1_1=instr(BeginPoint,strContent,"</li>",1)
  707. lngTemp4_1_2=instr(BeginPoint,strContent,"</LI>",1)
  708. if lngTemp4_1_1>0 then
  709. lngTemp4_1=lngTemp4_1_1
  710. elseif lngTemp4_1_2>0 then
  711. lngTemp4_1=lngTemp4_1_2
  712. else
  713. lngTemp4_1=0
  714. end if
  715. lngTemp4_2_1=instr(BeginPoint,strContent,"<li",1)
  716. lngTemp4_2_1=instr(BeginPoint,strContent,"<LI",1)
  717. if lngTemp4_2_1>0 then
  718. lngTemp4_2=lngTemp4_2_1
  719. elseif lngTemp4_2_2>0 then
  720. lngTemp4_2=lngTemp4_2_2
  721. else
  722. lngTemp4_2=0
  723. end if
  724. if lngTemp4_1=0 and lngTemp4_2=0 then
  725. lngTemp4=BeginPoint
  726. else
  727. if lngTemp4_1>lngTemp4_2 then
  728. lngtemp4=lngTemp4_2
  729. else
  730. lngTemp4=lngTemp4_1+5
  731. end if
  732. end if
  733. if lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound then
  734. BeginPoint=lngTemp4
  735. else
  736. lngTemp5_1=instr(BeginPoint,strContent,"<img",1)
  737. lngTemp5_2=instr(BeginPoint,strContent,"<IMG",1)
  738. if lngTemp5_1>0 then
  739. lngTemp5=lngTemp5_1
  740. elseif lngTemp5_2>0 then
  741. lngTemp5=lngTemp5_2
  742. else
  743. lngTemp5=BeginPoint
  744. end if
  745. if lngTemp5>BeginPoint and lngTemp5<BeginPoint+lngBound then
  746. BeginPoint=lngTemp5
  747. else
  748. lngTemp6_1=instr(BeginPoint,strContent,"<br>",1)
  749. lngTemp6_2=instr(BeginPoint,strContent,"<BR>",1)
  750. if lngTemp6_1>0 then
  751. lngTemp6=lngTemp6_1
  752. elseif lngTemp6_2>0 then
  753. lngTemp6=lngTemp6_2
  754. else
  755. lngTemp6=0
  756. end if
  757. if lngTemp6>BeginPoint and lngTemp6<BeginPoint+lngBound then
  758. BeginPoint=lngTemp6+4
  759. end if
  760. end if
  761. end if
  762. end if
  763. end if
  764. if CurrentPage=pages then
  765. EndPoint=ContentLen
  766. else
  767.   EndPoint=MaxPerPage_Content*CurrentPage
  768.   if EndPoint>=ContentLen then
  769. EndPoint=ContentLen
  770.   else
  771. lngTemp1_1_1=instr(EndPoint,strContent,"</table>",1)
  772. lngTemp1_1_2=instr(EndPoint,strContent,"</TABLE>",1)
  773. lngTemp1_1_3=instr(EndPoint,strContent,"</Table>",1)
  774. if lngTemp1_1_1>0 then
  775. lngTemp1_1=lngTemp1_1_1
  776. elseif lngTemp1_1_2>0 then
  777. lngTemp1_1=lngTemp1_1_2
  778. elseif lngTemp1_1_3>0 then
  779. lngTemp1_1=lngTemp1_1_3
  780. else
  781. lngTemp1_1=0
  782. end if
  783. lngTemp1_2_1=instr(EndPoint,strContent,"<table",1)
  784. lngTemp1_2_2=instr(EndPoint,strContent,"<TABLE",1)
  785. lngTemp1_2_3=instr(EndPoint,strContent,"<Table",1)
  786. if lngTemp1_2_1>0 then
  787. lngTemp1_2=lngTemp1_2_1
  788. elseif lngTemp1_2_2>0 then
  789. lngTemp1_2=lngTemp1_2_2
  790. elseif lngTemp1_2_3>0 then
  791. lngTemp1_2=lngTemp1_2_3
  792. else
  793. lngTemp1_2=0
  794. end if
  795. if lngTemp1_1=0 and lngTemp1_2=0 then
  796. lngTemp1=EndPoint
  797. else
  798. if lngTemp1_1>lngTemp1_2 then
  799. lngtemp1=lngTemp1_2-1
  800. else
  801. lngTemp1=lngTemp1_1+7
  802. end if
  803. end if
  804. lngTemp2_1_1=instr(EndPoint,strContent,"</p>",1)
  805. lngTemp2_1_2=instr(EndPoint,strContent,"</P>",1)
  806. if lngTemp2_1_1>0 then
  807. lngTemp2_1=lngTemp2_1_1
  808. elseif lngTemp2_1_2>0 then
  809. lngTemp2_1=lngTemp2_1_2
  810. else
  811. lngTemp2_1=0
  812. end if
  813. lngTemp2_2_1=instr(EndPoint,strContent,"<p",1)
  814. lngTemp2_2_2=instr(EndPoint,strContent,"<P",1)
  815. if lngTemp2_2_1>0 then
  816. lngTemp2_2=lngTemp2_2_1
  817. elseif lngTemp2_2_2>0 then
  818. lngTemp2_2=lngTemp2_2_2
  819. else
  820. lngTemp2_2=0
  821. end if
  822. if lngTemp2_1=0 and lngTemp2_2=0 then
  823. lngTemp2=EndPoint
  824. else
  825. if lngTemp2_1>lngTemp2_2 then
  826. lngTemp2=lngTemp2_2-1
  827. else
  828. lngTemp2=lngTemp2_1+3
  829. end if
  830. end if
  831. lngTemp3_1_1=instr(EndPoint,strContent,"</ur>",1)
  832. lngTemp3_1_2=instr(EndPoint,strContent,"</UR>",1)
  833. if lngTemp3_1_1>0 then
  834. lngTemp3_1=lngTemp3_1_1
  835. elseif lngTemp3_1_2>0 then
  836. lngTemp3_1=lngTemp3_1_2
  837. else
  838. lngTemp3_1=0
  839. end if
  840. lngTemp3_2_1=instr(EndPoint,strContent,"<ur",1)
  841. lngTemp3_2_2=instr(EndPoint,strContent,"<UR",1)
  842. if lngTemp3_2_1>0 then
  843. lngTemp3_2=lngTemp3_2_1
  844. elseif lngTemp3_2_2>0 then
  845. lngTemp3_2=lngTemp3_2_2
  846. else
  847. lngTemp3_2=0
  848. end if
  849. if lngTemp3_1=0 and lngTemp3_2=0 then
  850. lngTemp3=EndPoint
  851. else
  852. if lngTemp3_1>lngTemp3_2 then
  853. lngtemp3=lngTemp3_2-1
  854. else
  855. lngTemp3=lngTemp3_1+4
  856. end if
  857. end if
  858. if lngTemp1<lngTemp2 then
  859. lngTemp=lngTemp2
  860. else
  861. lngTemp=lngTemp1
  862. end if
  863. if lngTemp<lngTemp3 then
  864. lngTemp=lngTemp3
  865. end if
  866. if lngTemp>EndPoint and lngTemp<=EndPoint+lngBound then
  867. EndPoint=lngTemp
  868. else
  869. lngTemp4_1_1=instr(EndPoint,strContent,"</li>",1)
  870. lngTemp4_1_2=instr(EndPoint,strContent,"</LI>",1)
  871. if lngTemp4_1_1>0 then
  872. lngTemp4_1=lngTemp4_1_1
  873. elseif lngTemp4_1_2>0 then
  874. lngTemp4_1=lngTemp4_1_2
  875. else
  876. lngTemp4_1=0
  877. end if
  878. lngTemp4_2_1=instr(EndPoint,strContent,"<li",1)
  879. lngTemp4_2_1=instr(EndPoint,strContent,"<LI",1)
  880. if lngTemp4_2_1>0 then
  881. lngTemp4_2=lngTemp4_2_1
  882. elseif lngTemp4_2_2>0 then
  883. lngTemp4_2=lngTemp4_2_2
  884. else
  885. lngTemp4_2=0
  886. end if
  887. if lngTemp4_1=0 and lngTemp4_2=0 then
  888. lngTemp4=EndPoint
  889. else
  890. if lngTemp4_1>lngTemp4_2 then
  891. lngtemp4=lngTemp4_2-1
  892. else
  893. lngTemp4=lngTemp4_1+4
  894. end if
  895. end if
  896. if lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound then
  897. EndPoint=lngTemp4
  898. else
  899. lngTemp5_1=instr(EndPoint,strContent,"<img",1)
  900. lngTemp5_2=instr(EndPoint,strContent,"<IMG",1)
  901. if lngTemp5_1>0 then
  902. lngTemp5=lngTemp5_1-1
  903. elseif lngTemp5_2>0 then
  904. lngTemp5=lngTemp5_2-1
  905. else
  906. lngTemp5=EndPoint
  907. end if
  908. if lngTemp5>EndPoint and lngTemp5<EndPoint+lngBound then
  909. EndPoint=lngTemp5
  910. else
  911. lngTemp6_1=instr(EndPoint,strContent,"<br>",1)
  912. lngTemp6_2=instr(EndPoint,strContent,"<BR>",1)
  913. if lngTemp6_1>0 then
  914. lngTemp6=lngTemp6_1+3
  915. elseif lngTemp6_2>0 then
  916. lngTemp6=lngTemp6_2+3
  917. else
  918. lngTemp6=EndPoint
  919. end if
  920. if lngTemp6>EndPoint and lngTemp6<EndPoint+lngBound then
  921. EndPoint=lngTemp6
  922. end if
  923. end if
  924. end if
  925. end if
  926.   end if
  927. end if
  928. response.write mid(strContent,BeginPoint,EndPoint-BeginPoint)
  929. response.write "</p><p align='center'><b>"
  930. if CurrentPage>1 then
  931. response.write "<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage-1 & "'>上一页</a>&nbsp;&nbsp;"
  932. end if
  933. for i=1 to pages
  934. if i=CurrentPage then
  935. response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
  936. else
  937. response.write "<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & i & "'>[" & i & "]</a>&nbsp;"
  938. end if
  939. next
  940. if CurrentPage<pages then
  941. response.write "&nbsp;<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage+1 & "'>下一页</a>"
  942. end if
  943. response.write "</b></p>"
  944. end if
  945. end sub
  946. %>