⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 powereasy.common.front.asp

📁 个人网站比较简短
💻 ASP
📖 第 1 页 / 共 5 页
字号:
	    YN=Fir 
	Elseif LCase(Condition)="false" Then
	    YN=Sec
    Else
        regEx.Pattern = "^[0-9\<\>\=\%\+\-\*\/\""]+$"    '匹配只是数字还有运算符
        Dim Temp, result
        Temp = regEx.Test(Condition)  '判断是否只有数字和运算符
        If Temp = True Then           '如果只有数字和运算符
		    Condition = Replace(Condition,"%"," mod ")
            result = Eval(Condition)  '执行算术运算
            If (result) Then
                YN = Fir           '计算结果为真,返回条件1
            Else
                YN = Sec             '计算结果为假,返回条件2
            End If
        ElseIf InStr(Condition, "=") Then   '字符串允许等于判断

            Dim Tempequal
            Tempequal = Split(Condition, "=")
            If Tempequal(0) = Tempequal(1) Then
                YN = Fir
            Else
                YN = Sec
            End If
        ElseIf InStr(Condition, "<>") Then   '字符串允许不等于判断
            Dim Tempuneuqal
            Tempuneuqal = Split(Condition, "<>")
            If Tempuneuqal(0) <> Tempuneuqal(1) Then
                YN = Fir
            Else
                YN = Sec
            End If

        Else                            '其他情况都设置成非法参数
            YN = "参数类型不正确"
        End If
    End If
End Function

'==================================================
'函数名:ShowPath
'作  用:显示“你现在所有位置”导航信息
'参  数:无
'==================================================
Function ShowPath()
    If PageTitle <> "" Then
        strNavPath = strNavPath & "&nbsp;" & strNavLink & "&nbsp;" & PageTitle
    End If
    ShowPath = strNavPath
End Function


'==================================================
'函数名:GetLogo
'作  用:得到显示网站LOGO的HTML代码
'参  数:无
'==================================================
Function GetLogo(LogoWidth, LogoHeight)
    Dim strLogo, strLogoUrl
    If LogoUrl <> "" Then
        If LCase(Left(LogoUrl, 7)) = "http://" Or Left(LogoUrl, 1) = "/" Then
            strLogoUrl = LogoUrl
        Else
            strLogoUrl = strInstallDir & LogoUrl
        End If
        If LCase(Right(strLogoUrl, 3)) = "swf" Then
            strLogo = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'"
            If LogoWidth > 0 Then strLogo = strLogo & " width='" & LogoWidth & "'"
            If LogoHeight > 0 Then strLogo = strLogo & " height='" & LogoHeight & "'"
            strLogo = strLogo & "><param name='movie' value='" & strLogoUrl & "'>"
            strLogo = strLogo & "<param name='wmode' value='transparent'>"
            strLogo = strLogo & "<param name='quality' value='autohigh'>"
            strLogo = strLogo & "<embed"
            If LogoWidth > 0 Then strLogo = strLogo & " width='" & LogoWidth & "'"
            If LogoHeight > 0 Then strLogo = strLogo & " height='" & LogoHeight & "'"
            strLogo = strLogo & " src='" & strLogoUrl & "'"
            strLogo = strLogo & " wmode='transparent'"
            strLogo = strLogo & " quality='autohigh'"
            strLogo = strLogo & "pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>"
            strLogo = strLogo & "</object>"
        Else
            strLogo = "<a href='" & SiteUrl & "' title='" & SiteName & "' target='_blank'>"
            strLogo = strLogo & "<img src='" & strLogoUrl & "'"
            If LogoWidth > 0 Then strLogo = strLogo & " width='" & LogoWidth & "'"
            If LogoHeight > 0 Then strLogo = strLogo & " height='" & LogoHeight & "'"
            strLogo = strLogo & " border='0'>"
            strLogo = strLogo & "</a>"
        End If
    End If
    GetLogo = strLogo
End Function

