powereasy.common.content.asp

来自「个人网站比较简短」· ASP 代码 · 共 360 行 · 第 1/2 页

ASP
360
字号
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************

'**************************************************
'函数名:GetListPath
'作  用:获得列表路径
'参  数:iStructureType ---- 目录结构方式
'        iListFileType ---- 列表文件方式
'        sParentDir ---- 父栏目目录
'        sClassDir ---- 当前栏目目录
'返回值:列表路径
'**************************************************
Public Function GetListPath(iStructureType, iListFileType, sParentDir, sClassDir)
    Select Case iListFileType
    Case 0
        Select Case iStructureType
            Case 0, 1, 2
                GetListPath = sParentDir & sClassDir & "/"
            Case 3, 4, 5
                GetListPath = "/" & sClassDir & "/"
            Case Else
                GetListPath = sParentDir & sClassDir & "/"
        End Select
    Case 1
        GetListPath = "/List/"
    Case 2
        GetListPath = "/"
    End Select
    GetListPath = Replace(GetListPath, "//", "/")
End Function

'**************************************************
'函数名:GetListFileName
'作  用:获得列表文件名称(栏目有分页时)
'参  数:iListFileType ----列表文件方式
'        iClassID ---- 栏目ID
'        iCurrentPage ---- 列表当前页数
'返回值:列表文件名称
'**************************************************
Public Function GetListFileName(iListFileType, iClassID, iCurrentPage, iPages)
    Select Case iListFileType
    Case 0
        If iCurrentPage = 1 Then
            GetListFileName = "Index"
        Else
            GetListFileName = "List_" & iPages - iCurrentPage + 1
        End If
    Case 1, 2
        If iCurrentPage = 1 Then
            GetListFileName = "List_" & iClassID
        Else
            GetListFileName = "List_" & iClassID & "_" & iPages - iCurrentPage + 1
        End If
    End Select
End Function

'**************************************************
'函数名:GetList_1FileName
'作  用:获得列表文件名
'参  数:iListFileType ---- 列表文件方式
'        iClassID ---- 栏目ID
'返回值:列表文件名
'**************************************************
Public Function GetList_1FileName(iListFileType, iClassID)
    Select Case iListFileType
    Case 0
        GetList_1FileName = "List_0"
    Case 1
        GetList_1FileName = "List_" & iClassID & "_0"
    Case 2
        GetList_1FileName = "List_" & iClassID & "_0"
    End Select
End Function

'**************************************************
'函数名:GetItemPath
'作  用:获得项目路径
'参  数:iStructureType ---- 目录结构方式
'        sParentDir ---- 父栏目目录
'        sClassDir ---- 当前栏目目录
'        UpdateTime ---- 栏目目录
'返回值:获得项目路径
'**************************************************
Public Function GetItemPath(iStructureType, sParentDir, sClassDir, UpdateTime)
    Select Case iStructureType
    Case 0      '频道/大类/小类/月份/文件(栏目分级,再按月份保存)
        GetItemPath = sParentDir & sClassDir & "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/"
    Case 1      '频道/大类/小类/日期/文件(栏目分级,再按日期分,每天一个目录)
        GetItemPath = sParentDir & sClassDir & "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    Case 2      '频道/大类/小类/文件(栏目分级,不再按月份)
        GetItemPath = sParentDir & sClassDir & "/"
    Case 3      '频道/栏目/月份/文件(栏目平级,再按月份保存)
        GetItemPath = "/" & sClassDir & "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/"
    Case 4      '频道/栏目/日期/文件(栏目平级,再按日期分,每天一个目录)
        GetItemPath = "/" & sClassDir & "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    Case 5      '频道/栏目/文件(栏目平级,不再按月份)
        GetItemPath = "/" & sClassDir & "/"
    Case 6      '频道/文件(直接放在频道目录中)
        GetItemPath = "/"
    Case 7      '频道/HTML/文件(直接放在指定的“HTML”文件夹中)
        GetItemPath = "/HTML/"
    Case 8      '频道/年份/文件(直接按年份保存,每年一个目录)
        GetItemPath = "/" & Year(UpdateTime) & "/"
    Case 9      '频道/月份/文件(直接按月份保存,每月一个目录)
        GetItemPath = "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/"
    Case 10     '频道/日期/文件(直接按日期保存,每天一个目录)
        GetItemPath = "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    Case 11     '频道/年份/月份/文件(先按年份,再按月份保存,每月一个目录)
        GetItemPath = "/" & Year(UpdateTime) & "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/"
    Case 12     '频道/年份/日期/文件(先按年份,再按日期分,每天一个目录)
        GetItemPath = "/" & Year(UpdateTime) & "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    Case 13     '频道/月份/日期/文件(先按月份,再按日期分,每天一个目录)
        GetItemPath = "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    Case 14     '频道/年份/月份/日期/文件(先按年份,再按日期分,每天一个目录)
        GetItemPath = "/" & Year(UpdateTime) & "/" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & "/" & Year(UpdateTime) & "-" & Right("0" & Month(UpdateTime), 2) & "-" & Right("0" & Day(UpdateTime), 2) & "/"
    End Select
    GetItemPath = Replace(GetItemPath, "//", "/")
