Other_Public.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:15k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <%
  2. Class cls_Other
  3. '定义参数
  4. Private m_Rs,m_FSO,m_Dict
  5. Private m_PathDir,m_Path_UserDir,m_Path_User,m_Path_adminDir,m_Path_UserPageDir,m_Path_Templet
  6. Private m_Err_Info,m_Err_NO
  7. Private Sub Class_initialize()
  8. Set m_Rs = Server.CreateObject(G_FS_RS)
  9. Set m_FSO = Server.CreateObject(G_FS_FSO)
  10. Set m_Dict = Server.CreateObject(G_FS_DICT)
  11. m_PathDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/","//","/")
  12. m_Path_UserDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_USER_DIR&"/","//","/")
  13. m_Path_UserPageDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_USERFILES_DIR&"/","//","/")
  14. m_Path_Templet  = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_TEMPLETS_DIR&"/","//","/")
  15. End Sub 
  16. Private Sub Class_Terminate() 
  17. Set m_Rs = Nothing
  18. Set m_FSO = Nothing
  19. Set m_Dict = Nothing
  20. End Sub
  21. '获得参数
  22. Public Function get_LableChar(f_Lablechar,f_Id)
  23. Dim f_array
  24. f_array= split(f_Lablechar,"┆")
  25. if ubound(f_array)=0 and not isarray(f_array) then
  26. get_LableChar=""
  27. exit Function
  28. else
  29. select case LCase(f_array(0))
  30. case "sstype"
  31. if ubound(f_array)<>2   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=SSTYPE(f_Lablechar,"sstype"):end if
  32. case "picfl"
  33. if ubound(f_array)<>11   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=PicFL(f_Lablechar,"picfl"):end if
  34. case "wordfl"
  35. if ubound(f_array)<>11   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=WordFL(f_Lablechar,"wordfl"):end if
  36. case "bookcode"
  37. if ubound(f_array)<>15   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=BookCode(f_Lablechar,"bookcode"):end if
  38. case "vslist"
  39. if ubound(f_array)<>3   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=VSLIST(f_Lablechar,"vslist"):end if
  40. case "adlist"
  41. if ubound(f_array)<>2   then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=AdLIST(f_Lablechar,"adlist"):end if
  42. end select
  43. end if
  44. End Function
  45. '统计调用
  46. Public Function SSTYPE(f_Lablechar,f_type)
  47. 'SSTYPE┆方式$0┆路径$0
  48. dim CodeStyle,PathStyle,Url_Path,code_end
  49. CodeStyle = split(split(f_Lablechar,"┆")(1),"$")(1)
  50. PathStyle = split(split(f_Lablechar,"┆")(2),"$")(1)
  51. If PathStyle = "0" then
  52. Url_Path = Replace("/"&G_VIRTUAL_ROOT_DIR&"/","//","/")
  53. else
  54. Url_Path = "http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain") &"/"
  55. end if
  56. if CodeStyle="0" then
  57. code_end = "1"
  58. elseif CodeStyle="1" then
  59. code_end = "0"
  60. else
  61. code_end = "2"
  62. end if
  63. SSTYPE = "<script language=""JavaScript"" src="""& Url_Path&"stat?code="&CodeStyle&""" type=""text/JavaScript""></script>"
  64. End Function
  65. '调用图片友情连接
  66. Public Function PicFL(f_Lablechar,f_type)
  67. 'PicFL┆调用数量$12┆站点名称$0┆每列数量$6┆图片尺寸$88,31┆输出方式$out_Table┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$
  68. dim table_array,div_tf,div_chars,div_class,i_link
  69. dim CodeNumber,siteName,colsNumber,pizsize,rs
  70. table_array=split(f_Lablechar,"┆")
  71. CodeNumber = split(split(f_Lablechar,"┆")(1),"$")(1)
  72. siteName = split(split(f_Lablechar,"┆")(2),"$")(1)
  73. colsNumber = split(split(f_Lablechar,"┆")(3),"$")(1)
  74. pizsize = split(split(f_Lablechar,"┆")(4),"$")(1)
  75. if instr(f_Lablechar,"out_DIV")>0 then
  76. div_tf=1
  77. else
  78. div_tf=0
  79. end If
  80. If CodeNumber="" Then CodeNumber=0
  81. set rs = Conn.execute("select top "&CodeNumber&" F_Name,F_PicUrl,F_Url From FS_FL_FrendList where F_Lock=0 and F_Type=0 order by F_OrderID desc")
  82. PicFL = ""
  83. if rs.eof then
  84. PicFL = ""
  85. rs.close:set rs=nothing
  86. else
  87. i_link = 0 
  88. do while not rs.eof
  89. if div_tf=1 then
  90. PicFL = PicFL &"<a href="""& rs("F_Url")&"""><img src="""&rs("F_PicUrl")&""" alt="""& rs("F_Name")&""" border=""0"" width="""&split(pizsize,",")(0)&""" height="""&split(pizsize,",")(1)&""" /></a>"
  91. else
  92. PicFL = PicFL & "  <td width="""&cint(100/colsNumber)&"%"" align=""center""><a href="""& rs("F_Url")&"""><img  border=""0"" src="""&rs("F_PicUrl")&""" alt="""& rs("F_Name")&"""  width="""&split(pizsize,",")(0)&""" height="""&split(pizsize,",")(1)&""" /></a></td>"&chr(10)
  93. end if
  94. rs.movenext
  95. i_link = i_link + 1
  96. if i_link mod colsNumber = 0 then 
  97. PicFL = PicFL & "</tr><tr>"
  98. end if
  99. loop
  100. rs.close:set rs=nothing
  101. end if
  102. if div_tf = 1 then
  103. if split(split(f_Lablechar,"┆")(6),"$")(1)<>"" then
  104. div_chars = " id="&split(split(f_Lablechar,"┆")(6),"$")(1)&""
  105. else
  106. div_chars = ""
  107. end if
  108. if split(split(f_Lablechar,"┆")(7),"$")(1)<>"" then
  109. div_class = " class="&split(split(f_Lablechar,"┆")(7),"$")(1)&""
  110. else
  111. div_class = ""
  112. end if
  113. PicFL = "<div"&div_chars&div_class&">"&PicFL&"</div>"
  114. else
  115. PicFL = "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"">"&chr(10)&" <tr>"&chr(10)&" "&PicFL&chr(10)&" </tr>"&chr(10)&"</table>"
  116. end if
  117. PicFL = PicFL
  118. End Function
  119. '文字友情连接
  120. Public Function WordFL(f_Lablechar,f_type)
  121. 'WordFL┆调用数量$12┆每列数量$1┆标题CSS$20┆站点显示字数$20┆输出方式$out_Table┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$
  122. dim table_array,div_tf,div_chars,div_class,i_link
  123. dim CodeNumber,TitleCSS,colsNumber,pizsize,rs,lefttitle
  124. table_array=split(f_Lablechar,"┆")
  125. CodeNumber = split(split(f_Lablechar,"┆")(1),"$")(1)
  126. colsNumber = split(split(f_Lablechar,"┆")(2),"$")(1)
  127. lefttitle = split(split(f_Lablechar,"┆")(4),"$")(1)
  128. If IsNull(lefttitle) Then lefttitle=""
  129. if instr(f_Lablechar,"out_DIV")>0 then
  130. div_tf=1
  131. else
  132. div_tf=0
  133. TitleCSS = split(split(f_Lablechar,"┆")(3),"$")(1)
  134. If TitleCSS="" then
  135. TitleCSS = ""
  136. else
  137. TitleCSS = " class="""&TitleCSS&""""
  138. end if
  139. end If
  140. If CodeNumber="" Then CodeNumber=0
  141. set rs = Conn.execute("select top "&CodeNumber&" F_Name,F_Url From FS_FL_FrendList where F_Lock=0 and F_Type=1 order by F_OrderID desc")
  142. WordFL = ""
  143. if rs.eof then
  144. WordFL = ""
  145. rs.close:set rs=nothing
  146. else
  147. i_link = 0 
  148. do while not rs.eof
  149. if div_tf=1 Then
  150. If IsNumeric(lefttitle) then
  151. WordFL = WordFL &"<a href="""& rs("F_Url")&""">"&Left(rs("F_Name"),lefttitle)&"</a>"
  152. Else
  153. WordFL = WordFL &"<a href="""& rs("F_Url")&""">"&rs("F_Name")&"</a>"
  154. End if
  155. Else
  156. If IsNumeric(lefttitle) then
  157. WordFL = WordFL & "  <td width="""&cint(100/colsNumber)&"%"" align=""center""><a href="""& rs("F_Url")&""""&TitleCSS&">"& Left(rs("F_Name"),lefttitle) &"</a></td>"&chr(10)
  158. Else
  159. WordFL = WordFL & "  <td width="""&cint(100/colsNumber)&"%"" align=""center""><a href="""& rs("F_Url")&""""&TitleCSS&">"& rs("F_Name") &"</a></td>"&chr(10)
  160. End if
  161. end if
  162. rs.movenext
  163. i_link = i_link + 1
  164. if i_link mod colsNumber = 0 then 
  165. WordFL = WordFL & "</tr><tr>"
  166. end if
  167. loop
  168. rs.close:set rs=nothing
  169. end if
  170. if div_tf = 1 then
  171. if split(split(f_Lablechar,"┆")(6),"$")(1)<>"" then
  172. div_chars = " id="""&split(split(f_Lablechar,"┆")(6),"$")(1)&""""
  173. else
  174. div_chars = ""
  175. end if
  176. if split(split(f_Lablechar,"┆")(7),"$")(1)<>"" then
  177. div_class = " class="""&split(split(f_Lablechar,"┆")(7),"$")(1)&""""
  178. else
  179. div_class = ""
  180. end if
  181. WordFL = "<div"&div_chars&div_class&">"&WordFL&"</div>"
  182. else
  183. WordFL = "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"">"&chr(10)&" <tr>"&chr(10)&" "&WordFL&chr(10)&" </tr>"&chr(10)&"</table>"
  184. end if
  185. WordFL = WordFL
  186. End Function 
  187. '留言调用
  188. Public Function BookCode(f_Lablechar,f_type)
  189. 'BookCode┆类型$0┆栏目$┆数量$10┆列数$1┆字数$30┆标题CSS$┆日期CSS$┆日期格式$YY02-MM-DD┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$┆输入格式$out_Table
  190. dim table_array,BookPop,ClassID,TitleNumber,ColsNumber,leftTitle,div_tf,TitleCSS,DateCSS,datestyle
  191. dim classNews_head,classNews_middle1,classNews_bottom,classNews_middle2,user_str,tmp_hit
  192. dim rs,inSql_CMD,orderby,rec_tf
  193. table_array=split(f_Lablechar,"┆")
  194. BookPop = split(split(f_Lablechar,"┆")(1),"$")(1)
  195. ClassID = split(split(f_Lablechar,"┆")(2),"$")(1)
  196. TitleNumber = split(split(f_Lablechar,"┆")(3),"$")(1)
  197. ColsNumber = split(split(f_Lablechar,"┆")(4),"$")(1)
  198. leftTitle = split(split(f_Lablechar,"┆")(5),"$")(1)
  199. if leftTitle<>"" then
  200. leftTitle = cint(leftTitle)
  201. else
  202. leftTitle = 30
  203. end if
  204. DateStyle = split(split(f_Lablechar,"┆")(8),"$")(1)
  205. if instr(f_Lablechar,"out_DIV")>0 then
  206. div_tf=1
  207. else
  208. div_tf=0
  209. TitleCSS=split(split(f_Lablechar,"┆")(6),"$")(1)
  210. if TitleCSS="" then
  211. TitleCSS = ""
  212. else
  213. TitleCSS = " class="""&TitleCSS&""""
  214. end if
  215. DateCSS=split(split(f_Lablechar,"┆")(7),"$")(1)
  216. if DateCSS<>"" then
  217. DateCSS = " class="""&DateCSS&""""
  218. else
  219. DateCSS = ""
  220. end if
  221. end if
  222. if div_tf=1 then
  223. classNews_head = table_str_list_head(div_tf,split(table_array(9),"$")(1),split(table_array(10),"$")(1),split(table_array(11),"$")(1),split(table_array(12),"$")(1))
  224. classNews_middle1 = table_str_list_middle_1(div_tf,split(table_array(13),"$")(1),split(table_array(14),"$")(1))
  225. end if
  226. classNews_bottom = table_str_list_bottom(div_tf)
  227. classNews_middle2 = table_str_list_middle_2(div_tf)
  228. if ClassID<>"" then
  229. inSql_CMD = " and ClassID='"& ClassId &"'"
  230. else
  231. inSql_CMD = ""
  232. end if
  233. if BookPop="0" then
  234. orderby = " order by LastUpdateDate desc,id desc"
  235. rec_tf=""
  236. elseif BookPop="1" then
  237. orderby = " order by LastUpdateDate desc,id desc"
  238. rec_tf=" and IsTop='1'"
  239. else
  240. orderby = " order by hit desc,LastUpdateDate desc,id desc"
  241. rec_tf=""
  242. end if
  243. set rs = Conn.execute("select top "& TitleNumber &" ID,ClassId,Topic,Body,AddDate,Hit,State,user From FS_WS_BBS where State='0' and len(Topic)>3 "& inSql_CMD & rec_tf & orderby &"")
  244. BookCode = ""
  245. if rs.eof then
  246. BookCode = ""
  247. rs.close:set rs=nothing
  248. else
  249. do while not rs.eof
  250. if BookPop="2" then
  251. tmp_hit = "<font style=""font-size:10px;font-family:Arial;"" color=red>["&rs("Hit")&"]</font>"
  252. end if
  253. if div_tf = 1 then
  254. if rs("user")<>"游客" and rs("user")<>"过客" then
  255. user_str = "(<a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/"&G_USER_DIR&"/ShowUser.asp?UserName="&rs("User")&""" target=""_blank"">"& rs("User")&"</a>)"
  256. else
  257. user_str = "("&rs("User")&")"
  258. end if
  259. BookCode = BookCode & classNews_middle1 & "<a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/GuestBook/ShowNote.asp?NoteID="&rs("id")&"&ClassID="&rs("ClassId")&""" target=""_blank"">"&GotTopic(""& rs("Topic"),leftTitle) &"</a>"& tmp_hit & user_str & Get_Date(rs("AddDate"),DateStyle) & "" & classNews_middle2
  260. else
  261. if rs("user")<>"游客" and rs("user")<>"过客" then
  262. user_str = "(<a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/"&G_USER_DIR&"/ShowUser.asp?UserName="&rs("User")&""" target=""_blank"">"& rs("User")&"</a>)"
  263. else
  264. user_str = "("&rs("User")&")"
  265. end if
  266. BookCode = BookCode & "<img src=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/sys_images/book_tf.gif"" border=""0"" /><a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/GuestBook/ShowNote.asp?NoteID="&rs("id")&"&ClassID="&rs("ClassId")&""" target=""_blank"""&TitleCSS&">"&GotTopic(""&rs("Topic"),leftTitle)&"</a>"& tmp_hit & user_str &"<span"& DateCSS &">"& Get_Date(rs("AddDate"),DateStyle)&"</span>"&"<br>"
  267. end if
  268. rs.movenext
  269. loop
  270. rs.close:set rs=nothing
  271. end if
  272. if div_tf=1 then
  273. BookCode = classNews_head & BookCode & classNews_bottom
  274. end if
  275. BookCode = BookCode
  276. End Function
  277. '投票
  278. Public Function VSLIST(f_Lablechar,f_type)
  279. 'VSLIST┆投票项$4┆图片宽度$100┆SpanId$Vote_HTML_ID00000
  280. Dim Tid,SpanId,PicWidth
  281. Tid = split(split(f_Lablechar,"┆")(1),"$")(1)
  282. SpanId = split(split(f_Lablechar,"┆")(3),"$")(1)
  283. PicWidth = split(split(f_Lablechar,"┆")(2),"$")(1)
  284. VSLIST = VSLIST & "<span id="""&SpanId&""">加载投票中...</span>"
  285. VSLIST = VSLIST & "<script src=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/Vote/VoteJs.asp?TID="&Tid&"&InfoID="&SpanId&"&PicW="& PicWidth &""" language=""javascript""></script>"&chr(10)
  286. End Function
  287. '广告调用
  288. Public Function AdLIST(f_Lablechar,f_type)
  289. 'AdLIST┆广告ID$94┆SpanId$Ad_HTML_ID
  290. Dim AdId,SpanId
  291. AdId = split(split(f_Lablechar,"┆")(1),"$")(1)
  292. SpanId = split(split(f_Lablechar,"┆")(2),"$")(1)
  293. AdLIST = AdLIST & "<script src=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/ads/"&AdId&".js"" language=""javascript""></script>"&chr(10)
  294. End Function
  295. '得到div,table_________________________________________________________________________________
  296. Public Function table_str_list_head(f_tf,f_divid,f_divclass,f_ulid,f_ulclass)   
  297. Dim table_,tr_
  298. Dim f_divid_1,f_divclass_1,f_ulid_1,f_ulclass_1
  299. if f_tf=1 then
  300. if f_divid<>"" then:f_divid_1 = " id="""& f_divid &"""":else:f_divid_1 = "":end if
  301. if f_divclass<>"" then:f_divclass_1 = " class="""& f_divclass &"""":else:f_divclass_1 = "":end if
  302. if f_ulid<>"" then:f_ulid_1 = " id="""& f_ulid &"""":else:f_ulid_1 = "":end if
  303. if f_ulclass<>"" then:f_ulclass_1 = " class="""& f_ulclass &"""":else:f_ulclass_1 = "":end if
  304. table_="<div"& f_divid_1 & f_divclass_1 &">"
  305. tr_="<ul"& f_ulid_1 & f_ulclass_1 &">"
  306. table_str_list_head =  table_&chr(10)
  307. table_str_list_head = table_str_list_head &" "& tr_&chr(10)
  308. else
  309. table_="<table border=""0"" cellspacing=""0"" cellpadding=""3"" width=""100%"">"
  310. table_str_list_head =  table_&chr(10)
  311. end if
  312. End Function
  313. '得到div,table_________________________________________________________________________________
  314. public Function table_str_list_middle_1(f_tf,f_liid,f_liclass)
  315. Dim f_liid_1,f_liclass_1,td_
  316. if f_tf=1 then
  317. if f_liid<>"" then:f_liid_1 = " id="""& f_liid &"""":else:f_liid_1 = "":end if
  318. if f_liclass<>"" then:f_liclass_1 = " class="""& f_liclass &"""":else:f_liclass_1 = "":end if
  319. td_="<li"&f_liid_1&f_liclass_1&">"
  320. table_str_list_middle_1 ="  "&td_
  321. end if
  322. End Function
  323. '得到div,table_________________________________________________________________________________
  324. public Function table_str_list_middle_2(f_tf)
  325. Dim td__,tr__
  326. if f_tf=1 then
  327. td__="</li>"
  328. else
  329. td__="</td>"
  330. end if
  331. table_str_list_middle_2 =  td__&chr(10)
  332. End Function
  333. '得到div,table_________________________________________________________________________________
  334. Public Function table_str_list_middle_3(f_tf)
  335. if f_tf=1 then
  336. table_str_list_middle_3 = ""
  337. else
  338. table_str_list_middle_3 = "</tr>"
  339. end if
  340. End Function
  341. '得到div,table_________________________________________________________________________________
  342. Public Function table_str_list_bottom(f_tf)
  343. Dim table__,tr__
  344. if f_tf=1 then
  345. table__="</div>"
  346. tr__="</ul>"
  347. table_str_list_bottom = " "&tr__&chr(10)
  348. else
  349. table__="</table>"
  350. table_str_list_bottom = ""
  351. end if
  352. table_str_list_bottom = table_str_list_bottom &table__&chr(10)
  353. End Function
  354. 'DIV格式输出结束_____________________________________________________________________
  355. End Class
  356. %>