'==================================================
'过程名:GetBanner
'作  用:得到网站Banner的HTML代码
'参  数:无
'==================================================
Function GetBanner(BannerWidth, BannerHeight)
    Dim strBanner
    If BannerUrl <> "" Then
        If LCase(Right(BannerUrl, 3)) = "swf" Then
            If LCase(Left(BannerUrl, 7)) = "http://" Then
                strBanner = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" & BannerWidth & "' height='" & BannerHeight & "'><param name='movie' value='" & BannerUrl & "'><param name='wmode' value='transparent'><param name='quality' value='high'><embed src='" & BannerUrl & "' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" & BannerWidth & "' height='" & BannerHeight & "'></embed></object>"
            Else
                strBanner = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='" & BannerWidth & "' height='" & BannerHeight & "'><param name='movie' value='" & strInstallDir & BannerUrl & "'><param name='wmode' value='transparent'><param name='quality' value='high'><embed src='" & strInstallDir & BannerUrl & "' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='" & BannerWidth & "' height='" & BannerHeight & "'></embed></object>"
            End If
        Else
            If LCase(Left(BannerUrl, 7)) = "http://" Then
                strBanner = "<a href='" & SiteUrl & "' title='" & SiteName & "'><img src='" & BannerUrl & "' width='" & BannerWidth & "' height='" & BannerHeight & "' border='0'></a>"
            Else
                strBanner = "<a href='" & SiteUrl & "' title='" & SiteName & "'><img src='" & strInstallDir & BannerUrl & "' width='" & BannerWidth & "' height='" & BannerHeight & "' border='0'></a>"
            End If
        End If
    End If
    GetBanner = strBanner
End Function

Function GetChannelList(NumNewLine)
    If ShowSiteChannel = False Then
        GetChannelList = ""
        Exit Function
    End If
    Dim tmpCacheName
    tmpCacheName = "ChannelListHtml_" & ChannelID & "_" & NumNewLine
    If PE_Cache.CacheIsEmpty(tmpCacheName) Then
        Dim rsChannel, strChannel, ChannelLink, ChannelUrl, LineNum
        LineNum = 1
        ChannelLink = XmlText("BaseText", "ChannelLink", "&nbsp;|&nbsp;")
        If ChannelID = 0 Then
            strChannel = ChannelLink & "<a class='Channel2' href='" & strInstallDir & FileName_SiteIndex & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        Else
            strChannel = ChannelLink & "<a class='Channel' href='" & strInstallDir & FileName_SiteIndex & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        End If
        Set rsChannel = Conn.Execute("select * from PE_Channel order by OrderID")
        Do While Not rsChannel.EOF
            If rsChannel("Disabled") <> True And (rsChannel("ShowName") <> False Or rsChannel("ChannelType") = 2) Then
                If NumNewLine > 0 And LineNum = NumNewLine Then
                    LineNum = 0
                    strChannel = strChannel & "<br>" & ChannelLink
                End If
                '只使用绝对地址时,才使用频道子域名
                If IsNull(rsChannel("LinkUrl")) Or Trim(rsChannel("LinkUrl")) = "" Or Left(strInstallDir, 7) <> "http://" Then
                    ChannelUrl = strInstallDir & rsChannel("ChannelDir")
                Else
                    ChannelUrl = rsChannel("LinkUrl")
                End If
                If rsChannel("ChannelID") = ChannelID Then
                    strChannel = strChannel & "<a class='Channel2' "
                Else
                    strChannel = strChannel & "<a class='Channel' "
                End If
                If rsChannel("ChannelType") <= 1 Then
                    If rsChannel("UseCreateHTML") > 0 Then
                        strChannel = strChannel & " href='" & ChannelUrl & "/Index" & arrFileExt(rsChannel("FileExt_Index")) & "'"
                    Else
                        strChannel = strChannel & " href='" & ChannelUrl & "/Index.asp'"
                    End If
                Else
                    strChannel = strChannel & " href='" & rsChannel("LinkUrl") & "'"
                End If
                If rsChannel("OpenType") = 0 Then
                    strChannel = strChannel & " target='_self'"
                Else
                    strChannel = strChannel & " target='_blank'"
                End If
                
                strChannel = strChannel & " title='" & Trim(nohtml(rsChannel("ReadMe"))) & "'"

                If rsChannel("ChannelPicUrl") = "" Or IsNull(rsChannel("ChannelPicUrl")) = True Then
                    strChannel = strChannel & ">" & rsChannel("ChannelName") & "</a>" & ChannelLink
                Else
                    strChannel = strChannel & "><img src='" & rsChannel("ChannelPicUrl") & "' border=0 alt='" & rsChannel("ChannelName") & "'></a>" & ChannelLink
                End If
                If NumNewLine > 0 Then
                    LineNum = LineNum + 1
                End If
            End If
            rsChannel.MoveNext
        Loop
        rsChannel.Close
        Set rsChannel = Nothing
        PE_Cache.SetValue tmpCacheName, strChannel
    Else
        strChannel = PE_Cache.GetValue(tmpCacheName)
    End If

    GetChannelList = strChannel