End Function

'**************************************************
'函数名:GetItemFileName
'作  用:获得项目名称
'参  数:iFileNameType ---- 文件名称类型
'        sChannelDir ---- 当前频道目录
'        UpdateTime ---- 更新时间
'        ItemID ---- 内容ID(ArticleID/SoftID/PhotoID)
'返回值:获得项目名称
'**************************************************
Public Function GetItemFileName(iFileNameType, sChannelDir, UpdateTime, ItemID)
    Select Case iFileNameType
    Case 0
        GetItemFileName = ItemID
    Case 1
        GetItemFileName = Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & Right("0" & Day(UpdateTime), 2) & Right("0" & Hour(UpdateTime), 2) & Right("0" & Minute(UpdateTime), 2) & Right("0" & Second(UpdateTime), 2)
    Case 2
        GetItemFileName = sChannelDir & "_" & ItemID
    Case 3
        GetItemFileName = sChannelDir & "_" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & Right("0" & Day(UpdateTime), 2) & Right("0" & Hour(UpdateTime), 2) & Right("0" & Minute(UpdateTime), 2) & Right("0" & Second(UpdateTime), 2)
    Case 4
        GetItemFileName = Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & Right("0" & Day(UpdateTime), 2) & Right("0" & Hour(UpdateTime), 2) & Right("0" & Minute(UpdateTime), 2) & Right("0" & Second(UpdateTime), 2) & "_" & ItemID
    Case 5
        GetItemFileName = sChannelDir & "_" & Year(UpdateTime) & Right("0" & Month(UpdateTime), 2) & Right("0" & Day(UpdateTime), 2) & Right("0" & Hour(UpdateTime), 2) & Right("0" & Minute(UpdateTime), 2) & Right("0" & Second(UpdateTime), 2) & "_" & ItemID
    End Select
End Function



Sub CreateAllJS()
    Dim NeedCreateJS
    If Action = "SaveAdd" Or Action = "SaveModifyAsAdd" Then
        If Status = 3 Then
            NeedCreateJS = True
        Else
            NeedCreateJS = False
        End If
    Else
        NeedCreateJS = True
    End If
    If NeedCreateJS = True then
        Response.Write "<br><iframe id='CreateJS' width='100%' height='100' frameborder='0' src='Admin_CreateJS.asp?ChannelID=" & ChannelID & "&Action=CreateAllJs'></iframe>"
    End If
End Sub

Sub CreateAllJS_User()
    If Status = 3 Then
        Response.Write "<br><iframe id='CreateJS' width='100%' height='100' frameborder='0' src='User_CreateJS.asp?ChannelID=" & ChannelID & "&Action=CreateAllJs'></iframe>"
    End If
End Sub

Function GetArticleUrl(ByVal tParentDir, ByVal tClassDir, ByVal tUpdateTime, ByVal tArticleID, ByVal tClassPurview, ByVal tInfoPurview, ByVal tInfoPoint)
    If IsNull(tParentDir) Then tParentDir = ""
    If IsNull(tClassDir) Then tClassDir = ""
    If IsNull(tClassPurview) Then tClassPurview = 0
    If IsNull(tInfoPurview) Then tInfoPurview = 0
    
    If UseCreateHTML > 0 And tClassPurview = 0 And tInfoPoint = 0 And tInfoPurview = 0 Then

⌨️ 快捷键说明

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