<%@language=vbscript codepage=936 %> <% option explicit response.buffer=true Response.Expires = -1 Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" Dim ChannelID ChannelID=0 %> <% Dim DbPath,DbPath_U,DbPath_L Dim Conn,Conn_U,Conn_L,Conn_Count Dim Db,Cl,Template,PageData,Count,ClUbb,TempStr Dim IsSqlDataBase,IsSqlDataBase_U,IsSqlDataBase_L Dim SqlNowString,FalseType,TrueType Dim SqlNowString_U,FalseType_U,TrueType_U Dim SqlDatabaseName,SqlUsername,SqlPassword,SqlLocalName Dim SqlDatabaseName_U,SqlUsername_U,SqlPassword_U,SqlLocalName_U Dim SqlDatabaseName_L,SqlUsername_L,SqlPassword_L,SqlLocalName_L Dim CreateHtmlIng,DefaultPage,CreateFilePre Set Db = New Cls_DataBase Set Cl = New Cls_CMSSysTem Set Template = New Cls_Templates CreateHtmlIng=False : DefaultPage="Index" Rem 是否正在生成HTML Const SaveLog = 1 Rem 是否保存攻击日志 0为否,1为是 Const InstallDir= "/" Rem 网站安装目录,根目录用“/”,请用"/"开头及结尾:如安装在Cl3目录下,则值为:“/Cl3/” Const BbsDir = "/Bbs/" Rem 论坛安装目录,根目录用“/”,请用"/"结尾,整合论坛时生效 Const SysTemVersion = 0 Rem 系统版本,请不要更改,否则会出错 Const UserTableType = "Aspoo" 'Aspoo=不整合论坛,Dvbbs=整合动网7 IsSqlDataBase = 0 '主数据库类型(1=SQL,0=AC) IsSqlDataBase_U = 0 '用户数据库类型(1=SQL,0=AC)整合论坛时才生效,不整合论坛,则自动取主数据库类型 IsSqlDataBase_L = 0 'Log数据库类型(1=SQL,0=AC) DbPath = InstallDir & "Data/Cl_CreateLiveCMSv3.Asp" 'Access版主数据库文件的位置(请用绝对路径) DbPath_U = BbsDir & "Data/Dvbbs7.mdb" 'Access版论坛数据库文件的位置(整合论坛时生郊) DbPath_L = InstallDir & "Data/Cl_Log.Asp" '管理员及SQL注入记录数据库 '====SQL版主站 数据库参数================================================= SqlDatabaseName = "ClCMS3" '主数据库名 SqlUsername = "ClCMS3" '主数据库登录用户 SqlPassword = "123456" '主数据库登录密码 SqlLocalName = "(local)" '数据库服务器,本机用“(local)” '====SQL版论坛 数据库参数 (整合论坛时生郊)================================ SqlDatabaseName_U = "bbs" '论坛数据库名 SqlUsername_U = "bbs" '论坛数据库登录用户 SqlPassword_U = "123456" '论坛数据库登录密码 SqlLocalName_U = "(local)" '论坛数据库服务器,本机用“(local)” '====SQL Log数据库======================================================== SqlDatabaseName_L = "ClLog" 'Log数据库名 SqlUsername_L = "ClLog" 'Log数据库登录用户 SqlPassword_L = "123456" 'Log数据库登录密码 SqlLocalName_L = "(local)" 'Log数据库服务器,本机用“(local)” '=========================================================================== '以下部分,不需要再改!===================================================== If UserTableType = "Dvbbs" Then Db.UserTable = "[Dv_User]" Db.MessageTable = "[Dv_Message]" Db.FriendTable = "[Dv_Friend]" Db.UserFaceWidth = "Userwidth" '头像宽度 Db.UserFaceHeight = "Userheight" '头像高度 Db.UserTPassWord = "WebTruePassWord" Else Db.UserTable = "[Cl_User]" Db.MessageTable = "[Cl_Message]" Db.FriendTable = "[Cl_Friend]" Db.UserFaceWidth = "FaceWidth" '头像宽度 Db.UserFaceHeight = "FaceHeight" '头像高度 Db.UserTPassWord = "TruePassWord" DbPath_U = DbPath SqlDatabaseName_U = SqlDatabaseName SqlUsername_U = SqlUsername SqlPassword_U = SqlPassword SqlLocalName_U = SqlLocalName IsSqlDataBase_U = IsSqlDataBase End If Db.UserID = "UserID" '用户ID Db.UserName = "UserName" '用户名 Db.UserPassword = "UserPassword" '密码 Db.UserEmail = "UserEmail" 'Email地址 Db.UserSex = "UserSex" '性别 Db.UserFace = "UserFace" '头像 Db.UserJoinDate = "JoinDate" '注册日期 Db.UserLastLogin = "LastLogin" '最后登录时间 Db.UserLogins = "UserLogins" '登录次数 Db.UserQuestion = "UserQuesion" '忘记密码的提示问题 Db.UserAnswer = "UserAnswer" '问题答案 Db.UserLastIP = "UserLastIP" '最后登录IP '============================= Db.UserIM = "UserIM" '用户IM,0123456,bbsxp(012345) Db.UserLock = "LockUser" '是否锁定用户 Db.UserWealth = "UserWealth" '用户金钱(整合DVBBS用) Db.UserMoney = "UserMoney" '用户金币 Db.UserMsg = "UserMsg" '短消息状态 '============================= Db.UserReName = "UserReName" '真实姓名 Db.UserTelePhone = "UserTelePhone" '办公电话 Db.UserAddRess = "UserAddRess" '通讯地址 Db.UserBirthday = "UserBirthday" '用户生日 Db.IDCard = "IDCard" '身份证号 Db.CityInfo = "CityInfo" '城市 Db.ZipCode = "ZipCode" '邮编 Db.SchoolAge = "SchoolAge" '学历 Db.UserWorking = "UserWorking" '工作 Db.UserHomePhone = "UserHomePhone" '家庭电话 Db.UserMobile = "UserMobile" '手机 Db.WaitReceive = "WaitReceive" '待签收文章 Db.Received = "Received" '已签收文章 Db.TotalExp = "TotalExp" '个人购物积分 Db.UserReMark = "UserReMark" '备注 Db.UserDataNum = "DataCount" '发表文章数 Db.UserLevel = "UserLevel" '用户等级 Db.UserPoint = "UserPoint" '用户点数 Db.ChargeType = "ChargeType" '计费方式 Db.BeginDate = "BeginDate" '开始日期 Db.ValidNum = "Valid_Num" '有效期数值 Db.UserCheckNum = "UserCheckNum" '注册认证码 if IsSqlDataBase=1 then TrueType = "1" FalseType = "0" SqlNowString = "GetDate()" else TrueType = "True" FalseType = "False" SqlNowString = "Now()" end if if IsSqlDataBase_U=1 then TrueType_U = "1" FalseType_U = "0" SqlNowString_U = "GetDate()" else TrueType_U = "True" FalseType_U = "False" SqlNowString_U = "Now()" end if '主站数据库链接过程 Sub OpenConn() if IsObject(Conn) then Exit Sub if IsSqlDataBase=1 then Db.ConnValue = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";" else Db.ConnValue="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DbPath) end if Set Conn=Db.OpenConnection("主数据库") End Sub '用户主站数据库链接过程 Sub OpenConn_U() if IsObject(Conn_U) then Exit Sub if IsSqlDataBase_U=1 then Db.ConnValue = "Provider = Sqloledb; User ID = " & SqlUsername_U & "; Password = " & SqlPassword_U & "; Initial Catalog = " & SqlDatabaseName_U & "; Data Source = " & SqlLocalName_U & ";" else Db.ConnValue = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DbPath_U) end if Set Conn_U=Db.OpenConnection("用户数据库") End Sub 'Log数据库链接过程 Sub OpenConn_L() if IsObject(Conn_L) then Exit Sub if IsSqlDataBase_L=1 then Db.ConnValue = "Provider = Sqloledb; User ID = " & SqlUsername_L & "; Password = " & SqlPassword_L & "; Initial Catalog = " & SqlDatabaseName_L & "; Data Source = " & SqlLocalName_L & ";" else Db.ConnValue = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DbPath_L) end if Set Conn_L=Db.OpenConnection("Log数据库") End Sub Sub CloseAllObj() 'On Error Resume Next TempStr = Empty Template.html = Empty Set Db = Nothing Set Cl = Nothing Set Template = Nothing Set PageData = Nothing End Sub 'if Err then ' Response.Write "执行程序发现错误
" ' Response.Write "错 误 号: " & Err.Number & "
" ' Response.Write "错误描述:" & Err.Description & "
" ' Response.Write "错误来源:" & Err.Source & "
" ' Response.end 'end if %> <% '================================================== 'CreateLive CMS Version 3.1 ' Powered by Aspoo.Net ' '邮箱: aspoo@126.com Info@aspoo.cn 'QQ: 3315263 596197794 '网站: www.aspoo.cn www.aspoo.com '论坛: bbs.aspoo.cn bbs.aspoo.com ' 'Copyright (C) 2005 Aspoo.Net All Rights Reserved. '================================================== %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_ClsSysTem.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== ' 注: 本程序采用动网先锋缓存类。 '=================================================== Class Cls_CMSSysTem Private LocalCacheName Public Reloadtime, CacheName, CacheData, SqlQueryNum, SysTemUpDate Public ScriptName, ServerName, Page_Admin, pNum, pNum2, IPDataBase Public Web_Setting, Web_Version, BadWords, rBadWord Public Upload_Setting, Product_Setting, Channel_Setting Public Web_Cookies, Web_Info, Web_Pack Public Admin_Info, Admin_Purview Public User_Info, User_IM, User_Purview Public UserID, UserLevel, UserTrueIP, MemberName, MemberWord Public ChannelName, ChannelItemName, ChannelReadMe, ChannelItemUnit, ChannelUrl, IsDisabled Public IsCreateHtml, CreatePathType, CreateFileType, CreateFileExt, IsCreateList Public StyleID, CssID, Logo, Banner, CountConfig, ChannelOtherSetting Public StyleName, Web_CSS, Web_PicUrl, mainhtml, mainsetting, lanstr, mainpic Public WebDir, HtmlDir, ChannelDir, UpLoadDir, DownLoadDir '上传主目录,软件下载目录 Public SendMsgNum, SendMsgID, SendMsgUser Public Path, Title, Keywords, DeScriptIon, PATH_INFO Private Sub Class_Initialize() Dim Web_CacheName,Tmpstr Web_Cookies = "Aspoo" 'Cookies名称 Web_CacheName = "Aspoo" '网站缓存,如果一个站点有多个网站请更改 Reloadtime = 28800 SysTemUpDate = 20060622 SqlQueryNum = 0 : pNum = 1 : pNum2 = 0 SendMsgNum = 0 : SendMsgID = 0 : SendMsgUser = "" CacheName = Server.MapPath("/") & InstallDir & Web_CacheName CacheName = Replace(Replace(Replace(Replace(CacheName," ",""),":",""),"\",""),"/","") MemberName = Trim(Request.Cookies(Web_Cookies)("UserName")) If MemberName<>"" Then MemberName = ReplaceBadChar(MemberName) MemberWord = Trim(Request.Cookies(Web_Cookies)("PassWord")) UserID = ChkClng(Request.Cookies(Web_Cookies)("UserID")) UserLevel = Trim(Request.Cookies(Web_Cookies)("UserLevel")) UserTrueIP = CheckStr(Request.ServerVariables("REMOTE_ADDR")) Path_Info = Request.ServerVariables("PATH_INFO") Tmpstr = Split(Path_Info,"/") ScriptName = Lcase(Tmpstr(UBound(Tmpstr))) ServerName = Lcase(request.ServerVariables("Server_Name")) Page_Admin = False WebDir = InstallDir If Not IsNumeric(UserLevel) or UserLevel = "" Then UserLevel=5 UserLevel = Clng(UserLevel) If InStr(ScriptName,"showerr.asp")>0 Or InStr(ScriptName,"login.asp")>0 Or InStr(ScriptName,"logout.asp")>0 Or InStr(ScriptName,"admin_index.asp")>0 Or InStr(ScriptName,"count.asp")>0 Then Page_Admin=True End Sub Private Sub class_terminate() User_Info = Empty : Upload_Setting = Empty Product_Setting = Empty : Channel_Setting = Empty Web_Info = Empty : Web_Setting = Empty CacheData = Empty : MainHtml = Empty User_IM = Empty : User_Purview = Empty if IsObject(Conn) then Conn.Close : Set Conn = Nothing if IsObject(Conn_U) then Conn_U.Close : Set Conn_U = Nothing if IsObject(Conn_L) then Conn_L.Close : Set Conn_L = Nothing End Sub Public Property Let Name(ByVal vNewValue) LocalCacheName=LCase(vNewValue) End Property Public Property Let Value(ByVal vNewValue) If LocalCacheName<>"" Then Application.Lock Application(CacheName & "_" & LocalCacheName & "_-time")=Now() Application(CacheName & "_" & LocalCacheName) = vNewValue Application.unLock End If End Property Public Property Get Value() If LocalCacheName<>"" Then Value=Application(CacheName & "_" & LocalCacheName) End If End Property Public Function ObjIsEmpty() ObjIsEmpty=True If Not IsDate(Application(CacheName & "_" & LocalCacheName &"_-time")) Then Exit Function If DateDiff("s",CDate(Application(CacheName & "_" & LocalCacheName &"_-time")),Now()) < (60*Reloadtime) Then ObjIsEmpty=False End Function Public Sub DelCahe(MyCaheName) Application.Lock Application.Contents.Remove(CacheName&"_"&MyCaheName & "_-time") Application.Contents.Remove(CacheName&"_"&MyCaheName) Application.unLock End Sub Public Sub DelAllCache() Dim Cachelist,i Cachelist=split(GetallCache(),",") If UBound(cachelist)>1 Then For i=0 to UBound(cachelist)-1 Application.Lock Application.Contents.Remove(Cachelist(i)) Application.unLock Next End If Value=Date() If InStr(ScriptName,"showlogin.asp")>0 or InStr(ScriptName,"showerr.asp")>0 Then Exit Sub Name="ReFreshData" Value="Yes" Dim sPathInfo sPathInfo = Request.ServerVariables("PATH_INFO") If request.ServerVariables("QUERY_STRING")<>"" then sPathInfo = sPathInfo & "?" & request.ServerVariables("QUERY_STRING") If ChannelID>0 or Page_Admin Then Response.Redirect "../ReFreshData.Asp?cUrl=" & sPathInfo Elseif InStr(ScriptName,"index.asp")>0 then Response.Redirect "ReFreshData.Asp?cUrl=" & sPathInfo End if 'Response.end End Sub Public Function GetallCache() Dim Cacheobj For Each Cacheobj in Application.Contents If CStr(Left(Cacheobj,Len(CacheName)+1))=CStr(CacheName&"_") Then GetallCache=GetallCache & Cacheobj & "," End If Next End Function '取得系统定义资源 Public Sub GetWeb_Setting() If Not Response.IsClientConnected Then Session(CacheName & "UserID")=Empty Response.End End If Name = "Date" If ObjIsEmpty() Then Value=Date() 'Call DelAllCache() ElseIf Cstr(value) <> Cstr(Date()) Then Call DelAllCache() End If Name = "setup" if ObjIsEmpty() then ReloadSetup() CacheData = value CacheData(1,0) = Split(CacheData(1,0),"@@") Web_Info = Split(CacheData(1,0)(0),"$") Web_Setting = Split(CacheData(2,0),"$") StyleID = CLng(CacheData(3,0)) CssID = CLng(CacheData(4,0)) Title = Web_info(1) & " " & Web_Info(3) DeScriptIon = Web_Info(3) Keywords = Web_Info(2) Logo = Web_Info(5) Banner = Web_Info(6) Web_Version = Split(CacheData(5,0),",") CacheData(6,0) = Split(CacheData(6,0),"@@") Web_Pack = Split(CacheData(6,0)(0),"|||") BadWords = Split(CacheData(7,0),"|") rBadWord = Split(CacheData(8,0),"|") Upload_Setting = Split(CacheData(11,0),"$") Product_Setting = Split(CacheData(12,0),"|||") HtmlDir = Replace(Web_Info(16),"/","") & "/" UpLoadDir = Replace(WebDir&"/"&Upload_Setting(0)&"/","//","/") IPDataBase = WebDir & "Data/Cl_IpAddress.Mdb" 'IP数据库 If Trim(Request.Cookies(Web_Cookies & "Kill")("kill")) <> "No" Then If Trim(Request.Cookies(Web_Cookies & "Kill")("kill")) = "Yes" Then If Not Page_Admin Then Response.Redirect WebDir & "Showerr.asp?action=iplock" Else If Not Page_Admin Then Call ChecKIPlock() If Trim(Request.Cookies(Web_Cookies & "Kill")("kill")) = "Yes" Then Response.Redirect WebDir & "Showerr.asp?action=iplock" end if End If end if if Trim(CacheData(1,0)(1))<>Trim(CacheData(5,0)) and InStr(ScriptName,"showerr")=0 Then DelCahe("Setup") Cl.OutErr(CacheData(6,0)(1)) end if if Trim(Web_Info(11))="Close" And Not Page_Admin Then response.Redirect WebDir & "Showerr.asp?action=Close" if Trim(Web_Setting(8))="Yes" and Not NoChkSqlInFiles then ChkSQLInWord End Sub Public Sub GetWeb_CSetting(Byval sChannelID) 'Dim sTrStyleID, sTrCssID GetChannelSetting(sChannelID) 'sTrCssID = Request.Cookies("AspooSkins")("Css"&sChannelID) 'sTrStyleID = ChkClng(Request.Cookies("AspooSkins")("Style"&sChannelID)) ChannelName = Trim(Channel_Setting(1)) ChannelItemName = Trim(Channel_Setting(2)) ChannelItemUnit = Trim(Channel_Setting(3)) ChannelDir = Trim(Channel_Setting(4)) ChannelUrl = Trim(Channel_Setting(5)) IsDisabled = Clng(Channel_Setting(9)) IsCreateHtml = Clng(Channel_Setting(10)) CreatePathType = Cint(Channel_Setting(11)) CreateFileType = Cint(Channel_Setting(12)) CreateFileExt = Trim(Channel_Setting(13)) StyleID = Clng(Channel_Setting(16)) CssID = Clng(Channel_Setting(17)) ChannelReadMe = Channel_Setting(23) DeScriptIon = Channel_Setting(23) CountConfig = Channel_Setting(24) ChannelOtherSetting = Split(Channel_Setting(25),",") if Channel_Setting(18)<>"" then Logo = Channel_Setting(18) if Channel_Setting(19)<>"" then Banner = Channel_Setting(19) 'If sTrCssID<>"" and IsNumeric(sTrCssID) then CssID = CLng(sTrCssID) 'If sTrStyleID > 0 then StyleID = sTrStyleID End Sub Public Sub GetChannelSetting(Byval sChannelID) sChannelID = ChkClng(sChannelID) Name = "Channel_Setting" & sChannelID If ObjIsEmpty() Then Dim sv,Rs,SQL SQL = "Select ChannelID,ChannelName,ChannelItemName,ChannelItemUnit,ChannelDir,LinkUrl,ChannelType,OpenType,IsShow,IsDisabled,IsCreateHtml,CreatePathType,CreateFileType,CreateFileExt,IsCreateList,AutoCreateList,StyleID,CssID,Logo,Banner,ModuleID,CusTom,UpLoadSetting,ReadMe,CountConfig,OtherSetting" SQL=SQL+" From Cl_Channel Where ChannelID=" & sChannelID Set Rs = Execute(SQL) if Rs.Bof and Rs.Eof then Set Rs = Nothing Response.write "系统找不到指定频道“"&sChannelID&"”,请登录后台,查看模版中是否存在着调用ID为“"&sChannelID&"”频道的标签,请删除!" Response.end else sv = Rs.GetString(,1,"$$","%%%","") end if Set Rs = Nothing value = Replace(sv,"%%%","") & "$$Aspoo" End if Channel_Setting = Split(value,"$$") End Sub '读取网站频道 Public Sub Load_Channel() Dim Rs,SQL SQL = "select ChannelID,ChannelName,ChannelDir,LinkUrl,ChannelType,OpenType,ReadMe from Cl_Channel where IsShow="&TrueType&" order by OrderID" Set Rs = Execute(SQL) value = Rs.GetString(,,"|||","$$$","") Set Rs = Nothing End Sub '=============== '频道导航输出li函数 mf+20051013+ '=============== Public Function ShowChannelMenu(sChannelID) if Not IsNumeric(sChannelID) then Exit Function else sChannelID=Cint(sChannelID) end if Name="Channel" If ObjIsEmpty() Then Load_Channel() dim sTemp,sTrRow,sTrCol,i,RowNum,sLink sTrRow=Split(replace(value,"{%webdir%}",WebDir),"$$$") RowNum=UBound(sTrRow)-1 if sChannelID=0 then sTemp = "
  • 首页
  • " else sTemp = "
  • 首页
  • " end if For i = 1 to RowNum sTrCol=Split(sTrRow(i),"|||") 'Response.write strrow(i) if Cint(sTrCol(4))>=2 then sLink=sTrCol(3) else sLink=Cl.WebDir & sTrCol(2) & "/Index.asp" end if if Cint(strcol(0))= sChannelID then sTemp = sTemp & "
  • " else sTemp = sTemp & "
  • " end if sTemp = sTemp & "" else sTemp = sTemp & ">" end if sTemp = sTemp & sTrCol(1)&"" sTemp = sTemp & "
  • " next ShowChannelMenu=replace(sTemp,"'",chr(34)) End Function '===添加结束 Public Function ShowChannel(sChannelID) Name="Channel" sChannelID=Clng(sChannelID) If ObjIsEmpty() Then Load_Channel() dim sTemp,sTrRow,sTrCol,i,RowNum,sLink sTrRow=Split(replace(value,"{%webdir%}",WebDir),"$$$") RowNum=UBound(sTrRow)-1 sTrCol=Split(sTrRow(0),"|||") sTemp="" 'if Cint(sTrCol(4))=2 or Cint(sTrCol(0))=0 then ' sLink=sTrCol(3) 'else sLink=Cl.WebDir & "Index.asp" 'end if if Cint(sTrCol(5))=1 then sTemp=sTemp & "" & sTrCol(1)& "" else sTemp=sTemp & " class=""ochannel"">" & sTrCol(1)& "" end if For i = 1 to RowNum sTrCol=Split(sTrRow(i),"|||") 'ChannelID=0,ChannelName=1,ChannelDir=2,LinkUrl=3,ChannelType=4,OpenType=5 sTemp=sTemp & Cl.mainhtml(15) if Cint(sTrCol(4))=2 then sLink=sTrCol(3) else sLink=Cl.WebDir & sTrCol(2) & "/Index.asp" end if if Cint(sTrCol(5))=1 then sTemp=sTemp & "" & sTrCol(1)& "" else sTemp=sTemp & " class=""ochannel"">" & sTrCol(1)& "" end if next ShowChannel=sTemp End Function Public Function GetChannelName(sChannelID) sChannelID = Clng(sChannelID) if sChannelID < 0 then GetChannelName = "所有频道" : Exit Function end if Name="Channel" If ObjIsEmpty() Then Load_Channel() dim sTrRow,sTrCol,i sTrRow=Split(value,"$$$") For i = 0 to UBound(sTrRow)-1 sTrCol=Split(sTrRow(i),"|||") if Cint(sTrCol(0))=sChannelID then GetChannelName = sTrCol(1) Exit For end if Next End Function Public Function NoChkSqlInFiles() NoChkSqlInFiles=False if UserTrueIP="127.0.0.1" or ServerName="localhost" or Page_Admin or InStr(ScriptName,"install.asp")>0 then NoChkSqlInFiles=True : Exit Function If Instr(Lcase(CacheData(14,0)),ScriptName)>0 then NoChkSqlInFiles=True End Function Public Sub ReloadSetup() Dim SQL,Rs SQL = "Select ID,Web_Info,Web_Setting,Web_StyleID,Web_CssID,Web_Version,Web_Pack,Badwords,rBadword,LockIP,Regword,UpLoad_Setting,Product_Setting,SqlInword,NoChkSqlInFiles,Web_Css from [Cl_Setup]" Set Rs = Execute(SQL) value = Rs.GetRows(1) Set Rs = Nothing End Sub '装载模板 Public Sub LoadTemplates(ModuleNames) Dim Style_Pic,Main_Style,TempStyle,sCssTemp TempStyle = Split(CacheData(15,0),"@@@") sCssTemp = Split(TempStyle(1),"|||") If CssID>=UBound(sCssTemp) Then CssID = 0 Web_CSS = sCssTemp(CssID) Web_PicUrl = Split(TempStyle(2),"|||")(CssID) Name = "StyleName" & StyleID If ObjIsEmpty() Then TemplatesToCache ("StyleName") StyleName=value Name = "Main_Style" & StyleID If ObjIsEmpty() Then TemplatesToCache ("Main_Style") Main_Style = Replace(value,"{%picurl%}",WebDir&Web_PicUrl) Main_Style = Replace(Main_Style,"{%webdir%}",WebDir) If ModuleNames<>"" Then Name="module_" & ModuleNames & StyleID If ObjIsEmpty() Then TemplatesToCache ("module_"&ModuleNames) Template.value = Replace(value,"{%webdir%}",WebDir) End If Main_Style = Split(Main_Style,"@@@") mainhtml = Split(Main_Style(0),"|||") lanstr = Split(Main_Style(1),"|||") mainpic = Split(Main_Style(2),"|||") mainsetting = Split(mainhtml(0),"||") Web_CSS = Replace(Web_CSS,"{%picurl%}",WebDir & Web_PicUrl) Web_CSS = replace(Web_CSS,"{%webdir%}",WebDir) 'Title = replace(lanstr(0),"创力网站管理系统官方站",Web_Info(0)) End Sub Public Sub TemplatesToCache(ModuleNames) Dim Rs,SQL SQL = "Select "&ModuleNames&" from [Cl_Style] where id = " & Clng(StyleID) Set Rs = Execute(SQL) If Not Rs.EOF Then value=Rs(0)&"" Else Call FixSetupsid() End If Set Rs = Nothing End Sub Private Sub FixSetupsid() Dim Rs,SQL SQL = "Select Top 1 ID from [Cl_Style] Order by ID" Set Rs = Execute(SQL) If Rs.EOF Then Response.Write "模板数据是空的,无任何可用风格,请添加后再运行网站。" Response.End Else if ChannelID="" or Not IsNumeric(ChannelID) then Execute("Update Cl_Setup Set Web_StyleID="&Rs(0)&",Web_CssID=0") else Execute("Update Cl_Channel Set StyleID="&Rs(0)&",CssID=0 where ChannelID="&ChannelID&"") end if End If Set rs=Nothing End Sub '读取模板列表 Public Sub ReloadTemplateslist() Dim Rs,SQL,tmpdata SQL = "Select ID,StyleName from Cl_Style" Set Rs = Execute(SQL) tmpdata = Rs.GetString(,,"|||","@@@","") tmpdata = Left(tmpdata,Len(tmpdata)-3) Set Rs = Nothing value=tmpdata End Sub Public Function Head() dim sTemp sTemp = mainhtml(1) if ChannelID>0 and ChannelID<>6 then sTemp = sTemp & vbNewLine & mainhtml(2) sTemp = Replace(sTemp,"{%webcss%}",""&VbNewline&"{%webcss%}") if Cl.Web_Info(15) = "1" or CreateHtmlIng=True then sTemp = Replace(sTemp,"{%webcss%}","") sTemp = Replace(sTemp,"{%showchannel%}",Cl.ShowChannel(ChannelID)) 'sTemp = Replace(sTemp,"{%showchannel%}","") else sTemp = Replace(sTemp,"{%webcss%}","") sTemp = Replace(sTemp,"{%showchannel%}",Cl.ShowChannel(ChannelID)) end if Head = sTemp End Function Public Function Bottom() dim sTemp,Powered Powered = lanstr(2) & ""&Web_Version(1)&"" if SysTemVersion>1 then sTemp=Replace(mainhtml(3),"{%powered%}","") else sTemp=Replace(mainhtml(3),"{%powered%}",Powered) end if if Web_Setting(44)="Yes" then sTemp = sTemp & VbNewLine & "" Bottom = sTemp End Function Public Function GetClassMenu(sChannelID) GetChannelSetting(sChannelID) Dim sTemp, TopNum, ModNum, SettingStr SettingStr = Split(Channel_Setting(25),",") TopNum = Clng(SettingStr(0)) ModNum = Clng(SettingStr(1)) If TopNum > 0 then TopNum = "Top "&TopNum&"" Else TopNum = "" End if If ModNum = 0 then ModNum=10 sTemp = "" & vbcrlf sTemp = sTemp & "" sTemp=Empty End Function Public Function GetChildMenu(ID,ShowType,sChannelID) dim SQL,Rs,k,sTemp if pNum=1 then sTemp = "stm_bp('p" & pNum & "',[1,4,0,0,2,3,6,7,100,'progid:DXImageTransform.Microsoft.Fade(overlap=.5,enabled=0,Duration=0.43)',-2,'',-2,67,2,3,'#999999','#ffffff','',3,1,1,'#aca899']);" & vbcrlf else if ShowType=0 then sTemp = "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,4,0,0,2,3,6]);" & vbcrlf else sTemp = "stm_bpx('p" & pNum & "','p" & pNum2 & "',[1,2,-2,-3,2,3,0]);" & vbcrlf end if end if SQL="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,Depth,NextID,Child,Readme,IsOuter,LinkUrl From Cl_Class where ChannelID="&Cint(sChannelID)&" and ParentID=" & ID & " and ShowOnTop="&TrueType&" order by OrderID asc" Set Rs = Execute(SQL) if Not (Rs.Bof and Rs.Eof) THen SQL = Rs.GetRows(-1) For k=0 to Ubound(SQL,2) if SQL(9,k)=1 then if SQL(7,k) > 0 then sTemp = sTemp & "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & SQL(1,k) & "','','',-1,-1,0,'" & SQL(10,k) & "','_blank','" & SQL(10,k) & "','" & SQL(8,k) & "','','',6,0,0,'"&WebDir&"images/arrow_r.gif','"&WebDir&"images/arrow_w.gif',7,7,0,0,1,'#ffffff',0,'#cccccc',0,'','',3,3,0,0,'#fffff7','#000000','#000000','#ffffff','9pt 宋体']);" & vbcrlf pNum=pNum+1 : pNum2=pNum2+1 sTemp = sTemp & GetChildMenu(SQL(0,k),1,sChannelID) else sTemp = sTemp & "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & SQL(1,k) & "','','',-1,-1,0,'" & SQL(10,k) & "','_blank','" & SQL(10,k) & "','" & SQL(8,k) & "','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',0,'','',3,3,0,0,'#fffff7','#ff0000','#000000','#cc0000','9pt 宋体']);" & vbcrlf end if else if SQL(7,k) > 0 then sTemp = sTemp & "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & SQL(1,k) & "','','',-1,-1,0,'" & WebDir & GetClassUrl(Channel_Setting(11),HtmlDir,Channel_Setting(4),SQL(2,k),SQL(0,k),SQL(4,k),SQL(3,k),Channel_Setting(10),Channel_Setting(13)) & "','_self','" & WebDir & GetClassUrl(Channel_Setting(11),HtmlDir,Channel_Setting(4),SQL(2,k),SQL(0,k),SQL(4,k),SQL(3,k),Channel_Setting(10),Channel_Setting(13)) & "','" & SQL(8,k) & "','','',6,0,0,'"&WebDir&"images/arrow_r.gif','"&WebDir&"images/arrow_w.gif',7,7,0,0,1,'#ffffff',0,'#cccccc',0,'','',3,3,0,0,'#fffff7','#000000','#000000','#ffffff','9pt 宋体']);" & vbcrlf pNum=pNum+1 : pNum2=pNum2+1 sTemp = sTemp & GetChildMenu(SQL(0,k),1,sChannelID) else sTemp = sTemp & "stm_aix('p"&pNum&"i"&k&"','p"&pNum2&"i0',[0,'" & SQL(1,k) & "','','',-1,-1,0,'" & WebDir & GetClassUrl(Channel_Setting(11),HtmlDir,Channel_Setting(4),SQL(2,k),SQL(0,k),SQL(4,k),SQL(3,k),Channel_Setting(10),Channel_Setting(13)) & "','_self','" & WebDir & GetClassUrl(Channel_Setting(11),HtmlDir,Channel_Setting(4),SQL(2,k),SQL(0,k),SQL(4,k),SQL(3,k),Channel_Setting(10),Channel_Setting(13)) & "','" & SQL(8,k) & "','','',0,0,0,'','',0,0,0,0,1,'#f1f2ee',1,'#cccccc',0,'','',3,3,0,0,'#fffff7','#ff0000','#000000','#cc0000','9pt 宋体']);" & vbcrlf end if end if Next SQL=Empty End if Rs.Close : Set Rs=Nothing GetChildMenu = sTemp & "stm_ep();" & vbcrlf sTemp=Empty End Function Public Function ShowUserLogin(Byval sType) dim sTemp,sTemp2 if sType="1" then sTemp2=Split(Cl.mainhtml(5),"||") else sTemp2=Array(mainhtml(4),mainhtml(6),mainhtml(7), _ mainhtml(8),mainhtml(9),mainhtml(13)) end if if UserID=0 Or UserLevel=5 then sTemp=Replace(sTemp2(0),"{%webname%}",Web_Info(0)) if Cl.Web_Setting(39)="Yes" then sTemp=Replace(sTemp,"{%getcode%}",Replace(sTemp2(5),"{%getcode%}",Cl.GetCode("GetCode"))) else sTemp=Replace(sTemp,"{%getcode%}","") end if Else if Cint(User_Info(21))=1 then sTemp=Replace(sTemp2(2),"{%webname%}",Web_Info(0)) else sTemp=Replace(sTemp2(1),"{%webname%}",Web_Info(0)) end if if Cint(User_Info(24))=1 then sTemp=Replace(sTemp,"{%userinfo%}",sTemp2(3)) if clng(User_Info(22))>10 then sTemp=Replace(sTemp,"{%color2%}",mainsetting(3)) else sTemp=Replace(sTemp,"{%color2%}",mainsetting(4)) end if else sTemp=Replace(sTemp,"{%userinfo%}",sTemp2(4)) if clng(User_Info(40))>10 then sTemp=Replace(sTemp,"{%color3%}",mainsetting(5)) else sTemp=Replace(sTemp,"{%color3%}",mainsetting(6)) end if end if if Cint(SendMsgNum)>0 and Web_Setting(36)="Yes" then sTemp=sTemp & vbNewLine & mainhtml(10) sTemp=Replace(sTemp,"{%inceptid(1)%}",SendMsgID) sTemp=Replace(sTemp,"{%inceptid(2)%}","") sTemp=Replace(sTemp,"{%newincept%}",""&SendMsgNum&"") else sTemp=Replace(sTemp,"{%newincept%}",""&SendMsgNum&"") end if sTemp=Replace(sTemp,"{%username%}",User_Info(5)) sTemp=Replace(sTemp,"{%userpoint%}",User_Info(22)) sTemp=Replace(sTemp,"{%usermoney%}",User_Info(23)) sTemp=Replace(sTemp,"{%moneyitemname%}",Cl.Web_Setting(26)) sTemp=Replace(sTemp,"{%moneyitemunit%}",Cl.Web_Setting(27)) sTemp=Replace(sTemp,"{%pointitemname%}",Cl.Web_Setting(28)) sTemp=Replace(sTemp,"{%pointitemunit%}",Cl.Web_Setting(29)) sTemp=Replace(sTemp,"{%userlevel%}",User_Info(31)) sTemp=Replace(sTemp,"{%uservalidday%}",User_Info(40)) sTemp=Replace(sTemp,"{%color1%}",mainsetting(2)) if clng(User_Info(23))>10 then sTemp=Replace(sTemp,"{%color4%}",mainsetting(7)) else sTemp=Replace(sTemp,"{%color4%}",mainsetting(8)) end if end if ShowUserLogin=sTemp sTemp=Empty : sTemp2=Empty End Function Public Function newincept(sName) 'if UserTableType="Dvbbs" then newincept=Cl.Execute_U("Select Count(id) From " & Db.MessageTable & " Where flag=0 and issend=1 and delR=0 And incept='"&sName&"'")(0) 'else ' newincept=Cl.Execute("Select Count(id) From " & Db.MessageTable & " Where flag=0 and issend=1 and delR=0 And incept='"&sName&"'")(0) 'end if if Isnull(newincept) or Not IsNumeric(newincept) then newincept=0 End function '更新用户短信通知信息(新短信条数||新短讯ID||发信人名) Public Sub Update_User_Msg(sName) Dim msginfo,sMewMsgN,UP_UserInfo sMewMsgN=newincept(sName) If sMewMsgN>0 Then msginfo=sMewMsgN & "||" & inceptid(1,sName) & "||" & inceptid(2,sName) Else msginfo="0||0||null" End If Cl.Execute_U("Update " & Db.UserTable & " Set " & Db.UserMsg & "='"&Cl.CheckStr(msginfo)&"' Where " & Db.UserName & "='"&Cl.CheckStr(sName)&"'") If Trim(sName)=Trim(Cl.User_Info(5)) Then UP_UserInfo=Session(CacheName & "UserID") UP_UserInfo(30)=msginfo Session(CacheName & "UserID")=UP_UserInfo Else Call NeedUpdateList(sName,1) End If End Sub Public Function inceptid(stype,iusername) Dim Rs Set Rs=Cl.Execute_U("Select top 1 id,sender From " & Db.MessageTable & " Where flag=0 And issend=1 And DelR=0 And incept='"& iusername &"'") If not rs.eof Then If stype=1 Then inceptid=Rs(0) Else inceptid=Rs(1) End If Else If stype=1 Then inceptid=0 Else inceptid="null" End If End If Rs.Close : Set Rs=Nothing End Function Public Function Execute(Command) If Not IsObject(Conn) Then OpenConn On Error Resume Next Set Execute = Conn.Execute(Command) If Err Then Conn.Close : Set Conn = Nothing Response.Write "执行查询代码时发现错误,请检查您的查询代码是否正确。" & Err.Description &"
    " & Command err.Clear Response.End End If SqlQueryNum=SqlQueryNum+1 End Function Public Function Execute_U(Command) If Not IsObject(Conn_U) Then OpenConn_U On Error Resume Next Set Execute_U = Conn_U.Execute(Command) If Err Then err.Clear Conn_U.Close : Set Conn_U = Nothing Response.Write "执行查询代码时发现错误,请检查您的查询代码是否正确。" & Err.Description &"
    " & Command Response.End End If SqlQueryNum=SqlQueryNum+1 End Function Public Function Execute_L(Command) If Not IsObject(Conn_L) Then OpenConn_L On Error Resume Next Set Execute_L = Conn_L.Execute(Command) If Err Then err.Clear Conn_L.Close : Set Conn_L = Nothing Response.Write "执行查询代码时发现错误,请检查您的查询代码是否正确。" & Err.Description &"
    " & Command Response.End End If SqlQueryNum=SqlQueryNum+1 End Function '记录错误事件 Public Sub SaveSQLLOG(sSqlType,sCommand) Dim StrType,sTemp,ErrNum ErrNum=Session("ErrNum") if Not IsNumeric(ErrNum) then ErrNum=1 else ErrNum=Clng(ErrNum)+1 end If Session("ErrNum")=ErrNum if ErrNum >= 3 then Dim IPstr IPstr=Cstr(UserTrueIP) If IPstr<>"" And Trim(CacheData(9,0))<>"" Then CacheData(9,0)=Replace(Trim(CacheData(9,0)),IPstr,"") CacheData(9,0)=Replace(CacheData(9,0),"||","|") IPstr=CacheData(9,0) & "|" & Replace(IPstr,"|","") End If if IPstr<>"" and ErrNum<5 then Execute("update Cl_Setup set LockIP='"&replace(IPstr,"'","''")&"'") Load_Setup end if Session("ErrNum")=5 Response.write "您执行了非法操作次数已经超过3次,IP已封!" Response.write "" Response.end end if Select Case Cint(sSqlType) Case 2 : StrType="SQL注入(POST)" Case 3 : StrType="SQL注入(GET)" Case 3 : StrType="SQL注入(Cookies)" Case Else : StrType="非法查询管理员表" End Select Execute_L("insert into [Cl_SqlLog] (ScriptName,S_Info,ip,Type) values ('"&Server.URLEnCode(Request.ServerVariables("PATH_INFO"))&"','"&Checkstr(Server.HTMLEnCode(Left(sCommand,250)))&"','"&UserTrueIP&"','"&StrType&"')") sTemp="您执行了非法操作,操作已被禁止并作了如下记录↓
    " sTemp=sTemp & "操作IP:"&UserTrueIP&"
    " sTemp=sTemp & "操作时间:"&Now&"
    " sTemp=sTemp & "操作页面:"&Request.ServerVariables("PATH_INFO")&"
    " sTemp=sTemp & "操作方式:"&StrType&"
    " sTemp=sTemp & "提交数据:"&sCommand Response.write sTemp Response.end End Sub '过滤非法的SQL字符 Public Function ReplaceBadChar(Byval strChar) strChar=replace(replace(strChar," ",""),"'","") strChar=replace(replace(strChar,".",""),"<","") strChar=replace(replace(strChar,")",""),"(","") strChar=replace(replace(strChar,"?",""),"*","") strChar=replace(replace(strChar,"/",""),"\","") ReplaceBadChar=replace(strChar,Chr(0),"") End Function Public Function ChkBadWords(Byval Str) If IsNull(Str) Then Exit Function Dim i For i = 0 To Ubound(BadWords) If i > UBound(rBadWord) Then Str = Replace(Str,BadWords(i),"*") Else Str = Replace(Str,BadWords(i),rBadWord(i)) End If Next ChkBadWords = Str End Function '求字符串长度。汉字算两个字符,英文算一个字符。 Public Function strLength(Byval str) If isNull(str) Or Str = "" Then StrLength = 0:Exit Function End If Dim WINNT_CHINESE WINNT_CHINESE=(len("例子")=2) If WINNT_CHINESE Then Dim l,t,c,i l=len(str):t=l For i=1 To l c=asc(mid(str,i,1)) If c<0 Then c=c+65536 If c>255 Then t=t+1 Next strLength=t Else strLength=len(str) End If End Function Public Function Checkstr(Byval Str) If Isnull(Str) Then CheckStr = "" Exit Function End If Str = Replace(Str,Chr(0),"") CheckStr = Replace(Str,"'","''") End Function '截字符串,汉字一个算两个字符,英文算一个字符(str)原字符串 (strlen)截取长度 Public Function GotTopic(Byval str,Byval strlen) dim l, t, c, i if str="" then gotTopic="" : Exit function str = replace(replace(str," "," "),""",chr(34)) str = replace(replace(str,">",">"),"<","<") l = len(str) : t = 0 strlen = Clng(strlen) for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t >= strlen then 'if Abs(Asc(right(str,1)))>255 then gotTopic=left(str,i) & "..." exit for else gotTopic=str end if next End Function Public Function FormatNum(Byval num,Byval n) If Not IsNumeric(num) or num="" Then num=0 If num<1 and num>0 Then FormatNum = Cdbl("0" & FormatNumber(num,n)) Else FormatNum = Cdbl(FormatNumber(num,n)) End If End Function '时间格式处理 Public Function Format_Time(Byval Tvar,Byval sType) dim Tt,sYear,sMonth,sDay,sHour,sMinute,sSecond If Not IsDate(Tvar) or sType=0 Then Format_Time = "" : Exit Function Tt = Tvar sYear = Year(Tt) sMonth = Right("0" & Month(Tt),2) sDay = Right("0" & Day(Tt),2) sHour = Right("0" & Hour(Tt),2) sMinute = Right("0" & Minute(Tt),2) sSecond = Right("0" & Second(Tt),2) Select Case sType Case 1 '2005-10-01 23:45:45 Format_Time = sYear & "-" & sMonth & "-" & sDay & " " & sHour & ":" & sMinute & ":" & sSecond Case 2 '年-月-日 时:分:秒 Format_Time = sYear & "年" & sMonth & "月" & sDay & "日 " & sHour & "时" & sMinute & "分" & sSecond & "秒" Case 3 '2005-10-01 Format_Time = sYear & "-" & sMonth & "-" & sDay Case 4 '2005\10\01 Format_Time = sYear & "\" & sMonth & "\" & sDay Case 5 '10-01 23:45 Format_Time = sMonth & "-" & sDay & " " & sHour & ":" & sMinute Case 6 '2005年10月01日 Format_Time = sYear & "年" & sMonth & "月" & sDay & "日" Case 7 '10-01 Format_Time = sMonth & "-" & sDay Case 8 '20051001234545 Format_Time = sYear & sMonth & sDay & sHour & sMinute & sSecond Case Else Format_Time = Tt End Select End Function Public Function GetTitleFont(Byval sValue,Byval sType) Select Case ChkClng(sType) Case 0 : GetTitleFont = sValue Case 1 : GetTitleFont = "" & sValue & "" Case 2 : GetTitleFont = "" & sValue & "" Case 3 : GetTitleFont = "" & sValue & "" Case 4 : GetTitleFont = "" & sValue & "" Case 5 : GetTitleFont = "" & sValue & "" Case 6 : GetTitleFont = "" & sValue & "" Case 7 : GetTitleFont = "" & sValue & "" Case Else : GetTitleFont = sValue End Select End Function Public Function FormatColor(Byval sValue,Byval sColor) sColor=Trim(sColor) if Isnull(sColor) or sColor="" then FormatColor=sValue : Exit Function FormatColor = "" & sValue & "" End Function '写入客人session Public Sub LetGuestSession() Dim statID,GuestSID GuestSID = checkStr(Trim(Request.Cookies(Web_Cookies)("GuestSID"))) If Not IsNumeric(GuestSID) or GuestSID = "" Then statID = Split(UserTrueIP,".") GuestSID = "" for i=0 to Ubound(statID) GuestSID=GuestSID&right("00"&statID(i),3) next randomize GuestSID=GuestSID&int(600*rnd+369) If Not IsNumeric(GuestSID) Then GuestSID = int(10089657999*rnd+25789657939) 'GuestSID = Ccur(GuestSID) & int(600*rnd+369) '随机验证码 End If GuestSID = Ccur(GuestSID) Response.Cookies(Web_Cookies).Expires=DateAdd("s",3600,Now()) Response.Cookies(Web_Cookies)("GuestSID") = GuestSID '客人=SessionID+活动时间+IP GuestSID = GuestSID & "_" & Now & "_" & Now & "_" & ScriptName User_Info=Split(GuestSID,"_") Session(CacheName & "UserID") = User_Info End Sub '检查用户是否登录 Public Function ChkUserLogin() Dim NeedToUpdate,ToUpdate,sUserMsg ChkUserLogin=False if UserID=0 Or UserLevel=5 or MemberName="" or MemberWord="" then UserLevel=5 : UserID=0 If Not IsArray(Session(CacheName & "UserID")) Then Call LetGuestSession() Exit Function end if ToUpdate=False Name="NeedToUpdate" If Not ObjIsEmpty() Then NeedToUpdate=","&Value&"," If InStr(NeedToUpdate,","&MemberName&",")>0 Then Call NeedUpdateList(MemberName,0) ToUpdate=True End If End If If Not IsArray(Session(CacheName & "UserID")) or Toupdate Then GetCacheUserInfo if Ubound(User_Info)<39 then Exit Function else User_Info = Session(CacheName & "UserID") if Ubound(User_Info)<39 then GetCacheUserInfo if Ubound(User_Info)<39 then Exit Function end if end if UserID = Clng(User_Info(4)) MemberName = Trim(User_Info(5)) UserLevel = Clng(User_Info(21)) User_IM = Split(User_Info(13),"|||") sUserMsg = Split(User_Info(30),"||") User_Purview= Split(User_Info(34),",") If Ubound(sUserMsg)=2 Then SendMsgNum = sUserMsg(0) SendMsgID = sUserMsg(1) SendMsgUser = sUserMsg(2) End If ChkUserLogin=True End Function Public Sub GetCacheUserInfo() dim RsLogin,SqlLogin,RsGroup,sUserInfo,sValidDays,i SqlLogin="Select " & Db.UserID & "," & Db.UserName & "," & Db.UserPassWord & ","&Db.UserReName&"," & Db.UserEmail & "," & Db.UserSex & "," & Db.UserFace & "," & Db.UserFaceWidth & "," & Db.UserFaceHeight & "," & Db.UserIM & "," & Db.UserJoinDate & "," & Db.UserLastLogin & "," & Db.UserLogins & "," & Db.UserQuestion & "," & Db.UserAnswer & "," & Db.UserLastIP & "," & Db.UserDataNum & "," & Db.UserLevel & "," & Db.UserPoint & "," & Db.UserMoney & "," & Db.ChargeType & "," & Db.BeginDate & "," & Db.ValidNum & "," & Db.UserTPassWord & "," & Db.WaitReceive & "," & Db.Received & "," & Db.UserMsg & "," & Db.UserLock & " From " & Db.UserTable & " where " & Db.UserID & "=" & UserID Set RsLogin=Execute_U(sqlLogin) if RsLogin.bof and RsLogin.eof then UserLevel=5 : UserID=0 : EmptyCookies : LetGuestSession RsLogin.Close : Set RsLogin = Nothing : Exit Sub else if UserLevel<>rsLogin(17) or RsLogin(27)<>0 or MemberName<>rsLogin(1) or MemberWord<>rsLogin(2) then UserLevel=5 : UserID=0 : EmptyCookies : LetGuestSession RsLogin.Close : Set RsLogin = Nothing : Exit Sub end if Set RsGroup=Cl.Execute("Select GroupName,GroupImg,LoginPoint,Purview,Purview_Other,arrClassView,arrClassInput,arrClassCheck,arrClassMaster From Cl_UserGroup Where ID="&UserLevel&"") if RsGroup.Bof and RsGroup.Eof then UserLevel=5 : UserID=0 : EmptyCookies : LetGuestSession RsLogin.Close : Set RsLogin = Nothing RsGroup.Close : Set RsGroup = Nothing : Exit Sub End if sValidDays = rsLogin(22)-DateDiff("D",RsLogin(21),now()) if sValidDays<0 then sValidDays=0 sUserInfo = "ClCMS@@@"& Now & "@@@" & Now & "@@@" & ScriptName For i=0 to 26 sUserInfo = sUserInfo & "@@@" & RsLogin(i) Next For i=0 to 8 sUserInfo = sUserInfo & "@@@" & RsGroup(i) Next sUserInfo = sUserInfo & "@@@" & sValidDays & "@@@ClCMS" User_Info = Split(sUserInfo,"@@@") Session(CacheName & "UserID") = User_Info RsGroup.Close : Set RsGroup = Nothing End if RsLogin.Close : Set RsLogin = Nothing End Sub '检查管理员是否登录 Public Function ChkAdminLogin() ChkAdminLogin=False if Not ChkUserLogin then Exit Function Admin_Info = Session(CacheName & "AdminInfo") if Not IsArray(Admin_Info) then Dim AdminName,AdminPass,AddUser,rsGetAdmin AdminName = Trim(Checkstr(session("AdminName"))) AdminPass = Trim(Checkstr(session("AdminPass"))) AddUser = Trim(User_Info(5)) if AdminName="" or AdminPass="" or AddUser="" then Exit Function '0(ID),1(用户),2(密码),3(权限),4(前台用户) Set rsGetAdmin=Execute("select ID,UserName,Password,Purview,Purview_Other,arrClassMaster,arrClassCheck,arrClassInput,AddUser from Cl_Admin where UserName='" & AdminName & "' And AddUser='"&AddUser&"'") if rsGetAdmin.bof and rsGetAdmin.eof then Set rsGetAdmin=Nothing : Exit Function ElseIf rsGetAdmin(2) <> AdminPass then Set rsGetAdmin=Nothing : Exit Function End if Admin_Info = Split(rsGetAdmin.GetString(,1, "@@","",""),"@@") Set rsGetAdmin = Nothing Session(CacheName & "AdminInfo") = Admin_Info ElseIF Ubound(Admin_Info)<8 then Session(CacheName & "AdminInfo") = Empty ChkAdminLogin = False : Exit Function End if Admin_Purview = Split(Admin_Info(3),",") ChkAdminLogin = True End Function Public Function ChkSchoolUser() Dim rs_IP, sqlIP Dim sPurview, sarrClassID, sBeginDate, sUseDayNum, sIsClose, sIsLogin Dim C_sValidDays ChkSchoolUser=0 set rs_IP = Cl.Execute("select SchoolIP,SchoolName,Purview,arrClassID,BeginDate,UseDayNum,IsClose,IsLogin from [Cl_SchoolIP] Where SchoolIP='"&Cl.UserTrueIP&"'") if rs_IP.Bof and rs_IP.Eof then rs_IP.close:set rs_IP=nothing : Exit Function end if sPurview = rs_IP(2) : sarrClassID = rs_IP(3) sBeginDate = rs_IP(4) : sUseDayNum = rs_IP(5) sIsClose = rs_IP(6) : sIsLogin = rs_IP(7) rs_IP.close : set rs_IP=nothing if sIsClose=True then Exit Function if sIsLogin=True and Not Cl.ChkUserLogin then Exit Function C_sValidDays=Clng(sUseDayNum - datediff("d",sBeginDate,now)) if C_sValidDays <= 0 then Cl.Execute("Update Cl_SchoolIP Set IsClose="&TrueType&" Where SchoolIP='"&Cl.UserTrueIP&"'") Exit Function end if if sPurview=1 then ChkSchoolUser=True else Dim Prs,sPPath,n Set Prs=Cl.Execute("Select ParentPath From Cl_Class Where ClassID=" & Clng(sClassID)) If Not (Prs.Bof And Prs.Eof) then sPPath=Split(Prs(0) & "," & sClassID,",") For n=1 to Ubound(sPPath) If Instr(","&sarrClassID&",",","&sPPath(n)&",")>0 then IsSchoolUser=True Exit For End if if n>=20 then Exit For '防止进入死循环 Next End if Set Prs=Nothing end if End Function Public Function IsTrueSchoolUser(Byval sClassID) Dim rs_IP, sqlIP Dim sPurview, sarrClassID, sBeginDate, sUseDayNum, sIsClose, sIsLogin Dim C_sValidDays IsSchoolUser=False set rs_IP = Cl.Execute("select SchoolIP,SchoolName,Purview,arrClassID,BeginDate,UseDayNum,IsClose,IsLogin from [Cl_SchoolIP] Where SchoolIP='"&Cl.UserTrueIP&"'") if rs_IP.Bof and rs_IP.Eof then rs_IP.close:set rs_IP=nothing : Exit Function end if sPurview = rs_IP(2) : sarrClassID = rs_IP(3) sBeginDate = rs_IP(4) : sUseDayNum = rs_IP(5) sIsClose = rs_IP(6) : sIsLogin = rs_IP(7) rs_IP.close : set rs_IP=nothing if sIsClose=True then Exit Function if sIsLogin=True and Not Cl.ChkUserLogin then Exit Function C_sValidDays=Clng(sUseDayNum - datediff("d",sBeginDate,now)) if C_sValidDays <= 0 then Cl.Execute("Update Cl_SchoolIP Set IsClose="&TrueType&" Where SchoolIP='"&Cl.UserTrueIP&"'") Exit Function end if if sPurview=1 then IsSchoolUser=True else Dim Prs,sPPath,n Set Prs=Cl.Execute("Select ParentPath From Cl_Class Where ClassID=" & Clng(sClassID)) If Not (Prs.Bof And Prs.Eof) then sPPath=Split(Prs(0) & "," & sClassID,",") For n=1 to Ubound(sPPath) If Instr(","&sarrClassID&",",","&sPPath(n)&",")>0 then IsSchoolUser=True Exit For End if if n>=20 then Exit For '防止进入死循环 Next End if Set Prs=Nothing end if End Function Public Function GetCookies(sName) GetCookies=Trim(Request.Cookies(Web_Cookies)(sName)) End Function Public Sub SetCookies(sName,sValue) Response.Cookies(Web_Cookies)(sName)=Trim(sValue) End Sub Public Sub EmptyCookies() Response.Cookies(Web_Cookies)("UserID") = Empty Response.Cookies(Web_Cookies)("UserName") = Empty Response.Cookies(Web_Cookies)("Password") = Empty Response.Cookies(Web_Cookies)("UserLevel") = Empty Response.Cookies(Web_Cookies)("TruePassWord") = Empty Response.Cookies(Web_Cookies & "Kill")("kill") = Empty Response.Cookies(Web_Cookies) = Empty Session(CacheName & "UserID") = Empty End Sub '更新验证码 Public Sub SetTruePassWord(UserIDStr) if isnull(UserIDStr) or not isnumeric(UserIDStr) then Exit Sub Dim NewTruePassWord NewTruePassWord=Createpass(16) Response.Cookies(Web_Cookies)("TruePassWord")=NewTruePassWord if Checkstr(Trim(Request.Cookies(Web_Cookies)("TruePassWord")))=NewTruePassWord then Execute_U("Update "&Db.UserTable&" Set " & Db.UserTPassWord & "='"&NewTruePassWord&"' where UserID="&Clng(UserIDStr)) User_Info = Session(CacheName & "UserID") User_Info(27)=NewTruePassWord Session(CacheName & "UserID")=User_Info end if End Sub '更新用户资料 Public Sub NewUserInfo(Number,strData) if not isnumeric(Number) then Exit Sub Dim str_Info str_Info=Session(CacheName & "UserID") If Not IsArray(str_Info) Then Exit Sub if Ubound(str_Info)<28 then Exit Sub str_Info(Cint(Number))=Trim(strData) Session(CacheName & "UserID")=str_Info End Sub Public Sub NeedUpdateList(username,act) Dim Tmpstr,TmpUsername Name="NeedToUpdate" If ObjIsEmpty() Then Value="" Tmpstr=Value TmpUsername=","&username&"," Tmpstr=Replace(Tmpstr,TmpUsername,",") Tmpstr=Replace(Tmpstr,",,",",") IF act=1 Then 'If IsONline(username,0) Then If Tmpstr="" Then Tmpstr=TmpUsername Else Tmpstr=Tmpstr&TmpUsername End If 'End If End If Tmpstr=Replace(Tmpstr,",,",",") Value=Tmpstr End Sub '系统分配随机密码 Public Function Createpass(Byval LengthNum) Dim Ran,i if Not IsNumeric(LengthNum) then LengthNum=16 Createpass="" For i=1 To LengthNum Randomize Ran = CInt(Rnd * 2) Randomize Select Case Ran Case 0 Ran = CInt(Rnd * 25) + 97 Createpass =Createpass& UCase(Chr(Ran)) Case 1 Ran = CInt(Rnd * 9) Createpass = Createpass & Ran Case 2 Ran = CInt(Rnd * 25) + 97 Createpass =Createpass& Chr(Ran) End Select Next End Function Public Function GetUserSex(strSex) 'if UserTableType = "Bbsxp" then ' if strSex="male" then ' GetUserSex="男" ' else ' GetUserSex="女" ' end if 'else Select Case ChkClng(strSex) Case 0 : GetUserSex="女" Case 1 : GetUserSex="男" Case Else : GetUserSex="保密" End Select 'end if End Function Public Function GetPaymentName(Byval str) Select Case ChkClng(str) Case 0 : GetPaymentName="账户支付" Case 1 : GetPaymentName="在线支付" Case 2 : GetPaymentName="银行汇款" Case 3 : GetPaymentName="邮政汇款" Case Else : GetPaymentName="其它支付" End Select End Function '检查用户权限 Public Function ChkUserLevel(Byval sPurview,Byval sLevel) ChkUserLevel=False if Instr(","&sPurview&",",",5,")>0 then ChkUserLevel=True : Exit Function end if if Instr(","&sPurview&",",","&sLevel&",")>0 then ChkUserLevel=True End Function '====================================================== 'sPurview-----1(Master),2(Check),3(Input) '====================================================== Public Function TrueChannelPurview(Byval sPurview,Byval sChannelID) TrueChannelPurview = True If Cint(Cl.Admin_Purview(0)) = 1 Then Exit Function If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) then TrueChannelPurview = False : Exit Function end if If Ubound(Cl.Admin_Purview) < sChannelID Then TrueChannelPurview = False : Exit Function Else if Cint(Cl.Admin_Purview(sChannelID)) <= sPurview Then Exit Function End if TrueChannelPurview = False End Function Public Function TrueClassPurview(Byval sPurview,Byval sChannelID,Byval sClassID) TrueClassPurview = True If Cint(Cl.Admin_Purview(0)) = 1 Then Exit Function If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) or Not IsNumeric(sClassID) then TrueClassPurview = False : Exit Function end if If Ubound(Cl.Admin_Purview) < sChannelID Then TrueClassPurview = False : Exit Function Else if Cint(Cl.Admin_Purview(sChannelID)) < 3 Then Exit Function if Cint(Cl.Admin_Purview(sChannelID)) >= 4 Then TrueClassPurview = False : Exit Function End if if Instr(","&Cl.Admin_Info(5)&",",","&sClassID&",")>0 Then Exit Function ElseIf sPurview <= 1 Then TrueClassPurview = False : Exit Function End If If Instr(","&Cl.Admin_Info(6)&",",","&sClassID&",")>0 Then Exit Function ElseIf sPurview <= 2 Then TrueClassPurview = False : Exit Function End If If Instr(","&Cl.Admin_Info(7)&",",","&sClassID&",")>0 Then Exit Function End IF TrueClassPurview = False End Function Public Function TrueOtherPurview(Byval sPurview) TrueOtherPurview = True If Cint(Cl.Admin_Purview(0)) = 1 Then Exit Function if Instr("," & Lcase(Cl.Admin_Info(4)) & ",","," & Lcase(sPurview) & ",")>0 then Exit Function TrueOtherPurview = False End Function '====================================================== 'User:sPurview-----1(Master),2(Check),3(Input),4(View) '====================================================== Public Function TrueChannelPurview_U(Byval sPurview,Byval sChannelID) TrueChannelPurview_U = True if UserID=0 or UserLevel=5 then TrueChannelPurview_U = False : Exit Function If Cint(Cl.User_Purview(0)) = 1 Then Exit Function If Cint(Cl.User_Purview(0)) > 2 Then TrueChannelPurview_U = False : Exit Function If Ubound(Cl.User_Purview) < sChannelID Then TrueChannelPurview_U = False : Exit Function if Cint(Cl.User_Purview(sChannelID)) <= sPurview Then Exit Function TrueChannelPurview_U = False End Function Public Function TrueClassPurview_U(Byval sPurview,Byval sChannelID,Byval sClassID) TrueClassPurview_U = True if UserID=0 or UserLevel=5 then TrueClassPurview_U = False : Exit Function If Cint(Cl.User_Purview(0)) = 1 Then Exit Function If Cint(Cl.User_Purview(0)) > 2 Then TrueClassPurview_U = False : Exit Function If Not IsNumeric(sPurview) or Not IsNumeric(sChannelID) or Not IsNumeric(sClassID) then TrueClassPurview_U = False : Exit Function end if If Ubound(Cl.User_Purview) < sChannelID Then TrueClassPurview_U = False : Exit Function Select Case Cint(Cl.User_Purview(sChannelID)) Case 1 Exit Function Case 2 If sPurview >= 2 Then Exit Function Case 3 If Instr(","&Cl.User_Info(39)&",",","&sClassID&",")>0 Then TrueClassPurview_U = True : Exit Function ElseIf sPurview <= 1 Then TrueClassPurview_U = False : Exit Function End If If Instr(","&Cl.User_Info(38)&",",","&sClassID&",")>0 Then Exit Function ElseIf sPurview <= 2 Then TrueClassPurview_U = False : Exit Function End If If Instr(","&Cl.User_Info(37)&",",","&sClassID&",")>0 Then Exit Function ElseIf sPurview <= 3 Then TrueClassPurview_U = False : Exit Function End If If Instr(","&Cl.User_Info(36)&",",","&sClassID&",")>0 Then Exit Function End IF Case 4, 5 If sPurview >= 3 Then Exit Function Case 6 If sPurview >= 4 Then Exit Function End Select TrueClassPurview_U = False End Function Public Function TrueOtherPurview_U(Byval sPurview) TrueOtherPurview_U = True if UserID=0 or UserLevel=5 then TrueOtherPurview_U = False : Exit Function If Cint(Cl.User_Purview(0)) = 1 Then Exit Function if Instr("," & Lcase(Cl.User_Info(35)) & ",","," & Lcase(sPurview) & ",")>0 then Exit Function TrueOtherPurview_U = False End Function Public Function TrueBrowsePurview() TrueBrowsePurview=False Select Case BrowsePurview Case 0 : TrueBrowsePurview=True Case 1 if TrueChannelPurview_U(1,ChannelID) then TrueBrowsePurview=True else Dim sTr,i sTr=Split(ParentPath & "," & ClassID,",") for i=1 to Ubound(sTr) TrueBrowsePurview=TrueClassPurview_U(4,ChannelID,sTr(i)) if TrueBrowsePurview=True then Exit For Next end if Case 2 if Instr("|"&VipUser&"|","|"&MemberName&"|")>0 or UserLevel=1 then TrueBrowsePurview=True end if End Select End Function '取得用户级别 Public Function GetUserGroupName(Byval sLevel) Name="UserGroup" if ObjIsEmpty then LoadUserGroup Dim sGroup,sRow,sGL,n sGroup=Split(Value,"@@") If IsNull(sLevel) or sLevel="" then Exit Function if Instr(sLevel,",")>0 then Dim sL sLevel=Split(sLevel,","):sGL="," for sL=0 to Ubound(sLevel) for n=0 to Ubound(sGroup)-1 sRow=Split(sGroup(n),"||") if ChkClng(sRow(0))=ChkClng(sLevel(sL)) then sGL=sGL & "," & sRow(1) : Exit For end if Next Next sGL=Replace(sGL,",,","") else for n=0 to Ubound(sGroup)-1 sRow=Split(sGroup(n),"||") if ChkClng(sRow(0))=ChkClng(sLevel) then sGL=sRow(1):Exit For end if Next end if GetUserGroupName=sGL End Function Public Function UserGroup_Option(Byval sLevel) Name="UserGroup" if ObjIsEmpty then LoadUserGroup Dim sGroup,sRow,n,sTemp sGroup=Split(Value,"@@"):sTemp="" for n=0 to Ubound(sGroup)-1 sRow=Split(sGroup(n),"||") if Instr(","&sLevel&",",","&sRow(0)&",")>0 then sTemp=sTemp & "" else sTemp=sTemp & "" end if Next UserGroup_Option=sTemp End Function '缓存用户级别 Public Sub LoadUserGroup() Dim rs Set rs=Execute("Select ID,GroupName,GroupImg,Purview,Purview_Other,arrClassView,arrClassInput,arrClassCheck,arrClassMaster from Cl_UserGroup Order by ID") if rs.bof and rs.eof then Value="" else Value=rs.GetString(,,"||","@@","") end if End Sub Public Function GetClassUrl(Byval sPathType, Byval sHtmlDir, Byval sChannelDir, Byval sParentPath, _ Byval sClassID, Byval sParentDir, Byval sClassDir, Byval sIsCreate, Byval sCreateFileExt) if Clng(sIsCreate)=1 and CBool(Channel_Setting(14)) then GetClassUrl=GetItemPath(sPathType, sHtmlDir, sChannelDir, sParentPath, sClassID, sParentDir, sClassDir) & sClassID &"_Index." & sCreateFileExt else GetClassUrl=sChannelDir &"/ShowClass.asp?ClassID="&sClassID end if End Function Public Function GetItemPath(Byval sPathType, Byval sHtmlDir, Byval sChannelDir, _ Byval sParentPath, Byval sClassID, Byval sParentDir, Byval sClassDir) Select Case Clng(sPathType) Case 0 'HtmlDir/频道/大类/小类/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & sParentDir & sClassDir & "/" Case 1 'HtmlDir/频道/大类(ClassID)/小类(ClassID)/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & GetClassIDPath(sParentPath, sClassID) & "/" Case 2 'HtmlDir/频道/栏目(英文)/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & sClassDir & "/" Case 3 'HtmlDir/频道/栏目(ClassID)/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & "Class" & sClassID&"/" Case 4 'HtmlDir/频道/文件 GetItemPath = sHtmlDir & sChannelDir & "/" Case 5 'HtmlDir/频道/年月/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & Year(Now()) & Right("0" & Month(Now()),2) & "/" Case 6 'HtmlDir/频道/年/月/文件 GetItemPath = sHtmlDir & sChannelDir & "/" & Year(Now()) & "/" & Right("0" & Month(Now()),2) & "/" Case 7 '频道/Html目录/大类(英文目录)/小类(英文目录)/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & sParentDir & sClassDir & "/" Case 8 '频道/Html目录/大类(ClassID)/小类(ClassID)/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & GetClassIDPath(sParentPath, sClassID) & "/" Case 9 '频道/大类(英文目录)/小类(英文目录)/文件 GetItemPath = sChannelDir & "/" & sParentDir & sClassDir & "/" Case 10 '频道/大类(ClassID)/小类(ClassID)/文件 GetItemPath = sChannelDir & "/" & GetClassIDPath(sParentPath, sClassID) & "/" Case 11 '频道/Html目录/栏目(英文目录)/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & "/" & sClassDir & "/" Case 12 '频道/Html目录/栏目(ClassID)/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & "/" & "Class" & sClassID & "/" Case 13 '频道/栏目(英文目录)/文件 GetItemPath = sChannelDir & "/" & sClassDir & "/" Case 14 '频道/栏目(ClassID)/文件 GetItemPath = sChannelDir & "/" & "Class" & sClassID&"/" Case 15 '频道/Html目录/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & "/" Case 16 '频道/Html目录/年月/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & "/" & Year(Now()) & Right("0" & Month(Now()),2) & "/" Case 17 '频道/Html目录/年/月/文件 GetItemPath = sChannelDir & "/" & sHtmlDir & "/" & Year(Now()) & "/" & Right("0" & Month(Now()),2) & "/" Case Else GetItemPath = sHtmlDir & sChannelDir & "/" & sParentDir & sClassDir & "/" End Select GetItemPath = Replace(GetItemPath, "//", "/") if Not CheckFolder(Webdir&GetItemPath,False) then dim objFSO,sPath,tPath,i Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) tPath = Split(GetItemPath,"/") sPath = WebDir For i=0 to Ubound(tPath)-1 If objFSO.FolderExists(Server.MapPath(sPath & tPath(i)))=False Then objFSO.CreateFolder Server.MapPath(sPath & tPath(i)) End If sPath = sPath & tPath(i) & "/" Next Set objFSO = Nothing end if End Function Public Function GetItemFileName(ByVal sType, ByVal sClassID, ByVal sInfoID, ByVal sInfoTime) Select Case Clng(sType) Case 0 'ID + 时间(20051001234545) GetItemFileName = sInfoID & Format_Time(sInfoTime,8) Case 1 'ID GetItemFileName = sInfoID Case 2 'ID + 时间(20051001234545) GetItemFileName = Format_Time(sInfoTime,8) Case 3 '栏目ID + _ + ID + 时间(20051001234545) GetItemFileName = sClassID & "_" & sInfoID & Format_Time(sInfoTime,8) Case 4 '栏目ID + _ + ID GetItemFileName = sClassID & "_" & sInfoID Case 5 '栏目ID + _ + 时间(20051001234545) GetItemFileName = sClassID & "_" & Format_Time(sInfoTime,8) Case Else 'ID GetItemFileName = sInfoID End Select End Function Public Function GetItemIndexPath(ByVal sPathType, ByVal sHtmlDir, ByVal sChannelDir) Select Case Clng(sPathType) Case 0, 1, 2, 3, 4, 5, 6 'HtmlDir/频道/ GetItemIndexPath = sHtmlDir & sChannelDir & "/" Case 7, 8, 11, 12, 15, 16, 17 '频道/Html目录/ GetItemIndexPath = sChannelDir & "/" & sHtmlDir & "/" Case 9, 10, 13, 14 '频道/ GetItemIndexPath = sChannelDir & "/" Case Else GetItemIndexPath = sHtmlDir & sChannelDir & "/" End Select GetItemIndexPath = Replace(GetItemIndexPath, "//", "/") if Not CheckFolder(Webdir&GetItemIndexPath&"Special/",False) then dim objFSO,sPath,tPath,i Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) tPath = Split(GetItemIndexPath,"/") sPath = WebDir For i=0 to Ubound(tPath)-1 If objFSO.FolderExists(Server.MapPath(sPath & tPath(i)))=False Then objFSO.CreateFolder Server.MapPath(sPath & tPath(i)) End If sPath = sPath & tPath(i) & "/" Next objFSO.CreateFolder Server.MapPath(sPath&"Special/") objFSO.CreateFolder Server.MapPath(sPath&"Update/") objFSO.CreateFolder Server.MapPath(sPath&"Elite/") objFSO.CreateFolder Server.MapPath(sPath&"Hot/") Set objFSO = Nothing end if End Function Public Sub CreateFolder(Byval sFolder) On Error Resume Next Dim objFSO err=0 sFolder=Server.MapPath(sFolder) Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) If Not objFSO.FolderExists(sFolder) Then objFSO.CreateFolder sFolder End If Set objFSO = Nothing err=0 End Sub Public Sub DelFolder(Byval sFolder) On Error Resume Next Dim objFSO err=0 sFolder=Server.MapPath(sFolder) Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) If objFSO.FolderExists(sFolder) Then objFSO.DeleteFolder sFolder,True End If Set objFSO = Nothing err=0 End Sub Public Function MoveFolder(Byval oFolder,Byval nFolder) On Error Resume Next Dim objFSO err=0 MoveFolder=False oFolder=Server.MapPath(oFolder) nFolder=Server.MapPath(nFolder) Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) If objFSO.FolderExists(nFolder) Then MoveFolder=False Else objFSO.MoveFolder oFolder,nFolder MoveFolder=True End If Set objFSO = Nothing err=0 End Function '检查目录是否存在!(sFolderPath,sIsCreate 不存在是否创建) Public Function CheckFolder(byval sFolder,byval sIsCreate) On Error Resume Next Dim objFSO CheckFolder=False:err=0 sFolder=Server.MapPath(sFolder) Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) If objFSO.FolderExists(sFolder) Then CheckFolder=True ElseIf sIsCreate=True then objFSO.CreateFolder sFolder if err=0 then CheckFolder=True End If Set objFSO = Nothing err=0 End Function '按月份自动分类(By梅傲风) Public Function CreatePath(Byval sTopPath,Byval sSort) Dim objFSO,sPath,tPath,i if Not IsNumeric(sSort) then sSort=0 sTopPath=Replace(sTopPath&"/","//","/") Select Case sSort Case 1 : sPath = year(now) '以年分类,格式:2005 Case 2 : sPath = year(now)&"-"&month(now) '以年-月分类,格式:2005-9 Case 3 : sPath = year(now)&"/"&month(now) '以年/月分类,格式:2005/9 Case 4 : sPath = year(now)&"-"&month(now)&"-"&day(now) '以年-月-日分类,格式:2005-9-28 Case 5 : sPath = year(now)&"-"&month(now)&"/"&day(now) '以年-月/日分类,格式:2005-9/28 Case 6 : sPath = year(now)&"/"&month(now)&"/"&day(now) '以年/月/日分类,格式:2005/9/28 Case Else : sPath = year(now) End Select On Error Resume Next Err.Number = 0 Set objFSO = Server.CreateObject(Trim(Cl.Web_Info(13))) If objFSO.FolderExists(Server.MapPath(sTopPath))=False Then objFSO.CreateFolder Server.MapPath(sTopPath) End If If Err.Number = 0 Then tPath = Split(sPath,"/") For i=0 to Ubound(tPath) If objFSO.FolderExists(Server.MapPath(sTopPath & tPath(i)))=False Then objFSO.CreateFolder Server.MapPath(sTopPath & tPath(i)) End If sTopPath = sTopPath & tPath(i) & "/" Next Else Err.Clear End If Set objFSO = Nothing CreatePath = sTopPath End Function '取得文件路径 Public Function GetClassIDPath(sParentPath, sClassID) Dim P,tPath GetClassIDPath="":tPath=sParentPath if Instr(tPath,",")>0 or Instr(tPath,"|")>0 then tPath=Split(Replace(tPath,"|",","),",") for p=1 to Ubound(tPath) GetClassIDPath=GetClassIDPath & "Class" & tPath(p)&"/" next end if GetClassIDPath=GetClassIDPath & "Class" & sClassID&"/" End Function Public Function Getstar(starNum) Getstar = "" starNum = ChkClng(starNum) if starNum<1 or starNum>5 then Exit Function Getstar = "" End Function '显示验证码 Public Function GetCode(CodeType) GetCode="" End Function '检查验证码是否正确 Public Function CodeIsTrue(CodeStr,CodeType) 'Dim CodeStr CodeType=Trim(CodeType):CodeStr=Trim(CodeStr) If CStr(Session(CodeType)&"")=CStr(CodeStr&"") And CodeStr<>"" Then CodeIsTrue=True Session(CodeType)=Empty Else CodeIsTrue=False Session(CodeType)=Empty End If End Function '检查Email地址合法性 Public Function ChkEmail(email) dim names, name, i, c ChkEmail = true : names = Split(email, "@") if UBound(names) <> 1 then ChkEmail = false : Exit Function for each name in names if Len(name) <= 0 then ChkEmail = false:exit function for i = 1 to Len(name) c = Lcase(Mid(name, i, 1)) if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then ChkEmail = false:Exit Function end if next if Left(name, 1) = "." or Right(name, 1) = "." then ChkEmail = false:Exit Function end if next if InStr(names(1), ".") <= 0 then ChkEmail = false:exit function i = Len(names(1)) - InStrRev(names(1), ".") if i <> 2 and i <> 3 then ChkEmail = false : Exit function if InStr(email, "..") > 0 then ChkEmail = false End Function '检查组件是否已经安装 Public Function ChkObjInstalled(strClassString) On Error Resume Next ChkObjInstalled = False Err = 0 Dim xTestObj Set xTestObj = Server.CreateObject(strClassString) If 0 = Err Then ChkObjInstalled = True Set xTestObj = Nothing Err = 0 End Function '判断提交信息是否来自外部 Public Function ChkIsOuter() Dim server_v1,server_v2 ChkIsOuter=True server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) If Mid(server_v1,8,len(server_v2))=server_v2 Then ChkIsOuter=False End Function '向地址中加入 ? 或 & Public Function JoinChar(strUrl) if strUrl="" then JoinChar="":Exit Function if InStr(strUrl,"?")1 then if InStr(strUrl,"&") 0 Then IsSafeStr = False Exit Function End If Next End Function '获取任何表任何字段信息函数(字段名,表名,过滤,是否用户表1为是) Public Function GetTableInfo(ColumnName,TableName,StrWhere,IsUser) 'On Error Resume Next dim RsStr,SqlStr SqlStr="select " & ColumnName & " from [" & TableName & "] where "&StrWhere&"" If IsUser=1 then Set RsStr=Execute_U(SqlStr) Else Set RsStr=Execute(SqlStr) End If If Err Then GetTableInfo="" RsStr.close:set RsStr=Nothing Exit Function End if if RsStr.bof and RsStr.Eof then GetTableInfo="" else GetTableInfo=RsStr(0) end if RsStr.close:set RsStr=Nothing End Function Public Sub InToDataBase(DataBaseName,TableName,ColumnName,ColumnValue) On Error Resume Next dim sConn,sConnstr Set sConn = Server.CreateObject("ADODB.Connection") sConnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DataBaseName) sConn.Open sConnstr sConn.Execute("insert into ["&TableName&"] ("&ColumnName&") values ("&Replace(Replace(ColumnValue,"True","1"),"False","0")&")") sConn.Close:Set sConn = Nothing If Err Then Response.Write "在数据库"&DataBaseName&"表"&TableName&"中添加记录失败!原因:" & Err.Description Err.Clear End If End Sub Public Sub InToColumn(TableName,ColumnName,ColumnValue) On Error Resume Next Execute("insert into ["&TableName&"] ("&ColumnName&") values ("&Replace(Replace(ColumnValue,"True","1"),"False","0")&")") If Err Then Response.Write "在数据库表"&TableName&"中添加记录失败!原因:" & Err.Description Err.Clear 'Response.end End If End Sub Public Sub SaveAdminLog() On Error Resume Next Dim RequestStr RequestStr = Request("Action") If RequestStr<>"" Then RequestStr=Left("Action="&RequestStr & "&"&request.ServerVariables("QUERY_STRING"),200) RequestStr=CheckStr(URLDecode(RequestStr)) SQL="Insert Into Cl_AdminLog (UserID,UserName,UserLevel,UserIP,ScriptName,LogContent,LogTime) values ("&Cl.User_Info(4)&",'"&Cl.User_Info(5)&"',"&Cl.User_Info(21)&",'"&Cl.UserTrueIP&"','"&Cl.ScriptName&"','"&RequestStr&"','"&Now&"')" Cl.Execute_L(SQL) End If If request.form<>"" Then RequestStr=Left(request.form,200) RequestStr=CheckStr(URLDecode(RequestStr)) SQL="Insert Into Cl_AdminLog (UserID,UserName,UserLevel,UserIP,ScriptName,LogContent,LogTime) values ("&Cl.User_Info(4)&",'"&Cl.User_Info(5)&"',"&Cl.User_Info(21)&",'"&Cl.UserTrueIP&"','"&Cl.ScriptName&"','"&RequestStr&"','"&Now&"')" Cl.Execute_L(SQL) End if If Err Then 'Response.Write "添加管理事件记录失败!原因:" & Err.Description Err.Clear End If End Sub 'Server.URLEncode解码函数 Public Function URLDecode(byval enStr) dim deStr, c, i, v deStr="" for i=1 to len(enStr) c=Mid(enStr,i,1) if c="%" then v=eval("&h"+Mid(enStr,i+1,2)) if v<128 then deStr=deStr&chr(v) i=i+2 else if IsValidHex(mid(enstr,i,3)) then if IsValidHex(mid(enstr,i+3,3)) then v=eval("&h"+Mid(enStr,i+1,2)+Mid(enStr,i+4,2)) deStr=deStr&chr(v) i=i+5 else v=eval("&h"+Mid(enStr,i+1,2)+cstr(hex(asc(Mid(enStr,i+3,1))))) deStr=deStr&chr(v) i=i+3 end if else destr=destr&c end if end if else if c="+" then deStr=deStr&" " else deStr=deStr&c end if end if next URLDecode=deStr End Function Public Function IsValidHex(byval str) Dim c IsValidHex=true str=ucase(str) if len(str)<>3 then IsValidHex=False : Exit Function if left(str,1)<>"%" then IsValidHex=False : Exit Function c=mid(str,2,1) if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then IsValidHex=False : Exit Function c=mid(str,3,1) if not (((c>="0") and (c<="9")) or ((c>="A") and (c<="Z"))) then IsValidHex=False : Exit Function End Function '防SQL注入 Public Sub ChkSQLInWord() Dim InWordStr,NameStr,i Dim FormWord,QueryStringWord,CookiesWord CacheData(13,0) = Trim(CacheData(13,0)) if CacheData(13,0)="" then Exit Sub InWordStr = Split(LCase(CacheData(13,0)),"|") For Each NameStr In Request.Form 'POST FormWord = FormWord & "|" & Request.Form(NameStr) Next For Each NameStr In Request.QueryString 'GET QueryStringWord = QueryStringWord & "|" & Request.QueryString(NameStr) Next For Each NameStr In Request.Cookies(Web_Cookies) 'Cookies CookiesWord = CookiesWord & "|" & Request.Cookies(Web_Cookies)(NameStr) Next FormWord = LCase(FormWord) & "" QueryStringWord = LCase(QueryStringWord) & "" CookiesWord = LCase(CookiesWord) & "" For i=0 To Ubound(InWordStr) If Instr(LCase(FormWord & ""),InWordStr(i))<>0 Then Call SaveSQLLOG(2,FormWord) end If If Instr(LCase(QueryStringWord & ""),InWordStr(i))<>0 Then Call SaveSQLLOG(3,QueryStringWord) end If If Instr(LCase(CookiesWord & ""),InWordStr(i))<>0 Then Call SaveSQLLOG(4,CookiesWord) end if Next End Sub '显示"上一页 下一页":链接地址,总数,页数,单位,项目名 Public Function ShowPage(sFileName,TotalNumber,MaxperPage,sUnit,sItem) dim n, i, sTemp, strUrl n = TotalPages sTemp = sTemp & "
    " & VbCrlf if CreateHtmlIng=True then sTemp = sTemp & "" & vbcrlf sTemp = sTemp & "
    " & VbCrlf sTemp = sTemp & "共 " & totalnumber & " " & sUnit & sItem & " " sTemp = sTemp & " " & maxperpage & "" & sUnit & "/页 " sTemp = sTemp & " 页次:" & CurrentPage & "/" & n & "页  " if CurrentPage<2 then sTemp = sTemp & "首页 上一页 " else sTemp = sTemp & "首页 " if (CurrentPage-1) = 1 then sTemp = sTemp & "上一页 " else sTemp = sTemp & "上一页 " end if end if if CurrentPage >= n then sTemp = sTemp & "下一页 尾页" else sTemp = sTemp & "下一页 " sTemp = sTemp & "尾页" end if sTemp = sTemp & " 转到:" sTemp = sTemp & " " else sTemp = sTemp & "" & VbCrlf strUrl = JoinChar(sfilename) sTemp = sTemp & "共 " & totalnumber & " " & sUnit & sItem & " " sTemp = sTemp & " " & maxperpage & "" & sUnit & "/页 " sTemp = sTemp & " 页次:" & CurrentPage & "/" & n & "页  " if CurrentPage < 2 then sTemp = sTemp & "首页 上一页 " else sTemp = sTemp & "首页 " sTemp = sTemp & "上一页 " end if if CurrentPage >= n then sTemp = sTemp & "下一页 尾页" else sTemp = sTemp & "下一页 " sTemp = sTemp & "尾页" end if sTemp = sTemp & " 转到:" sTemp = sTemp & " " end if ShowPage = sTemp & "
    " & VbCrlf & "
    " End Function Public Sub ChecKIPlock() Dim IPlock IPlock = False Dim locklist If Checkstr(CacheData(9,0))="" Then Exit Sub Dim i,StrUserIP,StrKillIP StrUserIP=UserTrueIP If StrUserIP="" Then Exit Sub locklist=Split(Checkstr(CacheData(9,0)),"|") StrUserIP=Split(UserTrueIP,".") If Ubound(StrUserIP)<>3 Then Exit Sub For i= 0 to UBound(locklist) locklist(i)=Checkstr(locklist(i)) If locklist(i)<>"" Then StrKillIP = Split(locklist(i),".") If Ubound(StrKillIP)<>3 Then Exit For IPlock = True If (StrUserIP(0) <> StrKillIP(0)) And Instr(StrKillIP(0),"*")=0 Then IPlock=False If (StrUserIP(1) <> StrKillIP(1)) And Instr(StrKillIP(1),"*")=0 Then IPlock=False If (StrUserIP(2) <> StrKillIP(2)) And Instr(StrKillIP(2),"*")=0 Then IPlock=False If (StrUserIP(3) <> StrKillIP(3)) And Instr(StrKillIP(3),"*")=0 Then IPlock=False If IPlock Then Exit For End If Next If IPlock Then Response.Cookies(Web_Cookies & "Kill")("kill") = "Yes" Else Response.Cookies(Web_Cookies & "Kill")("kill") = "No" End If End Sub Function OutMsg(Message,GoToUrl) Message = Replace(Message,"'","") If GoToUrl="-1" Then Response.Write "" Else Response.Write "" End If Response.End End Function Public Sub OutErr(ErrCodes) Response.Redirect WebDir & "Showerr.asp?action=Ohter&ErrCodes="&HTMLCode(ErrCodes)&"" Response.End End Sub '显示成功提示信息 Public Function ShowSuc(Message) LoadTemplates("") ShowSuc = Replace(mainhtml(11),"{%sucmsg%}",Message) 'response.end End Function '显示错误提示信息 Public Function ShowErr(Message) LoadTemplates("") ShowErr = Replace(mainhtml(12),"{%errmsg%}",Message) 'response.end End Function '显示错误提示信息 Public Function NotLoginErr(sLevel,sFunName) LoadTemplates("") NotLoginErr = Replace(Cl.lanstr(7),"{%level%}",GetUserGroupName(sLevel)) NotLoginErr = Replace(NotLoginErr,"{%function%}",sFunName) End Function Public Function ReplaceLabel(Byval sTrC) Name="ReplaceLabel" if ObjIsEmpty() then Dim RsLabel Set RsLabel = Execute("Select LabelName,LabelContent from Cl_Label Order By LabelPriority,LabelID") if RsLabel.bof or RsLabel.eof then Value="" else Value=RsLabel.GetString(,,"||","@@","") end if Set RsLabel = Nothing end if if Value<>"" then dim sRow,sCol,i sRow=Split(Value,"@@") for i=0 to Ubound(sRow)-1 sCol=Split(sRow(i),"||") sTrC = Replace(sTrC,"{%"&Trim(sCol(0))&"%}",sCol(1)) next end if ReplaceLabel=sTrC End Function Public Function ReplaceKeyword(Byval sTrC) Name="ReplaceKeyword" if ObjIsEmpty() then Dim RsKeyword Set RsKeyword = Execute("Select KeywordName,KeywordColor,KeywordLink from Cl_Keyword Order By KeywordPriority,KeywordID") if RsKeyword.bof or RsKeyword.eof then Value="" else Value=RsKeyword.GetString(,,"||","@@","") end if Set RsKeyword = Nothing end if if Value<>"" then dim sRow,sCol,i sRow=Split(Value,"@@") for i=0 to Ubound(sRow)-1 sCol=Split(sRow(i),"||") sTrC = Replace(sTrC,Trim(sCol(0)),""&Trim(sCol(0))&"") next end if ReplaceKeyword=sTrC End Function Public Function ReplaceFlag(Byval sTrC,Byval strFlag,Byval strData) Dim regEx,Matches,Match,TempStr sTrC = Replace(sTrC,"","%}") ReplaceFlag = sTrC Set regEx = New RegExp regEx.Pattern = "(\{%"&strFlag&")(.[^\{]*)(\%\})" regEx.IgnoreCase = True regEx.Global = True Set Matches = regEx.Execute(sTrC) For Each Match in Matches TempStr = Replace(Match.Value,"{%","") TempStr = Replace(TempStr,"%}","") TempStr = Replace(TempStr,"(",",") TempStr = Replace(TempStr,")","") TempStr = Replace(TempStr,"""","") if strData<>"" then ReplaceFlag = Replace(ReplaceFlag,Match.Value,strData) else ReplaceFlag = Replace(ReplaceFlag,Match.Value,GetLabelContent(TempStr,sTrC)) end if Next End Function Public Function ReplaceAllFlag(Byval sTrC) Dim regEx,Matches,Match,TempValue,ArrayStr,DataStr sTrC = Replace(sTrC,"{%showhead%}",Cl.Head) sTrC = Replace(sTrC,"{%showfooter%}",Cl.Bottom) sTrC = ReplaceLabel(sTrC) sTrC = ReplacePublicFlag(sTrC) Set regEx = New RegExp regEx.IgnoreCase= True regEx.Global = True regEx.Pattern = "(\【)(.[^\【]*)(\】)" Set Matches = regEx.Execute(sTrC) For Each Match in Matches TempValue = Match.Value TempValue = Replace(TempValue,"【","") TempValue = Replace(TempValue,"】","") 'TempValue = Replace(TempValue,"(",",") 'TempValue = Replace(TempValue,")","") TempValue = Replace(TempValue,"""","") ArrayStr = Split(TempValue,",") Select Case Lcase(ArrayStr(0)) Case "getarticle" sTrC = Replace(sTrC,Match.Value,GetArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14))) Case "getsoft" sTrC = Replace(sTrC,Match.Value,GetSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14))) Case "getphoto" sTrC = Replace(sTrC,Match.Value,GetPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14))) Case "getmovie" sTrC = Replace(sTrC,Match.Value,GetMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14))) Case "getproduct" sTrC = Replace(sTrC,Match.Value,GetProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14))) End Select Next regEx.Pattern = "(\{%mainhtml)(.[^\{]*)(\%\})" Set Matches = regEx.Execute(sTrC) For Each Match in Matches TempValue = Replace(Match.Value,"{%","") TempValue = Replace(TempValue,"%}","") TempValue = Replace(TempValue,"(",",") TempValue = Replace(TempValue,")","") ArrayStr = Split(TempValue,",") sTrC = Replace(sTrC,Match.Value,Cl.mainhtml(ArrayStr(1))) Next regEx.Pattern = "(\{%)(.[^\{]*)(\%\})"'"{%([^{%}])*%}" Set Matches = regEx.Execute(sTrC) For Each Match in Matches TempValue = Match.Value 'TempValue = Replace(TempValue,Chr(13) & Chr(10),"") TempValue = Replace(TempValue,"{%","") TempValue = Replace(TempValue,"%}","") TempValue = Replace(TempValue,"(",",") TempValue = Replace(TempValue,")","") TempValue = Replace(TempValue,"""","") sTrC = Replace(sTrC,Match.Value,GetLabelContent(TempValue,sTrC)) Next sTrC = Replace(sTrC,"{%temploadjs%}","") sTrC = Replace(sTrC,"{%width%}",mainsetting(0)) sTrC = Replace(sTrC,"{%webname%}",Web_info(0)) sTrC = Replace(sTrC,"{%weburl%}",Web_info(4)) sTrC = Replace(sTrC,"{%picurl%}",WebDir&Cl.Web_PicUrl) sTrC = Replace(sTrC,"{%channelid%}",ChannelID) sTrC = Replace(sTrC,"{%channelname%}",ChannelName) sTrC = ReplaceDir(sTrC) 'sTrC = ReplaceItem(sTrC) ReplaceAllFlag = sTrC Set Matches = Nothing : Set regEx = Nothing End Function Public Function ReplaceDir(Byval sTrC) sTrC = Replace(sTrC,"{%webdir%}",WebDir) sTrC = Replace(sTrC,"{%admindir%}",Web_Info(14)) sTrC = Replace(sTrC,"{%bbsdir%}",BbsDir) sTrC = Replace(sTrC,"{%uploaddir%}",UploadDir) 'sTrC = Replace(sTrC,"{%downloaddir%}",DownLoadDir) sTrC = Replace(sTrC,"{%channeldir%}",ChannelDir) ReplaceDir = sTrC End Function Public Function ReplaceItem(Byval sTrC) sTrC = Replace(sTrC,"{%channelitemname%}",ChannelItemName) sTrC = Replace(sTrC,"{%channelitemunit%}",ChannelItemUnit) sTrC = Replace(sTrC,"{%moneyitemname%}",Web_Setting(26)) sTrC = Replace(sTrC,"{%moneyitemunit%}",Web_Setting(27)) sTrC = Replace(sTrC,"{%pointitemname%}",Web_Setting(28)) sTrC = Replace(sTrC,"{%pointitemunit%}",Web_Setting(29)) ReplaceItem = sTrC End Function Public Sub MakeHtml(Byval MakeData,Byval MakeFileName) Dim Fso,Make On Error Resume Next Err=0 MakeFileName=Trim(MakeFileName) Set Fso = CreateObject(Trim(Cl.Web_Info(13))) Set Make = Fso.CreateTextFile(Server.MapPath(MakeFileName), True) Make.Write MakeData & vbNewLine & _ " " Set Make = Nothing Set Fso = Nothing If 0 <> Err Then Response.Write "生成("&MakeFileName&")失败,请检查你的服务器是否有FSO(FileSystemObject)!
    " End if Err=0 End Sub '取得带端口的URL Public Function Get_ScriptNameUrl() If request.servervariables("SERVER_PORT")="80" Then Get_ScriptNameUrl="http://" & request.servervariables("server_name")&replace(lcase(request.servervariables("script_name")),ScriptName,"") Else Get_ScriptNameUrl="http://" & request.servervariables("server_name")&":"&request.servervariables("SERVER_PORT")&replace(lcase(request.servervariables("script_name")),ScriptName,"") End If End Function ' 转为根路径格式 Public Function RelativePath2RootPath(Byval url) Dim sTempUrl sTempUrl = url If Left(sTempUrl, 1) = "/" Then RelativePath2RootPath = sTempUrl Exit Function End If Dim sNowPath sNowPath = Request.ServerVariables("SCRIPT_NAME") sNowPath = Left(sNowPath, InstrRev(sNowPath, "/") - 1) Do While Left(sTempUrl, 3) = "../" sTempUrl = Mid(sTempUrl, 4) sNowPath = Left(sNowPath, InstrRev(sNowPath, "/") - 1) Loop RelativePath2RootPath = sNowPath & "/" & sTempUrl End Function ' 根路径转为带域名全路径格式 Public Function RootPath2DomainPath(Byval url) Dim sHost, sPort sHost = Split(Request.ServerVariables("SERVER_PROTOCOL"), "/")(0) & "://" & Request.ServerVariables("HTTP_HOST") sPort = Request.ServerVariables("SERVER_PORT") If sPort <> "80" Then sHost = sHost & ":" & sPort RootPath2DomainPath = sHost & url End Function Public Function GetSize(Byval size,Byval unit) if isEmpty(size) or Not Isnumeric(size) then Exit Function size=CheckUnit(size,unit) if size>1024 then size=(size/1024) getsize=formatnumber(size,2) & " MB" else getsize=size & " KB" Exit Function end if if size>1024 then size=(size/1024) getsize=formatnumber(size,2) & " GB" end if End Function Public Function CheckUnit(Byval size,Byval unit) Select Case Lcase(Unit) Case "b" CheckUnit = formatnumber(size/1024,2) Case "k" CheckUnit = size Case "m" CheckUnit = (size*1024) Case "g" CheckUnit = (size*1024*1024) Case Else CheckUnit = size End Select End Function Public Sub DelFiles(Byval strFiles) if strFiles="" then Exit Sub dim fso,arrFiles,i On Error Resume Next Err=0 Set fso = CreateObject(Trim(Web_Info(13))) if fso.FileExists(server.MapPath(strFiles)) then fso.DeleteFile(server.MapPath(strFiles)) if 0=Err then Response.write "
    清除文件("&strFiles&")成功!" else Response.write "
    清除文件("&strFiles&")失败!" end if end if Set fso = Nothing Err=0 End Sub Public Sub DownloadFile(Byval strFile,Byval sReName) On error resume next Server.ScriptTimeOut=999999 Dim S,fso,f,intFilelength,strFilename strFilename = strFile Response.Clear Set s = Server.CreateObject("Adodb." & "Str" & "eam") s.Open s.Type = 1 Set fso = Server.CreateObject(Trim(Cl.Web_Info(13))) If Not fso.FileExists(strFilename) Then Response.Write("

    错误:


    系统找不到指定文件!点此返回吧!") Exit Sub End If Set f = fso.GetFile(strFilename) intFilelength = f.size s.LoadFromFile(strFilename) If err Then Response.Write("

    错误:

    " & err.Description & "

    ") Response.End End If Set fso=Nothing Dim Data Data=s.Read s.Close Set s=Nothing If Response.IsClientConnected Then Response.AddHeader "Content-Disposition", "attachment; filename="&ReplaceBadChar(sReName)&"."&GetDownLoadFileExt(f.name) Response.AddHeader "Content-Length", intFilelength Response.CharSet = "UTF-8" Response.ContentType = "application/octet-stream" Response.BinaryWrite Data Response.Flush End If End Sub Public Function GetDownLoadFileExt(Byval strFile) GetDownLoadFileExt="rar" Dim strExt if Isnull(strFile) then Exit Function if Instr(strFile,".")<=0 then Exit Function strExt=Split(strFile,".") GetDownLoadFileExt=strExt(Ubound(strExt)) End Function Public Function HTMLEncode(Byval fString) If Not IsNull(fString) then fString = replace(fString, ">", ">") fString = replace(fString, "<", "<") fString = replace(fString, "&", "&") fString = Replace(fString, CHR(32), " ") fString = Replace(fString, CHR(9), " ") fString = Replace(fString, CHR(34), """) fString = Replace(fString, CHR(39), "'") fString = Replace(fString, CHR(13), "") fString = Replace(fString, CHR(10) & CHR(10), "

    ") fString = Replace(fString, CHR(10), "
    ") HTMLEncode = fString End If End Function Public Function HTMLCode(Byval fString) If Not IsNull(fString) then fString = replace(fString, ">", ">") fString = replace(fString, "<", "<") fString = Replace(fString, " "," ") fString = Replace(fString, """, CHR(34)) fString = Replace(fString, "'", CHR(39)) fString = Replace(fString, "

    ",CHR(10) & CHR(10)) fString = Replace(fString, "
    ", CHR(10)) HTMLCode = fString End If End Function Public Function NoHtml(Byval str) if not isnull(str) then dim re Set re=new RegExp re.IgnoreCase =true re.Global=True re.Pattern="(\<.[^\<]*\>)" str=re.replace(str," ") re.Pattern="(\<\/[^\<]*\>)" str=re.replace(str," ") NoHtml=str Set re=Nothing End if End Function 'sContent(要转换的数据字符串) 'sFilters(要过滤掉的格式集,用"|"分隔多个) Public Function DeCode(Byval sContent, Byval sFilters) Dim a_Filter, i, s_Result, s_Filters Decode = sContent If IsNull(sContent) or IsNull(sFilters) Then Exit Function If sContent = "" or sFilters = "" Then Exit Function s_Result = sContent s_Filters = sFilters If InStr(s_Filters,"|")>0 then a_Filter = Split(s_Filters, "|") For i = 0 To UBound(a_Filter) s_Result = DecodeFilter(s_Result, a_Filter(i)) Next Else s_Result = DecodeFilter(s_Result, s_Filters) End If DeCode = s_Result End Function Public Function DecodeFilter(Byval sContent, Byval sFilter) Dim regEx Set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True Select Case Ucase(sFilter) Case "SCRIPT"'去除所有客户端脚本javascipt,vbscript,jscript,js,vbs,event,... regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "(javascript|jscript|vbscript|vbs):" sContent = regEx.replace(sContent,"$1:") 'regEx.Pattern = "on(mouse|exit|error|click|key)" 'sContent = regEx.replace(sContent,"on$1") Case "OBJECT"'去除对象 regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") Case "TABLE"'去除表格") rsInfo.Close:Set rsInfo=Nothing:Exit Sub End if TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage sqlSearch=rsInfo.GetRows(MaxPerPage) rsInfo.Close:Set rsInfo=Nothing dim strTemp,Attribute,LinkUrl,sIntro dim sSearchContent sSearchContent="" for i=0 to Ubound(sqlSearch,2) if sqlSearch(14,i)=True then Attribute=" " elseif sqlSearch(15,i)=True then Attribute=" " else Attribute=" " end if if sqlSearch(24,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlSearch(25,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.asp?SoftID="& sqlSearch(0,i) end if if strField="Title" or strField="" then sqlSearch(2,i)=Replace(sqlSearch(2,i),keyword,""&keyword&"") end if sIntro=Left(Cl.NoHtml(sqlSearch(21,i)),200) if strField="Intro" then sIntro=Replace(sIntro,keyword,""&keyword&"") end if strTemp=Replace(Template.html(10),"{%attribute%}",Attribute) strTemp=Replace(strTemp,"{%linkurl%}",LinkUrl) strTemp=Replace(strTemp,"{%softid%}",sqlSearch(0,i)) strTemp=Replace(strTemp,"{%softname%}",sqlSearch(2,i)) strTemp=Replace(strTemp,"{%softpicurl%}",sqlSearch(18,i)&"") strTemp=Replace(strTemp,"{%softversion%}",sqlSearch(3,i)&"") strTemp=Replace(strTemp,"{%updatetime%}",Cl.Format_Time(sqlSearch(7,i),3)) strTemp=Replace(strTemp,"{%softsize%}",Cl.GetSize(sqlSearch(13,i),"k")) strTemp=Replace(strTemp,"{%hits%}",sqlSearch(9,i)) strTemp=Replace(strTemp,"{%stars%}",Cl.Getstar(sqlSearch(17,i))) strTemp=Replace(strTemp,"{%softintro%}",sIntro&"") strTemp=Replace(strTemp,"{%operatingsystem%}",sqlSearch(22,i)&"") strTemp=Replace(strTemp,"{%softtype%}",sqlSearch(23,i)&"") strTemp=Replace(strTemp,"{%dayhits%}",sqlSearch(10,i)) sSearchContent=sSearchContent & strTemp Next TempStr = Replace(TempStr,"{%searchcontent%}",sSearchContent) TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) End Sub Public Sub Soft_Show() if SoftID<1 then Call Cl.OutMsg("找不到指定"&Cl.ChannelItemName&"。","Index.asp") Cl.Path = CurrentPath & " >> " & Cl.ChannelItemName & "信息" Cl.Title = InfoTitle & "[" & Cl.Web_info(1) & "]" if Not IsNull(rs("SoftIntro")) then Cl.DeScriptIon=InfoTitle & "[" & Replace(Left(Cl.NoHtml(rs("SoftIntro")),150),VbCrlf,"") & "]" else Cl.DeScriptIon=InfoTitle & "、" & Cl.Web_info(3) end if Cl.Keywords = InfoTitle & "|" & rs("Keyword") & "|" & Cl.Web_Info(2) Cl.Keywords = Replace(Cl.Keywords,"||","|") dim declarecomment TempStr=Template.html(2) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr=Replace(TempStr,"{%showdownloadurl%}",ShowDownLoadUrl()) TempStr=Replace(TempStr,"{%downloadmsg%}","") declarecomment=Cl.mainhtml(14) declarecomment=Replace(declarecomment,"{%action%}",Cl.WebDir&"Comment.asp") if Cl.UserID>0 and Cl.UserLevel<>5 then declarecomment=Replace(declarecomment,"{%chkname%}","value="""&Cl.User_Info(5)&""" disabled") declarecomment=Replace(declarecomment,"{%chkemail%}","value="""&Cl.User_Info(8)&""" disabled") else declarecomment=Replace(declarecomment,"{%chkname%}","") declarecomment=Replace(declarecomment,"{%chkemail%}","") end if declarecomment=Replace(declarecomment,"{%infoid%}",rs("SoftID")) TempStr=Replace(TempStr,"{%declarecomment%}",declarecomment) TempStr=Replace(TempStr,"{%classid%}",ClassID) TempStr=Replace(TempStr,"{%classname%}",ClassName) TempStr=Replace(TempStr,"{%softid%}",rs("SoftID")) TempStr=Replace(TempStr,"{%softname%}",Cl.HTMLEncode(rs("SoftName"))) TempStr=Replace(TempStr,"{%softversion%}",Cl.HTMLEncode(rs("SoftVersion")&"")) TempStr=Replace(TempStr,"{%softsize%}",Cl.GetSize(rs("SoftSize"),"k")) if IsNull(rs("SoftPicUrl")) or rs("SoftPicUrl")="" then TempStr=Replace(TempStr,"{%softpicurl%}",Template.pic(3)) else TempStr=Replace(TempStr,"{%softpicurl%}",rs("SoftPicUrl")&"") end if TempStr=Replace(TempStr,"{%stars%}",Cl.Getstar(rs("Stars"))) TempStr=Replace(TempStr,"{%copyrighttype%}",rs("CopyrightType")&"") TempStr=Replace(TempStr,"{%softtype%}",rs("SoftType")&"") TempStr=Replace(TempStr,"{%softlanguage%}",rs("SoftLanguage")&"") TempStr=Replace(TempStr,"{%operatingsystem%}",Cl.HTMLEncode(rs("OperatingSystem")&"")) TempStr=Replace(TempStr,"{%author%}",Cl.HTMLEncode(rs("Author")&"")) TempStr=Replace(TempStr,"{%authoremail%}",rs("AuthorEmail")&"") TempStr=Replace(TempStr,"{%authorhomepage%}",rs("AuthorHomepage")&"") TempStr=Replace(TempStr,"{%demourl%}",rs("DemoUrl")&"") TempStr=Replace(TempStr,"{%updatetime%}",Cl.Format_Time(rs("UpdateTime"),2)) TempStr=Replace(TempStr,"{%decompresspassword%}",rs("DecompressPassword")&"") TempStr=Replace(TempStr,"{%softlevel%}",Cl.GetUserGroupName(rs("SoftLevel"))) TempStr=Replace(TempStr,"{%softpoint%}",rs("SoftPoint")) TempStr=Replace(TempStr,"{%softmoney%}",rs("SoftMoney"))' TempStr=Replace(TempStr,"{%dayhits%}",rs("DayHits")) TempStr=Replace(TempStr,"{%weekhits%}",rs("WeekHits")) TempStr=Replace(TempStr,"{%monthhits%}",rs("MonthHits")) TempStr=Replace(TempStr,"{%hits%}",rs("Hits")) TempStr=Replace(TempStr,"{%softintro%}",Cl.Ubbcode(rs("SoftIntro"))) TempStr=Replace(TempStr,"{%editor%}",rs("Editor") & "") TempStr=Replace(TempStr,"{%censor%}",rs("Censor") & "") TempStr=Replace(TempStr,"{%showdownloadurl%}",ShowDownLoadUrl()) End Sub Public Sub Soft_Down() dim UrlID,ComeUrl,SqlUpdate dim DownloadUrl,DownUrlStr,sTemp UrlID = Cl.ChkClng(request("UrlID")) ComeUrl = Cstr(Request.ServerVariables("HTTP_REFERER")) if SoftID=0 then Call Cl.OutMsg("请指定软件ID",ComeUrl) if UrlID<0 then UrlID=0 Call ChkSoftLevel() if Rs("UseServer") then Dim rsS,ServerAddress,FileAddress Set rsS=Cl.Execute("Select * from Cl_Server where ChannelID="&ChannelID&" and ServerID="&UrlID&"") If rsS.Bof and rsS.Eof then rsS.Close:Set rsS=Nothing Call Cl.OutMsg("找不到有效下载地址,请点确定返回,然后点击其它下载地址!",ComeUrl) End if if Not Cl.ChkUserLevel(rsS("DownGroup"),Cl.UserLevel) then sTemp=Cl.GetUserGroupName(rsS("DownGroup")) rsS.Close:Set rsS=Nothing Cl.OutErr("对不起,此下载服务器只供以下权限会员使用:"&sTemp&"
    有关下载权限问题,请联系本站管理员,点击 返回下载页!") Response.end end if ServerAddress = rsS("ServerAddress") FileAddress = Cl.ReplaceDir(rs("FileAddress")&"") if left(FileAddress,1)="/" then FileAddress=Right(FileAddress,len(FileAddress)-1) DownloadUrl = ServerAddress & FileAddress if Cl.GetCookies("DownAddress_" & UrlID & "_" & SoftID)<>"OK" then if rsS("DownPoint")>0 then if Clng(Cl.User_Info(22))0 then if Clng(Cl.User_Info(23))0 then DownUrlStr=Split(DownUrlStr,"@@@") if UrlID>Ubound(DownUrlStr) then UrlID=Ubound(DownUrlStr) DownLoadUrl=Split(DownUrlStr(UrlID),"|")(1) else DownLoadUrl=Split(DownUrlStr,"|")(1) end if On Error GoTo 0 if DownloadUrl="" or DownloadUrl="http://" then rs.Close:Set rs=Nothing Call Cl.OutMsg("找不到有效下载地址,请点确定返回,然后点击其它下载地址!",ComeUrl) end if sTemp=Split(Cl.Channel_Setting(22),"@") DownloadUrl=Cl.ReplaceDir(DownloadUrl) DownloadUrl=Cl.ReplaceLabel(DownloadUrl) DownloadUrl=Replace(DownloadUrl,"{%downloaddir%}",Cl.UploadDir & Trim(sTemp(1))) end if SqlUpdate="Update Cl_Soft Set Hits=Hits+1" if datediff("D",rs("LastHitTime"),now())<=0 then SqlUpdate=SqlUpdate & ",DayHits=DayHits+1" else SqlUpdate=SqlUpdate & ",DayHits=1" end if if datediff("ww",rs("LastHitTime"),now())<=0 then SqlUpdate=SqlUpdate & ",WeekHits=WeekHits+1" else SqlUpdate=SqlUpdate & ",WeekHits=1" end if if datediff("m",rs("LastHitTime"),now())<=0 then SqlUpdate=SqlUpdate & ",MonthHits=MonthHits+1" else SqlUpdate=SqlUpdate & ",MonthHits=1" end if Cl.Execute(SqlUpdate & ",LastHitTime='"&Now&"' where SoftID=" & SoftID) if left(lcase(DownloadUrl),7)="http://" or left(lcase(DownloadUrl),6)="ftp://" or Not Cl.ChkObjInstalled(Trim(Cl.Web_Info(13))) or Trim(Cl.Web_Setting(11))<>"Yes" then CloseAllObj response.redirect DownloadUrl else Call Cl.downloadFile(Server.MapPath(DownloadUrl),InfoTitle) end if End Sub '========================================================================= Public Sub Photo_Index() MaxPerPage=Cl.ChannelOtherSetting(9) Cl.Path=CurrentPath & " >> 首页" TempStr=Template.html(0) End Sub Public Sub Photo_Class() MaxPerPage=Cl.ChannelOtherSetting(3) Cl.Path=CurrentPath if ClassID>0 then if Not Cl.TrueBrowsePurview and CreateHtmlIng=False then Cl.OutErr(Template.Strings(3)) Cl.Title= ClassName & "--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" end if FileName="ShowClass.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(1) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr=Replace(TempStr,"{%classid%}",ClassID) TempStr=Replace(TempStr,"{%classname%}",ClassName) TempStr=Replace(TempStr,"{%channelid%}",ChannelID) TempStr=Cl.ReplaceFlag(TempStr,"showphoto","") TempStr=Cl.ReplaceFlag(TempStr,"showpicphoto","") if TotalPut>0 then TempStr=Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr=Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Photo_Special() MaxPerPage=Cl.ChannelOtherSetting(4) Cl.Path=CurrentPath & " >> 专题列表" Cl.Title= "专题列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSpecial.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Replace(Template.html(6),"{%specialname%}",SpecialName) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showphoto","") TempStr = Cl.ReplaceFlag(TempStr,"showpicphoto","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Photo_Update() MaxPerPage=Cl.ChannelOtherSetting(5) Cl.Path=CurrentPath & " >> 更新列表" Cl.Title= "更新列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowUpdate.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(4) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showphoto","") TempStr = Cl.ReplaceFlag(TempStr,"showpicphoto","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Photo_Elite() MaxPerPage=Cl.ChannelOtherSetting(6) Cl.Path=CurrentPath & " >> 推荐列表" Cl.Title= "推荐列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowElite.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(3) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showphoto","") TempStr = Cl.ReplaceFlag(TempStr,"showpicphoto","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Photo_Hot() MaxPerPage=Cl.ChannelOtherSetting(7) Cl.Path=CurrentPath & " >> 热门列表" Cl.Title= "热门列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowHot.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(13) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showphoto","") TempStr = Cl.ReplaceFlag(TempStr,"showpicphoto","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Photo_Search() MaxPerPage=Cl.ChannelOtherSetting(8) Cl.Path=CurrentPath & " >> 搜索结果" Cl.Title= "搜索结果--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSearch.asp?Field=" & strField & "&Keyword=" & keyword & "&ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(5) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr=Replace(TempStr,"{%classname%}",ClassName) TempStr=Replace(TempStr,"{%classid%}",ClassID) Dim keywordtitle,TopNum,sqlSearch if keyword="" then Cl.OutErr("



    请输入关键字!

    ") TopNum=Cl.ChkClng(Request("TopNum")) if TopNum=0 then sqlSearch="Select Top 100 " else sqlSearch="Select Top "&TopNum&" " end if sqlSearch=sqlSearch & "PhotoID,ClassID,PhotoName,Prefixion,Author,AuthorEmail,Editor,Keyword,Hits,DayHits,WeekHits,MonthHits,UpdateTime,PhotoPicUrl,OnTop,Elite,Passed,PhotoIntro,PhotoLevel,PhotoPoint,Stars,IsHtml,HtmlFileUrl from Cl_Photo where Deleted=False and Passed=True and ChannelID="&ChannelID&" " if ClassID>0 then sqlSearch=sqlSearch & " and ClassID in (" & Replace(arrChildID,"|",",") & ")" keyword = Cl.ReplaceBadChar(keyword&"") Select Case strField Case "ID" keywordtitle="ID号为 "&keyword&" " sqlSearch=sqlSearch & " and PhotoID = "&Cl.ChkClng(keyword)&" " Case "Title" keywordtitle="名称含有 "&keyword&" " sqlSearch=sqlSearch & " and PhotoName like '%" & keyword & "%' " Case "Keyword" keywordtitle="关键字含有 "&keyword&" " sqlSearch=sqlSearch & " and Keyword like '%" & keyword & "%' " Case "Intro" keywordtitle="简介含有 "&keyword&" " sqlSearch=sqlSearch & " and PhotoIntro like '%" & keyword & "%' " Case "Author" keywordtitle="作者含有 "&keyword&" " sqlSearch=sqlSearch & " and Author like '%" & keyword & "%' " Case "Editor" keywordtitle=""&keyword&" 添加" sqlSearch=sqlSearch & " and Editor='" & keyword & "' " Case "Censor" keywordtitle=""&keyword&" 审核" sqlSearch=sqlSearch & " and Censor='" & keyword & "' " Case "Point" keywordtitle=""&Cl.Web_Setting(28)&"小于或等于 "&keyword&" " sqlSearch=sqlSearch & " and PhotoPoint <= "&Cl.ChkClng(keyword)&" " Case Else keywordtitle="名称含有 "&keyword&" " sqlSearch=sqlSearch & " and PhotoName like '%" & keyword & "%' " End Select keywordtitle= keywordtitle & "的"&Cl.ChannelItemName sqlSearch=sqlSearch & " order by UpdateTime desc,PhotoID desc" TempStr=Replace(TempStr,"{%keywordtitle%}",keywordtitle) Set rsInfo= Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open sqlSearch,Conn,1,1 if rsInfo.bof and rsInfo.eof then TotalPut=0 TempStr = Replace(TempStr,"{%showpage%}","") TempStr = Replace(TempStr,"{%searchcontent%}","

    没有任何"&Cl.ChannelItemName&"

    ") rsInfo.Close:Set rsInfo=Nothing:Exit Sub End if TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage sqlSearch=rsInfo.GetRows(MaxPerPage) rsInfo.Close:Set rsInfo=Nothing dim strTemp,Attribute,LinkUrl,n,FileType,TitleStr strTemp="
    regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") Case "CLASS"'去除样式类class="" regEx.Pattern = "(<[^>]+) class=[^ |^>]*([^>]*>)" sContent = regEx.replace(sContent,"$1 $2") Case "STYLE"'去除样式style="" regEx.Pattern = "(<[^>]+) style=\""[^\""]*\""([^>]*>)" sContent = regEx.replace(sContent,"") Case "XML"'去除XML regEx.Pattern = "<\\?xml[^>]*>" sContent = regEx.replace(sContent,"") Case "NAMESPACE"'去除命名空间 regEx.Pattern = "<\/?[a-z]+:[^>]*>" sContent = regEx.replace(sContent,"") Case Else regEx.Pattern = "]*>" sContent = regEx.replace(sContent,"") End Select DecodeFilter = sContent Set regEx=nothing End Function Public Function UbbCode(str) If Not IsNull(str) then Set ClUbb=New Cls_UbbCode UbbCode=ClUbb.UbbCode(str) Set ClUbb=Nothing End if End Function Public Function ChkClng(ByVal str) If str<>"" and IsNumeric(str) Then ChkClng = CLng(str) Else ChkClng = 0 End If End Function Public Function ChkCBool(ByVal str) If Not IsNull(str) Then ChkCBool = CBool(str) Else ChkCBool = False End If End Function Public Function ChkCDbl(ByVal str) If str<>"" and IsNumeric(str) Then ChkCDbl = CDbl(str) Else ChkCDbl = 0 End If End Function Public Function ChkNull(ByVal str) If IsNull(str) Then ChkNull = "" Else ChkNull = str End If End Function Public Sub ChkUploadFile(iID,Content,Files) Dim sTr, sFiles, i, sFile iID = ChkClng(iID) sTr = Content sFiles = Files If IsNull(sTr) or IsNull(sFiles) or sTr="" or sFiles="" Then Exit Sub sTr = Lcase(ReplaceDir(sTr)) If Instr(sFiles,"@@@") > 0 then sFiles = Split(sFiles,"@@@") For i=0 to Ubound(sFiles) sFile = Trim(sFiles(i)) sFile = Lcase(ReplaceDir(sFile)) If Instr(sTr,sFile)>0 then Execute("Update Cl_UpFileLog Set InfoID="&iID&",IsUse=1 Where SaveFileName='"&CheckStr(sFiles(i))&"'") Else Execute("Update Cl_UpFileLog Set InfoID="&iID&",IsUse=0 Where SaveFileName='"&CheckStr(sFiles(i))&"'") End if Next Else sFile = Trim(sFiles) sFile = Lcase(ReplaceDir(sFile)) If Instr(sTr,sFile)>0 then Execute("Update Cl_UpFileLog Set InfoID="&iID&",IsUse=1 Where SaveFileName='"&CheckStr(sFiles)&"'") Else Execute("Update Cl_UpFileLog Set InfoID="&iID&",IsUse=0 Where SaveFileName='"&CheckStr(sFiles)&"'") End if End If End Sub End Class Class Cls_Templates Public html,Strings,pic Public Property Let Value(ByVal vNewValue) Dim tmpstr:tmpstr = vNewValue tmpstr = Replace(tmpstr,"{%PicUrl%}",Cl.Web_PicUrl) tmpstr = Split(tmpstr,"@@@") html = Split(tmpstr(0),"|||"):Strings = Split(tmpstr(1),"|||"):pic = Split(tmpstr(2),"|||") End Property End Class Class Cls_DataBase Private ConnStr Public UserTable,MessageTable,FriendTable Public UserID,UserName,UserSex,UserEmail,UserIM,UserPassword,UserQuestion,UserAnswer Public UserFace,UserFaceWidth,UserFaceHeight,UserJoinDate,UserLogins,UserLastLogin,UserLastIP,UserLock,UserWealth Public UserDataNum,UserLevel,UserPoint,UserMoney,ChargeType,BeginDate,ValidNum,UserCheckNum,UserTPassWord Public UserHomepage,UserQQ,UserIcq Public UserReName,UserTelePhone,UserAddRess,UserBirthday,IDCard,CityInfo,ZipCode,SchoolAge,UserWorking,UserHomePhone,UserMobile,UserReMark,WaitReceive,Received,UserMsg,TotalExp Public Property Let ConnValue(ByVal Val) ConnStr = Val End Property Public Property Get ConnValue() ConnValue = ConnStr End Property Public Function OpenConnection(DbType) Dim TempConn On Error Resume Next Set TempConn = Server.CreateObject("ADODB.Connection") TempConn.Open ConnValue Set OpenConnection = TempConn Set TempConn = Nothing If Err Then Err.Clear Response.Write DbType & "链接出错,请检查数据库链接字符串!" Response.End End If End Function End Class %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_GetLabel.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== 'ReplacePublicFlag(sTrC) '公共标签处理部分 Public Function ReplacePublicFlag(Byval sTrC) sTrC = Replace(Replace(sTrC,"","%}") sTrC = Replace(sTrC,"{%width%}",Cl.mainsetting(0)) sTrC = Replace(sTrC,"{%webname%}",Cl.Web_info(0)) sTrC = Replace(sTrC,"{%generator%}",Cl.Web_Version(2)) sTrC = Replace(sTrC,"{%keyword%}",Replace(Cl.Keywords,"|",",")) sTrC = Replace(sTrC,"{%description%}",Cl.DeScriptIon) sTrC = Replace(sTrC,"{%weburl%}",Cl.Web_info(4)) sTrC = Replace(sTrC,"{%picurl%}",Cl.WebDir&Cl.Web_PicUrl) sTrC = Replace(sTrC,"{%webmastemail%}",Cl.Web_info(8)) sTrC = Replace(sTrC,"{%channelid%}",ChannelID) sTrC = Replace(sTrC,"{%title%}",Cl.Title) sTrC = Replace(sTrC,"{%channelname%}",Cl.ChannelName) sTrC = Replace(sTrC,"{%showdate%}","") sTrC = Replace(sTrC,"{%currentpath%}",Cl.Path) sTrC = Cl.ReplaceDir(sTrC) sTrC = Cl.ReplaceItem(sTrC) ReplacePublicFlag = sTrC End Function Public Function GetLabelContent(Byval LabelStr,Byref sTrC) 'On Error Resume next Dim ArrayStr,Tn GetLabelContent = "标签("&LabelStr&")错误,请检查标签代码。" ArrayStr = Split(LabelStr,",") Select Case LCase(ArrayStr(0)) '=========================公共部分===================================== Case "showlogo" GetLabelContent = ShowLogo(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showbanner" GetLabelContent = ShowBanner(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showannounce" GetLabelContent = ShowAnnounce(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5)) Case "openannounce" if Cl.Web_Info(15) = "1" then GetLabelContent = "" else GetLabelContent = "" end if Case "showchannelmenu" if Cl.Web_Info(15) = "1" then GetLabelContent = "" else GetLabelContent = Cl.ShowChannelMenu(ArrayStr(1)) end if Case "showclassmenu" if Cl.Web_Info(15) = "1" then GetLabelContent = "" else GetLabelContent = "" end if '======================文章部分======================================== Case "showarticle" GetLabelContent = ShowArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16)) Case "showpicarticle" GetLabelContent = ShowPicArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12)) Case "showclassarticle" GetLabelContent = ShowClassArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showtoparticle" GetLabelContent = ShowTopArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6)) Case "showcorrelativearticle" GetLabelContent = ShowCorrelativeArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showneararticle" GetLabelContent = ShowNearArticle(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5)) '===========================下载部分=================================== Case "showsoft" GetLabelContent = ShowSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16)) Case "showpicsoft" GetLabelContent = ShowPicSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12)) Case "showclasssoft" GetLabelContent = ShowClassSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showtopsoft" GetLabelContent = ShowTopSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6)) Case "showcorrelativesoft" GetLabelContent = ShowCorrelativeSoft(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) '===========================图片部分=================================== Case "showphoto" GetLabelContent = ShowPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16)) Case "showpicphoto" GetLabelContent = ShowPicPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12)) Case "showclassphoto" GetLabelContent = ShowClassPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showtopphoto" GetLabelContent = ShowTopPhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6)) Case "showcorrelativephoto" GetLabelContent = ShowCorrelativePhoto(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) '============================影视部分================================== Case "showmovie" GetLabelContent = ShowMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16)) Case "showpicmovie" GetLabelContent = ShowPicMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12)) Case "showclassmovie" GetLabelContent = ShowClassMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showtopmovie" GetLabelContent = ShowTopMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6)) Case "showcorrelativemovie" GetLabelContent = ShowCorrelativeMovie(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) '===========================商城部分=================================== Case "showproduct" GetLabelContent = ShowProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12),ArrayStr(13),ArrayStr(14),ArrayStr(15),ArrayStr(16)) Case "showpicproduct" GetLabelContent = ShowPicProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8),ArrayStr(9),ArrayStr(10),ArrayStr(11),ArrayStr(12)) Case "showclassproduct" GetLabelContent = ShowClassProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showtopproduct" GetLabelContent = ShowTopProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6)) Case "showcorrelativeproduct" GetLabelContent = ShowCorrelativeProduct(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5),ArrayStr(6),ArrayStr(7),ArrayStr(8)) '=========================公共部分===================================== Case "showspecial" GetLabelContent = ShowSpecial(ArrayStr(1),ArrayStr(2)) Case "showchildclass" GetLabelContent = ShowChildClass(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4)) Case "showclassnavigation" GetLabelContent = ShowClassNavigation(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showcomment" GetLabelContent = ShowComment(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showsearchform" if Cint(ArrayStr(2))>=3 and Cl.Web_Info(15) = "1" then GetLabelContent = "" else GetLabelContent = ShowSearchForm(ArrayStr(1),ArrayStr(2)) end if Case "showvote" if Ubound(ArrayStr)<2 then ReDim ArrayStr(2) GetLabelContent = ShowVote(ArrayStr(1),ArrayStr(2)) Case "showad" if Ubound(ArrayStr)<5 then ReDim ArrayStr(5) GetLabelContent = ShowAd(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5)) Case "showwebcount" GetLabelContent = ShowWebCount(ArrayStr(1),ArrayStr(2)) Case "channelcount" if Cl.Web_Info(15) = "1" then GetLabelContent = "" else GetLabelContent = Replace(Cl.ReplaceFlag(Replace(Cl.CountConfig,"{%channelid%}",ChannelID),"ShowWebCount",""),VbCrLf,"
    ") end if Case "showlinksite" GetLabelContent = ShowLinkSite(ArrayStr(1),ArrayStr(2),ArrayStr(3),ArrayStr(4),ArrayStr(5)) Case "showtopuser" GetLabelContent = ShowTopUser(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showguest" GetLabelContent = ShowGuest(ArrayStr(1),ArrayStr(2),ArrayStr(3)) Case "showuserlogin" if Ubound(ArrayStr) < 1 then Redim ArrayStr(1) ArrayStr(1)=0 end if GetLabelContent = Cl.ShowUserLogin(ArrayStr(1)) Case "showjs" Randomize Tn=Int(9999*Rnd)+10000 GetLabelContent = "
    " & ArrayStr(1) & "
    " Dim TempsTr TempsTr="
    "&ArrayStr(2)&"
    " TempsTr=TempsTr & Vbcrlf & "" & Vbcrlf & "") Case "web_info" GetLabelContent = Cl.Web_Info(ArrayStr(1)) Case "mainsetting" GetLabelContent = Cl.mainsetting(ArrayStr(1)) Case "mainpic" GetLabelContent = Cl.mainpic(ArrayStr(1)) Case "mainhtml" GetLabelContent = Cl.mainhtml(ArrayStr(1)) Case "powered" GetLabelContent = Cl.lanstr(2) & ""&Cl.Web_Version(1)&"" Case "copyright" GetLabelContent = Cl.Web_info(9) Case "runtime" if Trim(Cl.Web_Setting(0))="Yes" then GetLabelContent = Replace(Cl.lanstr(3),"{%runtime%}",Right(0&FormatNumber(Timer-BeginTime,3),5))' & "  " & Replace(Cl.lanstr(4),"{%querynum%}",Cl.SqlQueryNum)) else GetLabelContent = "" end if Case "stylename" GetLabelContent = Replace(Cl.lanstr(5),"{%stylename%}",Cl.StyleName) Case Else Exit Function End Select End Function %> <% Class Cls_PageData Public Sub Article_Index() MaxPerPage = Cl.ChannelOtherSetting(9) Cl.Path=CurrentPath & " >> 首页" TempStr = Cl.ReplaceFlag(Template.html(0),"showclassarticle","") End Sub Public Sub Article_Class() MaxPerPage=Cl.ChannelOtherSetting(3) Cl.Path=CurrentPath if ClassID>0 then if Not Cl.TrueBrowsePurview and CreateHtmlIng=False then Cl.OutErr(Template.Strings(3)) Cl.Title= ClassName & "--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" end if FileName="ShowClass.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Template.html(1) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%classbody%}",Template.html(11)) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"ShowArticle","") TempStr = Cl.ReplaceFlag(TempStr,"ShowPicArticle","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Article_Special() MaxPerPage=Cl.ChannelOtherSetting(4) Cl.Path=CurrentPath & " >> 专题列表" Cl.Title="专题列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSpecial.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Replace(Template.html(6),"{%specialname%}",SpecialName) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showarticle","") TempStr = Cl.ReplaceFlag(TempStr,"showpicarticle","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Article_Update() MaxPerPage=Cl.ChannelOtherSetting(5) Cl.Path=CurrentPath & " >> 更新列表" Cl.Title="更新列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowUpdate.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Template.html(4) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showarticle","") TempStr = Cl.ReplaceFlag(TempStr,"showpicarticle","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Article_Elite() MaxPerPage=Cl.ChannelOtherSetting(6) Cl.Path=CurrentPath & " >> 推荐列表" Cl.Title="推荐列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowElite.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Template.html(3) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showarticle","") TempStr = Cl.ReplaceFlag(TempStr,"showpicarticle","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Article_Hot() MaxPerPage=Cl.ChannelOtherSetting(7) Cl.Path=CurrentPath & " >> 热门列表" Cl.Title="热门列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowHot.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Template.html(14) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showarticle","") TempStr = Cl.ReplaceFlag(TempStr,"showpicarticle","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Article_Search() MaxPerPage=Cl.ChannelOtherSetting(8) Cl.Path=CurrentPath & " >> 搜索结果" Cl.Title="搜索结果--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSearch.asp?Field=" & strField & "&Keyword=" & keyword & "&ClassID=" & ClassID & "&SpecialID=" & SpecialID Dim keywordtitle,TopNum,sqlSearch if keyword="" then Cl.OutErr("



    请输入关键字!

    ") TopNum=Cl.ChkClng(Request("TopNum")) if TopNum=0 then sqlSearch="Select Top 100 " else sqlSearch="Select Top "&TopNum&" " end if sqlSearch=sqlSearch & "ArticleID,ClassID,Title,Keyword,Author,CopyFrom,UpdateTime,Editor,TitleFontColor,TitleFontType,Content,Hits,OnTop,Hot,Elite,Passed,Prefixion,Stars,PaginationType,ReadLevel,ReadPoint,DefaultPicUrl,IsHtml,HtmlFileUrl,Intro from Cl_Article where Deleted=False and Passed=True and ChannelID="&ChannelID&" " if ClassID>0 then sqlSearch=sqlSearch & " and ClassID in (" & Replace(arrChildID,"|",",") & ")" keyword = Cl.ReplaceBadChar(keyword&"") Select Case strField Case "ID" keywordtitle="ID号为 "&keyword&" " sqlSearch=sqlSearch & " and ArticleID = "&Cl.ChkClng(keyword)&" " Case "Title" keywordtitle="标题含有 "&keyword&" " sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' " Case "Keyword" keywordtitle="关键字含有 "&keyword&" " sqlSearch=sqlSearch & " and Keyword like '%" & keyword & "%' " Case "Intro" keywordtitle="简介含有 "&keyword&" " sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' " Case "CopyFrom" keywordtitle="来源含有 "&keyword&" " sqlSearch=sqlSearch & " and CopyFrom like '%" & keyword & "%' " Case "Author" keywordtitle="作者含有 "&keyword&" " sqlSearch=sqlSearch & " and Author like '%" & keyword & "%' " Case "Editor" keywordtitle=""&keyword&" 添加" sqlSearch=sqlSearch & " and Editor='" & keyword & "' " Case "Censor" keywordtitle=""&keyword&" 审核" sqlSearch=sqlSearch & " and Censor='" & keyword & "' " Case "Point" keywordtitle=""&Cl.Web_Setting(28)&"小于或等于 "&keyword&" " sqlSearch=sqlSearch & " and ReadPoint <= "&Cl.ChkClng(keyword)&" " Case Else keywordtitle="标题含有 "&keyword&" " sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' " End Select keywordtitle=keywordtitle & "的" & Cl.ChannelItemName TempStr = Replace(Template.html(5),"{%keywordtitle%}",keywordtitle) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if sqlSearch=sqlSearch & " order by UpdateTime desc,ArticleID desc" Set rsInfo= Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open sqlSearch,Conn,1,1 if rsInfo.eof and rsInfo.bof then TotalPut=0 TempStr = Replace(TempStr,"{%searchcontent%}","



    没有或没有找到任何"&Cl.ChannelItemName&"

    ") TempStr = Replace(TempStr,"{%showpage%}","") rsInfo.close : set rsInfo=Nothing : Exit Sub End if TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage sqlSearch=rsInfo.GetRows(MaxPerPage) rsInfo.close : set rsInfo=Nothing dim i,strTemp,LinkUrl for i=0 to ubound(sqlSearch,2) if sqlSearch(22,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlSearch(23,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&sqlSearch(0,i) end if strTemp=strTemp & (MaxPerPage*(CurrentPage-1)+i+1) & "." if strField="Title" then strTemp=strTemp & "" & replace(sqlSearch(2,i),""&keyword&"",""&keyword&"") & "" else strTemp=strTemp & "" & sqlSearch(2,i) & "" end if if strField="Author" then strTemp=strTemp & " [" & replace(sqlSearch(4,i)&"",""&keyword&"",""&keyword&"") & "]" else strTemp=strTemp & " [" & sqlSearch(4,i) & "]" end if strTemp=strTemp & "[" & FormatDateTime(sqlSearch(6,i),1) & "][" & sqlSearch(11,i) & "]" if strField="Content" then strTemp=strTemp & "
    " & replace(sqlSearch(24,i)&"",""&keyword&"",""&keyword&"") else strTemp=strTemp & "
    " & sqlSearch(24,i) end if strTemp=strTemp & " [详情……]
    " Next TempStr = Replace(TempStr,"{%searchcontent%}",strTemp) TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) sqlSearch="" End Sub Public Sub Article_Show() if ArticleId<=0 then Call Cl.OutErr("找不到指定"&Cl.ChannelItemName&"。") if rs("IsLink")=True then Response.Redirect rs("HtmlFileUrl") Cl.Path=CurrentPath & " >> 正文" Cl.Title=InfoTitle & "[" & Cl.Web_info(1) & "]" if Not IsNull(rs("Intro")) then Cl.DeScriptIon=InfoTitle & "[" & Replace(Left(Cl.NoHtml(rs("Intro")),150),VbCrlf,"") & "]" else Cl.DeScriptIon=InfoTitle & "、" & Cl.Web_info(3) end if Cl.Keywords=InfoTitle & "|" & rs("Keyword") & "|" & Cl.Web_Info(2) Cl.Keywords=Replace(Cl.Keywords,"||","|") FileName="ArticleShow.asp" Dim Attribute,Author,CopyFrom Author = rs("Author") : CopyFrom = rs("CopyFrom") if rs("OnTop") then Attribute=" " if rs("Hot") then Attribute=Attribute & " " if rs("Elite") then Attribute=Attribute & "" Attribute=Attribute & "  " & Cl.Getstar(rs("Stars")) TempStr =Template.html(2) if Child>0 then TempStr = Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr = Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%classid%}",rs("ClassID")) TempStr = Replace(TempStr,"{%articleid%}",rs("ArticleID")) TempStr = Replace(TempStr,"{%title%}",rs("Title")) TempStr = Replace(TempStr,"{%titleintact%}",rs("TitleIntact")&"") TempStr = Replace(TempStr,"{%articlepicurl%}",rs("DefaultPicUrl")&"") TempStr = Replace(TempStr,"{%attribute%}",Attribute) if instr(Author,"|")>0 then TempStr = Replace(TempStr,"{%author%}","" & left(Author,instr(Author,"|")-1) & "") else TempStr = Replace(TempStr,"{%author%}",Author) end if if instr(CopyFrom,"|")>0 then TempStr = Replace(TempStr,"{%copyfrom%}","" & left(CopyFrom,instr(CopyFrom,"|")-1) & "") else TempStr = Replace(TempStr,"{%copyfrom%}",CopyFrom) end if if CreateHtmlIng then TempStr = Replace(TempStr,"{%hits%}","") else TempStr = Replace(TempStr,"{%hits%}",rs("Hits")) end if TempStr = Replace(TempStr,"{%updatetime%}",FormatDateTime(rs("UpdateTime"),2)) TempStr = Replace(TempStr,"{%editor%}","" & rs("Editor") & "") TempStr = Replace(TempStr,"{%censor%}",rs("Censor") & "") TempStr = Replace(TempStr,"{%showarticlecontent%}",ShowArticleContent()) End Sub '===================================================================== Public Sub Soft_Index() MaxPerPage=Cl.ChannelOtherSetting(9) Cl.Path=CurrentPath & " >> 首页" TempStr=Template.html(0) End Sub Public Sub Soft_Class() MaxPerPage=Cl.ChannelOtherSetting(3) Cl.Path=CurrentPath FileName="ShowClass.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID Dim sqlSoft sqlSoft="select SoftID,ClassID,SoftName,SoftVersion,Author,AuthorEmail,Keyword,UpdateTime,Editor,Hits,DayHits,WeekHits,MonthHits,SoftSize,OnTop,Elite,Passed,Stars,SoftPicUrl,SoftLevel,SoftPoint,SoftMoney,SoftIntro,OperatingSystem,SoftType,CopyRighttype,IsHTML,HTMLFileUrl from Cl_Soft where Deleted=False and Passed=True " if ClassID>0 then if Not Cl.TrueBrowsePurview and CreateHtmlIng=False then Cl.OutErr(Template.Strings(2)) Cl.Title= ClassName & "--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" sqlSoft=sqlSoft & " and ClassID in (" & Replace(arrChildID,"|",",") & ")" end if 'if IsSqlDataBase=1 then sqlSoft=sqlSoft & " order by OnTop Asc,UpdateTime desc,SoftID desc" Set rsInfo = Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open sqlSoft,Conn,1,1 TempStr = Template.html(1) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if if rsInfo.bof and rsInfo.eof then TotalPut=0 TempStr=Replace(TempStr,"{%softclasscontent%}","

    没有任何"&Cl.ChannelItemName&"

    ") TempStr=Replace(TempStr,"{%showpage%}","") else TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage sqlSoft=rsInfo.GetRows(MaxPerPage) dim strTemp,strClassContent,Attribute,LinkURl strClassContent="" for i=0 to Ubound(sqlSoft,2) if sqlSoft(14,i)=True then Attribute=" " elseif sqlSoft(15,i)=True then Attribute=" " else Attribute=" " end if strTemp=Replace(Template.html(10),"{%attribute%}",Attribute) if sqlSoft(26,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkURl=Cl.WebDir & sqlSoft(27,i) else LinkURl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.asp?SoftID={%softid%}" end if strTemp=Replace(strTemp,"{%linkurl%}",LinkURl) strTemp=Replace(strTemp,"{%softid%}",sqlSoft(0,i)) strTemp=Replace(strTemp,"{%softname%}",sqlSoft(2,i)) strTemp=Replace(strTemp,"{%softpicurl%}",sqlSoft(18,i)&"") strTemp=Replace(strTemp,"{%softversion%}",sqlSoft(3,i)&"") strTemp=Replace(strTemp,"{%updatetime%}",Cl.Format_Time(sqlSoft(7,i),3)) strTemp=Replace(strTemp,"{%softsize%}",Cl.GetSize(sqlSoft(13,i),"k")) strTemp=Replace(strTemp,"{%hits%}",sqlSoft(9,i)) strTemp=Replace(strTemp,"{%stars%}",Cl.Getstar(sqlSoft(17,i))) strTemp=Replace(strTemp,"{%softpoint%}",sqlSoft(20,i)) strTemp=Replace(strTemp,"{%softmoney%}",sqlSoft(21,i)) strTemp=Replace(strTemp,"{%softintro%}",Left(Cl.NoHtml(sqlSoft(22,i)),200)) strTemp=Replace(strTemp,"{%operatingsystem%}",sqlSoft(23,i)&"") strTemp=Replace(strTemp,"{%softtype%}",sqlSoft(24,i)&"") strTemp=Replace(strTemp,"{%copyrighttype%}",sqlSoft(25,i)&"") strTemp=Replace(strTemp,"{%dayhits%}",sqlSoft(10,i)) strClassContent=strClassContent & strTemp Next TempStr=Replace(TempStr,"{%softclasscontent%}",strClassContent) TempStr=Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) end if TempStr=Replace(TempStr,"{%classname%}",ClassName) TempStr=Replace(TempStr,"{%classid%}",ClassID) rsInfo.Close : Set rsInfo=Nothing End Sub Public Sub Soft_Special() MaxPerPage=Cl.ChannelOtherSetting(4) Cl.Path=CurrentPath & " >> 专题列表" Cl.Title= "专题列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSpecial.Asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr = Replace(Template.html(6),"{%specialname%}",SpecialName) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showsoft","") TempStr = Cl.ReplaceFlag(TempStr,"showpicsoft","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Soft_Update() MaxPerPage=Cl.ChannelOtherSetting(5) Cl.Path=CurrentPath & " >> 更新列表" Cl.Title= "更新列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowUpdate.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(4) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showsoft","") TempStr = Cl.ReplaceFlag(TempStr,"showpicsoft","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Soft_Elite() MaxPerPage=Cl.ChannelOtherSetting(6) Cl.Path=CurrentPath & " >> 推荐列表" Cl.Title= "推荐列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowElite.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(3) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showsoft","") TempStr = Cl.ReplaceFlag(TempStr,"showpicsoft","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Soft_Hot() MaxPerPage=Cl.ChannelOtherSetting(7) Cl.Path=CurrentPath & " >> 热门列表" Cl.Title= "热门列表--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowHot.asp?ClassID=" & ClassID & "&SpecialID=" & SpecialID TempStr=Template.html(16) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr = Replace(TempStr,"{%specialid%}",SpecialID) TempStr = Replace(TempStr,"{%classid%}",ClassID) TempStr = Replace(TempStr,"{%classname%}",ClassName) TempStr = Replace(TempStr,"{%channelid%}",ChannelID) TempStr = Cl.ReplaceFlag(TempStr,"showsoft","") TempStr = Cl.ReplaceFlag(TempStr,"showpicsoft","") if TotalPut>0 then TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) else TempStr = Replace(TempStr,"{%showpage%}","") end if End Sub Public Sub Soft_Search() MaxPerPage=Cl.ChannelOtherSetting(8) Cl.Path=CurrentPath & " >> 搜索结果" Cl.Title= "搜索结果--" & Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" FileName="ShowSearch.asp?Field=" & strField & "&Keyword=" & keyword & "&ClassID=" & ClassID & "&SpecialID=" & SpecialID Dim keywordtitle,TopNum,sqlSearch if keyword="" then Cl.OutErr("



    请输入关键字!

    ") TopNum=Cl.ChkClng(Request("TopNum")) if TopNum=0 then sqlSearch="Select Top 100 " else sqlSearch="Select Top "&TopNum&" " end if sqlSearch=sqlSearch & "SoftID,ClassID,SoftName,SoftVersion,Author,AuthorEmail,Keyword,UpdateTime,Editor,Hits,DayHits,WeekHits,MonthHits,SoftSize,OnTop,Elite,Passed,Stars,SoftPicUrl,SoftLevel,SoftPoint,SoftIntro,OperatingSystem,SoftType,IsHTML,HTMLFileUrl from Cl_Soft where Deleted=False and Passed=True and ChannelID="&ChannelID&" " if ClassID>0 then sqlSearch=sqlSearch & " and ClassID in (" & Replace(arrChildID,"|",",") & ")" keyword = Cl.ReplaceBadChar(keyword&"") Select Case strField Case "ID" keywordtitle="ID号为 "&keyword&" " sqlSearch=sqlSearch & " and SoftID = "&Cl.ChkClng(keyword)&" " Case "Title" keywordtitle="名称含有 "&keyword&" " sqlSearch=sqlSearch & " and SoftName like '%" & keyword & "%' " Case "Keyword" keywordtitle="关键字含有 "&keyword&" " sqlSearch=sqlSearch & " and Keyword like '%" & keyword & "%' " Case "Intro" keywordtitle="简介含有 "&keyword&" " sqlSearch=sqlSearch & " and SoftIntro like '%" & keyword & "%' " Case "Author" keywordtitle="作者含有 "&keyword&" " sqlSearch=sqlSearch & " and Author like '%" & keyword & "%' " Case "Editor" keywordtitle=""&keyword&" 添加" sqlSearch=sqlSearch & " and Editor='" & keyword & "' " Case "Censor" keywordtitle=""&keyword&" 审核" sqlSearch=sqlSearch & " and Censor='" & keyword & "' " Case "Point" keywordtitle=""&Cl.Web_Setting(28)&"小于或等于 "&keyword&" " sqlSearch=sqlSearch & " and SoftPoint <= "&Cl.ChkClng(keyword)&" " Case Else sqlSearch=sqlSearch & " and SoftName like '%" & keyword & "%' " End Select keywordtitle = keywordtitle & "的"&Cl.ChannelItemName sqlSearch = sqlSearch & " order by UpdateTime desc,SoftID desc" TempStr = Template.html(5) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(11)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if TempStr=Replace(TempStr,"{%keywordtitle%}",keywordtitle) Set rsInfo= Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open sqlSearch,Conn,1,1 if rsInfo.bof and rsInfo.eof then TotalPut=0 TempStr = Replace(TempStr,"{%showpage%}","") TempStr = Replace(TempStr,"{%searchcontent%}","
    没有任何"&Cl.ChannelItemName&"
    " for i=0 to Ubound(sqlSearch,2) strTemp=strTemp & "" if (i+1) mod 3 = 0 then strTemp=strTemp & "" Next strTemp=strTemp & "
    " if CBool(sqlSearch(21,i)) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlSearch(22,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID=" & sqlSearch(0,i) end if FileType=right(lcase(sqlSearch(13,i)),3) TitleStr=Cl.GotTopic(sqlSearch(2,i),20) strTemp=strTemp & "" sqlSearch(13,i)=Cl.ReplaceDir(sqlSearch(13,i)) Select Case FileType Case "swf" strTemp=strTemp & "" Case "jpg", "bmp", "png", "gif" strTemp=strTemp & "" Case Else strTemp=strTemp & "" End Select strTemp=strTemp & "
    " & TitleStr & "
    " strTemp=strTemp & "
    " TempStr = Replace(TempStr,"{%searchcontent%}",strTemp) TempStr = Replace(TempStr,"{%showpage%}",Cl.ShowPage(FileName,TotalPut,MaxPerPage,Cl.ChannelItemUnit,Cl.ChannelItemName)) End Sub Public Sub Photo_Show() if PhotoID=0 then Call Cl.OutMsg("找不到指定" & Cl.ChannelItemName & "。","Index.asp") Cl.Path = CurrentPath & " >> " & Cl.ChannelItemName & "信息" Cl.Title = InfoTitle & "[" & Cl.Web_info(1) & "]" if Not IsNull(rs("PhotoIntro")) then Cl.DeScriptIon=InfoTitle & "[" & Replace(Left(Cl.NoHtml(rs("PhotoIntro")),150),VbCrlf,"") & "]" else Cl.DeScriptIon=InfoTitle & "、" & Cl.Web_info(3) end if Cl.Keywords=InfoTitle & "|" & rs("Keyword") & "|" & Cl.Web_Info(2) Cl.Keywords=Replace(Cl.Keywords,"||","|") TempStr=Template.html(2) if Child>0 then TempStr=Replace(TempStr,"{%showchildclass%}",Template.html(10)) else TempStr=Replace(TempStr,"{%showchildclass%}","") end if dim PhotoUrlStr,TempPhotoUrl,TempPhotoDownUrl PhotoUrlStr=Trim(rs("PhotoUrl")) On error Resume Next if Instr(PhotoUrlStr,"@@@")>0 then PhotoUrlStr=Split(PhotoUrlStr,"@@@") for i=0 to Ubound(PhotoUrlStr) TempPhotoUrl = TempPhotoUrl & "" & Split(PhotoUrlStr(i),"|")(0) & "
    " TempPhotoDownUrl = TempPhotoDownUrl & "" & Split(PhotoUrlStr(i),"|")(0) & "
    " next else TempPhotoUrl = "" & Split(PhotoUrlStr,"|")(0) & "" TempPhotoDownUrl = "" & Split(PhotoUrlStr,"|")(0) & "" end if On Error GoTo 0 TempStr=Replace(TempStr,"{%photourl%}",TempPhotoUrl) if Not rs("IsDownLoad") then TempStr=Replace(TempStr,"{%photodownurl%}",Template.Strings(9)) else TempStr=Replace(TempStr,"{%photodownurl%}",TempPhotoDownUrl) end if Dim declarecomment declarecomment=Cl.mainhtml(14) declarecomment=Replace(declarecomment,"{%action%}",Cl.WebDir&"Comment.asp") if Cl.UserID>0 and Cl.UserLevel<>5 then declarecomment=Replace(declarecomment,"{%chkname%}","value="""&Cl.User_Info(5)&""" disabled") declarecomment=Replace(declarecomment,"{%chkemail%}","value="""&Cl.User_Info(8)&""" disabled") else declarecomment=Replace(declarecomment,"{%chkname%}","") declarecomment=Replace(declarecomment,"{%chkemail%}","") end if declarecomment=Replace(declarecomment,"{%infoid%}",rs("PhotoID")) TempStr=Replace(TempStr,"{%declarecomment%}",declarecomment) TempStr=Replace(TempStr,"{%classid%}",ClassID) TempStr=Replace(TempStr,"{%classname%}",ClassName) TempStr=Replace(TempStr,"{%photoname%}",rs("PhotoName")) TempStr=Replace(TempStr,"{%photoid%}",rs("PhotoID")) TempStr=Replace(TempStr,"{%photourlid%}",Request("UrlID")&"") TempStr=Replace(TempStr,"{%photopicurl%}",rs("PhotoPicUrl") & "")' TempStr=Replace(TempStr,"{%photosize%}","") TempStr=Replace(TempStr,"{%author%}",rs("Author")&"") TempStr=Replace(TempStr,"{%updatetime%}",rs("UpdateTime")) TempStr=Replace(TempStr,"{%stars%}",Cl.Getstar(rs("Stars"))) TempStr=Replace(TempStr,"{%photopoint%}",rs("PhotoPoint")&"") TempStr=Replace(TempStr,"{%photomoney%}",rs("PhotoMoney")&"") TempStr=Replace(TempStr,"{%dayhits%}",rs("DayHits")&"") TempStr=Replace(TempStr,"{%weekhits%}",rs("WeekHits")&"") TempStr=Replace(TempStr,"{%monthhits%}",rs("Monthhits")&"") TempStr=Replace(TempStr,"{%hits%}",rs("Hits")&"") TempStr=Replace(TempStr,"{%authoremail%}",rs("AuthorEmail")&"") TempStr=Replace(TempStr,"{%authorhomepage%}",rs("AuthorHomepage")&"") TempStr=Replace(TempStr,"{%editor%}",rs("Editor") & "") TempStr=Replace(TempStr,"{%censor%}",rs("Censor") & "") TempStr=Replace(TempStr,"{%photointro%}",Cl.Ubbcode(rs("PhotoIntro")&"")) End Sub Public Sub Photo_View() if PhotoID=0 then Call Cl.OutMsg("请指定软件ID",ComeUrl) Dim UrlID,PhotoJsContent Dim PhotoUrl,PhotoUrlStr,FirstUrl UrlID=Cl.ChkClng(Request("UrlID")) if UrlID<0 then UrlID=0 ChkPhotoLevel PhotoUrlStr=Cl.ReplaceDir(rs("PhotoUrl")) if Instr(PhotoUrlStr,"@@@")>0 then PhotoUrlStr=Split(PhotoUrlStr,"@@@") if UrlID>Ubound(PhotoUrlStr) then UrlID=Ubound(PhotoUrlStr) for i=0 to Ubound(PhotoUrlStr) if Instr(PhotoUrlStr(i),"|")>0 then PhotoUrl = Split(PhotoUrlStr(i),"|")(1) else PhotoUrl = PhotoUrlStr(i) end if if UrlID=i then FirstUrl = PhotoUrl PhotoJsContent = PhotoJsContent & "s = new slide();" & VbCrlf PhotoJsContent = PhotoJsContent & "s.src = """&PhotoUrl&""";" & VbCrlf PhotoJsContent = PhotoJsContent & "ss.add_slide(s);" & VbCrlf next else if Instr(PhotoUrlStr,"|")>0 then PhotoUrl = Split(PhotoUrlStr,"|")(1) else PhotoUrl = PhotoUrlStr end if FirstUrl = PhotoUrl PhotoJsContent = PhotoJsContent & "s = new slide();" & VbCrlf PhotoJsContent = PhotoJsContent & "s.src = """&PhotoUrl&""";" & VbCrlf PhotoJsContent = PhotoJsContent & "ss.add_slide(s);" & VbCrlf end if TempStr=Template.html(11) TempStr=Replace(TempStr,"{%photojscontent%}",PhotoJsContent) If FoundErr=True then TempStr=Replace(TempStr,"{%photourlcontent%}",ErrMsg) response.write ErrMsg ElseIf FirstUrl="" or FirstUrl="http://" then TempStr=Replace(TempStr,"{%photourlcontent%}","地址错误!") response.write "地址错误!" Else TempStr=Replace(TempStr,"{%photourlcontent%}",Template.html(12)) TempStr=Replace(TempStr,"{%photourl%}",FirstUrl) End if if Cl.GetCookies("View_"&ChannelID&"_" & PhotoID)<>"Yes" then dim StrUpdate StrUpdate="Update Cl_Photo Set Hits=Hits+1" if datediff("D",rs("LastHitTime"),now())<=0 then StrUpdate=StrUpdate & ",DayHits=DayHits+1" else StrUpdate=StrUpdate & ",DayHits=1" end if if datediff("ww",rs("LastHitTime"),now())<=0 then StrUpdate=StrUpdate & ",WeekHits=WeekHits+1" else StrUpdate=StrUpdate & ",WeekHits=1" end if if datediff("m",rs("LastHitTime"),now())<=0 then StrUpdate=StrUpdate & ",MonthHits=MonthHits+1" else StrUpdate=StrUpdate & ",MonthHits=1" end if StrUpdate=StrUpdate & ",LastHitTime="&SqlNowString&" where PhotoID=" & PhotoID Cl.Execute(StrUpdate) Cl.SetCookies "View_"&ChannelID&"_" & PhotoID,"Yes" end if End Sub Public Sub Photo_Down() if PhotoID=0 then Call Cl.OutMsg("请指定软件ID",ComeUrl) if Not rs("IsDownLoad") then Call Cl.OutMsg(Template.Strings(9),ComeUrl) dim UrlID,ComeUrl dim DownloadUrl,DownUrlStr UrlID=Cl.ChkCLng(request("UrlID")) ComeUrl=Cstr(Request.ServerVariables("HTTP_REFERER")) if UrlID<0 then UrlID=0 DownUrlStr=rs("PhotoUrl") On Error Resume Next if InStr(DownUrlStr,"@@@")>0 then DownUrlStr=Split(DownUrlStr,"@@@") if UrlID>Ubound(DownUrlStr) then UrlID=Ubound(DownUrlStr) DownLoadUrl=Split(DownUrlStr(UrlID),"|")(1) else DownLoadUrl=Split(DownUrlStr,"|")(1) end if On Error GoTo 0 if DownloadUrl="" or DownloadUrl="http://" then Call Cl.OutMsg("找不到有效下载地址,请点确定返回,然后点击其它下载地址!",ComeUrl) end if if Cl.GetCookies("Down_"&ChannelID&"_" & PhotoID)<>"Yes" then Cl.Execute("Update Cl_Photo Set DownLoadNum=DownLoadNum+1 where PhotoID=" & PhotoID) Cl.SetCookies "Down_"&ChannelID&"_" & PhotoID,"Yes" end if DownloadUrl=Cl.ReplaceDir(DownloadUrl) if left(lcase(DownloadUrl),7)="http://" or left(lcase(DownloadUrl),6)="ftp://" or Not Cl.ChkObjInstalled(Trim(Cl.Web_Info(13))) or Trim(Cl.Web_Setting(11))="Yes" then response.redirect DownloadUrl else Call Cl.downloadFile(Server.MapPath(DownloadUrl),InfoTitle) end if End Sub End Class Set PageData = New Cls_PageData '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_ClsPageData.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== %> <% Dim Rs,Sql,i Dim tClass,rsInfo,InfoTitle,Pages Dim Founderr,ErrMsg,BeginTime,EndTime Dim CurrentPath,FileName,strFileName Dim MaxPerPage,TotalPut,CurrentPage,TotalPages Dim ArticleID,SoftID,PhotoID,MovieID,ProductID Dim ClassID,ClassName,SpecialID,keyword,strField,SpecialName Dim ClassDir,ParentDir,ParentID,ParentPath,RootID,Depth,Child Dim arrChildID,BrowsePurview,VipUser,TStyleID,TCssID Dim PresentExp,MoneyTotal,MoneySum PresentExp=0:MoneyTotal=0:MoneySum=0 ClassID=0:SpecialID=0:Child=0:arrChildID=0 TotalPut=0:CurrentPage=1:TotalPages=0 BeginTime=Timer Cl.GetWeb_Setting Cl.GetWeb_CSetting(ChannelID) if Cl.IsDisabled <> 0 then Response.write "对不起,本频道暂时已禁用!请返回网站首页!" Response.end End if Cl.ChkUserLogin %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Const.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Public.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== '================================================================== '过程:ShowLogo(sChannelID,sWidth,sHeight) '参数: ' sChannelID ------ 频道ID ' sWidth ------ 宽度 ' sHeight ------ 高度 '================================================================== Function ShowLogo(sChannelID,sWidth,sHeight) if Cl.Logo <> "" then dim sLogo sChannelID = Cl.ChkClng(sChannelID) sWidth = Cl.ChkClng(sWidth) sHeight = Cl.ChkClng(sHeight) sLogo = "" if lcase(right(Cl.Logo,3))<>"swf" then sLogo = sLogo & "" else sLogo = sLogo & "" end if sLogo = sLogo & "" ShowLogo = sLogo else ShowLogo = "" end if End Function '================================================================== '过程:ShowBanner(sChannelID,Width,Height) '参数: ' sChannelID ------ 频道ID ' sWidth ------ 宽度 ' sHeight ------ 高度 '================================================================== Function ShowBanner(sChannelID,sWidth,sHeight) if Cl.Banner<>"" then sChannelID = Cl.ChkClng(sChannelID) sWidth = Cl.ChkClng(sWidth) sHeight = Cl.ChkClng(sHeight) if lcase(right(Cl.Banner,3))="swf" then ShowBanner="" else ShowBanner="" end if else ShowBanner="" end if End Function '显示网站调查 Function ShowVote(Byval sChannelID,Byval TopNum) dim i,ii,strHTML,sConTent,sType sChannelID = Cl.ChkClng(sChannelID) TopNum = Cl.ChkClng(TopNum) if TopNum<=1 then TopNum=1 dim SqlVote,RsVote SqlVote = "select top "&TopNum&" ID,Title,Content,nums,Type,totalNums from Cl_Vote where IsNew=1 and (ChannelID=-1 or ChannelID=" & sChannelID & ") order by ID Desc" Set RsVote = Cl.Execute(SqlVote) if rsVote.bof and rsVote.eof then ShowVote = "

  • 没有任何调查
  • " rsVote.close : set rsVote=Nothing : Exit Function End If SqlVote = rsVote.GetRows(-1) rsVote.close:set rsVote=Nothing For ii=0 to Ubound(SqlVote,2) strHTML = strHTML & "
    " strHTML = strHTML & "    " & SqlVote(1,ii) & "
    " sConTent = Split(SqlVote(2,ii),"@") if SqlVote(4,ii) = 0 then sType = "radio" else sType = "checkbox" end if for i=0 to Ubound(sConTent) if Trim(sConTent(i)) = "" then exit for strHTML = strHTML & "" & sConTent(i) & "
    " next strHTML = strHTML & "
    " strHTML = strHTML & "" strHTML = strHTML & "" strHTML = strHTML & "
    " strHTML = strHTML & "  " strHTML = strHTML & "" strHTML = strHTML & "
    " Next ShowVote = strHTML End Function '================================================================== '过程:ShowAnnounce(sChannelID,TopNum,TitleLen,ShowType,DateType) '参数: ' sChannelID ------ 频道ID ' TopNum ------ 最多记录数,0为全部(用于分页显示) ' TitleLen ------ 标题最多字节数,只对列表方式有效 ' ShowType ------ 0列表,1纵向,2横向 ' DateType ------ 显示更新日期的样式 ' ---- 0(不显示) ' ---- 1(2004-10-01 23:45:45) ' ---- 2(年-月-日 时:分:秒) ' ---- 3(2004-10-01) ' ---- 4(2004\10\01) ' ---- 5(10-01 23:45) ' ---- 6(2004年10月01日) ' ---- 7(10-01) ' ---- 8(20041001234545) '================================================================== Function ShowAnnounce(sChannelID,TopNum,TitleLen,ShowType,DateType) sChannelID = Cl.ChkCLng(sChannelID) : ShowType = Cl.ChkCLng(ShowType) TopNum = Cl.ChkCLng(TopNum) : DateType = Cl.ChkCLng(DateType) dim SQL, Rs, i, sTemp if TopNum>0 then SQL="Select Top " & TopNum & " " else SQL="Select Top 10 " end if SQL=SQL & " ID,Title,Content,Author,AddTime from Cl_Announce where IsSelected=True and (ChannelID=-1 or ChannelID=" & sChannelID & ") and (ShowType=0 or ShowType=1) order by ID Desc" Set Rs = Cl.Execute(SQL) if Rs.bof and Rs.eof then ShowAnnounce = "当前没有通告!" Rs.Close : Set Rs=Nothing : Exit Function end if SQL = Rs.GetRows(-1) Rs.Close : Set Rs=Nothing sTemp = "" : TopNum = Ubound(SQL,2) Select Case ShowType Case 0 TitleLen = Cl. ChkClng(TitleLen) for i=0 to TopNum sTemp = sTemp & "
  • " & Cl.GotTopic(SQL(1,i),TitleLen) & "

  • " next Case 1 for i=0 to TopNum sTemp = sTemp & "    
    " & SQL(1,i) & "
    " & SQL(3,i) & "  
    " & Cl.Format_Time(SQL(4,i),DateType) & "
    " if i < TopNum then sTemp = sTemp & "
    " next Case 2 for i=0 to TopNum if i>0 then sTemp = sTemp & "      " sTemp = sTemp & "" & Cl.GotTopic(SQL(1,i),TitleLen) & "  [" & Cl.Format_Time(SQL(4,i),DateType) & "]" next Case 3 sTemp = "" & SQL(1,TopNum) & "" & VbCrlf sTemp = sTemp & "
    " & VbCrlf for i=0 to TopNum sTemp = sTemp & "
    " & VbCrlf sTemp = sTemp & "
    " & SQL(1,i) & "
    " & VbCrlf sTemp = sTemp & "
    "&Cl.WebDir&"Announce.asp?ChannelID=" & sChannelID & "&ID=" & SQL(0,i) &"
    " & VbCrlf sTemp = sTemp & "
    " & VbCrlf next sTemp = sTemp & "
    " & VbCrlf sTemp = sTemp & "" End Select ShowAnnounce = sTemp SQL=Empty End Function '================================================================== '过程:OpenAnnounce(sChannelID) '参数: ' sChannelID ------ 频道ID '================================================================== Function OpenAnnounce(sChannelID) if Cl.Web_Setting(1)="Yes" then dim popCount,rsAnnounce,strHTML set rsAnnounce=Cl.Execute("select count(*) from Cl_Announce where IsSelected=True and (ChannelID=-1 or ChannelID=" & Clng(sChannelID) & ") and (ShowType=0 or ShowType=2)") popCount=rsAnnounce(0) if popCount>0 then Cl.LoadTemplates("") strHTML=Cl.mainhtml(16) strHTML=Replace(strHTML,"{%channelid%}",sChannelID) strHTML=Replace(strHTML,"{%width%}",Split(Cl.Web_Setting(2),"|")(0)) strHTML=Replace(strHTML,"{%height%}",Split(Cl.Web_Setting(2),"|")(1)) 'strHTML="" else strHTML="" end if OpenAnnounce=strHTML end if End Function '========================================================= 'ShowLinkSite(sClassID,TopNum,Cols,LinkType,ShowType) '参数: ' sClassID ----- 分类ID ' TopNum ----- 最多显示多少个记录 ' Cols ----- 几列换行 ' LinkType ----- 链接方式(1为LOGO,2为文字) ' ShowType ----- 显示方式(1向上,2横向,3文字下拉) '========================================================= Function ShowLinkSite(sClassID,TopNum,Cols,LinkType,ShowType) dim SiteCount,i,strLink,sValue sClassID=Cl.ChkClng(sClassID):sValue="" LinkType=Cl.ChkClng(LinkType):TopNum=Cl.ChkClng(TopNum) Cols=Cl.ChkClng(Cols):ShowType=Cl.ChkClng(ShowType) If TopNum=0 then TopNum=10 Select Case ShowType Case 1 strLink=strLink & "
    " strLink=strLink & "" strLink=strLink & "{%tempvalue%}" strLink=strLink & "
    " strLink=strLink & "
    " '新增代码 strLink=strLink & vbcrlf & RollFriendLink() '新增代码 Case 2 strLink=strLink & "" strLink=strLink & "{%tempvalue%}" strLink=strLink & "
    " Case 3 strLink=strLink & "" End Select dim sqlLink,rsLink sqlLink="select top " & TopNum & " ID,LinkType,SiteName,SiteUrl,SiteIntro,LogoUrl from Cl_LinkSite where IsOK=True and LinkType=" & LinkType & " and IsIndex=1 " if sClassID>0 then sqlLink=sqlLink & " and ClassID="&sClassID&" " sqlLink=sqlLink & " order by IsGood,View desc,OrderID" set rsLink=Cl.Execute(sqlLink) if rsLink.bof and rsLink.eof then if ShowType<>3 then if LinkType=1 then for i=1 to TopNum sValue=sValue & "" sValue=sValue & "" sValue=sValue & "" if i mod Cols=0 then sValue=sValue & VbCrlf & "" next else for i=1 to TopNum sValue=sValue & "点击申请" if i mod Cols=0 then sValue=sValue & VbCrlf & "" next end if end if rsLink.Close:Set rsLink=Nothing else sqlLink = rsLink.GetRows(-1) rsLink.Close:Set rsLink=Nothing SiteCount=Ubound(sqlLink,2) if ShowType=3 then for i = 0 to SiteCount sValue=sValue & "" next else if LinkType=1 then for i = 0 to SiteCount sValue=sValue & "" if sqlLink(5,i)="" or sqlLink(5,i)="http://" then sValue=sValue & "" else sValue=sValue & "" end if sValue=sValue & "" if (i+1) mod Cols=0 then sValue=sValue & VbCrlf & "" next if SiteCount < TopNum-1 then for i=SiteCount+1 to TopNum-1 sValue=sValue & "" if (i+1) mod Cols=0 then sValue=sValue & VbCrlf & "" next end if else for i = 0 to SiteCount sValue=sValue & "" & sqlLink(2,i) & "" if (i+1) mod Cols=0 then sValue=sValue & VbCrlf & "" next if SiteCount < TopNum-1 then for i=SiteCount+1 to TopNum-1 sValue=sValue & "点击申请" if (i+1) mod Cols=0 then sValue=sValue & VbCrlf & "" next end if end if end if sqlLink=Empty end if ShowLinkSite=Replace(strLink,"{%tempvalue%}",sValue) End Function '滚动显示友情链接站点 Function RollFriendLink() Dim sTemp sTemp="" RollFriendLink=sTemp End Function '========================================================= 'ShowTopUser(TopNum,ShowType,OrderType) '显示用户排行:显示数量,排列方式(1文章数,其它为注册时间) 'TopNum ----- 最多显示多少个 'ShowType ----- 排列方式 ' ----- 0(用户ID) ' ----- 1(资料) ' ----- 2(金钱) ' ----- 3(点数) ' ----- 4(登录次数) ' ----- 5(等级) ' ----- 6(新增用户) 'OrderType ----- 排序方式(0,降序,其他升序) '========================================================= Function ShowTopUser(TopNum,ShowType,OrderType) TopNum = Cl.ChkClng(TopNum) ShowType = Cl.ChkClng(ShowType) OrderType = Cl.ChkClng(OrderType) If TopNum = 0 then TopNum = 10 if OrderType=0 then OrderType="Desc" Else OrderType="Asc" End if Dim sqlTop,rsTop,i,ts,ls sqlTop="Select Top "&TopNum&" " & Db.UserID & "," & Db.UserName & "," & Db.UserPassWord & ","&Db.UserReName&"," & Db.UserEmail & "," & Db.UserSex & "," & Db.UserFace & "," & Db.UserFaceWidth & "," & Db.UserFaceHeight & "," & Db.UserIM & "," & Db.UserJoinDate & "," & Db.UserLastLogin & "," & Db.UserLogins & "," & Db.UserQuestion & "," & Db.UserAnswer & "," & Db.UserLastIP & "," & Db.UserDataNum & "," & Db.UserLevel & "," & Db.UserPoint & "," & Db.UserMoney & "," & Db.ChargeType & "," & Db.BeginDate & "," & Db.ValidNum & " from " & Db.UserTable & " where " & Db.UserLock & "=0 " Select Case ShowType Case 0 sqlTop= sqlTop & " Order by " & Db.UserID & " "&OrderType&"":ts="用户ID":ls=0 Case 1 sqlTop= sqlTop & " Order by " & Db.UserDataNum & " "&OrderType&"," & Db.UserID & " Asc":ts="发表":ls=16 Case 2 sqlTop= sqlTop & " Order by " & Db.UserMoney & " "&OrderType&"," & Db.UserID & " Asc":ts="金钱":ls=19 Case 3 sqlTop= sqlTop & " Order by " & Db.UserPoint & " "&OrderType&"," & Db.UserID & " Asc":ts="点数":ls=18 Case 4 sqlTop= sqlTop & " Order by " & Db.UserLogins & " "&OrderType&"," & Db.UserID & " Asc":ts="登录":ls=12 Case 5 sqlTop= sqlTop & " Order by " & Db.UserLevel & " "&OrderType&"," & Db.UserID & " Asc":ts="等级":ls=17 Case Else sqlTop= sqlTop & " Order by " & Db.UserID & " Desc":ts="注册":ls=10 End Select set rsTop=Cl.Execute_U(sqlTop) if rsTop.bof and rsTop.eof then ShowTopUser = "没有任何用户" rsTop.Close : Set rsTop=Nothing : Exit Function end if sqlTop = rsTop.GetRows(-1) rsTop.Close : Set rsTop=Nothing Dim sTemp sTemp="" if ls=10 then For i=0 to Ubound(sqlTop,2) sTemp=sTemp & "" next else For i=0 to Ubound(sqlTop,2) sTemp=sTemp & "" next end if sTemp=sTemp & "" sTemp=sTemp & "
    名次用户名"&ts&"
    " & (i+1) & "" & sqlTop(1,i) & "" & formatdatetime(sqlTop(ls,i),2)& "
    " & (i+1) & "" & sqlTop(1,i) & "" & sqlTop(ls,i) & "
    more...
    " ShowTopUser=sTemp sqlTop=Empty End Function '===================================================== 'ShowGuest(TopNum,TitleLen,ShowReply) '参数: ' TopNum ----- 显示记录数 ' TitleLen ----- 标题字节数 ' ShowReply ----- 是否显示已回复字样(True为是) '===================================================== Function ShowGuest(TopNum,TitleLen,ShowReply) TopNum=Cl.ChkClng(TopNum) TitleLen=Cl.ChkClng(TitleLen) ShowReply=Cl.ChkCBool(ShowReply) if TopNum=0 then TopNum=8 dim sqlGuest,rsGuest sqlGuest="select top "&TopNum&" GuestId,GuestTitle,GuestName,GuestDatetime,GuestReply,GuestReplyAdmin from Cl_Guest where GuestIsPassed=True order by GuestId desc" Set rsGuest= Cl.Execute(sqlGuest) if rsGuest.bof and rsGuest.eof then ShowGuest="没有任何留言" rsGuest.Close:Set rsGuest=Nothing:Exit Function End if sqlGuest=RsGuest.GetRows(-1) rsGuest.Close:Set rsGuest=Nothing dim i,sTemp sTemp="" for i=0 to Ubound(sqlGuest,2) sTemp=sTemp & "" Next ShowGuest=sTemp & "
    ·" sTemp=sTemp & Cl.GotTopic(sqlGuest(1,i),TitleLen) if Len(sqlGuest(4,i)) >0 and ShowReply then 'sTemp=sTemp & "[" & "" & sqlGuest(5,i) & "" & "已回复]" '显示[***已回复] sTemp=sTemp & "[已回复]" '显示[已回复] Else sTemp=sTemp & "[未回复]" '显示[未回复] end if sTemp=sTemp & "
    " sqlGuest=Empty End Function '================================================================== '过程:ShowAD(sAdID,sType,sAct,sWidth,sHeight) '参数: ' sAdID ------ ADID ' sType ------ 0=图片,1=代码 ' sAct ------ 0=普通,1=弹出,2=浮动,3=固定 ' sWidth ------ 宽度 ' sHeight ------ 高度 '================================================================== Function ShowAD(sAdID,sType,sAct,sWidth,sHeight) dim sqlAD,rsAD,sTempAD sAdID = Cl.ChkClng(sAdID) sType = Cl.ChkClng(sType) sAct = Cl.ChkClng(sAct) sWidth = Cl.ChkClng(sWidth) sHeight = Cl.ChkClng(sHeight) if sAdID>0 then sqlAD="Select ID,AdName,AdLinkUrl,AdImgUrl,ImgWidth,ImgHeight,IsFlash,ADType,AdAct,ADSetting from Cl_Ads where ID=" & sAdID & " and IsUse=1" else sqlAD="Select Top 1 ID,AdName,AdLinkUrl,AdImgUrl,ImgWidth,ImgHeight,IsFlash,ADType,AdAct,ADSetting from Cl_Ads where AdAct=" & sAct & " and IsUse=1 and AdType="&sType&"" end if Set rsAD=Cl.Execute(sqlAD) if rsAd.bof and rsAD.eof then rsAD.Close : Set rsAD=Nothing ShowAD = "" : Exit Function end if Select Case rsAd(7) Case 0 if sWidth = 0 then sWidth = rsAd(4) if sHeight = 0 then sHeight= rsAd(5) if rsAd(6)=true then sTempAD = "" sTempAD = sTempAD & "" sTempAD = sTempAD & "" else sTempAd = "" end if 'sTempAD = Replace(Replace(sTempAD,"'",""),vbcrlf,"\n") Dim AdSetting AdSetting = split(rsAd(9),"|") if Clng(AdSetting(1)) = 0 then AdSetting(1) = 100 if Clng(AdSetting(2)) = 0 then AdSetting(2) = 100 Select Case rsAd(8) Case 0 ShowAD = sTempAD Case 1 ShowAD = Cl.mainhtml(17) ShowAD = Replace(ShowAD,"{%adid%}",sAdID) ShowAD = Replace(ShowAD,"{%width%}",sWidth) ShowAD = Replace(ShowAD,"{%height%}",sHeight) ShowAD = Replace(ShowAD,"{%popleft%}",AdSetting(1)) ShowAD = Replace(ShowAD,"{%poptop%}",AdSetting(2)) ShowAD = "" Case 2 ShowAD = "
    " & sTempAD & "
    " ShowAD = ShowAD & VbCrlf & "" Case 3 ShowAD = "
    " & sTempAD & "
    " ShowAD = ShowAD & VbCrlf & "" End Select Case 1 ShowAD = Cl.ReplaceDir(rsAd(3)) Case Else ShowAD = "" End Select rsAD.Close : Set rsAD=Nothing End Function '================================================================== '过程:ShowComment(sChannelID,InfoID,TopNum) '参数: ' sChannelID ------ 频道ID ' InfoID ------ 内容ID ' TopNum ------ 最多显示数 '================================================================== Function ShowComment(sChannelID,InfoID,TopNum) dim rsComment,sqlComment,rsCommentU,NoPassedNum,i NoPassedNum=Cl.Execute("Select Count(CommentID) from Cl_Comment where ChannelID="&sChannelID&" and InfoID=" & InfoID & " and Passed=False")(0) if NoPassedNum="" then NoPassedNum=0 sChannelID = Cl.ChkClng(sChannelID) InfoID = Cl.ChkClng(InfoID) TopNum = Cl.ChkClng(TopNum) if TopNum > 0 then sqlComment = "select top " & TopNum & " " else sqlComment = "select top 8 " end if sqlComment=sqlComment & " CommentID,InfoID,ClassID,UserLevel,UserName,Email,WriteTime,Score,Content,ReplyContent,ReplyName,ReplyTime,Passed from Cl_Comment where ChannelID="&sChannelID&" and InfoID=" & InfoID & " " if Cl.UserLevel=1 then sqlComment=sqlComment & " order by CommentID desc" else sqlComment=sqlComment & " and Passed=True order by CommentID desc" end if Set rsComment = Cl.Execute(sqlComment) if rsComment.bof and rsComment.eof then if NoPassedNum>0 then ShowComment="  待审评论 "&NoPassedNum&" 条,请管理员 登录 后操作!" else ShowComment="  没有任何评论" end if rsComment.close:set rsComment=Nothing else Set ClUbb=New Cls_UbbCode Dim sTemp,UserIM sTemp="" sqlComment = rsComment.GetRows(-1) rsComment.close:set rsComment=Nothing For i=0 to Ubound(sqlComment,2) sTemp=sTemp & "" sTemp=sTemp & "" Next Set ClUbb=Nothing sTemp=sTemp & "" sTemp=sTemp & "
  • "&Cl.GetUserGroupName(sqlComment(3,i))&"『" if sqlComment(3,i)=5 then sTemp=sTemp & "" & sqlComment(4,i) & "" else sTemp=sTemp & "" & sqlComment(4,i) & "" end if sTemp=sTemp & "』于" & sqlComment(6,i) & "发表评论:
  • " if Cl.UserLevel=1 then if sqlComment(12,i)=True then sTemp=sTemp & " [取消]" else sTemp=sTemp & " [审核]" end if 'sTemp=sTemp & " [修改]" sTemp=sTemp & " [删除]" end if sTemp=sTemp & "
    评分:"&sqlComment(7,i)&"分
    " sTemp=sTemp & "    " & ClUbb.UbbCode(sqlComment(8,i)) & "
    " if sqlComment(9,i)<>"" then sTemp=sTemp & "     管理员『" & sqlComment(10,i) & "』于 " & sqlComment(11,i) & " 回复道:    " & ClUbb.UbbCode(sqlComment(9,i)) & "
    " end if sTemp=sTemp & "
     " if NoPassedNum>0 then sTemp=sTemp & "待审评论 "&NoPassedNum&" 条,请管理员 登录 后操作!" end if sTemp=sTemp & "查看所有评论
    " ShowComment=sTemp end if sqlComment=Empty End Function '显示所有栏目(树形目录效果)(预留) Function ShowClass_Tree(sChannelID) dim rsClass,sqlClass,tmpDepth,i,j sqlClass="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,Depth,NextID,IsOuter,LinkUrl,Child From Cl_Class where ChannelID="&Cint(sChannelID)&" and order by RootID,OrderID" set rsClass=Cl.Execute(sqlClass) if rsClass.bof and rsClass.bof then ShowClass_Tree="没有任何栏目" rsClass.close:set rsClass=Nothing : Exit Function End if dim arrShowLine(20),strClassTree for i=0 to ubound(arrShowLine) arrShowLine(i)=False next sqlClass = rsClass.GetRows(-1) rsClass.close:set rsClass=Nothing For i=0 to Ubound(sqlClass,2) tmpDepth=sqlClass(5,i) if sqlClass(6,i)>0 then arrShowLine(tmpDepth)=True else arrShowLine(tmpDepth)=False end if if tmpDepth>0 then for j=1 to tmpDepth if j=tmpDepth then if sqlClass(6,i)>0 then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if else if arrShowLine(j)=True then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if end if next end if if sqlClass(9,i)>0 then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if if sqlClass(7)=1 then strClassTree=strClassTree & "" else strClassTree=strClassTree & "" end if if sqlClass(5,i)=0 then strClassTree=strClassTree & "" & sqlClass(1,i) & "" else strClassTree=strClassTree & sqlClass(1,i) end if strClassTree=strClassTree & "" if sqlClass(9,i)>0 then strClassTree=strClassTree & "(" & sqlClass(9,i) & ")" end if strClassTree=strClassTree & "
    " Next ShowClass_Tree=strClassTree sqlClass=Empty End Function '=============================================================== '显示当前栏目的下一级子栏目 '过程:ShowChildClass(sChannelID,sClassID,sCol,ShowType) '参数: ' sChannelID ----- 频道ID ' sClassID-----------栏目ID ' sCol ------ 几列换行(当ShowType大于1时生效) ' ShowType ------ 显示方式(0,
  • 每个栏目一行) '=============================================================== Function ShowChildClass(sChannelID,sClassID,sCol,ShowType) dim SQL,Rs,i,n,sTemp sChannelID=Cl.ChkClng(sChannelID):sClassID=Cl.ChkClng(sClassID) ShowType=Cl.ChkClng(ShowType):sCol=Cl.ChkClng(sCol) SQL="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,Depth,NextID,IsOuter,LinkUrl,Child From Cl_Class where ChannelID="&sChannelID&" and ParentID=" & ClassID & " order by OrderID" Set Rs= Cl.Execute(SQL) if Rs.bof and Rs.eof then ShowChildClass="没有子栏目" Rs.Close : Set Rs=Nothing : Exit Function End if SQL=Rs.GetRows(-1) n=1:sTemp="" if ShowType=0 then for i=0 to Ubound(SQL,2) if SQL(7,i)=1 then sTemp=sTemp & "
  • " & SQL(1,i) & "
  • " else sTemp=sTemp & "
  • " & SQL(1,i) & "
  • " end if if SQL(9,i)>0 then sTemp=sTemp & "(" & SQL(9,i) & ")" sTemp=sTemp & "
    " Next else for i=0 to Ubound(SQL,2) if SQL(7,i)=1 then sTemp=sTemp & "  " & SQL(1,i) & "" else sTemp=sTemp & "  " & SQL(1,i) & "" end if if SQL(9,i)>0 then sTemp=sTemp & "(" & SQL(9,i) & ")" if n mod sCol=0 then sTemp=sTemp & "
    " n=n+1 Next end if ShowChildClass=sTemp SQL=Empty End Function '=============================================================== '显示栏目导航 '过程:ShowClassNavigation(sChannelID,sClassID,sCol) '参数: ' sChannelID ----- 频道ID ' sClassID-----------栏目ID ' sCol ------ 几列换行 '=============================================================== Function ShowClassNavigation(sChannelID,sClassID,sCol) dim SQL,Rs,sTemp,PrevRootID,i,n sChannelID=Cl.ChkClng(sChannelID):sClassID=Cl.ChkClng(sClassID):sCol=Cl.ChkClng(sCol) SQL="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,Depth,RootID,IsOuter,LinkUrl,Child,Readme From Cl_Class where ChannelID="&sChannelID&"" if sClassID>0 then SQL=SQL & " and (ClassID="&sClassID&" or ParentID="&sClassID&") order by RootID,OrderID" else SQL=SQL & " and Depth<=1 order by RootID,OrderID" end if Set Rs= Cl.Execute(SQL) if Rs.bof and Rs.eof then ShowClassNavigation = "没有任何栏目" Rs.Close : Set Rs=Nothing : Exit Function End if if sCol=0 then sCol=6 Cl.GetChannelSetting(sChannelID) SQL=Rs.GetRows(-1) Rs.Close : Set Rs=Nothing sTemp="
    " & SQL(1,i) & "" PrevRootID=SQL(6,i):n=1 For i=1 to Ubound(SQL,2) if PrevRootID=SQL(6,i) then if SQL(7,i)=1 then sTemp=sTemp & "" else sTemp=sTemp & "" end if sTemp=sTemp & SQL(1,i) & "  " if n>=sCol then n=1 : sTemp=sTemp & "
    " else n=n+1 end if else sTemp=sTemp & "
    " if SQL(7,i)=1 then sTemp=sTemp & "【" else sTemp=sTemp & "【" end if sTemp=sTemp & SQL(1,i) & "" n=1 end if PrevRootID=SQL(6,i) Next ShowClassNavigation = sTemp & "
    " SQL=Empty End Function '显示站点统计信息 Function ShowWebCount(sChannelID,sType) sChannelID = Cl.ChkClng(sChannelID) sType = Cl.ChkClng(sType) Cl.GetChannelSetting(sChannelID) Cl.Name="ShowWebCount" & sChannelID if Cl.ObjIsEmpty() then dim rsCount,sTempD Cl.Channel_Setting(20) = Cl.ChkClng(Cl.Channel_Setting(20)) if Cl.Channel_Setting(20) = 6 then Set rsCount = Cl.Execute("select count(GuestID) from Cl_Guest") sTempD = rsCount(0) & "@" '===(0) Set rsCount = Cl.Execute("select count(GuestID) from Cl_Guest where GuestIsPassed=True") sTempD = sTempD & rsCount(0) & "@" '===(1) Set rsCount = Cl.Execute("select count(GuestID) from Cl_Guest where GuestIsPassed=False") sTempD = sTempD & rsCount(0) & "@0@0@0@0@0@" '===(2) Else Dim sMName,TempV,TempV2 Select Case Cl.Channel_Setting(20) Case 1 : sMName = "Article" Case 2 : sMName = "Soft" Case 3 : sMName = "Photo" Case 4 : sMName = "Movie" Case 5 : sMName = "Product" Case else : sModuleName = "Article" End Select Set rsCount = Cl.Execute("select count("&sMName&"ID) from Cl_"&sMName&" where ChannelID="&sChannelID&" and Deleted=False") TempV = rsCount(0) sTempD = TempV & "@" '===(0) 总数 Set rsCount = Cl.Execute("select count("&sMName&"ID) from Cl_"&sMName&" where ChannelID="&sChannelID&" and Passed=True and Deleted=False") TempV2 = rsCount(0) sTempD = sTempD & TempV2 & "@" '===(1) 已审 sTempD = sTempD & (TempV-TempV2) & "@" '===(2) 待审 Set rsCount = Cl.Execute("select sum(Hits) From Cl_"&sMName&" where ChannelID="&sChannelID&" ") sTempD = sTempD & rsCount(0) & "@" '===(3) 阅读 Set rsCount = Cl.Execute("select count(CommentID) from Cl_Comment where ChannelID="&sChannelID&"") TempV = rsCount(0) sTempD = sTempD & TempV & "@" '===(4) 评论总数 Set rsCount = Cl.Execute("select count(CommentID) from Cl_Comment where ChannelID="&sChannelID&" and Passed=True") TempV2 = rsCount(0) sTempD = sTempD & TempV2 & "@" '===(5) 已审评论 sTempD = sTempD & (TempV-TempV2) & "@" '===(6) 待审评论 Set rsCount = Cl.Execute("select count(SpecialID) from Cl_Special where (ChannelID=-1 or ChannelID="&sChannelID&")") sTempD = sTempD & rsCount(0) & "@" '===(7) 专题数 End if Set rsCount = Cl.Execute("select count(SpecialID) from Cl_Special") sTempD = sTempD & rsCount(0) & "@" '===(8) 专题总数 Set rsCount = Cl.Execute_U("select Count(UserID) from " & Db.UserTable) sTempD = sTempD & rsCount(0) & "@0" '===(9) 用户总数 Set rsCount = Cl.Execute_U("select Count(UserID) from " & Db.UserTable & " where (UserLevel=6 or UserLevel=7)") sTempD = sTempD & rsCount(0) & "@0" '===(10) 待审用户 set rsCount = Nothing Cl.Value = sTempD end if Dim sTemp sTemp = Split(Cl.Value,"@") If sType > Ubound(sTemp) then ShowWebCount = 0 Else ShowWebCount = sTemp(sType) End If sTemp=Empty End Function '=============================================================== '过程名:ShowSearchForm(sChannelID,ShowType) '参 数: ' sChannelID ---- 频道ID ' ShowType ---- 显示方式 1简,2标,3(带栏目),4(带专题),5(带栏目+专题) '=============================================================== Function ShowSearchForm(sChannelID,ShowType) sChannelID = Cl.ChkClng(sChannelID) ShowType = Cl.ChkClng(ShowType) Cl.GetChannelSetting(sChannelID) Dim sTemp sTemp="" sTemp=sTemp & "" sTemp=sTemp & "
    " Select Case ShowType Case 0, 1 sTemp=sTemp & "" Case 2 sTemp=sTemp & ShowSearchField(Cl.Channel_Setting(20),Cl.Channel_Setting(2)) Case 3 sTemp=sTemp & ShowSearchField(Cl.Channel_Setting(20),Cl.Channel_Setting(2)) sTemp=sTemp & " " Case 4 sTemp=sTemp & ShowSearchField(Cl.Channel_Setting(20),Cl.Channel_Setting(2)) sTemp=sTemp & " " Case 5 sTemp=sTemp & ShowSearchField(Cl.Channel_Setting(20),Cl.Channel_Setting(2)) sTemp=sTemp & " " sTemp=sTemp & " " End Select sTemp=sTemp & "  " sTemp=sTemp & "" sTemp=sTemp & "
    " ShowSearchForm=sTemp End Function Function ShowSearchField(sModuleID,sItemName) Dim sTemp sTemp="" sTemp=Empty End Function Function ShowRootClass(sChannelID,sRootID) dim sqlRoot,rsRoot,sTemp,i sqlRoot="select ClassID,ClassName,RootID,Child From Cl_Class where ChannelID="&Clng(sChannelID)&" and ParentID=0 and IsOuter=0 order by RootID" Set rsRoot = Cl.Execute(sqlRoot) if rsRoot.bof and rsRoot.eof then sTemp="还没有任何栏目,请首先添加栏目。" else sqlRoot=rsRoot.GetRows(-1) For i=0 To Ubound(sqlRoot,2) if sqlRoot(2,i)=sRootID then sTemp = sTemp & "" & sqlRoot(1,i) & "" else sTemp = sTemp & "" & sqlRoot(1,i) & "" end if if (i+1) mod 8=0 then sTemp=sTemp&"
    " else sTemp=sTemp&" | " end if Next end if ShowRootClass=sTemp sqlRoot=Empty : sTemp=Empty rsRoot.Close : Set rsRoot=Nothing End Function Function ShowClass_Option(sChannelID,CurrentID,sDepth,ShowType) dim rsClass,sqlClass,sTemp,tmpDepth,i,n dim arrShowLine(10) CurrentID = Cl.ChkClng(CurrentID) ShowType = Cl.ChkClng(ShowType) sChannelID = Cl.ChkClng(sChannelID) sDepth = Cl.ChkClng(sDepth) for i=0 to ubound(arrShowLine) arrShowLine(i)=False next if ShowType=0 then sTemp="" end if sqlClass="Select ClassID,ClassName,Depth,NextID,IsOuter,Child From Cl_Class where ChannelID="&sChannelID&" " if sDepth>0 then sqlClass=sqlClass & " and Depth<"&sDepth&" order by RootID,OrderID" else sqlClass=sqlClass & " order by RootID,OrderID" end if set rsClass=Cl.Execute(sqlClass) if rsClass.bof and rsClass.bof then ShowClass_Option = sTemp & "" rsClass.close : set rsClass=Nothing : Exit Function End if sqlClass=rsClass.GetRows(-1) rsClass.close : set rsClass=Nothing Dim sChecked, sTClassName For i=0 to Ubound(sqlClass,2) tmpDepth=sqlClass(2,i) if sqlClass(3,i)>0 then arrShowLine(tmpDepth)=True else arrShowLine(tmpDepth)=False end if sChecked = "" : sTClassName = "" if sqlClass(0,i)=CurrentID then sChecked = " selected" if tmpDepth>0 then for n=1 to tmpDepth sTClassName = sTClassName & "  " if n=tmpDepth then if sqlClass(3,i)>0 then sTClassName = sTClassName & "├ " else sTClassName = sTClassName & "└ " end if else if arrShowLine(n)=True then sTClassName = sTClassName & "│" else sTClassName = sTClassName & " " end if end if next end if sTClassName = sTClassName & sqlClass(1,i) Select Case ShowType Case 0 sTemp=sTemp & "" Case 1 if sqlClass(4,i)=1 then sTemp=sTemp & "" Case 2 if sqlClass(4,i)=1 then sTemp=sTemp & "" Case 3 if sqlClass(4,i)=0 then sTemp=sTemp & "" end if Case 4 if Cl.TrueClassPurview_U(3,sChannelID,sqlClass(0,i)) then if sqlClass(5,i)>0 then sTemp=sTemp & "" end if Case else sTemp=sTemp & "" End Select Next ShowClass_Option=sTemp sqlClass=Empty : sTemp=Empty End Function Function ShowManageClassPath(sChannelID,sClassName,sParentPath,iDepth) dim sTemp if iDepth<=0 then ShowManageClassPath = sClassName : Exit Function dim sqlPath,rsPath,i sqlPath="select ClassID,ClassName,Depth From Cl_Class where ChannelID="&Clng(sChannelID)&" and ClassID in (" & sParentPath & ") order by Depth" set rsPath=Cl.Execute(sqlPath) do while not rsPath.eof for i=1 to rsPath("Depth") sTemp= sTemp & "   " next if rsPath("Depth")>0 then sTemp= sTemp & "└" end if sTemp= sTemp & rsPath("ClassName") & "
    " rsPath.movenext loop Set rsPath=Nothing if iDepth>0 and sClassName<>"" then for i=1 to iDepth sTemp= sTemp & "   " next sTemp= sTemp & "└" & sClassName end if ShowManageClassPath = sTemp sTemp=Empty End Function Function ShowManageChild(sChannelID,sClassID) dim sqlChild,rsChild,sTemp,i sqlChild = "select ClassID,ClassName,Child From Cl_Class where ChannelID="&Cint(sChannelID)&" and ParentID=" & sClassID & " order by OrderID" Set rsChild = Cl.Execute(sqlChild) If rsChild.bof and rsChild.eof then ShowManageChild = "" rsChild.Close : Set rsChild = Nothing : Exit Function End If sqlChild=rsChild.GetRows(-1) rsChild.Close : Set rsChild = Nothing sTemp = " >> " For i=0 to Ubound(sqlChild,2) sTemp = sTemp & "" & sqlChild(1,i) & "" if sqlChild(2,i)>0 then sTemp = sTemp & "(" & sqlChild(2,i) & ")" if (i+1) mod 8=0 then sTemp = sTemp & "
    " else sTemp = sTemp & "  " end if Next ShowManageChild=sTemp sqlChild=Empty End Function Function ShowRootSpecial(sChannelID,sSpecialID) dim sqlSpecial,rsSpecial,sTemp,i sqlSpecial="select SpecialID,SpecialName from Cl_Special where ChannelID=-1 or ChannelID="&sChannelID&" order by OrderID" set rsSpecial=Cl.Execute(sqlSpecial) if rsSpecial.bof and rsSpecial.eof then sTemp="没有任何专题" else sqlSpecial=rsSpecial.GetRows(-1) For i=0 to Ubound(sqlSpecial,2) if sqlSpecial(0,i)=sSpecialID then sTemp=sTemp&"" & sqlSpecial(1,i) & "" else sTemp=sTemp&"" & sqlSpecial(1,i) & "" end if if (i+1) mod 8=0 then sTemp=sTemp&"
    " else sTemp=sTemp&" | " end if Next end if ShowRootSpecial=sTemp sqlSpecial=Empty : sTemp=Empty rsSpecial.Close : Set rsSpecial=Nothing End Function Function ShowSpecial_Option(sChannelID,sSpecialID,ShowType) dim sqlSpecial,rsSpecial,sTemp,i ShowType = Cl.ChkClng(ShowType) sChannelID = Cl.ChkClng(sChannelID) sTemp = "" sqlSpecial = "select SpecialID,SpecialName,AddGroup from Cl_Special where (ChannelID=-1 or ChannelID="&sChannelID&") order by OrderID Desc" set rsSpecial=Cl.Execute(sqlSpecial) if Not (rsSpecial.bof and rsSpecial.bof) then sqlSpecial=rsSpecial.GetRows(-1) for i=0 to Ubound(sqlSpecial,2) if Cl.ChkUserLevel(sqlSpecial(2,i),Cl.UserLevel) or ShowType=1 then if Instr(","&sSpecialID&",",","&sqlSpecial(0,i)&",")>0 then sTemp = sTemp & "" else sTemp = sTemp & "" end if end if Next end if Set rsSpecial = Nothing ShowSpecial_Option = sTemp sqlSpecial=Empty End Function '================================================= '显示专题名称:ShowSpecial(sChannelID,TopNum) 'sChannelID ----- (频道ID,为区分链接) 'TopNum ----- (最多显示多少个专题名称) '================================================= Function ShowSpecial(sChannelID,TopNum) Dim Sql, Rs, i, sTemp TopNum = Cl.ChkClng(TopNum) sChannelID = Cl.ChkClng(sChannelID) if TopNum = 0 then TopNum = 10 if sChannelID = 0 then sChannelID = 1 Sql="Select Top "&TopNum&" SpecialID,SpecialName,ChannelID from Cl_Special where ChannelID=-1 or ChannelID="&sChannelID&" order by OrderID" Set Rs = Cl.Execute(sql) if Rs.bof and Rs.eof then ShowSpecial= " 没有任何专题栏目" Rs.Close : Set Rs = Nothing : Exit Function else Sql=Rs.GetRows(-1) Rs.Close : Set Rs = Nothing Cl.GetChannelSetting(sChannelID) sTemp = "
  • " & Sql(1,0) & "

  • " For i = 1 to Ubound(Sql,2) sTemp = sTemp & "
  • " & Sql(1,i) & "

  • " Next ShowSpecial=sTemp & "

    更多专题

    " SQL=Empty end if End Function '分页显示所有专题 Function ShowSpecialList(sChannelID) Dim SQL,Rs,i,sTemp SQL="select SpecialID,SpecialName,ChannelID from Cl_Special where ChannelID=-1 or ChannelID="&sChannelID&" order by OrderID" Set Rs= server.CreateObject ("adodb.recordset") OpenConn : Rs.open SQL,Conn,1,1 if rs.bof and rs.eof then TotalPut=0 ShowSpecialList = " 没有任何专题栏目" Rs.close : Set Rs=Nothing : Exit Function else Cl.GetChannelSetting(sChannelID) TotalPut=rs.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rs.move (CurrentPage-1)*MaxPerPage SQL = Rs.GetRows(-1) Rs.close:Set Rs=Nothing if sChannelID=0 then For i=0 to Ubound(SQL,2) sTemp=sTemp & "
  • " & SQL(1,i) & " --> " Cl.Name="Channel" If Cl.ObjIsEmpty() Then Cl.Load_Channel() dim sTrRow,sTrCol,n sTrRow=Split(Cl.value,"$$$") For n = 0 to UBound(sTrRow)-1 sTrCol=Split(sTrRow(n),"|||") if Cint(sTrCol(4))<2 and Cint(strcol(0))<>0 and Cint(strcol(0))<>6 then sTemp = sTemp & " [" & sTrCol(1)&"]" end if next sTemp = sTemp & "
  • " Next else For i=0 to Ubound(SQL,2) sTemp=sTemp & "
  • " & SQL(1,i) & "
  • " Next end if ShowSpecialList = sTemp SQL=Empty end if End Function '============================================== Sub RefreshJs(Byval sChannelID) Dim RsRe,sTr,sID,sModuleID,TempData sID=Cl.ChkClng(sChannelID) if sID>0 then Set RsRe=Cl.Execute("Select ChannelID,JsName,JsReadme,JsType,JsFileName,Config From Cl_Js where ChannelID="&sID&"") else Set RsRe=Cl.Execute("Select ChannelID,JsName,JsReadme,JsType,JsFileName,Config From Cl_Js") end if Do while Not Rsre.eof ChannelID=RsRe(0) Cl.GetChannelSetting(ChannelID) sModuleID=Cl.ChkClng(Cl.Channel_Setting(20)) if sModuleID=0 then Exit do Cl.LoadTemplates("") if Rsre("JsType")=0 then TempData=Cl.ReplaceAllFlag(Rsre("Config")) TempData=replace(replace(replace(TempData,chr(34),""),chr(10),"\n"),chr(13),"\n") else sTr=Split(Rsre("Config"),"@@") sTr(0)=Split(sTr(0),"||") sTr(1)=Split(sTr(1),"||") Select Case sModuleID Case 1 TempData=GetArticle(sTr(0)(0),sTr(0)(1),sTr(0)(2),sTr(0)(3),sTr(0)(4),sTr(0)(5),sTr(0)(6),sTr(0)(7),sTr(0)(8),sTr(0)(9),sTr(0)(10),sTr(1)(0),sTr(1)(1),sTr(1)(2)) Case 2 TempData=GetSoft(sTr(0)(0),sTr(0)(1),sTr(0)(2),sTr(0)(3),sTr(0)(4),sTr(0)(5),sTr(0)(6),sTr(0)(7),sTr(0)(8),sTr(0)(9),sTr(0)(10),sTr(1)(0),sTr(1)(1),sTr(1)(2)) Case 3 TempData=GetPhoto(sTr(0)(0),sTr(0)(1),sTr(0)(2),sTr(0)(3),sTr(0)(4),sTr(0)(5),sTr(0)(6),sTr(0)(7),sTr(0)(8),sTr(0)(9),sTr(0)(10),sTr(1)(0),sTr(1)(1),sTr(1)(2)) Case 4 TempData=GetMovie(sTr(0)(0),sTr(0)(1),sTr(0)(2),sTr(0)(3),sTr(0)(4),sTr(0)(5),sTr(0)(6),sTr(0)(7),sTr(0)(8),sTr(0)(9),sTr(0)(10),sTr(1)(0),sTr(1)(1),sTr(1)(2)) Case 5 TempData=GetProduct(sTr(0)(0),sTr(0)(1),sTr(0)(2),sTr(0)(3),sTr(0)(4),sTr(0)(5),sTr(0)(6),sTr(0)(7),sTr(0)(8),sTr(0)(9),sTr(0)(10),sTr(1)(0),sTr(1)(1),sTr(1)(2)) Case Else Exit do End Select end if TempData=Replace(TempData,Vbcrlf,"") TempData="document.write ('" & Replace(TempData,",","") & "');" Cl.MakeHtml TempData,Cl.WebDir & Cl.Channel_Setting(4) & "/Js/"&Rsre("JsFileName")&".Js" Rsre.Movenext Loop RsRe.Close:Set RsRe=Nothing End Sub Sub RefreshCountJs() Dim rs,strJs Set rs=Cl.Execute("Select ChannelID,ChannelName,ChannelItemName,ChannelItemUnit,CountConfig From Cl_Channel where ChannelType<=1 Order by OrderID") do while not rs.eof strJs=Replace(Cl.ChkNull(rs(4)),"{%channelid%}",rs(0)) strJs=Replace(strJs,"{%channelname%}",rs(1)) strJs=Replace(strJs,"{%channelitemname%}",rs(2)) strJs=Replace(strJs,"{%channelitemunit%}",rs(3)) strJs=Cl.ReplaceFlag(strJs,"ShowWebCount","") strJs="document.write ('"&Replace(strJs,VbCrLf,"
    ")&"');" Cl.MakeHtml strJs,Cl.WebDir&"Js/Count/Count_"&rs(0)&".Js" rs.MoveNext loop Set rs=Nothing End Sub Sub RefreshClassMenuJs() Dim rs Set rs=Cl.Execute("Select ChannelID From Cl_Channel where ChannelType<=1 and ChannelID>0 and ChannelID<>6 Order by OrderID") Cl.LoadTemplates("") do while not rs.eof ChannelID=rs(0) Cl.MakeHtml Cl.GetClassMenu(ChannelID),Cl.WebDir&"Js/ClassMenu/ClassMenu_" & ChannelID & ".Js" rs.MoveNext loop Set rs=Nothing End Sub Sub CreateClassJs(sChannelID) Cl.GetChannelSetting(sChannelID) Cl.LoadTemplates("") Cl.MakeHtml Cl.GetClassMenu(sChannelID),Cl.WebDir&"Js/ClassMenu/ClassMenu_" & sChannelID & ".Js" dim strSearchDate,i for i=3 to 5 strSearchDate=Replace(Cl.ReplaceDir(ShowSearchForm(sChannelID,i)),"'","") strSearchDate="document.write ('" & Replace(strSearchDate,vbcrlf,"\n") & "');" Cl.MakeHtml strSearchDate,Cl.WebDir&"Js/Search/Search" & sChannelID & "_" & i & ".Js" next End Sub Function ChkPicUrl(sDir,sTopDir,PicUrl) If IsEmpTy(PicUrl) or PicUrl="" then ChkPicUrl=sDir & "Images/NoPic.Gif" else PicUrl=lcase(Trim(PicUrl)) PicUrl=Replace(PicUrl,"{%webdir%}",sDir) PicUrl=Replace(PicUrl,"{%uploaddir%}",sTopDir & Cl.UploadDir) ChkPicUrl=PicUrl End if End Function Sub Admin_ShowErr(sErrMsg) Response.Write "错误信息" Response.Write "" Response.Write "" Response.Write "

    " Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "
    错误信息
    产生错误的可能原因:
    "&sErrMsg&"
    返回上一步】  【关闭窗口】  【重登录后台
    " CloseAllObj response.end End Sub '显示错误提示信息 Sub User_ShowErr(sErrMsg) Response.Write "错误信息" Response.Write "" Response.Write "" Response.Write "

    " Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "
    错误信息
    产生错误的可能原因:
    "&sErrMsg&"
    返回上一步】  【关闭窗口
    " CloseAllObj response.end End Sub Sub User_MsgNav() Response.Write "" Response.Write "" Response.Write " " Response.Write "" Response.Write "" Response.Write "
    用户短消息功能
    " Response.Write "   " Response.Write "   " Response.Write "   " Response.Write "   " Response.Write "   " Response.Write "

    " End Sub Sub Header() Response.Write "" & Vbcrlf & "" & Vbcrlf Response.Write "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf Response.Write "Aspoo创力网站管理系统--后台管理" & Vbcrlf Response.Write "" & Vbcrlf Response.Write "" & Vbcrlf Response.Write "" & Vbcrlf Response.Write "" End Sub Sub Footer() Response.Write "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf & _ "" & Vbcrlf & _ "
    Cr"&"eate"&"Live C"&"MS V"&"ersion 3"&".1."&Right(Cl.SysTemUpDate,4)&"
    "& Cl.Web_info(9) &"
    " & Vbcrlf Response.Write "" & Vbcrlf & "" CloseAllObj End Sub Public Sub ShowCreateWindow(w_title,w_href) Response.Write "" Response.Write "" Response.Write "" Response.Write "
    HTML生成管理窗口
    "&w_title&"
    注意,在未完成时,请不要关闭浏览器或刷新本页。
    " Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "
    " Response.Write "" Response.Write "
    " Response.Write "
    0%
    " Response.Write "" Response.Write "" Response.Write "
      查看详细进程
    " Response.Write "
    " Response.Write "
    " Response.write "
    " Response.write "" Response.Flush End Sub Public Sub RefreshHtml(txt,Nown,Alln) Response.Write "" Response.Flush End Sub Public Sub RefreshHtml2(SName,SValue) Response.Write "" Response.Flush End Sub %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Article.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== Public Sub Article_Setting() CurrentPath = Cl.lanstr(1) & "" & Cl.Web_info(0) & " >> " & Cl.ChannelName & "" Cl.Title = Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" if keyword<>"" then keyword=Cl.ReplaceBadChar(keyword) if ArticleID>0 then Set rs = Cl.Execute("select * From Cl_Article where ChannelID=" & ChannelID & " and Deleted=False and Passed=True and ArticleID=" & ArticleID & "") if rs.bof and rs.eof then Cl.OutErr(Replace(Template.Strings(0),"{%channelitemname%}",Cl.ChannelItemName)) ClassID=rs("ClassID"):SpecialID=rs("SpecialID"):InfoTitle=rs("Title") if rs("Hot")=False then if rs("hits")>=Clng(Cl.Web_Setting(14)) then Cl.Execute("Update Cl_Article Set Hot=True where ArticleID=" & ArticleID & "") end if end if if ClassID>0 then sql="select ClassName,ParentID,ParentPath,ClassDir,ParentDir,RootID,Depth,Child,arrChildID,BrowsePurview,VipUser,StyleID,CssID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & ClassID set tClass=Cl.Execute(sql) if tClass.bof and tClass.eof then Cl.OutErr(Template.Strings(2)) ClassName = tClass(0) : ParentID = tClass(1) : ParentPath= tClass(2) ClassDir = tClass(3) : ParentDir = tClass(4) : RootID = tClass(5) Depth = tClass(6) : Child = tClass(7) : arrChildID= tClass(8) BrowsePurview=tClass(9) : VipUser = tClass(10): TStyleID = tClass(11) : TCssID=tClass(12) if TStyleID > 0 or TCssID > -1 then If TStyleID > 0 then Cl.StyleID = TStyleID If TCssID > -1 then Cl.CssID = TCssID Cl.LoadTempLates(Cl.Channel_Setting(4)) end if if ParentID>0 then dim sqlPath,rsPath sqlPath="select ClassID,ClassName,ParentPath,ClassDir,ParentDir From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth" set rsPath=Cl.Execute(sqlPath) do while not rsPath.eof CurrentPath=CurrentPath & " >> " & rsPath(1) & "" rsPath.movenext loop set rsPath=Nothing end if CurrentPath=CurrentPath & " >> " & ClassName & "" end if End Sub 'Rem 文章 Function GetArticle(Byval sChannelID,Byval sClassID,Byval sSpecialID,Byval TopNum,Byval IncludeChild,Byval ShowType, _ Byval ColsNum,Byval IsHot,Byval IsElite,Byval DateNum,Byval OrderType,Byval Style1,Byval Style2,Byval Style3) Dim JsSQL,sHTML,sTitleMaxLen,TitleStr,LinkUrl,FileType Dim Author,AuthorName,AuthorEmail Dim SystemTopDir,SystemDir Dim Rs,i On Error Resume Next SystemTopDir = "http://"&Request.servervariables("Server_Name") SystemDir = SystemTopDir & Cl.WebDir sChannelID = Clng(sChannelID) sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) TopNum = Clng(TopNum) IncludeChild = CBool(IncludeChild) ShowType = Clng(ShowType) ColsNum = Clng(ColsNum) IsHot = CBool(IsHot) IsElite = CBool(IsElite) DateNum = CLng(DateNum) OrderType = CLng(OrderType) Style1 = Trim(Style1) Style2 = Trim(Style2) Style3 = Trim(Style3) if Err then Err.Clear : GetArticle="GetArticle参数错误。":Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) if TopNum > 0 then JsSQL="select top " & TopNum & " " else JsSQL="select top 100 " end if JsSQL=JsSQL & " A.ArticleID,A.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,A.Title,A.Prefixion,A.Author,A.CopyFrom,A.Editor,A.Keyword,A.Hits,A.DayHits,A.WeekHits,A.MonthHits,A.UpdateTime,A.OnTop,A.Hot,A.Elite,A.Passed,A.Content,A.DefaultPicUrl,A.ReadLevel,A.ReadPoint,A.Stars,A.TitleFontColor,A.TitleFontType,A.IsHtml,A.HtmlFileUrl,A.Intro,A.IsLink from Cl_Article A" JsSQL=JsSQL & " inner join Cl_Class C on A.ClassID=C.ClassID where A.Deleted=False and A.Passed=True and A.ChannelID="&sChannelID&"" if sClassID>0 then if IncludeChild=True then Dim tClass set tClass=Cl.Execute("select ClassID,ParentPath,arrChildID From Cl_Class where ClassID=" & sClassID) if tClass.bof and tClass.eof then GetArticle="找不到指定的栏目。" : set tClass=Nothing : Exit Function else JsSQL=JsSQL & " and A.ClassID in (" & tClass(2) & ")" end if set tClass=Nothing else JsSQL=JsSQL & " and A.ClassID=" & sClassID & "" end if end if if sSpecialID>0 then JsSQL=JsSQL & " and A.SpecialID like '%" & sSpecialID & "%'" if ShowType >= 2 then JsSQL=JsSQL & " and A.DefaultPicUrl<>''" if IsHot=True then JsSQL=JsSQL & " and A.Hot=True" if IsElite=True then JsSQL=JsSQL & " and A.Elite=True" if DateNum>0 then JsSQL=JsSQL & " and DATEDIFF('d',A.UpdateTime,"&SQLNowString&")<=" & DateNum & " " end if JsSQL=JsSQL & " order by A.OnTop asc" Select Case OrderType Case 1 : JsSQL=JsSQL & " ,A.ArticleID desc" Case 2 : JsSQL=JsSQL & " ,A.ArticleID asc" Case 3 : JsSQL=JsSQL & " ,A.UpDateTime desc, A.ArticleID desc" Case 4 : JsSQL=JsSQL & " ,A.UpDateTime asc, A.ArticleID desc" Case 5 : JsSQL=JsSQL & " ,A.Hits desc, A.ArticleID desc" Case 6 : JsSQL=JsSQL & " ,A.Hits asc, A.ArticleID desc" Case else : JsSQL=JsSQL & " ,A.ArticleID desc" End Select set Rs=server.createObject("Adodb.recordset") OpenConn : Rs.open JsSQL,Conn,1,1 if Rs.bof and Rs.eof then GetArticle = "没有任何"&Cl.Channel_Setting(2)&"!" Rs.close:set Rs=Nothing : Exit Function End if JsSQL=Rs.GetRows(-1) Rs.close:set Rs=Nothing Dim TempBody Dim regEx,Matches,Match,TempStr Dim PropertyImg,ClassFileUrl,sImgUrl TempBody="":sHTML="" Set regEx = New RegExp regEx.Pattern = "(\{%)(.[^\{]*)(\%\})" regEx.IgnoreCase = True regEx.Global = True For i=0 to Ubound(JsSQL,2) if JsSQL(28,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl = SystemDir & JsSQL(29,i) elseif JsSQL(31,i)=True then LinkUrl = SystemDir & JsSQL(29,i) else LinkUrl = SystemDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID=" & JsSQL(0,i) end if if instr(JsSQL(8,i),"|")>0 then Author = Split(JsSQL(8,i),"|") AuthorName = Author(0) AuthorEmail = Author(1) else AuthorName = JsSQL(8,i) end if if JsSQL(17,i)=True then PropertyImg = "" elseif JsSQL(19,i)=True then PropertyImg = "" else PropertyImg = "" end if ClassFileUrl = SystemDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),JsSQL(3,i),JsSQL(1,i),JsSQL(5,i),JsSQL(4,i),Cl.Channel_Setting(10),Cl.Channel_Setting(13)) if ShowType >= 2 then FileType=right(lcase(JsSQL(22,i)),3) JsSQL(22,i) = ChkPicUrl(SysTemDir,SysTemTopDir,JsSQL(22,i)) Select Case FileType Case "swf" sImgUrl = "" Case "jpg", "bmp", "png", "gif" sImgUrl = "" Case Else sImgUrl = "" End Select end if TempBody = Style2 TempBody = Replace(TempBody,"{%InfoID%}",JsSQL(0,i)) TempBody = Replace(TempBody,"{%Prefixion%}",JsSQL(7,i)&"") TempBody = Replace(TempBody,"{%PropertyImg%}",PropertyImg) TempBody = Replace(TempBody,"{%LinkUrl%}",LinkUrl) TempBody = Replace(TempBody,"{%ClassID%}",JsSQL(1,i)) TempBody = Replace(TempBody,"{%ClassName%}",JsSQL(2,i)) TempBody = Replace(TempBody,"{%ClassUrl%}",ClassFileUrl) TempBody = Replace(TempBody,"{%AuthorName%}",AuthorName) TempBody = Replace(TempBody,"{%AuthorEmail%}",AuthorEmail) TempBody = Replace(TempBody,"{%Hits%}",JsSQL(12,i)) TempBody = Replace(TempBody,"{%DayHits%}",JsSQL(13,i)) TempBody = Replace(TempBody,"{%WeekHits%}",JsSQL(14,i)) TempBody = Replace(TempBody,"{%MonthHits%}",JsSQL(15,i)) Set Matches = regEx.Execute(TempBody) For Each Match in Matches TempStr = Replace(Match.Value,"{%","") TempStr = Replace(TempStr,"%}","") TempStr = Replace(TempStr,"(",",") TempStr = Replace(TempStr,")","") TempStr = Replace(TempStr,"""","") TempStr = Split(Lcase(TempStr),",") Select Case TempStr(0) Case "title" TitleStr = Cl.GotTopic(JsSQL(6,i),TempStr(1)) TitleStr = Cl.GetTitleFont(TitleStr,JsSQL(27,i)) TitleStr = Cl.FormatColor(TitleStr,JsSQL(26,i)) TempBody = Replace(TempBody,Match.Value,TitleStr) Case "imgurl" sImgUrl = Replace(sImgUrl,"{%ImgWidth%}",TempStr(1)) sImgUrl = Replace(sImgUrl,"{%ImgHeight%}",TempStr(2)) TempBody = Replace(TempBody,Match.Value,sImgUrl) Case "intro" TempBody = Replace(TempBody,Match.Value,Left(JsSQL(30,i)&"",TempStr(1))) Case "updatetime" TempBody = Replace(TempBody,Match.Value,Cl.Format_Time(JsSQL(16,i),TempStr(1))) End Select Next sHTML = sHTML & TempBody if (i+1) mod ColsNum=0 then sHTML = sHTML & Style3 Next GetArticle=Replace(Style1,"{%ContentBody%}",sHTML) JsSQL=Empty End Function '================================================= '过程名:ShowClassArticle(sChannelID,sClassID,ModNum,TopNum) '参 数: ' sChannelID ---- 频道ID ' sClassID ---- 指定栏目,多个用“|”分隔,不指定请留空或0 ' ModNum --- 多少个换行 ' TopNum --- 最多显示记录数 '================================================= Function ShowClassArticle(Byval sChannelID,Byval sClassID,Byval ModNum,Byval TopNum) dim sqlRoot,rsRoot,ClassCount,iClassID Dim sTemp,strValue sChannelID = Cl.ChkClng(sChannelID) sClassID = Trim(sClassID) ModNum = Cl.ChkClng(ModNum) if sClassID="" or sClassID="0" then TopNum = Cl.ChkClng(TopNum) if TopNum=0 then TopNum = 6 sqlRoot="select Top "&TopNum&" ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and ParentID=0 and IsElite=True and IsOuter=0 order by RootID" Else sqlRoot="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and IsElite=True and IsOuter=0 and ClassID In ("&Replace(sClassID,"|",",")&") order by RootID" End if Set rsRoot= Cl.Execute(sqlRoot) if rsRoot.bof and rsRoot.eof then sTemp="还没有任何栏目,请首先添加栏目。" rsRoot.Close:Set rsRoot=Nothing:Exit Function end if sqlRoot=rsRoot.GetRows(-1) rsRoot.Close:Set rsRoot=Nothing Cl.GetChannelSetting(sChannelID) Cl.LoadTempLates(Cl.Channel_Setting(4)) for iClassID=0 to Ubound(sqlRoot,2) strValue=Replace(Template.html(8),"{%channelid%}",sChannelID) strValue=Replace(strValue,"{%classid%}",sqlRoot(0,iClassID)) strValue=Replace(strValue,"{%classtitle%}",sqlRoot(8,iClassID)&"") strValue=Replace(strValue,"{%classname%}",sqlRoot(1,iClassID)) strValue=Replace(strValue,"{%classfileurl%}",Cl.WebDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),sqlRoot(2,iClassID),sqlRoot(0,iClassID),sqlRoot(4,iClassID),sqlRoot(3,iClassID),Cl.Channel_Setting(10),Cl.Channel_Setting(13))) strValue=Cl.ReplaceFlag(strValue,"showarticle","") if ((iClassID+1) mod ModNum) = 0 then strValue = strValue & Split(Template.html(9),"||")(1) else strValue = strValue & Split(Template.html(9),"||")(0) end if sTemp=sTemp & strValue Next ShowClassArticle=Replace(Template.html(7),"{%classarticlebody%}",sTemp) sqlRoot=Empty End Function '==================================================================================================== '过程:ShowPicArticle(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowType,Cols,ImgWidth,ImgHeight,ContentLen,IsHot,IsElite) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为所有栏目,若大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为所有栏目,若大于0,则调用指定专题) ' TopNum ------ 最多显示多少篇 ' TitleLen ------ 标题最多字符数 ' ShowType ------ 显示方式。0(图),1(图+标),2(图+标+内),3(图+幻),4(图+标+幻) ' Cols ------ 列数。超过此列数就换行 ' ImgWidth ------ 图片宽度 ' ImgHeight ------ 图片高度 ' ContentLen ------ 内容最多字符数 ' IsHot ------ 是否是热门(True为是,False为否) ' IsElite ------ 是否是推荐(True为是,False为否) '==================================================================================================== Function ShowPicArticle(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowType,Byval Cols,Byval ImgWidth, _ Byval ImgHeight,Byval ContentLen,Byval IsHot,Byval IsElite) On Error Resume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowType = Clng(ShowType) Cols = Clng(Cols) : ImgWidth = Clng(ImgWidth) ImgHeight = Clng(ImgHeight) : ContentLen = Clng(ContentLen) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) if Err then Err.Clear : ShowPicArticle="ShowPicArticle参数错误。":Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) dim rsPic,sqlPic,tClass,j,strPic if TopNum<=0 then sqlPic="Select " else sqlPic="Select top "&TopNum&" " end if sqlPic=sqlPic & " ArticleID,ClassID,Title,Author,UpdateTime,Editor,TitleFontColor,TitleFontType,Content,OnTop,Hot,Elite,Passed,Prefixion,Stars,PaginationType,DefaultPicUrl,hits,IsHtml,HtmlFileUrl,Intro from Cl_Article where Deleted=False and Passed=True and DefaultPicUrl<>'' and ChannelID="&sChannelID&" " if sClassID>0 then set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlPic=sqlPic & " and ClassID in (" & tClass(3) & ")" else sqlPic=sqlPic & " and ClassID=" & sClassID end if else sqlPic=sqlPic & " and ClassID=" & sClassID end if set tClass=Nothing end if if sSpecialID>0 then sqlPic=sqlPic & " and SpecialID Like '%" & sSpecialID & "%'" if IsHot=True then sqlPic=sqlPic & " and Hot=True " if IsElite=True then sqlPic=sqlPic & " and Elite=True " 'if IsSqlDataBase=1 then sqlPic=sqlPic & " order by OnTop Asc,UpdateTime desc,ArticleID desc" Set rsPic= Server.CreateObject("ADODB.Recordset") OpenConn : rsPic.open sqlPic,Conn,1,1 strPic= "" if rsPic.bof and rsPic.eof then strPic = strPic & "" rsPic.Close : Set rsPic = Nothing else dim FileType,TitleStr,LinkUrl if TopNum<=0 or TopNum>=100 then TotalPut=rsPic.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsPic.move (CurrentPage-1)*MaxPerPage sqlPic = rsPic.GetRows(MaxPerPage) else sqlPic=rsPic.GetRows(-1) end if rsPic.Close : Set rsPic = Nothing Select Case ShowType Case 0 for j=0 to Ubound(sqlPic,2) if CBool(sqlPic(18,j)) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(19,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 1 for j=0 to Ubound(sqlPic,2) if CBool(sqlPic(18,j)) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(19,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 2 for j=0 to Ubound(sqlPic,2) strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 3, 4 Dim sImgID sImgID=Cl.CreatePass(3) & "Cl" & ImgWidth & ImgHeight & ContentLen' & IsHot & IsElite strPic = strPic & "" & vbcrlf strPic = strPic & "" & vbcrlf if ShowType=4 then strPic = strPic & "" & vbcrlf else strPic = strPic & "" & vbcrlf end if strPic = strPic & "" end Select end if strPic = strPic & "

    没有"&Cl.Channel_Setting(2)&"
    " FileType=right(lcase(sqlPic(16,j)),3) strPic = strPic & "" sqlPic(16,j)=Cl.ReplaceDir(sqlPic(16,j)) Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " FileType=right(lcase(sqlPic(16,j)),3) TitleStr=Cl.GotTopic(sqlPic(2,j),TitleLen) sqlPic(16,j)=Cl.ReplaceDir(sqlPic(16,j)) strPic = strPic & "" Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select TitleStr=Cl.GetTitleFont(TitleStr,sqlPic(7,j)) TitleStr=Cl.FormatColor(TitleStr,sqlPic(6,j)) strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " if CBool(sqlPic(18,j)) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(19,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID=" & sqlPic(0,j) end if FileType=right(lcase(sqlPic(16,j)),3) TitleStr=Cl.GotTopic(sqlPic(2,j),TitleLen) sqlPic(16,j)=Cl.ReplaceDir(sqlPic(16,j)) strPic = strPic & "" Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select TitleStr=Cl.GetTitleFont(TitleStr,sqlPic(7,j)) TitleStr=Cl.FormatColor(TitleStr,sqlPic(6,j)) strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " & left(Cl.NoHtml(sqlPic(8,j)),ContentLen) & "……
    " & vbcrlf strPic = strPic & "" & vbcrlf strPic = strPic & "
    " ShowPicArticle=strPic sqlPic=Empty End Function '==================================================================================================== '过程:ShowArticle(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowClassName,ShowProperty,ShowPrefix,ShowAuthor,ShowDateType,ShowHits,ShowHot,IsElite,IsHot,UserName,CssStyle) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为全部,如果大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为全部,如果大于0,刚调用指定专题) ' TopNum ------ 最多记录数,0为全部(用于分页显示) ' TitleLen ------ 标题最多字符数 ' ShowClassName ------ 是否显示栏目名称(True为显示,False为不显示) ' ShowProperty ------ 是否显示文章属性(固顶/推荐/普通),(True为显示,False为不显示) ' ShowPrefix ------ 是否显示前缀如:[推荐][图文][注意]字样(True为显示,False为不显示) ' ShowAuthor ------ 是否显示文章作者,True为显示,False为不显示) ' ShowDateType ------ 显示更新日期的样式 ' ---- 0(不显示) ' ---- 1(2004-10-01 23:45:45) ' ---- 2(年-月-日 时:分:秒) ' ---- 3(2004-10-01) ' ---- 4(2004\10\01) ' ---- 5(10-01 23:45) ' ---- 6(2004年10月01日) ' ---- 7(10-01) ' ---- 8(20041001234545) ' ShowHits ------ 是否显示文章点击数(True为显示,False为不显示) ' ShowHot ------ 是否显示热门文章标志(True为显示,False为不显示) ' IsHot ------ 是否热门(True为是,False为否) ' IsElite ------ 是否推荐(True为是,False为否) ' UserName ------ 指定某用户(不指定请留空值或0) ' CssClassName ------ CSS样式 '==================================================================================================== Function ShowArticle(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowClassName,Byval ShowProperty, _ Byval ShowPrefix,Byval ShowAuthor,Byval ShowDateType,Byval ShowHits, _ Byval ShowHot,Byval IsHot,Byval IsElite,Byval UserName,Byval CssClassName) On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowClassName = CBool(ShowClassName) ShowProperty = CBool(ShowProperty) : ShowPrefix = CBool(ShowPrefix) ShowAuthor = CBool(ShowAuthor) : ShowDateType = Clng(ShowDateType) ShowHits = CBool(ShowHits) : ShowHot = CBool(ShowHot) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) UserName = Trim(UserName) : CssClassName = Trim(CssClassName) if Err then Err.Clear : ShowArticle="ShowArticle参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) Dim SQLInfo if TopNum<=0 then SqlInfo="Select " else SqlInfo="Select Top "&TopNum&" " end if SqlInfo = SqlInfo & "A.ArticleID,A.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,A.Title,A.Author,A.CopyFrom,A.UpdateTime,A.Editor,A.TitleFontColor,A.TitleFontType,A.Hits,A.OnTop,A.Hot,A.Elite,A.Passed,A.Prefixion,A.Stars,A.PaginationType,A.ReadLevel,A.ReadPoint,A.DefaultPicUrl,A.IsHtml,A.HtmlFileUrl,Intro from Cl_Article A Inner Join Cl_Class C On A.ClassID=C.ClassID where A.Deleted=False and A.Passed=True and A.ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then SqlInfo=SqlInfo & " and A.ClassID in (" & tClass(3) & ")" else SqlInfo=SqlInfo & " and A.ClassID=" & sClassID end if else SqlInfo=SqlInfo & " and A.ClassID=" & sClassID end if Set tClass=Nothing end if if sSpecialID>0 then SqlInfo=SqlInfo & " and A.SpecialID Like '%" & sSpecialID & "%'" if IsElite=True then SqlInfo=SqlInfo & " and A.Elite=True" if IsHot=True then SqlInfo=SqlInfo & " and A.Hot=True" if UserName<>"" and UserName<>"0" then SqlInfo=SqlInfo & " and A.Editor='" & UserName & "'" 'if IsSqlDataBase=1 then SqlInfo=SqlInfo & " order by A.OnTop Asc,A.UpdateTime desc,A.ArticleID desc" Set rsInfo= Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open SqlInfo,Conn,1,1 if rsInfo.bof and rsInfo.eof then 'TotalPut=0 ShowArticle="
  • 没有任何"&Cl.Channel_Setting(2)&"
  • " rsInfo.close:set rsInfo=Nothing : Exit Function End if if TopNum<=0 or TopNum>=100 then TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage SqlInfo=rsInfo.GetRows(MaxPerPage) else SqlInfo=rsInfo.GetRows(-1) end if rsInfo.close:set rsInfo=Nothing dim sTemp,Linkurl,i dim TitleStr,Author,AuthorName,AuthorEmail,sTitleLen i=0:sTemp = "" & VbCrlf For i=0 to Ubound(SqlInfo,2) sTitleLen = TitleLen sTemp = sTemp & "" & VbCrlf & "" & VbCrlf Next ShowArticle=sTemp & "
     " if ShowProperty=True then if SqlInfo(14,i)=True then sTemp = sTemp & " " elseif SqlInfo(16,i)=True then sTemp = sTemp & " " else sTemp = sTemp & " " end if end if if ShowClassName=True and SqlInfo(1,i)<>ClassID then sTemp=sTemp & "[" & SqlInfo(2,i) & "] " sTitleLen=sTitleLen-Cl.strLength(SqlInfo(2,i))-1 end if if ShowPrefix=True and SqlInfo(18,i)<>"" then sTemp = sTemp & ""&SqlInfo(18,i)&"" sTitleLen=sTitleLen-Cl.strLength(SqlInfo(18,i))-2 end if if Instr(SqlInfo(7,i),"|")>0 then Author=Split(SqlInfo(7,i),"|") AuthorName=Author(0) AuthorEmail=Author(1) else AuthorName=SqlInfo(7,i) AuthorEmail="Aspoo@126.com" end if if CBool(SqlInfo(24,i)) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & SqlInfo(25,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&SqlInfo(0,i) end if sTemp = sTemp & "" TitleStr=Cl.GotTopic(SqlInfo(6,i),sTitleLen) TitleStr=Cl.GetTitleFont(TitleStr,SqlInfo(12,i)) TitleStr=Cl.FormatColor(TitleStr,SqlInfo(11,i)) sTemp=sTemp & TitleStr & "" if ShowHot=True then if CDate(FormatDateTime(SqlInfo(9,i),2))=Date() then sTemp= sTemp & "" elseif SqlInfo(15,i)=True then sTemp= sTemp & "" end if end if if ShowAuthor=True or ShowHits=True or ShowDateType>0 then sTemp = sTemp & "(" if ShowAuthor=True then sTemp=sTemp & "" & AuthorName & "" end if if ShowHits=True then if ShowAuthor=True then sTemp=sTemp & "," end if sTemp=sTemp & Cl.FormatColor(SqlInfo(13,i),"#ff0033") end if if ShowDateType>0 then if ShowHits=True or ShowAuthor=True then sTemp=sTemp & "," end if if CDate(FormatDateTime(SqlInfo(9,i),2))=date() then sTemp = sTemp & "" else sTemp = sTemp & "" end if sTemp = sTemp & Cl.Format_Time(SqlInfo(9,i),ShowDateType) & "" end if sTemp = sTemp & ")" end if sTemp = sTemp & "
    " SqlInfo=Empty end Function '================================================================ '过程名:ShowTopArticle(sChannelID,sClassID,TopNum,TitleLen,ShowType,ShowHits) ' sChannelID ----频道ID ' sClassID ----栏目ID ' TopNum ----下载TOP ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 ' ShowType ----- 1(本日),2(本周),3(本月),4(累计) ' ShowHits ------ (是否显示点击数,True为是) '================================================================ Function ShowTopArticle(Byval sChannelID,Byval sClassID,Byval TopNum, _ Byval TitleLen,Byval ShowType,Byval ShowHits) dim sqlTop,rsTop,LinkUrl On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) TopNum = Clng(TopNum) : TitleLen = Clng(TitleLen) ShowType = Clng(ShowType) : ShowHits = CBool(ShowHits) if Err then Err.Clear : ShowTopArticle="ShowTopArticle参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) if TopNum>0 then sqlTop="select top " & TopNum & " " else sqlTop="select top 10 " end if sqlTop=sqlTop & " ArticleID,ClassID,Title,Author,UpdateTime,Editor,TitleFontColor,TitleFontType,Content,OnTop,Hot,Elite,Passed,Prefixion,Stars,PaginationType,DefaultPicUrl,hits,IsHtml,HtmlFileUrl,Intro from Cl_Article where Deleted=False and Passed=True and ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlTop=sqlTop & " and ClassID in (" & tClass(3) & ")" else sqlTop=sqlTop & " and ClassID=" & sClassID end if else sqlTop=sqlTop & " and ClassID=" & sClassID end if Set tClass=Nothing end if Select Case ShowType Case 1 sqlTop=sqlTop & " And datediff('D',LastHitTime,now())<=0 order by DayHits desc,ArticleID desc" Case 2 sqlTop=sqlTop & " And datediff('ww',LastHitTime,now())<=0 order by WeekHits desc,ArticleID desc" Case 3 sqlTop=sqlTop & " And datediff('m',LastHitTime,now())<=0 order by MonthHits desc,ArticleID desc" Case Else sqlTop=sqlTop & " order by Hits desc,ArticleID desc" end Select Set rsTop= Cl.Execute(sqlTop) if rsTop.bof and rsTop.eof then ShowTopArticle = "
  • 没有"&Cl.Channel_Setting(2)&"
  • " rsTop.Close:Set rsTop=Nothing:Exit Function End if Dim i,sTemp i=1:sTemp = "" sqlTop=rsTop.GetRows(-1) rsTop.Close:Set rsTop=Nothing For i=0 to Ubound(sqlTop,2) if sqlTop(18,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlTop(19,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&sqlTop(0,i) end if sTemp = sTemp & "
  • " & Cl.gotTopic(sqlTop(2,i),TitleLen) & "" if ShowHits=True then sTemp=sTemp & "(" & sqlTop(17,i) & ")" end if sTemp = sTemp & "

  • " Next ShowTopArticle=sTemp sqlTop=Empty End Function '======================================================================= '显示相关文章 'ShowCorrelativeArticle(sChannelID,TopNum,TitleLen,ShowHits) ' sChannelID ' TopNum ------ (文章数量) ' TitleLen ------ (标题字符数) ' ShowHits ------ (是否显示点击数,True为是) '======================================================================= Function ShowCorrelativeArticle(Byval sChannelID,Byval TopNum,Byval TitleLen,Byval ShowHits) dim rsC,SQL,sTemp dim strKey,arrKey,i sChannelID=Cl.ChkClng(sChannelID):ShowHits=Cl.ChkCBool(ShowHits) TopNum=Cl.ChkClng(TopNum):TitleLen=Cl.ChkClng(TitleLen) if TopNum>0 then SQL="select top " & TopNum else SQL="Select Top 5 " end if strKey=rs("Keyword") if instr(strkey,"|")>1 then arrKey=split(strKey,"|") strKey="((Keyword like '%" & arrKey(0) & "%')" for i=1 to ubound(arrKey) strKey=strKey & " or (Keyword like '%" & arrKey(i) & "%')" next strKey=strKey & ")" else strKey="(Keyword like '%" & strKey & "%')" end if SQL=SQL & " ArticleID,Title,Author,UpdateTime,Hits,IsHtml,HtmlFileUrl From Cl_Article Where Deleted=False and Passed=True and " & strKey & " and ArticleID<>" & ArticleID & " and ChannelID="&sChannelID&" Order by UpdateTime desc,ArticleID desc" Set rsC= Cl.Execute(SQL) if rsC.bof and rsC.Eof then sTemp="
  • 无相关文章
  • " else sTemp="" Dim LinkUrl Cl.GetChannelSetting(sChannelID) do while not rsC.eof if rsC("IsHtml")=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & rsC("HtmlFileUrl") else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&rsC("ArticleID") end if sTemp=sTemp&"
    " sTemp=sTemp&" " & Cl.GotTopic(rsC("Title"),TitleLen) & "" if ShowHits=True then sTemp=sTemp&"[" & rsC("hits") & "]" end if sTemp=sTemp&"
    " rsC.movenext loop end if rsC.close:set rsC=Nothing ShowCorrelativeArticle=sTemp End Function '=================================================================== '显示上一篇或下一篇文章 '过程名:ShowNearArticle(sChannelID,sClassID,sInfoID,TitleLen,sType) '参 数: 'sChannelID ------ sChannelID(频道ID) 'sClassID ------ sClassID(栏目ID) 'sInfoID ------ sInfoID(文章ID) 'TitleLen ------ TitleLen(标题最多字符数) 'sType ------ sType(n为下一篇文章) '=================================================================== Function ShowNearArticle(Byval sChannelID,Byval sClassID,Byval sInfoID,Byval TitleLen,Byval sType) dim rsNear,sqlNear sChannelID =Cl.ChkClng(sChannelID) : sInfoID = Cl.ChkClng(sInfoID) sClassID =Cl.ChkClng(sClassID) : TitleLen = Cl.ChkClng(TitleLen) sqlNear="Select Top 1 ArticleID,ClassID,Title,Author,UpdateTime,Hits,IsHtml,HtmlFileUrl From Cl_Article Where Deleted=False and Passed=True and ChannelID="&sChannelID&" and ClassID=" & sClassID & " " if Lcase(sType)="n" then sqlNear=sqlNear & " and ArticleID>" & sInfoID & " order by UpdateTime ASC,ArticleID ASC" else sqlNear=sqlNear & " and ArticleID<" & sInfoID & " order by UpdateTime DESC,ArticleID DESC" end if Set rsNear= Cl.Execute(sqlNear) if rsNear.Eof then ShowNearArticle="没有了" else Dim LinkUrl Cl.GetChannelSetting(sChannelID) sqlNear = rsNear.GetRows(-1) if sqlNear(6,0)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlNear(7,0) elseif CreateHtmlIng=True then LinkUrl=Cl.WebDir & Cl.GetItemPath(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),ParentPath,ClassID,ParentDir,ClassDir) & Cl.GetItemFileName(Cl.Channel_Setting(12),sqlNear(1,0),sqlNear(0,0),sqlNear(4,0)) &"."&Cl.Channel_Setting(13) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/ArticleShow.asp?ArticleID="&sqlNear(0,0) end if ShowNearArticle = "" & Cl.GotTopic(sqlNear(2,0),TitleLen) & "" end if rsNear.Close : Set rsNear=Nothing End Function '显示文章具体的内容:ShowArticleContent Function ShowArticleContent() if (Cl.ChkUserLevel(rs("ReadLevel"),5)=False or rs("Receive")=True) and CreateHtmlIng=True then ShowArticleContent="" Exit Function end if if Not ChkTrueRead then ErrMsg=Replace(Template.Strings(11),"{%content%}",Cl.NoHtml(rs("Intro"))) & ErrMsg ShowArticleContent=ErrMsg Exit Function end if dim sTContent Set ClUbb = New Cls_UbbCode ClUbb.OpenHTML = 1 Select Case Rs("PaginationType") Case 0 : sTContent = Rs("Content") '不分页显示 Case 1 : sTContent = AutoPagination '自动分页显示 Case 2 : sTContent = ManualPagination '手动分页显示 End Select ShowArticleContent = ErrMsg & ClUbb.UbbCode(sTContent) Set ClUbb=Nothing if Not CreateHtmlIng then Cl.Execute("Update Cl_Article Set Hits=Hits+1 where ArticleID=" & ArticleID & "") 'Cl.GetCookies "View_"&ChannelID&"_"&ArticleID,"OK" end if End Function '采用手动分页方式 Function ManualPagination() dim strContent dim ContentLen,MaxPerPage',pages,i dim arrContent strContent=rs("Content") ContentLen=len(strContent) if Instr(strContent,"[NextPage]")<=0 then ManualPagination=strContent : Exit Function else Dim sTemp arrContent=split(strContent,"[NextPage]") pages=Ubound(arrContent)+1 if CurrentPage<1 then CurrentPage=1 if CurrentPage>pages then CurrentPage=pages sTemp="

    " & arrContent(CurrentPage-1) sTemp=sTemp & "

    " if CreateHtmlIng=True then if CurrentPage>1 then if (CurrentPage-1) > 1 then sTemp=sTemp & "上一页  " else sTemp=sTemp & "上一页  " end if end if for i=1 to pages if i=CurrentPage then sTemp=sTemp & "[" & cstr(i) & "] " else if i>1 then sTemp=sTemp & "[" & i & "] " else sTemp=sTemp & "[" & i & "] " end if end if next if CurrentPage下一页" end if else if CurrentPage>1 then sTemp=sTemp & "上一页  " end if for i=1 to pages if i=CurrentPage then sTemp=sTemp & "[" & cstr(i) & "] " else sTemp=sTemp & "[" & i & "] " end if next if CurrentPage下一页" end if end if sTemp=sTemp & "

    " ManualPagination=sTemp end if End Function '采用自动分页方式 Function AutoPagination() dim strContent,sMaxCharPerPage dim ContentLen,MaxPerPage,lngBound dim BeginPoint,EndPoint strContent=rs("Content") ContentLen=len(strContent) sMaxCharPerPage=rs("MaxCharPerPage") if Not IsNumeric(sMaxCharPerPage) then sMaxCharPerPage=0 if ContentLen<=sMaxCharPerPage or sMaxCharPerPage<10 then AutoPagination=strContent Exit Function else pages=ContentLen\sMaxCharPerPage if sMaxCharPerPage*pages<1 then CurrentPage=1 if CurrentPage>pages then CurrentPage=pages dim lngTemp dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3 dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2 dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2 dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2 dim lngTemp5,lngTemp5_1,lngTemp5_2 dim lngTemp6,lngTemp6_1,lngTemp6_2 if CurrentPage=1 then BeginPoint=1 else BeginPoint=sMaxCharPerPage*(CurrentPage-1)+1 lngTemp1_1_1=instr(BeginPoint,strContent,"",1) lngTemp1_1_2=instr(BeginPoint,strContent,"",1) lngTemp1_1_3=instr(BeginPoint,strContent,"",1) if lngTemp1_1_1>0 then lngTemp1_1=lngTemp1_1_1 elseif lngTemp1_1_2>0 then lngTemp1_1=lngTemp1_1_2 elseif lngTemp1_1_3>0 then lngTemp1_1=lngTemp1_1_3 else lngTemp1_1=0 end if lngTemp1_2_1=instr(BeginPoint,strContent,"0 then lngTemp1_2=lngTemp1_2_1 elseif lngTemp1_2_2>0 then lngTemp1_2=lngTemp1_2_2 elseif lngTemp1_2_3>0 then lngTemp1_2=lngTemp1_2_3 else lngTemp1_2=0 end if if lngTemp1_1=0 and lngTemp1_2=0 then lngTemp1=BeginPoint else if lngTemp1_1>lngTemp1_2 then lngtemp1=lngTemp1_2 else lngTemp1=lngTemp1_1+8 end if end if lngTemp2_1_1=instr(BeginPoint,strContent,"

    ",1) lngTemp2_1_2=instr(BeginPoint,strContent,"

    ",1) if lngTemp2_1_1>0 then lngTemp2_1=lngTemp2_1_1 elseif lngTemp2_1_2>0 then lngTemp2_1=lngTemp2_1_2 else lngTemp2_1=0 end if lngTemp2_2_1=instr(BeginPoint,strContent,"0 then lngTemp2_2=lngTemp2_2_1 elseif lngTemp2_2_2>0 then lngTemp2_2=lngTemp2_2_2 else lngTemp2_2=0 end if if lngTemp2_1=0 and lngTemp2_2=0 then lngTemp2=BeginPoint elseif lngTemp2_1>lngTemp2_2 then lngtemp2=lngTemp2_2 else lngTemp2=lngTemp2_1+4 end if lngTemp3_1_1=instr(BeginPoint,strContent,"",1) lngTemp3_1_2=instr(BeginPoint,strContent,"",1) if lngTemp3_1_1>0 then lngTemp3_1=lngTemp3_1_1 elseif lngTemp3_1_2>0 then lngTemp3_1=lngTemp3_1_2 else lngTemp3_1=0 end if lngTemp3_2_1=instr(BeginPoint,strContent,"0 then lngTemp3_2=lngTemp3_2_1 elseif lngTemp3_2_2>0 then lngTemp3_2=lngTemp3_2_2 else lngTemp3_2=0 end if if lngTemp3_1=0 and lngTemp3_2=0 then lngTemp3=BeginPoint elseif lngTemp3_1>lngTemp3_2 then lngtemp3=lngTemp3_2 else lngTemp3=lngTemp3_1+5 end if if lngTemp1BeginPoint and lngTemp<=BeginPoint+lngBound then BeginPoint=lngTemp else lngTemp4_1_1=instr(BeginPoint,strContent,"",1) lngTemp4_1_2=instr(BeginPoint,strContent,"",1) if lngTemp4_1_1>0 then lngTemp4_1=lngTemp4_1_1 elseif lngTemp4_1_2>0 then lngTemp4_1=lngTemp4_1_2 else lngTemp4_1=0 end if lngTemp4_2_1=instr(BeginPoint,strContent,"0 then lngTemp4_2=lngTemp4_2_1 elseif lngTemp4_2_2>0 then lngTemp4_2=lngTemp4_2_2 else lngTemp4_2=0 end if if lngTemp4_1=0 and lngTemp4_2=0 then lngTemp4=BeginPoint elseif lngTemp4_1>lngTemp4_2 then lngtemp4=lngTemp4_2 else lngTemp4=lngTemp4_1+5 end if if lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound then BeginPoint=lngTemp4 else lngTemp5_1=instr(BeginPoint,strContent,"0 then lngTemp5=lngTemp5_1 elseif lngTemp5_2>0 then lngTemp5=lngTemp5_2 else lngTemp5=BeginPoint end if if lngTemp5>BeginPoint and lngTemp5",1) lngTemp6_2=instr(BeginPoint,strContent,"
    ",1) if lngTemp6_1>0 then lngTemp6=lngTemp6_1 elseif lngTemp6_2>0 then lngTemp6=lngTemp6_2 else lngTemp6=0 end if if lngTemp6>BeginPoint and lngTemp6=ContentLen then EndPoint=ContentLen else lngTemp1_1_1=instr(EndPoint,strContent,"",1) lngTemp1_1_2=instr(EndPoint,strContent,"",1) lngTemp1_1_3=instr(EndPoint,strContent,"",1) if lngTemp1_1_1>0 then lngTemp1_1=lngTemp1_1_1 elseif lngTemp1_1_2>0 then lngTemp1_1=lngTemp1_1_2 elseif lngTemp1_1_3>0 then lngTemp1_1=lngTemp1_1_3 else lngTemp1_1=0 end if lngTemp1_2_1=instr(EndPoint,strContent,"0 then lngTemp1_2=lngTemp1_2_1 elseif lngTemp1_2_2>0 then lngTemp1_2=lngTemp1_2_2 elseif lngTemp1_2_3>0 then lngTemp1_2=lngTemp1_2_3 else lngTemp1_2=0 end if if lngTemp1_1=0 and lngTemp1_2=0 then lngTemp1=EndPoint else if lngTemp1_1>lngTemp1_2 then lngtemp1=lngTemp1_2-1 else lngTemp1=lngTemp1_1+7 end if end if lngTemp2_1_1=instr(EndPoint,strContent,"

    ",1) lngTemp2_1_2=instr(EndPoint,strContent,"

    ",1) if lngTemp2_1_1>0 then lngTemp2_1=lngTemp2_1_1 elseif lngTemp2_1_2>0 then lngTemp2_1=lngTemp2_1_2 else lngTemp2_1=0 end if lngTemp2_2_1=instr(EndPoint,strContent,"0 then lngTemp2_2=lngTemp2_2_1 elseif lngTemp2_2_2>0 then lngTemp2_2=lngTemp2_2_2 else lngTemp2_2=0 end if if lngTemp2_1=0 and lngTemp2_2=0 then lngTemp2=EndPoint elseif lngTemp2_1>lngTemp2_2 then lngTemp2=lngTemp2_2-1 else lngTemp2=lngTemp2_1+3 end if lngTemp3_1_1=instr(EndPoint,strContent,"",1) lngTemp3_1_2=instr(EndPoint,strContent,"",1) if lngTemp3_1_1>0 then lngTemp3_1=lngTemp3_1_1 elseif lngTemp3_1_2>0 then lngTemp3_1=lngTemp3_1_2 else lngTemp3_1=0 end if lngTemp3_2_1=instr(EndPoint,strContent,"0 then lngTemp3_2=lngTemp3_2_1 elseif lngTemp3_2_2>0 then lngTemp3_2=lngTemp3_2_2 else lngTemp3_2=0 end if if lngTemp3_1=0 and lngTemp3_2=0 then lngTemp3=EndPoint elseif lngTemp3_1>lngTemp3_2 then lngtemp3=lngTemp3_2-1 else lngTemp3=lngTemp3_1+4 end if if lngTemp1EndPoint and lngTemp<=EndPoint+lngBound then EndPoint=lngTemp else lngTemp4_1_1=instr(EndPoint,strContent,"",1) lngTemp4_1_2=instr(EndPoint,strContent,"",1) if lngTemp4_1_1>0 then lngTemp4_1=lngTemp4_1_1 elseif lngTemp4_1_2>0 then lngTemp4_1=lngTemp4_1_2 else lngTemp4_1=0 end if lngTemp4_2_1=instr(EndPoint,strContent,"0 then lngTemp4_2=lngTemp4_2_1 elseif lngTemp4_2_2>0 then lngTemp4_2=lngTemp4_2_2 else lngTemp4_2=0 end if if lngTemp4_1=0 and lngTemp4_2=0 then lngTemp4=EndPoint elseif lngTemp4_1>lngTemp4_2 then lngtemp4=lngTemp4_2-1 else lngTemp4=lngTemp4_1+4 end if if lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound then EndPoint=lngTemp4 else lngTemp5_1=instr(EndPoint,strContent,"0 then lngTemp5=lngTemp5_1-1 elseif lngTemp5_2>0 then lngTemp5=lngTemp5_2-1 else lngTemp5=EndPoint end if if lngTemp5>EndPoint and lngTemp5",1) lngTemp6_2=instr(EndPoint,strContent,"
    ",1) if lngTemp6_1>0 then lngTemp6=lngTemp6_1+3 elseif lngTemp6_2>0 then lngTemp6=lngTemp6_2+3 else lngTemp6=EndPoint end if if lngTemp6>EndPoint and lngTemp6EndPoint then '确保EndPoint大于BeginPoint。 Dim sP sP=(BeginPoint-EndPoint) if sP>sMaxCharPerPage then EndPoint=BeginPoint+sMaxCharPerPage else EndPoint=EndPoint+sMaxCharPerPage end if end if sTemp="

    " sTemp=sTemp & mid(strContent,BeginPoint,EndPoint-BeginPoint) sTemp=sTemp & "

    " if CreateHtmlIng=True then if CurrentPage>1 then if (CurrentPage-1) > 1 then sTemp=sTemp & "上一页  " else sTemp=sTemp & "上一页  " end if end if for i=1 to pages if i=CurrentPage then sTemp=sTemp & "[" & cstr(i) & "] " else if i>1 then sTemp=sTemp & "[" & i & "] " else sTemp=sTemp & "[" & i & "] " end if end if next if CurrentPage下一页" end if else if CurrentPage>1 then sTemp=sTemp & "上一页  " end if for i=1 to pages if i=CurrentPage then sTemp=sTemp & "[" & cstr(i) & "] " else sTemp=sTemp & "[" & i & "] " end if next if CurrentPage下一页" end if end if sTemp=sTemp & "

    " AutoPagination=sTemp end if End Function Function ChkTrueRead() ChkTrueRead=True ErrMsg="" '============================================================================ if rs("Receive")=True and SysTemVersion > 0 then if request.Form("Receive")="now" then Call DoReceive(ArticleId) end if Dim sReceiveHTML,sUserMsg,sNotReceiveUser Dim IsPrivate,IsReceiveUser,IsReceived IsPrivate=False:IsReceiveUser=False:IsReceived=False sReceiveHTML=Split(Template.html(13),"||") ErrMsg=sReceiveHTML(0) if Rs("ReceiveType")=1 then IsPrivate=True if Cl.UserID>0 and Cl.UserLevel<>5 then if Instr(Rs("ReceiveUser"),"|"&Cl.User_Info(5)&"|")>0 then IsReceiveUser=True if Instr(Rs("Received"),"|"&Cl.User_Info(5)&"|")>0 then IsReceived=True ErrMsg=Replace(ErrMsg,"{%nologinmsg%}","") else ErrMsg=Replace(ErrMsg,"{%nologinmsg%}",sReceiveHTML(4)) end if if IsReceiveUser then if Not IsReceived then ErrMsg=Replace(ErrMsg,"{%userreceivemsg%}",sReceiveHTML(1)) if Rs("AutoReceiveTime")>0 then ErrMsg=ErrMsg & VbNewLine & Replace(sReceiveHTML(3),"{%time%}",Rs("AutoReceiveTime")) end if else ErrMsg=Replace(ErrMsg,"{%userreceivemsg%}",sReceiveHTML(2)) ErrMsg=Replace(ErrMsg,"{%articleid%}",ArticleID) end if else ErrMsg=Replace(ErrMsg,"{%userreceivemsg%}","") end if ErrMsg=Replace(ErrMsg,"{%receiveuser%}",replace(DelHeadTail(Rs("ReceiveUser")),"|",",")) ErrMsg=Replace(ErrMsg,"{%received%}",replace(DelHeadTail(Rs("Received")),"|",",")) sNotReceiveUser=Trim(replace(DelHeadTail(Rs("NotReceiveUser")),"|",",")) if sNotReceiveUser="" or IsNull(sNotReceiveUser) then ErrMsg=Replace(ErrMsg,"{%notreceiveuser%}","") else ErrMsg=Replace(ErrMsg,"{%notreceiveuser%}",sReceiveHTML(5)) ErrMsg=Replace(ErrMsg,"{%notreceiveuser%}",sNotReceiveUser) end if If IsPrivate and Not IsReceiveUser then ChkTrueRead=False ErrMsg=Template.Strings(12) & ErrMsg Exit Function elseif IsPrivate then if Not IsReceived then ChkTrueRead=False ErrMsg=Template.Strings(13) & ErrMsg Exit Function end if end if end if '========================================================================= if Not Cl.TrueBrowsePurview then ErrMsg=ErrMsg & Template.Strings(3) ChkTrueRead=False : Exit Function end if if Not Cl.ChkUserLevel(rs("ReadLevel"),5) or rs("ReadPoint")>0 or rs("ReadMoney")>0 then if Cl.UserID=0 Or Cl.UserLevel=5 then ErrMsg=ErrMsg & Template.Strings(6) ChkTrueRead=False : Exit Function End if if Not Cl.ChkUserLevel(rs("ReadLevel"),Cl.UserLevel) then ErrMsg=ErrMsg & Template.Strings(7) ChkTrueRead=False : Exit Function End if Dim rsL,SQLL,IsPay SQLL="Select Top 1 ID,ConsumePoint,ConsumeMoney,ConsumeNums,ConsumeLog,ConsumeTime From Cl_ConsumeLog Where ChannelID="&ChannelID&" and InfoID="&ArticleID&" and UserID="&Cl.UserID&" Order By ID Desc" Set rsL=Server.CreateObject("adodb.recordset") OpenConn_L : rsL.Open SQLL,Conn_L,1,3 if rsL.Bof and rsL.Eof then IsPay=False else IsPay=True 'if *** then IsPay=False rsL("ConsumeNums")=rsL("ConsumeNums")+1 rsL.Update end if rsL.Close : Set rsL=Nothing Dim sBackMoney,sBackPoint Select Case Clng(Cl.User_Info(24)) Case 1 if Not IsPay and (Rs("ReadPoint") > 0 or Rs("ReadMoney") > 0) then '1 if Clng(Cl.User_Info(22))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if else ChkTrueRead=False ErrMsg=Replace(Template.Strings(9),"{%readpoint%}",rs("ReadPoint")) ErrMsg=Replace(ErrMsg,"{%userpoint%}",Cl.User_Info(22)) ErrMsg=Replace(ErrMsg,"{%readmoney%}",rs("ReadMoney")) ErrMsg=Replace(ErrMsg,"{%usermoney%}",Cl.User_Info(23)) ErrMsg=Replace(ErrMsg,"{%filename%}",strFileName) ErrMsg=Replace(ErrMsg,"{%articleid%}",rs("ArticleID")) end if end if '2 end if '1 Case 2 if Clng(Cl.User_Info(40))<=0 then ErrMsg=ErrMsg & Template.Strings(10) ChkTrueRead=False elseif IsPay=False and Rs("ReadMoney")>0 then '1 if Clng(Cl.User_Info(23))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if else ChkTrueRead=False ErrMsg=Replace(Template.Strings(9),"{%readpoint%}",0) ErrMsg=Replace(ErrMsg,"{%userpoint%}",0) ErrMsg=Replace(ErrMsg,"{%readmoney%}",rs("ReadMoney")) ErrMsg=Replace(ErrMsg,"{%usermoney%}",Cl.User_Info(23)) ErrMsg=Replace(ErrMsg,"{%filename%}",strFileName) ErrMsg=Replace(ErrMsg,"{%articleid%}",rs("ArticleID")) end if end if '2 end if Case Else ErrMsg=ErrMsg & Template.Strings(7) ChkTrueRead=False End Select end if End Function %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Soft.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== Public Sub Soft_Setting() CurrentPath = Cl.lanstr(1) & "" & Cl.Web_info(0) & " >> " & Cl.ChannelName & "" Cl.Title = Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" if keyword<>"" then keyword=Cl.ReplaceBadChar(keyword) if SoftID>0 then Set rs = Cl.Execute("select * from Cl_Soft where ChannelID=" & ChannelID & " and Deleted=False and Passed=True and SoftID=" & SoftID & "") if rs.bof and rs.eof then Cl.OutErr(Replace(Template.Strings(0),"{%channelitemname%}",Cl.ChannelItemName)) ClassID=rs("ClassID"):SpecialID=rs("SpecialID"):InfoTitle=rs("SoftName") & " " & rs("SoftVersion") if rs("Hot")=False then if rs("hits")>=Clng(Cl.Web_Setting(14)) then Cl.Execute("Update Cl_Soft Set Hot=True where SoftID=" & SoftID & "") end if end if if ClassID>0 then sql="select ClassName,ParentID,ParentPath,ClassDir,ParentDir,RootID,Depth,Child,arrChildID,BrowsePurview,VipUser,StyleID,CssID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & ClassID set tClass=Cl.Execute(sql) if tClass.bof and tClass.eof then Cl.OutErr(Template.Strings(1)) ClassName = tClass(0) : ParentID = tClass(1) : ParentPath= tClass(2) ClassDir = tClass(3) : ParentDir = tClass(4) : RootID = tClass(5) Depth = tClass(6) : Child = tClass(7) : arrChildID= tClass(8) BrowsePurview=tClass(9) : VipUser = tClass(10): TStyleID = tClass(11) : TCssID=tClass(12) if TStyleID > 0 or TCssID > -1 then If TStyleID > 0 then Cl.StyleID = TStyleID If TCssID > -1 then Cl.CssID = TCssID Cl.LoadTempLates(Cl.Channel_Setting(4)) end if if ParentID>0 then dim sqlPath,rsPath sqlPath="select ClassID,ClassName,ParentPath,ClassDir,ParentDir From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth" set rsPath=Cl.Execute(sqlPath) do while not rsPath.eof CurrentPath=CurrentPath & " >> " & rsPath(1) & "" rsPath.movenext loop set rsPath=Nothing end if CurrentPath=CurrentPath & " >> " & ClassName & "" end if End Sub 'Rem 软件 Function GetSoft(Byval sChannelID,Byval sClassID,Byval sSpecialID,Byval TopNum,Byval IncludeChild,Byval ShowType, _ Byval ColsNum,Byval IsHot,Byval IsElite,Byval DateNum,Byval OrderType,Byval Style1,Byval Style2,Byval Style3) Dim JsSQL,sHTML,sTitleMaxLen,TitleStr,LinkUrl,FileType Dim Author,AuthorName,AuthorEmail Dim SystemTopDir,SystemDir Dim Rs,i On Error Resume Next SystemTopDir = "http://"&Request.servervariables("Server_Name") SystemDir = SystemTopDir & Cl.WebDir sChannelID = Clng(sChannelID) sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) TopNum = Clng(TopNum) IncludeChild = CBool(IncludeChild) ShowType = Clng(ShowType) ColsNum = Clng(ColsNum) IsHot = CBool(IsHot) IsElite = CBool(IsElite) DateNum = CLng(DateNum) OrderType = CLng(OrderType) Style1 = Trim(Style1) Style2 = Trim(Style2) Style3 = Trim(Style3) if Err then Err.Clear : GetSoft="GetSoft参数错误。":Exit Function On Error GoTo 0 if TopNum > 0 then JsSQL="Select Top " & TopNum & " " else JsSQL="Select Top 100 " end if JsSQL=JsSQL & " S.SoftID,S.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,S.SoftName,S.Prefixion,S.SoftVersion,S.Author,S.AuthorEmail,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.OnTop,S.Hot,S.Elite,S.Passed,S.SoftIntro,S.SoftPicUrl,S.SoftLevel,S.SoftPoint,S.Stars,S.IsHtml,S.HtmlFileUrl from Cl_Soft S" JsSQL=JsSQL & " inner join Cl_Class C on S.ClassID=C.ClassID where S.Deleted=False and S.Passed=True and S.ChannelID="&sChannelID&"" if sClassID>0 then if IncludeChild=True then Dim tClass set tClass=Cl.Execute("select ClassID,ParentPath,arrChildID From Cl_Class where ClassID=" & sClassID) if tClass.bof and tClass.eof then GetSoft="找不到指定的栏目。" : set tClass=Nothing : Exit Function else JsSQL=JsSQL & " and S.ClassID in (" & tClass(2) & ")" end if set tClass=Nothing else JsSQL=JsSQL & " and S.ClassID=" & sClassID & "" end if end if if sSpecialID>0 then JsSQL=JsSQL & " and S.SpecialID like '%" & sSpecialID & "%'" if ShowType >= 2 then JsSQL=JsSQL & " and S.SoftPicUrl<>''" if IsHot=True then JsSQL=JsSQL & " and S.Hot=True" if IsElite=True then JsSQL=JsSQL & " and S.Elite=True" if DateNum>0 then JsSQL=JsSQL & " and DATEDIFF('d',S.UpdateTime,"&SQLNowString&")<=" & DateNum & " " end if JsSQL=JsSQL & " order by S.OnTop asc" Select Case OrderType Case 1 : JsSQL=JsSQL & " ,S.SoftID desc" Case 2 : JsSQL=JsSQL & " ,S.SoftID asc" Case 3 : JsSQL=JsSQL & " ,S.UpDateTime desc, S.SoftID desc" Case 4 : JsSQL=JsSQL & " ,S.UpDateTime asc, S.SoftID desc" Case 5 : JsSQL=JsSQL & " ,S.Hits desc, S.SoftID desc" Case 6 : JsSQL=JsSQL & " ,S.Hits asc, S.SoftID desc" Case else : JsSQL=JsSQL & " ,S.SoftID desc" End Select set Rs=server.createObject("Adodb.recordset") OpenConn : Rs.open JsSQL,Conn,1,1 if Rs.bof and Rs.eof then GetSoft = "没有任何"&Cl.Channel_Setting(2)&"!" Rs.close:set Rs=Nothing : Exit Function End if JsSQL=Rs.GetRows(-1) Rs.close:set Rs=Nothing Dim TempBody Dim regEx,Matches,Match,TempStr Dim PropertyImg,ClassFileUrl,sImgUrl TempBody="":sHTML="" Set regEx = New RegExp regEx.Pattern = "(\{%)(.[^\{]*)(\%\})" regEx.IgnoreCase = True regEx.Global = True For i=0 to Ubound(JsSQL,2) if JsSQL(28,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl = SystemDir & JsSQL(29,i) else LinkUrl = SystemDir & Cl.Channel_Setting(4) & "/SoftShow.asp?SoftID=" & JsSQL(0,i) end if if JsSQL(19,i)=True then PropertyImg = "" elseif JsSQL(21,i)=True then PropertyImg = "" else PropertyImg = "" end if ClassFileUrl = SystemDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),JsSQL(3,i),JsSQL(1,i),JsSQL(5,i),JsSQL(4,i),Cl.Channel_Setting(10),Cl.Channel_Setting(13)) if ShowType >= 2 then FileType=right(lcase(JsSQL(24,i)),3) JsSQL(24,i) = ChkPicUrl(SysTemDir,SysTemTopDir,JsSQL(24,i)) Select Case FileType Case "swf" sImgUrl = "" Case "jpg", "bmp", "png", "gif" sImgUrl = "" Case Else sImgUrl = "" End Select end if TempBody = Style2 TempBody = Replace(TempBody,"{%InfoID%}",JsSQL(0,i)) TempBody = Replace(TempBody,"{%Prefixion%}",JsSQL(7,i)&"") TempBody = Replace(TempBody,"{%PropertyImg%}",PropertyImg) TempBody = Replace(TempBody,"{%LinkUrl%}",LinkUrl) TempBody = Replace(TempBody,"{%ClassID%}",JsSQL(1,i)) TempBody = Replace(TempBody,"{%ClassName%}",JsSQL(2,i)) TempBody = Replace(TempBody,"{%ClassUrl%}",ClassFileUrl) TempBody = Replace(TempBody,"{%Author%}",JsSQL(9,i)) TempBody = Replace(TempBody,"{%Hits%}",JsSQL(14,i)) TempBody = Replace(TempBody,"{%DayHits%}",JsSQL(15,i)) TempBody = Replace(TempBody,"{%WeekHits%}",JsSQL(16,i)) TempBody = Replace(TempBody,"{%MonthHits%}",JsSQL(17,i)) Set Matches = regEx.Execute(TempBody) For Each Match in Matches TempStr = Replace(Match.Value,"{%","") TempStr = Replace(TempStr,"%}","") TempStr = Replace(TempStr,"(",",") TempStr = Replace(TempStr,")","") TempStr = Replace(TempStr,"""","") TempStr = Split(Lcase(TempStr),",") Select Case TempStr(0) Case "title" TitleStr = Cl.GotTopic(JsSQL(6,i) & "" & JsSQL(8,i),TempStr(1)) TempBody = Replace(TempBody,Match.Value,TitleStr) Case "imgurl" sImgUrl = Replace(sImgUrl,"{%ImgWidth%}",TempStr(1)) sImgUrl = Replace(sImgUrl,"{%ImgHeight%}",TempStr(2)) TempBody = Replace(TempBody,Match.Value,sImgUrl) Case "intro" TempBody = Replace(TempBody,Match.Value,Left(Cl.NoHtml(JsSQL(23,i)),TempStr(1))) Case "updatetime" TempBody = Replace(TempBody,Match.Value,Cl.Format_Time(JsSQL(12,i),TempStr(1))) End Select Next sHTML = sHTML & TempBody if (i+1) mod ColsNum=0 then sHTML = sHTML & Style3 Next GetSoft=Replace(Style1,"{%ContentBody%}",sHTML) JsSQL=Empty End Function '================================================= '过程名:ShowClassSoft(sChannelID,sClassID,ModNum,TopNum) '参 数: ' sChannelID ---- 频道ID ' sClassID ---- 指定栏目,多个用“|”分隔,不指定请留空或0 ' ModNum --- 多少个换行 ' TopNum --- 最多显示记录数 '================================================= Function ShowClassSoft(Byval sChannelID,Byval sClassID,Byval ModNum,Byval TopNum) dim sqlRoot,rsRoot,ClassCount,iClassID Dim sTemp,strValue sChannelID = Cl.ChkClng(sChannelID) sClassID = Trim(sClassID) ModNum = Cl.ChkClng(ModNum) if sClassID="" or sClassID="0" then TopNum = Cl.ChkClng(TopNum) if TopNum=0 then TopNum = 6 sqlRoot="select Top "&TopNum&" ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and ParentID=0 and IsElite=True and IsOuter=0 order by RootID" Else sqlRoot="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and IsElite=True and IsOuter=0 and ClassID In ("&Replace(sClassID,"|",",")&") order by RootID" End if Set rsRoot= Cl.Execute(sqlRoot) if rsRoot.bof and rsRoot.eof then sTemp="还没有任何栏目,请首先添加栏目。" rsRoot.Close:Set rsRoot=Nothing:Exit Function end if sqlRoot=rsRoot.GetRows(-1) rsRoot.Close:Set rsRoot=Nothing Cl.GetChannelSetting(sChannelID) Cl.LoadTempLates(Cl.Channel_Setting(4)) for iClassID=0 to Ubound(sqlRoot,2) strValue=Replace(Template.html(8),"{%channelid%}",sChannelID) strValue=Replace(strValue,"{%classid%}",sqlRoot(0,iClassID)) strValue=Replace(strValue,"{%classtitle%}",sqlRoot(8,iClassID)&"") strValue=Replace(strValue,"{%classname%}",sqlRoot(1,iClassID)) strValue=Replace(strValue,"{%classfileurl%}",Cl.WebDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),sqlRoot(2,iClassID),sqlRoot(0,iClassID),sqlRoot(4,iClassID),sqlRoot(3,iClassID),Cl.Channel_Setting(10),Cl.Channel_Setting(13))) strValue=Cl.ReplaceFlag(strValue,"showsoft","") if ((iClassID+1) mod modnum) = 0 then strValue = strValue & Split(Template.html(9),"||")(1) else strValue = strValue & Split(Template.html(9),"||")(0) end if sTemp=sTemp & strValue Next ShowClassSoft=Replace(Template.html(7),"{%classsoftbody%}",sTemp) sqlRoot=Empty End Function '==================================================================================================== '过程:ShowPicSoft(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowType,Cols,ImgWidth,ImgHeight,ContentLen,IsHot,IsElite) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为所有栏目,若大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为所有栏目,若大于0,则调用指定专题) ' TopNum ------ 最多显示多少篇 ' TitleLen ------ 标题最多字符数 ' ShowType ------ 显示方式。0(图),1(图+标),2(图+标+内),3(图+幻),4(图+标+幻) ' Cols ------ 列数。超过此列数就换行 ' ImgWidth ------ 图片宽度 ' ImgHeight ------ 图片高度 ' ContentLen ------ 内容最多字符数 ' IsHot ------ 是否是热门(True为是,False为否) ' IsElite ------ 是否是推荐(True为是,False为否) '==================================================================================================== Function ShowPicSoft(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowType,Byval Cols,Byval ImgWidth, _ Byval ImgHeight,Byval ContentLen,Byval IsHot,Byval IsElite) On Error Resume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowType = Clng(ShowType) Cols = Clng(Cols) : ImgWidth = Clng(ImgWidth) ImgHeight = Clng(ImgHeight) : ContentLen = Clng(ContentLen) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) if Err then Err.Clear : ShowPicSoft="ShowPicSoft参数错误。":Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) dim rsPic,sqlPic,tClass,j,strPic if TopNum<=0 then sqlPic="Select " else sqlPic="Select top "&TopNum&" " end if sqlPic= sqlPic & " SoftID,SoftName,SoftVersion,SoftSize,Author,UpdateTime,Editor,SoftIntro,OnTop,Elite,SoftPicUrl,IsHtml,HtmlFileUrl from Cl_Soft where Deleted=False and Passed=True and ChannelID="&sChannelID&" and SoftPicUrl<>'' " if sClassID>0 then set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlPic=sqlPic & " and ClassID in (" & tClass(3) & ")" else sqlPic=sqlPic & " and ClassID=" & sClassID end if else sqlPic=sqlPic & " and ClassID=" & sClassID end if set tClass=Nothing end if if sSpecialID>0 then sqlPic=sqlPic & " and SpecialID Like '%" & sSpecialID & "%'" if IsHot=True then sqlPic=sqlPic & " and Hot=True " if IsElite=True then sqlPic=sqlPic & " and Elite=True " 'if IsSqlDataBase=1 then sqlPic=sqlPic & " order by OnTop Asc,UpdateTime desc,SoftID desc" Set rsPic= Server.CreateObject("ADODB.Recordset") OpenConn : rsPic.open sqlPic,Conn,1,1 strPic= "" if rsPic.bof and rsPic.eof then strPic = strPic & "" rsPic.Close : Set rsPic = Nothing else dim FileType,TitleStr,LinkUrl if TopNum<=0 or TopNum>=100 then TotalPut=rsPic.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsPic.move (CurrentPage-1)*MaxPerPage sqlPic = rsPic.GetRows(MaxPerPage) else sqlPic=rsPic.GetRows(-1) end if rsPic.Close : Set rsPic = Nothing Select Case ShowType Case 0 for j=0 to Ubound(sqlPic,2) if sqlPic(11,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(12,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 1 for j=0 to Ubound(sqlPic,2) if sqlPic(11,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(12,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 2 for j=0 to Ubound(sqlPic,2) strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 3, 4 Dim sImgID sImgID=Cl.CreatePass(3) & "Cl" & ImgWidth & ImgHeight & ContentLen' & IsHot & IsElite strPic = strPic & "" & vbcrlf strPic = strPic & "" & vbcrlf if ShowType=4 then strPic = strPic & "" & vbcrlf else strPic = strPic & "" & vbcrlf end if strPic = strPic & "" End Select sqlPic=Empty end if strPic = strPic & "

    没有"&Cl.Channel_Setting(2)&"
    " FileType=right(lcase(sqlPic(10,j)),3) sqlPic(10,j)=Cl.ReplaceDir(sqlPic(10,j)) strPic = strPic & "" Select Case FileType Case "swf" strPic = strPic & "" Case "jpg","bmp","png","gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "" strPic = strPic & "
    " FileType=right(lcase(sqlPic(10,j)),3) sqlPic(10,j)=Cl.ReplaceDir(sqlPic(10,j)) TitleStr=Cl.GotTopic(sqlPic(1,j) & " " & sqlPic(2,j),TitleLen) strPic = strPic & "" Select Case FileType Case "swf" strPic = strPic & "" Case "jpg","bmp","png","gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " if sqlPic(11,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(12,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & sqlPic(0,j) end if FileType=right(lcase(sqlPic(10,j)),3) sqlPic(10,j)=Cl.ReplaceDir(sqlPic(10,j)) TitleStr=Cl.GotTopic(sqlPic(1,j) & " " & sqlPic(2,j),TitleLen) strPic = strPic & "" Select Case FileType Case "swf" strPic = strPic & "" Case "jpg","bmp","png","gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " & left(Cl.NoHtml(sqlPic(7,j)),ContentLen) & "……
    " & vbcrlf strPic = strPic & "" & vbcrlf strPic = strPic & "
    " ShowPicSoft=strPic End Function '==================================================================================================== '过程:ShowSoft(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowClassName,ShowProperty,ShowPrefix,ShowAuthor,ShowDateType,ShowHits,ShowHot,IsElite,IsHot,UserName,CssStyle) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为全部,如果大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为全部,如果大于0,刚调用指定专题) ' TopNum ------ 最多记录数,0为全部(用于分页显示) ' TitleLen ------ 标题最多字符数 ' ShowClassName ------ 是否显示栏目名称(True为显示,False为不显示) ' ShowProperty ------ 是否显示文章属性(固顶/推荐/普通),(True为显示,False为不显示) ' ShowPrefix ------ 是否显示前缀如:[推荐][图文][注意]字样(True为显示,False为不显示) ' ShowAuthor ------ 是否显示文章作者,True为显示,False为不显示) ' ShowDateType ------ 显示更新日期的样式 ' ---- 0(不显示) ' ---- 1(2004-10-01 23:45:45) ' ---- 2(年-月-日 时:分:秒) ' ---- 3(2004-10-01) ' ---- 4(2004\10\01) ' ---- 5(10-01 23:45) ' ---- 6(2004年10月01日) ' ---- 7(10-01) ' ---- 8(20041001234545) ' ShowHits ------ 是否显示文章点击数(True为显示,False为不显示) ' ShowHot ------ 是否显示热门文章标志(True为显示,False为不显示) ' IsHot ------ 是否热门(True为是,False为否) ' IsElite ------ 是否推荐(True为是,False为否) ' UserName ------ 指定某用户(不指定请留空值或0) ' CssStyle ------ CSS样式 '==================================================================================================== Function ShowSoft(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowClassName,Byval ShowProperty, _ Byval ShowPrefix,Byval ShowAuthor,Byval ShowDateType,Byval ShowHits, _ Byval ShowHot,Byval IsHot,Byval IsElite,Byval UserName,Byval CssStyle) On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowClassName = CBool(ShowClassName) ShowProperty = CBool(ShowProperty) : ShowPrefix = CBool(ShowPrefix) ShowAuthor = CBool(ShowAuthor) : ShowDateType = Clng(ShowDateType) ShowHits = CBool(ShowHits) : ShowHot = CBool(ShowHot) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) UserName = Trim(UserName) : CssStyle = Trim(CssStyle) if Err then Err.Clear : ShowSoft="ShowSoft参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) Dim SQLInfo if TopNum<=0 then SqlInfo="Select " else SqlInfo="Select Top "&TopNum&" " end if SqlInfo = SqlInfo & "S.SoftID,S.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,S.SoftName,S.SoftVersion,S.Author,S.AuthorEmail,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.DayHits,S.WeekHits,S.MonthHits,S.SoftSize,S.OnTop,S.Hot,S.Elite,S.Passed,S.Stars,S.SoftLevel,S.SoftPoint,S.IsHtml,S.HtmlFileUrl from Cl_Soft S Inner Join Cl_Class C On S.ClassID=C.ClassID where S.Deleted=False and S.Passed=True and S.ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then SqlInfo=SqlInfo & " and S.ClassID in (" & tClass(3) & ")" else SqlInfo=SqlInfo & " and S.ClassID=" & sClassID end if else SqlInfo=SqlInfo & " and S.ClassID=" & sClassID end if Set tClass=Nothing end if if sSpecialID>0 then SqlInfo=SqlInfo & " and S.SpecialID Like '%" & sSpecialID & "%'" if IsElite=True then SqlInfo=SqlInfo & " and S.Elite=True" if IsHot=True then SqlInfo=SqlInfo & " and S.Hot=True" 'if IsSqlDataBase=1 then SqlInfo=SqlInfo & " order by S.OnTop Asc,S.UpdateTime desc,S.SoftID desc" Set rsInfo=Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open SqlInfo,Conn,1,1 if rsInfo.bof and rsInfo.eof then 'TotalPut=0 ShowSoft="
  • 没有任何"&Cl.Channel_Setting(2)&"
  • " rsInfo.close:set rsInfo=Nothing : Exit Function End if if TopNum<=0 or TopNum>=100 then TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage SqlInfo=rsInfo.GetRows(MaxPerPage) else SqlInfo=rsInfo.GetRows(-1) end if rsInfo.close:set rsInfo=Nothing dim i,sTemp,TitleStr,sTitleLen,LinkUrl i=0:sTemp="" & VbCrlf for i=0 to Ubound(SqlInfo,2) sTitleLen=TitleLen sTemp=sTemp & "" & VbCrlf & "" & VbCrlf Next ShowSoft=sTemp & "
     " if ShowProperty=True then if SqlInfo(18,i)=True then sTemp = sTemp & " " elseif SqlInfo(20,i)=True then sTemp = sTemp & " " else sTemp = sTemp & " " end if end if if ShowClassName=True and SqlInfo(1,i)<>ClassID then sTemp=sTemp & "[" & SqlInfo(2,i) & "] " sTitleLen=sTitleLen-Cl.strLength(SqlInfo(2,i))-1 end if 'if ShowPrefix=True and SqlInfo(7,i)<>"" then ' sTemp = sTemp & ""&SqlInfo(7,i)&"" ' sTitleLen=sTitleLen-Cl.strLength(SqlInfo(7,i))-2 'end if if SqlInfo(25,i) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & SqlInfo(26,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & SqlInfo(0,i) end if sTemp=sTemp & "" sTemp=sTemp & Cl.GotTopic(SqlInfo(6,i) & " " & SqlInfo(7,i),sTitleLen) & "" sTemp=sTemp & "" if ShowHot=True then if CDate(FormatDateTime(SqlInfo(11,i),2))=date() then sTemp= sTemp & "" elseif SqlInfo(19,i)=True then sTemp= sTemp & "" end if end if if ShowAuthor=True or ShowDateType>0 or ShowHits=True then sTemp = sTemp & " (" if ShowAuthor=True then sTemp=sTemp & "" & SqlInfo(8,i) & "" end if if ShowHits=True then if ShowAuthor=True then sTemp=sTemp & "," end if sTemp=sTemp & Cl.FormatColor(SqlInfo(13,i),"#ff0033") end if if ShowDateType>0 then if ShowHits=True or ShowAuthor=True then sTemp=sTemp & "," end if if CDate(FormatDateTime(SqlInfo(11,i),2))=date() then sTemp = sTemp & "" else sTemp= sTemp & "" end if sTemp=sTemp & Cl.Format_Time(SqlInfo(11,i),ShowDateType) & "" end if sTemp=sTemp & ")" end if sTemp= sTemp & "
    " SqlInfo=Empty End Function '============================================================== '过程名:ShowTopSoft(sChannelID,sClassID,TopNum,TitleLen,ShowType,ShowHits) ' sChannelID ----频道ID ' sClassID ----栏目ID ' TopNum ----下载TOP ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 ' ShowType ----- 1(本日),2(本周),3(本月),4(累计) ' ShowHits ------ (是否显示点击数,True为是) '================================================================ Function ShowTopSoft(Byval sChannelID,Byval sClassID,Byval TopNum, _ Byval TitleLen,Byval ShowType,Byval ShowHits) dim sqlTop,rsTop,LinkUrl On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) TopNum = Clng(TopNum) : TitleLen = Clng(TitleLen) ShowType = Clng(ShowType) : ShowHits = CBool(ShowHits) if Err then Err.Clear : ShowTopSoft="ShowTopSoft参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) if TopNum>0 then sqlTop="select top " & TopNum else sqlTop="select top 10 " end if sqlTop=sqlTop & " SoftID,SoftName,SoftVersion,Author,Keyword,UpdateTime,Editor,Hits,DayHits,WeekHits,MonthHits,SoftSize,SoftLevel,SoftPoint,IsHTML,HTMLfileUrl from Cl_Soft where Deleted=False and Passed=True and ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlTop=sqlTop & " and ClassID in (" & tClass(3) & ")" else sqlTop=sqlTop & " and ClassID=" & sClassID end if else sqlTop=sqlTop & " and ClassID=" & sClassID end if Set tClass=Nothing end if Select Case ShowType Case 1 sqlTop=sqlTop & " And datediff('D',LastHitTime,now())<=0 order by DayHits desc,SoftID desc" Case 2 sqlTop=sqlTop & " And datediff('ww',LastHitTime,now())<=0 order by WeekHits desc,SoftID desc" Case 3 sqlTop=sqlTop & " And datediff('m',LastHitTime,now())<=0 order by MonthHits desc,SoftID desc" Case else sqlTop=sqlTop & " order by Hits desc,SoftID desc" end Select Set rsTop= Cl.Execute(sqlTop) if rsTop.bof and rsTop.eof then ShowTopSoft = "
  • 没有"&Cl.Channel_Setting(2)&"
  • " rsTop.Close:Set rsTop=Nothing:Exit Function End if Dim i,sTemp i=1:sTemp = "" sqlTop=rsTop.GetRows(-1) rsTop.Close:Set rsTop=Nothing For i=0 to Ubound(sqlTop,2) if sqlTop(14,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlTop(15,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & sqlTop(0,i) end if sTemp = sTemp & "
  • " & Cl.GotTopic(sqlTop(1,i) & " " & sqlTop(2,i),TitleLen) & "" if ShowHits=True then sTemp=sTemp & "(" & sqlTop(7,i) & ")" end if sTemp=sTemp & "

  • " Next ShowTopSoft = sTemp sqlTop=Empty End Function '======================================================================= '显示相关软件 'ShowCorrelativeSoft(sChannelID,TopNum,TitleLen,ShowHits) ' sChannelID ' TopNum ------ (文章数量) ' TitleLen ------ (标题字符数) ' ShowHits ------ (是否显示点击数,True为是) '======================================================================= Function ShowCorrelativeSoft(Byval sChannelID,Byval TopNum,Byval TitleLen,Byval ShowHits) dim rsC,SQL,LinkUrl,sTemp dim strKey,arrKey,i sChannelID=Cl.ChkClng(sChannelID):ShowHits=Cl.ChkCBool(ShowHits) TopNum=Cl.ChkClng(TopNum):TitleLen=Cl.ChkClng(TitleLen) if TopNum>0 then SQL="select top " & TopNum else SQL="Select Top 5 " end if strKey=rs("Keyword") if instr(strkey,"|")>1 then arrKey=split(strKey,"|") strKey="((Keyword like '%" & arrKey(0) & "%')" for i=1 to ubound(arrKey) strKey=strKey & " or (Keyword like '%" & arrKey(i) & "%')" next strKey=strKey & ")" else strKey="(Keyword like '%" & strKey & "%')" end if SQL=SQL & " SoftID,SoftName,SoftVersion,Author,Keyword,UpdateTime,Editor,Hits,SoftSize,SoftLevel,SoftPoint,IsHTML,HTMLFileUrl from Cl_Soft Where Deleted=False and Passed=True and " & strKey & " and SoftID<>" & SoftID & " Order by UpdateTime desc,SoftID desc" Set rsC= Cl.Execute(SQL) if rsC.bof and rsC.Eof then sTemp="没有相关下载" else Cl.GetChannelSetting(sChannelID) do while not rsC.eof if rsC("IsHTML")=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & rsC("HTMLFileUrl") else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/SoftShow.Asp?SoftID=" & rsC("Softid") end if sTemp=sTemp & "
  • " & Cl.GotTopic(rsC("SoftName") & " " & rsC("SoftVersion"),TitleLen) if ShowHits=True then sTemp=sTemp & "(" & rsC("hits") & ")" end if sTemp=sTemp & "

  • " rsC.movenext loop end if rsC.Close : set rsC=Nothing ShowCorrelativeSoft=sTemp End Function Public Function ShowDownLoadUrl() Dim sTemp,sUrl,DownUrlStr if rs("UseServer") then Dim rsServer Set rsServer=Cl.Execute("Select ServerID,ServerName From Cl_Server Where ChannelID="&ChannelID&" and IsDisabled=False order by OrderID Asc") Do while Not rsServer.Eof sUrl=Template.html(14) sUrl=Replace(sUrl,"{%urlid%}",rsServer(0)) sUrl=Replace(sUrl,"{%downloadname%}",rsServer(1)) sTemp = sTemp & sUrl rsServer.MoveNext Loop rsServer.Close : Set rsServer=Nothing else DownUrlStr=rs("DownloadUrl") On Error Resume Next if InStr(DownUrlStr,"@@@")>0 then DownUrlStr=Split(DownUrlStr,"@@@") for i=0 to Ubound(DownUrlStr) sUrl=Template.html(14) sUrl=Replace(sUrl,"{%urlid%}",i) sUrl=Replace(sUrl,"{%downloadname%}",Split(DownUrlStr(i),"|")(0)) sTemp = sTemp & sUrl next else sUrl=Template.html(14) sUrl=Replace(sUrl,"{%urlid%}",0) sUrl=Replace(sUrl,"{%downloadname%}",Split(DownUrlStr,"|")(0)) sTemp = sTemp & sUrl end if On Error GoTo 0 end if sTemp=Replace(sTemp,"{%softid%}",rs("SoftID")) sTemp=Replace(sTemp,"{%channeldir%}",Cl.Channel_Setting(4)) ShowDownLoadUrl=Replace(Template.html(12),"{%downloadurl%}",sTemp) End Function Public Sub ChkSoftLevel() if Not Cl.TrueBrowsePurview then Response.write Template.Strings(2) Response.end end if if Cl.ChkUserLevel(rs("SoftLevel"),5) and rs("SoftPoint")=0 and rs("SoftMoney")=0 then Exit Sub if Cl.UserID=0 Or Cl.UserLevel=5 then response.write Template.Strings(3) response.end end if if Not Cl.ChkUserLevel(rs("SoftLevel"),Cl.UserLevel) then response.write Replace(Template.Strings(4),"{%level%}",Cl.GetUserGroupName(rs("SoftLevel"))) response.end end if Dim rsL,SQLL,IsPay SQLL="Select Top 1 ID,ConsumePoint,ConsumeMoney,ConsumeNums,ConsumeLog,ConsumeTime From Cl_ConsumeLog Where ChannelID="&ChannelID&" and InfoID="&SoftID&" and UserID="&Cl.UserID&" Order By ID Desc" Set rsL=Server.CreateObject("adodb.recordset") OpenConn_L : rsL.Open SQLL,Conn_L,1,3 if rsL.Bof and rsL.Eof then IsPay=False else IsPay=True 'if *** then IsPay=False rsL("ConsumeNums")=rsL("ConsumeNums")+1 rsL.Update end if rsL.Close : Set rsL=Nothing Dim sBackMoney,sBackPoint Select Case Cint(Cl.User_Info(24)) Case 1 if IsPay=False and (rs("SoftPoint")>0 or rs("SoftMoney")>0) then if Clng(Cl.User_Info(22))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if end if Case 2 if Clng(Cl.User_Info(40))<=0 then response.write Template.Strings(9) response.end elseif IsPay=False and Rs("SoftMoney")>0 then if Clng(Cl.User_Info(23))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if End if '2 end if Case else response.write Template.Strings(9) response.end end Select End Sub %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Photo.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== Public Sub Photo_Setting() CurrentPath = Cl.lanstr(1) & "
    " & Cl.Web_info(0) & " >> " & Cl.ChannelName & "" Cl.Title = Cl.NoHtml(Cl.ChannelName) & " " & Cl.GotTopic(Cl.ChannelReadMe,50) & "[" & Cl.Web_info(1) & "]" if keyword<>"" then keyword=Cl.ReplaceBadChar(keyword) if PhotoID>0 then Set rs= Cl.Execute("select * from Cl_Photo where ChannelID=" & ChannelID & " and Deleted=False and Passed=True and PhotoID=" & PhotoID & "") if rs.bof and rs.eof then Cl.OutErr(Replace(Template.Strings(0),"{%channelitemname%}",Cl.ChannelItemName)) ClassID=rs("ClassID"):SpecialID=rs("SpecialID"):InfoTitle=rs("PhotoName") if rs("Hot")=False then if rs("hits")>=Clng(Cl.Web_Setting(14)) then Cl.Execute("Update Cl_Photo Set Hot=True where PhotoID=" & PhotoID & "") end if end if if ClassID>0 then sql="select ClassName,ParentID,ParentPath,ClassDir,ParentDir,RootID,Depth,Child,arrChildID,BrowsePurview,VipUser,StyleID,CssID From Cl_Class where ChannelID="&ChannelID&" and ClassID=" & ClassID set tClass=Cl.Execute(sql) if tClass.bof and tClass.eof then Cl.OutErr(Template.Strings(1)) ClassName = tClass(0) : ParentID = tClass(1) : ParentPath= tClass(2) ClassDir = tClass(3) : ParentDir = tClass(4) : RootID = tClass(5) Depth = tClass(6) : Child = tClass(7) : arrChildID= tClass(8) BrowsePurview=tClass(9) : VipUser = tClass(10): TStyleID = tClass(11) : TCssID=tClass(12) if TStyleID > 0 or TCssID > -1 then If TStyleID > 0 then Cl.StyleID = TStyleID If TCssID > -1 then Cl.CssID = TCssID Cl.LoadTempLates(Cl.Channel_Setting(4)) end if if ParentID>0 then dim sqlPath,rsPath sqlPath="select ClassID,ClassName,ParentPath,ClassDir,ParentDir From Cl_Class where ChannelID="&ChannelID&" and ClassID in (" & ParentPath & ") order by Depth" set rsPath=Cl.Execute(sqlPath) do while not rsPath.eof CurrentPath=CurrentPath & " >> " & rsPath(1) & "" rsPath.movenext loop set rsPath=Nothing end if CurrentPath=CurrentPath & " >> " & ClassName & "" end if End Sub 'Rem 图片 Function GetPhoto(Byval sChannelID,Byval sClassID,Byval sSpecialID,Byval TopNum,Byval IncludeChild,Byval ShowType, _ Byval ColsNum,Byval IsHot,Byval IsElite,Byval DateNum,Byval OrderType,Byval Style1,Byval Style2,Byval Style3) Dim JsSQL,sHTML,sTitleMaxLen,TitleStr,LinkUrl,FileType Dim Author,AuthorName,AuthorEmail Dim SystemTopDir,SystemDir Dim Rs,i On Error Resume Next SystemTopDir = "http://"&Request.servervariables("Server_Name") SystemDir = SystemTopDir & Cl.WebDir sChannelID = Clng(sChannelID) sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) TopNum = Clng(TopNum) IncludeChild = CBool(IncludeChild) ShowType = Clng(ShowType) ColsNum = Clng(ColsNum) IsHot = CBool(IsHot) IsElite = CBool(IsElite) DateNum = CLng(DateNum) OrderType = CLng(OrderType) Style1 = Trim(Style1) Style2 = Trim(Style2) Style3 = Trim(Style3) if Err then Err.Clear : GetPhoto="GetPhoto参数错误。":Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) if TopNum > 0 then JsSQL="select top " & TopNum & " " else JsSQL="select top 100 " end if JsSQL=JsSQL & " P.PhotoID,P.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,P.PhotoName,P.Prefixion,P.Author,P.AuthorEmail,P.Editor,P.Keyword,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.UpdateTime,P.PhotoPicUrl,P.OnTop,P.Hot,P.Elite,P.Passed,P.PhotoIntro,P.PhotoLevel,P.PhotoPoint,P.Stars,P.IsHtml,P.HtmlFileUrl from Cl_Photo P" JsSQL=JsSQL & " inner join Cl_Class C on P.ClassID=C.ClassID where P.Deleted=False and P.Passed=True and P.ChannelID="&sChannelID&"" if sClassID>0 then if IncludeChild=True then Dim tClass set tClass=Cl.Execute("select ClassID,ParentPath,arrChildID From Cl_Class where ClassID=" & sClassID) if tClass.bof and tClass.eof then GetPhoto="找不到指定的栏目。" : set tClass=Nothing : Exit Function else JsSQL=JsSQL & " and P.ClassID in (" & tClass(2) & ")" end if set tClass=Nothing else JsSQL=JsSQL & " and P.ClassID=" & sClassID & "" end if end if if sSpecialID>0 then JsSQL=JsSQL & " and P.SpecialID like '%" & sSpecialID & "%'" if ShowType >= 2 then JsSQL=JsSQL & " and P.PhotoPicUrl<>''" if IsHot=True then JsSQL=JsSQL & " and P.Hot=True" if IsElite=True then JsSQL=JsSQL & " and P.Elite=True" if DateNum>0 then JsSQL=JsSQL & " and DATEDIFF('d',P.UpdateTime,"&SQLNowString&")<=" & DateNum & " " end if JsSQL=JsSQL & " order by P.OnTop asc" Select Case OrderType Case 1 : JsSQL=JsSQL & " ,P.PhotoID desc" Case 2 : JsSQL=JsSQL & " ,P.PhotoID asc" Case 3 : JsSQL=JsSQL & " ,P.UpDateTime desc, P.PhotoID desc" Case 4 : JsSQL=JsSQL & " ,P.UpDateTime asc, P.PhotoID desc" Case 5 : JsSQL=JsSQL & " ,P.Hits desc, P.PhotoID desc" Case 6 : JsSQL=JsSQL & " ,P.Hits asc, P.PhotoID desc" Case else : JsSQL=JsSQL & " ,P.PhotoID desc" End Select set Rs=server.createObject("Adodb.recordset") OpenConn : Rs.open JsSQL,Conn,1,1 if Rs.bof and Rs.eof then GetPhoto = "没有任何"&Cl.Channel_Setting(2)&"!" Rs.close:set Rs=Nothing : Exit Function End if JsSQL=Rs.GetRows(-1) Rs.close:set Rs=Nothing Dim TempBody Dim regEx,Matches,Match,TempStr Dim PropertyImg,ClassFileUrl,sImgUrl TempBody="":sHTML="" Set regEx = New RegExp regEx.Pattern = "(\{%)(.[^\{]*)(\%\})" regEx.IgnoreCase = True regEx.Global = True For i=0 to Ubound(JsSQL,2) if JsSQL(26,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl = SystemDir & JsSQL(27,i) else LinkUrl = SystemDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID=" & JsSQL(0,i) end if if JsSQL(18,i)=True then PropertyImg = "" elseif JsSQL(20,i)=True then PropertyImg = "" else PropertyImg = "" end if ClassFileUrl = SystemDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),JsSQL(3,i),JsSQL(1,i),JsSQL(5,i),JsSQL(4,i),Cl.Channel_Setting(10),Cl.Channel_Setting(13)) if ShowType >= 2 then FileType=right(lcase(JsSQL(17,i)),3) JsSQL(17,i) = ChkPicUrl(SysTemDir,SysTemTopDir,JsSQL(17,i)) Select Case FileType Case "swf" sImgUrl = "" Case "jpg", "bmp", "png", "gif" sImgUrl = "" Case Else sImgUrl = "" End Select end if TempBody = Style2 TempBody = Replace(TempBody,"{%InfoID%}",JsSQL(0,i)) TempBody = Replace(TempBody,"{%Prefixion%}",JsSQL(7,i)&"") TempBody = Replace(TempBody,"{%PropertyImg%}",PropertyImg) TempBody = Replace(TempBody,"{%LinkUrl%}",LinkUrl) TempBody = Replace(TempBody,"{%ClassID%}",JsSQL(1,i)) TempBody = Replace(TempBody,"{%ClassName%}",JsSQL(2,i)) TempBody = Replace(TempBody,"{%ClassUrl%}",ClassFileUrl) TempBody = Replace(TempBody,"{%AuthorName%}",JsSQL(8,i)&"") TempBody = Replace(TempBody,"{%AuthorEmail%}",JsSQL(9,i)&"") TempBody = Replace(TempBody,"{%Hits%}",JsSQL(12,i)) TempBody = Replace(TempBody,"{%DayHits%}",JsSQL(13,i)) TempBody = Replace(TempBody,"{%WeekHits%}",JsSQL(14,i)) TempBody = Replace(TempBody,"{%MonthHits%}",JsSQL(15,i)) Set Matches = regEx.Execute(TempBody) For Each Match in Matches TempStr = Replace(Match.Value,"{%","") TempStr = Replace(TempStr,"%}","") TempStr = Replace(TempStr,"(",",") TempStr = Replace(TempStr,")","") TempStr = Replace(TempStr,"""","") TempStr = Split(Lcase(TempStr),",") Select Case TempStr(0) Case "title" TitleStr = Cl.GotTopic(JsSQL(6,i),TempStr(1)) TempBody = Replace(TempBody,Match.Value,TitleStr) Case "imgurl" sImgUrl = Replace(sImgUrl,"{%ImgWidth%}",TempStr(1)) sImgUrl = Replace(sImgUrl,"{%ImgHeight%}",TempStr(2)) TempBody = Replace(TempBody,Match.Value,sImgUrl) Case "intro" TempBody = Replace(TempBody,Match.Value,Left(Cl.NoHtml(JsSQL(22,i)),TempStr(1))) Case "updatetime" TempBody = Replace(TempBody,Match.Value,Cl.Format_Time(JsSQL(16,i),TempStr(1))) End Select Next sHTML = sHTML & TempBody if (i+1) mod ColsNum=0 then sHTML = sHTML & Style3 Next GetPhoto=Replace(Style1,"{%ContentBody%}",sHTML) JsSQL=Empty End Function '================================================= '过程名:ShowClassPhoto(sChannelID,sClassID,ModNum,TopNum) '参 数: ' sChannelID ---- 频道ID ' sClassID ---- 指定栏目,多个用“|”分隔,不指定请留空或0 ' ModNum --- 多少个换行 ' TopNum --- 最多显示记录数 '================================================= Function ShowClassPhoto(Byval sChannelID,Byval sClassID,Byval ModNum,Byval TopNum) dim sqlRoot,rsRoot,ClassCount,iClassID Dim sTemp,strValue sChannelID = Cl.ChkClng(sChannelID) sTemp = "" sClassID = Trim(sClassID) ModNum = Cl.ChkClng(ModNum) if sClassID="" or sClassID="0" then TopNum = Cl.ChkClng(TopNum) if TopNum=0 then TopNum = 6 sqlRoot="select Top "&TopNum&" ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and ParentID=0 and IsElite=True and IsOuter=0 order by RootID" Else sqlRoot="select ClassID,ClassName,ParentPath,ClassDir,ParentDir,RootID,Child,arrChildID,Readme From Cl_Class where ChannelID="&sChannelID&" and IsElite=True and IsOuter=0 and ClassID In ("&Replace(sClassID,"|",",")&") order by RootID" End if Set rsRoot= Cl.Execute(sqlRoot) if rsRoot.bof and rsRoot.eof then sTemp="还没有任何栏目,请首先添加栏目。" rsRoot.Close:Set rsRoot=Nothing:Exit Function end if sqlRoot=rsRoot.GetRows(-1) rsRoot.Close:Set rsRoot=Nothing Cl.GetChannelSetting(sChannelID) Cl.LoadTempLates(Cl.Channel_Setting(4)) for iClassID=0 to Ubound(sqlRoot,2) strValue=Replace(Template.html(8),"{%channelid%}",sChannelID) strValue=Replace(strValue,"{%classid%}",sqlRoot(0,iClassID)) strValue=Replace(strValue,"{%classtitle%}",sqlRoot(8,iClassID)&"") strValue=Replace(strValue,"{%classname%}",sqlRoot(1,iClassID)) strValue=Replace(strValue,"{%classfileurl%}",Cl.WebDir & Cl.GetClassUrl(Cl.Channel_Setting(11),Cl.HtmlDir,Cl.Channel_Setting(4),sqlRoot(2,iClassID),sqlRoot(0,iClassID),sqlRoot(4,iClassID),sqlRoot(3,iClassID),Cl.Channel_Setting(10),Cl.Channel_Setting(13))) strValue=Cl.ReplaceFlag(strValue,"showphoto","") if ((iClassID+1) mod modnum) = 0 then strValue = strValue & Split(Template.html(9),"||")(1) else strValue = strValue & Split(Template.html(9),"||")(0) end if sTemp=sTemp & strValue Next ShowClassPhoto=Replace(Template.html(7),"{%classphotobody%}",sTemp) sqlRoot=Empty End Function '==================================================================================================== '过程:ShowPicPhoto(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowType,Cols,ImgWidth,ImgHeight,ContentLen,IsHot,IsElite) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为所有栏目,若大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为所有栏目,若大于0,则调用指定专题) ' TopNum ------ 最多显示多少篇 ' TitleLen ------ 标题最多字符数 ' ShowType ------ 显示方式。0(图),1(图+标),2(图+标+内),3(图+幻),4(图+标+幻) ' Cols ------ 列数。超过此列数就换行 ' ImgWidth ------ 图片宽度 ' ImgHeight ------ 图片高度 ' ContentLen ------ 内容最多字符数 ' IsHot ------ 是否是热门(True为是,False为否) ' IsElite ------ 是否是推荐(True为是,False为否) '==================================================================================================== Function ShowPicPhoto(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowType,Byval Cols,Byval ImgWidth, _ Byval ImgHeight,Byval ContentLen,Byval IsHot,Byval IsElite) On Error Resume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowType = Clng(ShowType) Cols = Clng(Cols) : ImgWidth = Clng(ImgWidth) ImgHeight = Clng(ImgHeight) : ContentLen = Clng(ContentLen) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) if Err then Err.Clear : ShowPicPhoto="ShowPicPhoto参数错误。":Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) dim rsPic,sqlPic,tClass,j,strPic if TopNum<=0 then sqlPic="Select " else sqlPic="Select top "&TopNum&" " end if sqlPic=sqlPic & " PhotoID,ClassID,PhotoName,Author,AuthorEmail,Editor,Keyword,Hits,DayHits,WeekHits,MonthHits,UpdateTime,PhotoPicUrl,OnTop,Elite,Passed,PhotoIntro,PhotoLevel,PhotoPoint,Stars,IsHtml,HtmlFileUrl from Cl_Photo where Deleted=False and Passed=True and ChannelID="&sChannelID&" and PhotoPicUrl<>'' " if sClassID>0 then set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlPic=sqlPic & " and ClassID in (" & tClass(3) & ")" else sqlPic=sqlPic & " and ClassID=" & sClassID end if else sqlPic=sqlPic & " and ClassID=" & sClassID end if set tClass=Nothing end if if sSpecialID>0 then sqlPic=sqlPic & " and SpecialID Like '%" & sSpecialID & "%'" if IsHot=True then sqlPic=sqlPic & " and Hot=True " if IsElite=True then sqlPic=sqlPic & " and Elite=True " 'if IsSqlDataBase=1 then sqlPic=sqlPic & " order by OnTop Asc,UpdateTime desc,PhotoID desc" Set rsPic= Server.CreateObject("ADODB.Recordset") OpenConn : rsPic.open sqlPic,Conn,1,1 strPic= "" if rsPic.bof and rsPic.eof then strPic = strPic & "" rsPic.Close : Set rsPic = Nothing else dim FileType,TitleStr,LinkUrl if TopNum<=0 or TopNum>=100 then TotalPut=rsPic.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsPic.move (CurrentPage-1)*MaxPerPage sqlPic = rsPic.GetRows(MaxPerPage) else sqlPic=rsPic.GetRows(-1) end if rsPic.Close : Set rsPic = Nothing Select Case ShowType Case 0 for j=0 to Ubound(sqlPic,2) if sqlPic(20,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(21,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 1 for j=0 to Ubound(sqlPic,2) if sqlPic(20,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(21,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 2 for j=0 to Ubound(sqlPic,2) if sqlPic(20,j) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlPic(21,j) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID=" & sqlPic(0,j) end if strPic = strPic & "" if (j+1) Mod Cols=0 then strPic = strPic & "" Next Case 3, 4 Dim sImgID sImgID=Cl.CreatePass(3) & "Cl" & ImgWidth & ImgHeight & ContentLen' & IsHot & IsElite strPic = strPic & "" & vbcrlf strPic = strPic & "" & vbcrlf if ShowType=4 then strPic = strPic & "" & vbcrlf else strPic = strPic & "" & vbcrlf end if strPic = strPic & "" end Select sqlPic=Empty end if strPic = strPic & "

    没有"&Cl.Channel_Setting(2)&"
    " FileType=right(lcase(sqlPic(12,j)),3) strPic = strPic & "" sqlPic(12,j)=Cl.ReplaceDir(sqlPic(12,j)) Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " FileType=right(lcase(sqlPic(12,j)),3) TitleStr=Cl.GotTopic(sqlPic(2,j),TitleLen) strPic = strPic & "" sqlPic(12,j)=Cl.ReplaceDir(sqlPic(12,j)) Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " FileType=right(lcase(sqlPic(12,j)),3) TitleStr=Cl.GotTopic(sqlPic(2,j),TitleLen) strPic = strPic & "" sqlPic(12,j)=Cl.ReplaceDir(sqlPic(12,j)) Select Case FileType Case "swf" strPic = strPic & "" Case "jpg", "bmp", "png", "gif" strPic = strPic & "" Case else strPic = strPic & "" end Select strPic = strPic & "
    " & TitleStr & "
    " strPic = strPic & "
    " & left(Cl.NoHtml(sqlPic(16,j)),ContentLen) & "……
    " & vbcrlf strPic = strPic & "" & vbcrlf strPic = strPic & "
    " ShowPicPhoto=strPic End Function '==================================================================================================== '过程:ShowPhoto(sChannelID,sClassID,sSpecialID,TopNum,TitleLen,ShowClassName,ShowProperty,ShowPrefix,ShowAuthor,ShowDateType,ShowHits,ShowHot,IsElite,IsHot,UserName,CssStyle) '参数: ' sChannelID ------ 频道ID ' sClassID ------ 栏目ID(0为全部,如果大于0,则调用指定栏目及其子栏目) ' sSpecialID ------ 专题ID(0为全部,如果大于0,刚调用指定专题) ' TopNum ------ 最多记录数,0为全部(用于分页显示) ' TitleLen ------ 标题最多字符数 ' ShowClassName ------ 是否显示栏目名称(True为显示,False为不显示) ' ShowProperty ------ 是否显示文章属性(固顶/推荐/普通),(True为显示,False为不显示) ' ShowPrefix ------ 是否显示前缀如:[推荐][图文][注意]字样(True为显示,False为不显示) ' ShowAuthor ------ 是否显示文章作者,True为显示,False为不显示) ' ShowDateType ------ 显示更新日期的样式 ' ---- 0(不显示) ' ---- 1(2004-10-01 23:45:45) ' ---- 2(年-月-日 时:分:秒) ' ---- 3(2004-10-01) ' ---- 4(2004\10\01) ' ---- 5(10-01 23:45) ' ---- 6(2004年10月01日) ' ---- 7(10-01) ' ---- 8(20041001234545) ' ShowHits ------ 是否显示文章点击数(True为显示,False为不显示) ' ShowHot ------ 是否显示热门文章标志(True为显示,False为不显示) ' IsHot ------ 是否热门(True为是,False为否) ' IsElite ------ 是否推荐(True为是,False为否) ' UserName ------ 指定某用户(不指定请留空值或0) ' CssStyle ------ CSS样式 '==================================================================================================== Function ShowPhoto(Byval sChannelID,Byval sClassID,Byval sSpecialID, _ Byval TopNum,Byval TitleLen,Byval ShowClassName,Byval ShowProperty, _ Byval ShowPrefix,Byval ShowAuthor,Byval ShowDateType,Byval ShowHits, _ Byval ShowHot,Byval IsHot,Byval IsElite,Byval UserName,Byval CssStyle) On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) sSpecialID = Clng(sSpecialID) : TopNum = Clng(TopNum) TitleLen = Clng(TitleLen) : ShowClassName = CBool(ShowClassName) ShowProperty = CBool(ShowProperty) : ShowPrefix = CBool(ShowPrefix) ShowAuthor = CBool(ShowAuthor) : ShowDateType = Clng(ShowDateType) ShowHits = CBool(ShowHits) : ShowHot = CBool(ShowHot) IsHot = CBool(IsHot) : IsElite = CBool(IsElite) UserName = Trim(UserName) : CssStyle = Trim(CssStyle) if Err then Err.Clear : ShowPhoto="ShowPhoto参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) Dim SQLInfo if TopNum<=0 then SqlInfo="Select " else SqlInfo="Select Top "&TopNum&" " end if SqlInfo = SqlInfo & "P.PhotoID,P.ClassID,C.ClassName,C.ParentPath,C.ClassDir,C.ParentDir,P.PhotoName,P.Prefixion,P.Author,P.AuthorEmail,P.Editor,P.Keyword,P.Hits,P.DayHits,P.WeekHits,P.MonthHits,P.UpdateTime,P.PhotoPicUrl,P.OnTop,P.Hot,P.Elite,P.Passed,P.PhotoLevel,P.PhotoPoint,P.Stars,P.IsHtml,P.HtmlFileUrl from Cl_Photo P Inner Join Cl_Class C On P.ClassID=C.ClassID where P.Deleted=False and P.Passed=True and P.ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then SqlInfo=SqlInfo & " and P.ClassID in (" & tClass(3) & ")" else SqlInfo=SqlInfo & " and P.ClassID=" & sClassID end if else SqlInfo=SqlInfo & " and P.ClassID=" & sClassID end if Set tClass=Nothing end if if sSpecialID>0 then SqlInfo=SqlInfo & " and P.SpecialID Like '%" & sSpecialID & "%'" if IsElite=True then SqlInfo=SqlInfo & " and P.Elite=True" if IsHot=True then SqlInfo=SqlInfo & " and P.Hot=True" if UserName<>"" and UserName<>"0" then SqlInfo=SqlInfo & " and P.Editor='" & UserName & "'" 'if IsSqlDataBase=1 then SqlInfo=SqlInfo & " order by P.OnTop Asc,P.UpdateTime desc,P.PhotoID desc" Set rsInfo= Server.CreateObject("ADODB.Recordset") OpenConn : rsInfo.open SqlInfo,Conn,1,1 if rsInfo.bof and rsInfo.eof then 'TotalPut=0 ShowPhoto="
  • 没有任何"&Cl.Channel_Setting(2)&"
  • " rsInfo.close:set rsInfo=Nothing : Exit Function End if if TopNum<=0 or TopNum>=100 then TotalPut=rsInfo.recordcount if (TotalPut mod MaxPerPage)=0 then TotalPages = TotalPut \ MaxPerPage else TotalPages = TotalPut \ MaxPerPage + 1 end if if CurrentPage > TotalPages then CurrentPage=TotalPages if CurrentPage < 1 then CurrentPage=1 rsInfo.move (CurrentPage-1)*MaxPerPage SqlInfo=rsInfo.GetRows(MaxPerPage) else SqlInfo=rsInfo.GetRows(-1) end if rsInfo.close:set rsInfo=Nothing dim sTemp,Linkurl,i dim TitleStr,Author,AuthorName,AuthorEmail,sTitleLen i=0:sTemp = "" & VbCrlf For i=0 to Ubound(SqlInfo,2) sTitleLen = TitleLen sTemp = sTemp & "" & VbCrlf & "" & VbCrlf Next ShowPhoto=sTemp & "
     " if ShowProperty=True then if SqlInfo(18,i)=True then sTemp = sTemp & " " elseif SqlInfo(20,i)=True then sTemp = sTemp & " " else sTemp = sTemp & " " end if end if if ShowClassName=True and SqlInfo(1,i)<>ClassID then sTemp=sTemp & "[" & SqlInfo(2,i) & "] " sTitleLen=sTitleLen-Cl.strLength(SqlInfo(2,i))-1 end if 'if ShowPrefix=True and SqlInfo(7,i)<>"" then ' sTemp = sTemp & ""&SqlInfo(7,i)&"" ' sTitleLen=sTitleLen-Cl.strLength(SqlInfo(7,i))-2 'end if if SqlInfo(25,i) and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & SqlInfo(26,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID="&SqlInfo(0,i) end if sTemp = sTemp & "" TitleStr=Cl.GotTopic(SqlInfo(6,i),sTitleLen) sTemp=sTemp & TitleStr & "" if ShowHot=True then if CDate(FormatDateTime(SqlInfo(16,i),2))=date() then sTemp= sTemp & "" elseif SqlInfo(19,i)=True then sTemp= sTemp & "" end if end if if ShowAuthor=True or ShowHits=True or ShowDateType>0 then sTemp = sTemp & "(" if ShowAuthor=True then sTemp=sTemp & "" & SqlInfo(8,i) & "" end if if ShowHits=True then if ShowAuthor=True then sTemp=sTemp & "," end if sTemp=sTemp & Cl.FormatColor(SqlInfo(12,i),"#ff0033") end if if ShowDateType>0 then if ShowHits=True or ShowAuthor=True then sTemp=sTemp & "," end if if CDate(FormatDateTime(SqlInfo(16,i),2))=date() then sTemp = sTemp & "" else sTemp = sTemp & "" end if sTemp = sTemp & Cl.Format_Time(SqlInfo(16,i),ShowDateType) & "" end if sTemp = sTemp & ")" end if sTemp = sTemp & "
    " SqlInfo=Empty End Function '================================================================ '过程名:ShowTopPhoto(sChannelID,sClassID,TopNum,TitleLen,ShowType,ShowHits) ' sChannelID ----频道ID ' sClassID ----栏目ID ' TopNum ----下载TOP ' TitleLen ----标题最多字符数,一个汉字=两个英文字符 ' ShowType ----- 1(本日),2(本周),3(本月),4(累计) ' ShowHits ------ (是否显示点击数,True为是) '================================================================ Function ShowTopPhoto(Byval sChannelID,Byval sClassID,Byval TopNum, _ Byval TitleLen,Byval ShowType,Byval ShowHits) dim sqlTop,rsTop,LinkUrl On Error ReSume Next sChannelID = Clng(sChannelID) : sClassID = Clng(sClassID) TopNum = Clng(TopNum) : TitleLen = Clng(TitleLen) ShowType = Clng(ShowType) : ShowHits = CBool(ShowHits) if Err then Err.Clear : ShowTopPhoto="ShowTopPhoto参数错误。" : Exit Function On Error GoTo 0 Cl.GetChannelSetting(sChannelID) if TopNum>0 then sqlTop="select top " & TopNum & " " else sqlTop="select top 10 " end if sqlTop=sqlTop & " PhotoID,ClassID,PhotoName,Author,AuthorEmail,Editor,Keyword,Hits,DayHits,WeekHits,MonthHits,UpdateTime,PhotoPicUrl,OnTop,Elite,Passed,PhotoIntro,PhotoLevel,PhotoPoint,Stars,IsHtml,HtmlFileUrl from Cl_Photo where Deleted=False and Passed=True and ChannelID="&sChannelID&" " if sClassID>0 then Dim tClass Set tClass=Cl.Execute("select ClassID,Child,ParentPath,arrChildID from Cl_Class where ChannelID="&sChannelID&" and ClassID=" & sClassID) if not(tClass.bof and tClass.eof) then if tClass(1)>0 then sqlTop=sqlTop & " and ClassID in (" & tClass(3) & ")" else sqlTop=sqlTop & " and ClassID=" & sClassID end if else sqlTop=sqlTop & " and ClassID=" & sClassID end if Set tClass=Nothing end if Select Case ShowType Case 1 sqlTop=sqlTop & " And datediff('D',LastHitTime,now())<=0 order by DayHits desc,PhotoID desc" Case 2 sqlTop=sqlTop & " And datediff('ww',LastHitTime,now())<=0 order by WeekHits desc,PhotoID desc" Case 3 sqlTop=sqlTop & " And datediff('m',LastHitTime,now())<=0 order by MonthHits desc,PhotoID desc" Case Else sqlTop=sqlTop & " order by Hits desc,PhotoID desc" end Select Set rsTop= Cl.Execute(sqlTop) if rsTop.bof and rsTop.eof then ShowTopPhoto = "
  • 没有"&Cl.Channel_Setting(2)&"
  • " rsTop.Close:Set rsTop=Nothing:Exit Function End if Dim i,sTemp i=1:sTemp = "" sqlTop=rsTop.GetRows(-1) rsTop.Close:Set rsTop=Nothing For i=0 to Ubound(sqlTop,2) if sqlTop(20,i)=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & sqlTop(21,i) else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID="&sqlTop(0,i) end if sTemp = sTemp & "
  • " & Cl.gotTopic(sqlTop(2,i),TitleLen) & "" if ShowHits=True then sTemp=sTemp & "(" & sqlTop(7,i) & ")" end if sTemp=sTemp & "

  • " Next ShowTopPhoto=sTemp sqlTop=Empty End Function '======================================================================= '显示相关文章 'ShowCorrelativePhoto(sChannelID,TopNum,TitleLen,ShowHits) ' sChannelID ' TopNum ------ (文章数量) ' TitleLen ------ (标题字符数) ' ShowHits ------ (是否显示点击数,True为是) '======================================================================= Function ShowCorrelativePhoto(Byval sChannelID,Byval TopNum,Byval TitleLen,Byval ShowHits) dim rsC,SQL,sTemp sChannelID=Cl.ChkClng(sChannelID):ShowHits=Cl.ChkCBool(ShowHits) TopNum=Cl.ChkClng(TopNum):TitleLen=Cl.ChkClng(TitleLen) dim strKey,arrKey,i,LinkUrl if TopNum>0 then SQL="select top " & TopNum else SQL="Select Top 5 " end if strKey=rs("Keyword") if instr(strkey,"|")>1 then arrKey=split(strKey,"|") strKey="((Keyword like '%" & arrKey(0) & "%')" for i=1 to ubound(arrKey) strKey=strKey & " or (Keyword like '%" & arrKey(i) & "%')" next strKey=strKey & ")" else strKey="(Keyword like '%" & strKey & "%')" end if SQL=SQL & " PhotoID,PhotoName,Author,Keyword,UpdateTime,Editor,Hits,PhotoSize,PhotoLevel,PhotoPoint,IsHtml,HtmlFileUrl from Cl_Photo Where Deleted=False and Passed=True and " & strKey & " and PhotoID<>" & PhotoID & " and ChannelID="&sChannelID&" Order by UpdateTime desc, PhotoID desc" Set rsC= Cl.Execute(SQL) if TitleLen<0 or TitleLen>255 then TitleLen=50 if rsC.bof and rsC.Eof then sTemp = "没有相关图片" else Cl.GetChannelSetting(sChannelID) do while not rsC.eof if rsC("IsHtml")=True and Clng(Cl.Channel_Setting(10))=1 then LinkUrl=Cl.WebDir & rsC("HtmlFileUrl") else LinkUrl=Cl.WebDir & Cl.Channel_Setting(4) & "/PhotoShow.asp?PhotoID="&rsC("Photoid") end if sTemp = sTemp & "
  • " & Cl.gotTopic(rsC("PhotoName"),TitleLen) if ShowHits=True then sTemp = sTemp & "[" & rsC("hits") & "]" end if sTemp = sTemp & "

  • " rsC.movenext loop end if rsC.Close : set rsC=Nothing ShowCorrelativePhoto=sTemp End Function Public Sub ChkPhotoLevel() if Not Cl.TrueBrowsePurview then Response.write Template.Strings(2) Response.end end if if Cl.ChkUserLevel(rs("PhotoLevel"),5) and rs("PhotoPoint")=0 and rs("PhotoMoney")=0 then Exit Sub If Cl.UserID=0 or Cl.UserLevel=5 then Response.write Template.Strings(3) Response.end End if if Not Cl.ChkUserLevel(rs("PhotoLevel"),Cl.UserLevel) then Response.write Replace(Template.Strings(4),"{%level%}",Cl.GetUserGroupName(rs("PhotoLevel"))) Response.end End if Dim rsL,SQLL,IsPay SQLL="Select Top 1 ID,ConsumePoint,ConsumeMoney,ConsumeNums,ConsumeLog,ConsumeTime From Cl_ConsumeLog Where ChannelID="&ChannelID&" and InfoID="&PhotoID&" and UserID="&Cl.UserID&" Order By ID Desc" Set rsL=Server.CreateObject("adodb.recordset") OpenConn_L : rsL.Open SQLL,Conn_L,1,3 if rsL.Bof and rsL.Eof then IsPay=False else IsPay=True 'if *** then IsPay=False rsL("ConsumeNums")=rsL("ConsumeNums")+1 rsL.Update end if rsL.Close : Set rsL=Nothing Dim sBackMoney,sBackPoint Select Case Cint(Cl.User_Info(24)) Case 1 if IsPay=False and (rs("PhotoPoint")>0 or rs("PhotoMoney")>0) then if Clng(Cl.User_Info(22))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if else ErrMsg=Replace(Template.Strings(8),"{%photopoint%}",rs("PhotoPoint")) ErrMsg=Replace(ErrMsg,"{%userpoint%}",Cl.User_Info(22)) ErrMsg=Replace(ErrMsg,"{%photomoney%}",rs("PhotoMoney")) ErrMsg=Replace(ErrMsg,"{%usermoney%}",Cl.User_Info(23)) Response.write Replace(ErrMsg,"{%photourl%}","PhotoView.asp?Pay=yes&UrlID="&UrlID&"&PhotoID="&PhotoID&"") Response.end end if end if Case 2 if Clng(Cl.User_Info(40))<=0 then response.write Template.Strings(7) response.end elseif IsPay=False and Rs("PhotoMoney")>0 then if Clng(Cl.User_Info(23))0 or sBackPoint>0 then Cl.Execute_U "update " & Db.UserTable & " set " & Db.UserPoint & "=" & Db.UserPoint & "+" & sBackPoint & "," & Db.UserMoney & "=" & Db.UserMoney & "+" & sBackMoney & " where " & Db.UserName & "='" & rs("Editor") & "'" end if Else ErrMsg=Replace(Template.Strings(8),"{%photopoint%}",0) ErrMsg=Replace(ErrMsg,"{%userpoint%}",0) ErrMsg=Replace(ErrMsg,"{%photomoney%}",rs("PhotoMoney")) ErrMsg=Replace(ErrMsg,"{%usermoney%}",Cl.User_Info(23)) Response.write Replace(ErrMsg,"{%photourl%}","PhotoView.asp?Pay=yes&UrlID="&UrlID&"&PhotoID="&PhotoID&"") Response.end End if End if '2 End if Case Else response.write Template.Strings(7) response.end End Select End Sub %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Movie.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== %> <% '=================================================== ' CreateLive CMS Version 3.1 ' Powered by Aspoo.CoM '=================================================== ' File: Cl_Function_Product.asp ' Date: 2005-10-31 ' Mail: aspoo@126.com, Info@aspoo.cn ' Q Q: 3315263, 596197794 ' Msn : aspoo@126.com, Clw866@hotmail.com ' Web : http://www.aspoo.com, http://www.aspoo.net ' Bbs : http://bbs.aspoo.com, http://bbs.aspoo.net ' Copyright (C) 2005 Aspoo.CoM All Rights Reserved. '=================================================== %> <% MaxPerPage=20 Cl.LoadTemplates("index") Cl.Path = Cl.lanstr(1) & "
    " & Cl.Web_info(0) & " >> " & Cl.ChannelName CurrentPage=Cl.ChkClng(request("page")) %> <% '================================================== 'CreateLive CMS Version 3.1 ' Powered by Aspoo.Net ' '邮箱: aspoo@126.com Info@aspoo.cn 'QQ: 3315263 596197794 '网站: www.aspoo.cn www.aspoo.com '论坛: bbs.aspoo.cn bbs.aspoo.com ' 'Copyright (C) 2005 Aspoo.Net All Rights Reserved. '================================================== %> <% MaxPerPage=20 'if Cl.IsCreateHtml=1 then Response.redirect "Index." & Cl.Channel_Setting(13) TempStr=Template.html(17) Response.write Cl.ReplaceAllFlag(TempStr) %> <% '================================================== 'CreateLive CMS Version 3.1 ' Powered by Aspoo.Net ' ' 'Copyright (C) 2005 Aspoo.Net All Rights Reserved. '================================================== %>