End Function

'=================================================
'函数名:GetBrotherClass
'作  用:显示当前栏目的同级栏目
'参  数:
'1       theClassID ---- 栏目ID,0为本栏目
'2       ClassNum ---- 栏目数,若大于0,则只查询前几个栏目
'3       ShowPropertyType ---- 显示栏目前的小图标,0为不显示,1为符号,其他为小图片:/images/article_common*.gif
'4       OpenType ---- 栏目打开方式,0为在原窗口打开,1为在新窗口打开,3为根据栏目设置
'5       Cols ---- 每行的列数。超过此列数就换行。
'=================================================
Function GetBrotherClass(theClassID, ClassNum, ShowPropertyType, OpenType, Cols)
    Dim sqlBro, rsBro, i, strBro, tOpenType

    If Cols = 0 Then Cols = 1
    
    sqlBro = "select"
    If ClassNum > 0 Then
        sqlBro = sqlBro & " top " & ClassNum
    End If
    sqlBro = sqlBro & " ClassID,ClassName,Depth,ParentPath,NextID,ClassType,Child,ParentDir,ClassDir,OpenType,LinkUrl,ClassPurview from PE_Class where ChannelID=" & ChannelID & " "
    
    If theClassID <> 0 Then
        sqlBro = sqlBro & " and ParentID=(select ParentID from PE_Class where ClassID= " & theClassID & ")"
    Else
        sqlBro = sqlBro & " and ParentID=(select ParentID from PE_Class where ClassID= " & ClassID & ")"
    End If

    sqlBro = sqlBro & " and IsElite=" & PE_True & " order by OrderID,RootID"

    Set rsBro = Conn.Execute(sqlBro)
    If rsBro.BOF And rsBro.EOF Then
        strBro = "没有任何同级栏目"
    Else
        i = 0
        Do While Not rsBro.EOF
            If i > 0 Then
                If i Mod Cols = 0 Then
                    strBro = strBro & "<br>"
                Else
                    strBro = strBro & "&nbsp;&nbsp;"
                End If
            
            End If
                
            If ShowPropertyType = 0 Then
                strBro = strBro & ""
            ElseIf ShowPropertyType = 1 Then
                strBro = strBro & "·"
            Else
                strBro = strBro & "<img src='" & ChannelUrl & "/images/" & ModuleName & "_common" & ShowPropertyType & ".gif' border='0'>"
            End If

            If rsBro("ClassType") = 1 Then
                strBro = strBro & "&nbsp;<a class='childclass' href='" & GetClassUrl(rsBro("ParentDir"), rsBro("ClassDir"), rsBro("ClassID"), rsBro("ClassPurview")) & "'"
            Else
                strBro = strBro & "&nbsp;<a class='childclass' href='" & rsBro("LinkUrl") & "'"
            End If
            If OpenType = 3 Then
                tOpenType = rsBro("OpenType")
            Else
                tOpenType = OpenType
            End If
            If tOpenType = 0 Then
                strBro = strBro & " target=""_self"">"
            Else
                strBro = strBro & " target=""_blank"">"
            End If
            strBro = strBro & rsBro("ClassName") & "</a>"

            rsBro.MoveNext
            i = i + 1
        Loop

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -