Other_Public.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:15k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <%
- Class cls_Other
- '定义参数
- Private m_Rs,m_FSO,m_Dict
- Private m_PathDir,m_Path_UserDir,m_Path_User,m_Path_adminDir,m_Path_UserPageDir,m_Path_Templet
- Private m_Err_Info,m_Err_NO
- Private Sub Class_initialize()
- Set m_Rs = Server.CreateObject(G_FS_RS)
- Set m_FSO = Server.CreateObject(G_FS_FSO)
- Set m_Dict = Server.CreateObject(G_FS_DICT)
- m_PathDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/","//","/")
- m_Path_UserDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_USER_DIR&"/","//","/")
- m_Path_UserPageDir = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_USERFILES_DIR&"/","//","/")
- m_Path_Templet = replace("/"&G_VIRTUAL_ROOT_DIR&"/"&G_TEMPLETS_DIR&"/","//","/")
- End Sub
- Private Sub Class_Terminate()
- Set m_Rs = Nothing
- Set m_FSO = Nothing
- Set m_Dict = Nothing
- End Sub
- '获得参数
- Public Function get_LableChar(f_Lablechar,f_Id)
- Dim f_array
- f_array= split(f_Lablechar,"┆")
- if ubound(f_array)=0 and not isarray(f_array) then
- get_LableChar=""
- exit Function
- else
- select case LCase(f_array(0))
- case "sstype"
- if ubound(f_array)<>2 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=SSTYPE(f_Lablechar,"sstype"):end if
- case "picfl"
- if ubound(f_array)<>11 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=PicFL(f_Lablechar,"picfl"):end if
- case "wordfl"
- if ubound(f_array)<>11 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=WordFL(f_Lablechar,"wordfl"):end if
- case "bookcode"
- if ubound(f_array)<>15 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=BookCode(f_Lablechar,"bookcode"):end if
- case "vslist"
- if ubound(f_array)<>3 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=VSLIST(f_Lablechar,"vslist"):end if
- case "adlist"
- if ubound(f_array)<>2 then:get_LableChar="标签错误,by Foosun.cn":else:get_LableChar=AdLIST(f_Lablechar,"adlist"):end if
- end select
- end if
- End Function
- '统计调用
- Public Function SSTYPE(f_Lablechar,f_type)
- 'SSTYPE┆方式$0┆路径$0
- dim CodeStyle,PathStyle,Url_Path,code_end
- CodeStyle = split(split(f_Lablechar,"┆")(1),"$")(1)
- PathStyle = split(split(f_Lablechar,"┆")(2),"$")(1)
- If PathStyle = "0" then
- Url_Path = Replace("/"&G_VIRTUAL_ROOT_DIR&"/","//","/")
- else
- Url_Path = "http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain") &"/"
- end if
- if CodeStyle="0" then
- code_end = "1"
- elseif CodeStyle="1" then
- code_end = "0"
- else
- code_end = "2"
- end if
- SSTYPE = "<script language=""JavaScript"" src="""& Url_Path&"stat?code="&CodeStyle&""" type=""text/JavaScript""></script>"
- End Function
- '调用图片友情连接
- Public Function PicFL(f_Lablechar,f_type)
- 'PicFL┆调用数量$12┆站点名称$0┆每列数量$6┆图片尺寸$88,31┆输出方式$out_Table┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$
- dim table_array,div_tf,div_chars,div_class,i_link
- dim CodeNumber,siteName,colsNumber,pizsize,rs
- table_array=split(f_Lablechar,"┆")
- CodeNumber = split(split(f_Lablechar,"┆")(1),"$")(1)
- siteName = split(split(f_Lablechar,"┆")(2),"$")(1)
- colsNumber = split(split(f_Lablechar,"┆")(3),"$")(1)
- pizsize = split(split(f_Lablechar,"┆")(4),"$")(1)
- if instr(f_Lablechar,"out_DIV")>0 then
- div_tf=1
- else
- div_tf=0
- end If
- If CodeNumber="" Then CodeNumber=0
- 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")
- PicFL = ""
- if rs.eof then
- PicFL = ""
- rs.close:set rs=nothing
- else
- i_link = 0
- do while not rs.eof
- if div_tf=1 then
- 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>"
- else
- 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)
- end if
- rs.movenext
- i_link = i_link + 1
- if i_link mod colsNumber = 0 then
- PicFL = PicFL & "</tr><tr>"
- end if
- loop
- rs.close:set rs=nothing
- end if
- if div_tf = 1 then
- if split(split(f_Lablechar,"┆")(6),"$")(1)<>"" then
- div_chars = " id="&split(split(f_Lablechar,"┆")(6),"$")(1)&""
- else
- div_chars = ""
- end if
- if split(split(f_Lablechar,"┆")(7),"$")(1)<>"" then
- div_class = " class="&split(split(f_Lablechar,"┆")(7),"$")(1)&""
- else
- div_class = ""
- end if
- PicFL = "<div"&div_chars&div_class&">"&PicFL&"</div>"
- else
- PicFL = "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"">"&chr(10)&" <tr>"&chr(10)&" "&PicFL&chr(10)&" </tr>"&chr(10)&"</table>"
- end if
- PicFL = PicFL
- End Function
- '文字友情连接
- Public Function WordFL(f_Lablechar,f_type)
- 'WordFL┆调用数量$12┆每列数量$1┆标题CSS$20┆站点显示字数$20┆输出方式$out_Table┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$
- dim table_array,div_tf,div_chars,div_class,i_link
- dim CodeNumber,TitleCSS,colsNumber,pizsize,rs,lefttitle
- table_array=split(f_Lablechar,"┆")
- CodeNumber = split(split(f_Lablechar,"┆")(1),"$")(1)
- colsNumber = split(split(f_Lablechar,"┆")(2),"$")(1)
- lefttitle = split(split(f_Lablechar,"┆")(4),"$")(1)
- If IsNull(lefttitle) Then lefttitle=""
- if instr(f_Lablechar,"out_DIV")>0 then
- div_tf=1
- else
- div_tf=0
- TitleCSS = split(split(f_Lablechar,"┆")(3),"$")(1)
- If TitleCSS="" then
- TitleCSS = ""
- else
- TitleCSS = " class="""&TitleCSS&""""
- end if
- end If
- If CodeNumber="" Then CodeNumber=0
- 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")
- WordFL = ""
- if rs.eof then
- WordFL = ""
- rs.close:set rs=nothing
- else
- i_link = 0
- do while not rs.eof
- if div_tf=1 Then
- If IsNumeric(lefttitle) then
- WordFL = WordFL &"<a href="""& rs("F_Url")&""">"&Left(rs("F_Name"),lefttitle)&"</a>"
- Else
- WordFL = WordFL &"<a href="""& rs("F_Url")&""">"&rs("F_Name")&"</a>"
- End if
- Else
- If IsNumeric(lefttitle) then
- WordFL = WordFL & " <td width="""&cint(100/colsNumber)&"%"" align=""center""><a href="""& rs("F_Url")&""""&TitleCSS&">"& Left(rs("F_Name"),lefttitle) &"</a></td>"&chr(10)
- Else
- WordFL = WordFL & " <td width="""&cint(100/colsNumber)&"%"" align=""center""><a href="""& rs("F_Url")&""""&TitleCSS&">"& rs("F_Name") &"</a></td>"&chr(10)
- End if
- end if
- rs.movenext
- i_link = i_link + 1
- if i_link mod colsNumber = 0 then
- WordFL = WordFL & "</tr><tr>"
- end if
- loop
- rs.close:set rs=nothing
- end if
- if div_tf = 1 then
- if split(split(f_Lablechar,"┆")(6),"$")(1)<>"" then
- div_chars = " id="""&split(split(f_Lablechar,"┆")(6),"$")(1)&""""
- else
- div_chars = ""
- end if
- if split(split(f_Lablechar,"┆")(7),"$")(1)<>"" then
- div_class = " class="""&split(split(f_Lablechar,"┆")(7),"$")(1)&""""
- else
- div_class = ""
- end if
- WordFL = "<div"&div_chars&div_class&">"&WordFL&"</div>"
- else
- WordFL = "<table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""3"">"&chr(10)&" <tr>"&chr(10)&" "&WordFL&chr(10)&" </tr>"&chr(10)&"</table>"
- end if
- WordFL = WordFL
- End Function
- '留言调用
- Public Function BookCode(f_Lablechar,f_type)
- 'BookCode┆类型$0┆栏目$┆数量$10┆列数$1┆字数$30┆标题CSS$┆日期CSS$┆日期格式$YY02-MM-DD┆DivID$┆Divclass$┆ulid$┆ulclass$┆liid$┆liclass$┆输入格式$out_Table
- dim table_array,BookPop,ClassID,TitleNumber,ColsNumber,leftTitle,div_tf,TitleCSS,DateCSS,datestyle
- dim classNews_head,classNews_middle1,classNews_bottom,classNews_middle2,user_str,tmp_hit
- dim rs,inSql_CMD,orderby,rec_tf
- table_array=split(f_Lablechar,"┆")
- BookPop = split(split(f_Lablechar,"┆")(1),"$")(1)
- ClassID = split(split(f_Lablechar,"┆")(2),"$")(1)
- TitleNumber = split(split(f_Lablechar,"┆")(3),"$")(1)
- ColsNumber = split(split(f_Lablechar,"┆")(4),"$")(1)
- leftTitle = split(split(f_Lablechar,"┆")(5),"$")(1)
- if leftTitle<>"" then
- leftTitle = cint(leftTitle)
- else
- leftTitle = 30
- end if
- DateStyle = split(split(f_Lablechar,"┆")(8),"$")(1)
- if instr(f_Lablechar,"out_DIV")>0 then
- div_tf=1
- else
- div_tf=0
- TitleCSS=split(split(f_Lablechar,"┆")(6),"$")(1)
- if TitleCSS="" then
- TitleCSS = ""
- else
- TitleCSS = " class="""&TitleCSS&""""
- end if
- DateCSS=split(split(f_Lablechar,"┆")(7),"$")(1)
- if DateCSS<>"" then
- DateCSS = " class="""&DateCSS&""""
- else
- DateCSS = ""
- end if
- end if
- if div_tf=1 then
- 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))
- classNews_middle1 = table_str_list_middle_1(div_tf,split(table_array(13),"$")(1),split(table_array(14),"$")(1))
- end if
- classNews_bottom = table_str_list_bottom(div_tf)
- classNews_middle2 = table_str_list_middle_2(div_tf)
- if ClassID<>"" then
- inSql_CMD = " and ClassID='"& ClassId &"'"
- else
- inSql_CMD = ""
- end if
- if BookPop="0" then
- orderby = " order by LastUpdateDate desc,id desc"
- rec_tf=""
- elseif BookPop="1" then
- orderby = " order by LastUpdateDate desc,id desc"
- rec_tf=" and IsTop='1'"
- else
- orderby = " order by hit desc,LastUpdateDate desc,id desc"
- rec_tf=""
- end if
- 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 &"")
- BookCode = ""
- if rs.eof then
- BookCode = ""
- rs.close:set rs=nothing
- else
- do while not rs.eof
- if BookPop="2" then
- tmp_hit = "<font style=""font-size:10px;font-family:Arial;"" color=red>["&rs("Hit")&"]</font>"
- end if
- if div_tf = 1 then
- if rs("user")<>"游客" and rs("user")<>"过客" then
- user_str = "(<a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/"&G_USER_DIR&"/ShowUser.asp?UserName="&rs("User")&""" target=""_blank"">"& rs("User")&"</a>)"
- else
- user_str = "("&rs("User")&")"
- end if
- 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
- else
- if rs("user")<>"游客" and rs("user")<>"过客" then
- user_str = "(<a href=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/"&G_USER_DIR&"/ShowUser.asp?UserName="&rs("User")&""" target=""_blank"">"& rs("User")&"</a>)"
- else
- user_str = "("&rs("User")&")"
- end if
- 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>"
- end if
- rs.movenext
- loop
- rs.close:set rs=nothing
- end if
- if div_tf=1 then
- BookCode = classNews_head & BookCode & classNews_bottom
- end if
- BookCode = BookCode
- End Function
- '投票
- Public Function VSLIST(f_Lablechar,f_type)
- 'VSLIST┆投票项$4┆图片宽度$100┆SpanId$Vote_HTML_ID00000
- Dim Tid,SpanId,PicWidth
- Tid = split(split(f_Lablechar,"┆")(1),"$")(1)
- SpanId = split(split(f_Lablechar,"┆")(3),"$")(1)
- PicWidth = split(split(f_Lablechar,"┆")(2),"$")(1)
- VSLIST = VSLIST & "<span id="""&SpanId&""">加载投票中...</span>"
- VSLIST = VSLIST & "<script src=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/Vote/VoteJs.asp?TID="&Tid&"&InfoID="&SpanId&"&PicW="& PicWidth &""" language=""javascript""></script>"&chr(10)
- End Function
- '广告调用
- Public Function AdLIST(f_Lablechar,f_type)
- 'AdLIST┆广告ID$94┆SpanId$Ad_HTML_ID
- Dim AdId,SpanId
- AdId = split(split(f_Lablechar,"┆")(1),"$")(1)
- SpanId = split(split(f_Lablechar,"┆")(2),"$")(1)
- AdLIST = AdLIST & "<script src=""http://"&request.Cookies("FoosunMFCookies")("FoosunMFDomain")&"/ads/"&AdId&".js"" language=""javascript""></script>"&chr(10)
- End Function
- '得到div,table_________________________________________________________________________________
- Public Function table_str_list_head(f_tf,f_divid,f_divclass,f_ulid,f_ulclass)
- Dim table_,tr_
- Dim f_divid_1,f_divclass_1,f_ulid_1,f_ulclass_1
- if f_tf=1 then
- if f_divid<>"" then:f_divid_1 = " id="""& f_divid &"""":else:f_divid_1 = "":end if
- if f_divclass<>"" then:f_divclass_1 = " class="""& f_divclass &"""":else:f_divclass_1 = "":end if
- if f_ulid<>"" then:f_ulid_1 = " id="""& f_ulid &"""":else:f_ulid_1 = "":end if
- if f_ulclass<>"" then:f_ulclass_1 = " class="""& f_ulclass &"""":else:f_ulclass_1 = "":end if
- table_="<div"& f_divid_1 & f_divclass_1 &">"
- tr_="<ul"& f_ulid_1 & f_ulclass_1 &">"
- table_str_list_head = table_&chr(10)
- table_str_list_head = table_str_list_head &" "& tr_&chr(10)
- else
- table_="<table border=""0"" cellspacing=""0"" cellpadding=""3"" width=""100%"">"
- table_str_list_head = table_&chr(10)
- end if
- End Function
- '得到div,table_________________________________________________________________________________
- public Function table_str_list_middle_1(f_tf,f_liid,f_liclass)
- Dim f_liid_1,f_liclass_1,td_
- if f_tf=1 then
- if f_liid<>"" then:f_liid_1 = " id="""& f_liid &"""":else:f_liid_1 = "":end if
- if f_liclass<>"" then:f_liclass_1 = " class="""& f_liclass &"""":else:f_liclass_1 = "":end if
- td_="<li"&f_liid_1&f_liclass_1&">"
- table_str_list_middle_1 =" "&td_
- end if
- End Function
- '得到div,table_________________________________________________________________________________
- public Function table_str_list_middle_2(f_tf)
- Dim td__,tr__
- if f_tf=1 then
- td__="</li>"
- else
- td__="</td>"
- end if
- table_str_list_middle_2 = td__&chr(10)
- End Function
- '得到div,table_________________________________________________________________________________
- Public Function table_str_list_middle_3(f_tf)
- if f_tf=1 then
- table_str_list_middle_3 = ""
- else
- table_str_list_middle_3 = "</tr>"
- end if
- End Function
- '得到div,table_________________________________________________________________________________
- Public Function table_str_list_bottom(f_tf)
- Dim table__,tr__
- if f_tf=1 then
- table__="</div>"
- tr__="</ul>"
- table_str_list_bottom = " "&tr__&chr(10)
- else
- table__="</table>"
- table_str_list_bottom = ""
- end if
- table_str_list_bottom = table_str_list_bottom &table__&chr(10)
- End Function
- 'DIV格式输出结束_____________________________________________________________________
- End Class
- %>