📄 matter.asp
字号:
objCmd.Add "Examine", 1
objCmd.Add "Hidden", 0
objCmd.Add "RemarkTotal", 0
objCmd.Add "Intime", GetTime(Now())
objCmd.Add "GroupId", MyAdmin("GroupId")
objCmd.Add "TeamId", MyAdmin("TeamId")
objCmd.Add "AdminId", MyAdmin("SeqId")
objCmd.Exec
Set objCmd = Nothing
RemoveCache "staple", objStaple("SeqId"), 0, 0
RemoveCache "index", 0, 0, 0
End Function
Private Sub ParseServerX(objStaple, intRet())
Dim strPath
strPath = GetMapPath("images/temp")
Call ParseServer(objStaple, "JAR", strPath, True, intRet)
Call ParseServer(objStaple, "XXX", strPath, True, intRet)
Call ParseServer(objStaple, "YYY", strPath, True, intRet)
Call ParseServer(objStaple, "TXT", strPath, True, intRet)
End Sub
Private Function ParseServer(objStaple, ByVal strHandle, ByVal strParent, ByVal blnType, intRet())
Dim objFolder
Dim objFile
Dim objCmd
Dim blnKeep
Dim strName
Dim strPath(1)
Dim arrExt
Dim strExt
Dim strContent
Dim size
Dim strRet
Dim intPlace
Set objFolder = fso.GetFolder(strParent)
Set objCmd = MyKernel.Command(T_MATTER)
blnKeep = CBool(MyIO.Form("Keep") = "1")
intPlace = atoi(MyIO.Form("Place"))
arrExt = Split(MyKernel.Config("AllowImage"), "|")
strRet = ""
If strHandle = "JAR" Then
intRet(0) = intRet(0) + objFolder.Files.Count
End If
For Each objFile In objFolder.Files
strPath(0) = objFile.Path
objCmd("Ext") = fso.GetExtensionName(objFile.Name)
objCmd("Category") = GetMatterCategory(objCmd("Ext"))
strName = GetFileNameNoExt(objFile.Name)
If blnKeep Then
objCmd("Title") = objFile.Name
Else
objCmd("Title") = strName
End If
If objCmd("Category") <> 0 Then
objCmd("Source") = Replace(strPath(0), "\", "/")
objCmd("Mark") = GetMatterMark() + 1
objCmd("Intime") = GetTime(Now())
objCmd("Width") = 0
objCmd("Height") = 0
objCmd("Preview") = ""
CheckMatterFolder objCmd("Category"), objCmd("Intime")
End If
Select Case strHandle
Case "JAR"
If objCmd("Category") = wmTypeSoft And UCase(objCmd("Ext")) = "JAR" Then
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Ext"), "")
fso.MoveFile strPath(0), strPath(1)
intRet(1) = intRet(1) + 1
'jad
strPath(0) = strParent & "\" & strName & ".jad"
If fso.FileExists(strPath(0)) Then
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), "jad", "")
fso.MoveFile strPath(0), strPath(1)
intRet(1) = intRet(1) + 1
End If
'preview
For Each strExt In arrExt
strPath(0) = strParent & "\" & strName & "." & strExt
If fso.FileExists(strPath(0)) Then
objCmd("Preview") = strExt
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Preview"), "")
fso.MoveFile strPath(0), strPath(1)
ImageResize2 strPath(1), strPath(1), atoi(MyKernel.Config("KeepWidth")), atoi(MyKernel.Config("KeepHeight"))
ImageImpress strPath(1)
intRet(1) = intRet(1) + 1
Exit For
End If
Next
AddMatter objCmd
If blnType Then
If AddContent(objStaple, objCmd("Title"), objCmd("Mark"), "", intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
Else
strRet = strRet & "[soft,id=" & Hex(objCmd("Mark")) & ",name=$(IsName),fileSize=$(IsFileSize),content=$(IsContent),count=$(IsCount)]" & vbCrLf
End If
SetMatterMark objCmd("Mark")
End If
Case "XXX"
If objCmd("Category") = wmTypeVideo Or objCmd("Category") = wmTypeSoft Then
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Ext"), "")
fso.MoveFile strPath(0), strPath(1)
intRet(1) = intRet(1) + 1
For Each strExt In arrExt
strPath(0) = strParent & "\" & strName & "." & strExt
If fso.FileExists(strPath(0)) Then
objCmd("Preview") = strExt
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Preview"), "")
fso.MoveFile strPath(0), strPath(1)
ImageResize2 strPath(1), strPath(1), atoi(MyKernel.Config("KeepWidth")), atoi(MyKernel.Config("KeepHeight"))
ImageImpress strPath(1)
intRet(1) = intRet(1) + 1
Exit For
End If
Next
AddMatter objCmd
If blnType Then
If AddContent(objStaple, objCmd("Title"), objCmd("Mark"), "", intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
ElseIf objCmd("Category") = wmTypeVideo Then
strRet = strRet & "[video,id=" & Hex(objCmd("Mark")) & ",name=$(IsName),fileSize=$(IsFileSize),content=$(IsContent),count=$(IsCount)]" & vbCrLf
Else
strRet = strRet & "[soft,id=" & Hex(objCmd("Mark")) & ",name=$(IsName),fileSize=$(IsFileSize),content=$(IsContent),count=$(IsCount)]" & vbCrLf
End If
SetMatterMark objCmd("Mark")
End If
Case "YYY"
If objCmd("Category") = wmTypeImage Or objCmd("Category") = wmTypeRing Then
strPath(1) = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Ext"), "")
fso.MoveFile strPath(0), strPath(1)
If objCmd("Category") = wmTypeImage Then
size = ImageResize2(strPath(1), strPath(1), atoi(MyKernel.Config("KeepWidth")), atoi(MyKernel.Config("KeepHeight")))
If Not size(0) Then
size = GetFileInfo(strPath(1))
End If
objCmd("Width") = size(1)
objCmd("Height") = size(2)
ImageImpress strPath(1)
End If
intRet(1) = intRet(1) + 1
AddMatter objCmd
If blnType Then
If AddContent(objStaple, objCmd("Title"), objCmd("Mark"), "", intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
ElseIf objCmd("Category") = wmTypeImage Then
strRet = strRet & "[image,id=" & Hex(objCmd("Mark")) & ",download=$(IsDownload),name=$(IsName),fileSize=$(IsFileSize),content=$(IsContent),count=$(IsCount)]" & vbCrLf
Else
strRet = strRet & "[ring,id=" & Hex(objCmd("Mark")) & ",name=$(IsName),fileSize=$(IsFileSize),content=$(IsContent),count=$(IsCount)]" & vbCrLf
End If
SetMatterMark objCmd("Mark")
End If
Case "TXT"
If objCmd("Category") = 0 And UCase(objCmd("Ext")) = "TXT" Then
strContent = GetFileString(strPath(0), LOCAL_CHARSET)
fso.DeleteFile strPath(0)
intRet(1) = intRet(1) + 1
If blnType Then
If AddContent(objStaple, objCmd("Title"), 0, strContent, intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
Else
strRet = strRet & strContent
End If
End If
End Select
Next
Set objCmd = Nothing
ParseServer = strRet
End Function
Private Sub ParseServerY(objStaple, intRet())
If objStaple("SeqId") = 0 Then Exit Sub
Dim objParent
Dim objFolder
Dim strPath
Dim strTemp
Dim intPlace
Dim vtAttr
Dim IsDownload
Dim IsName
Dim IsImageSize
Dim IsFileSize
Dim IsContent
Dim IsCount
vtAttr = Split(MyIO.Form("Attributes"), ",")
If UBound(vtAttr) = 5 Then
IsDownload = atoi(vtAttr(0))
IsName = atoi(vtAttr(1))
IsImageSize = atoi(vtAttr(2))
IsFileSize = atoi(vtAttr(3))
IsContent = atoi(vtAttr(4))
IsCount = atoi(vtAttr(5))
Else
IsDownload = 1
IsName = 1
IsImageSize = 1
IsFileSize = 1
IsContent = 0
IsCount = 1
End If
Set objParent = fso.GetFolder(GetMapPath("images/temp"))
intPlace = atoi(MyIO.Form("Place"))
For Each objFolder In objParent.SubFolders
strPath = GetMapPath("images/temp/" & objFolder.Name)
strTemp = ParseServer(objStaple, "JAR", strPath, False, intRet)
strTemp = strTemp & ParseServer(objStaple, "XXX", strPath, False, intRet)
strTemp = strTemp & ParseServer(objStaple, "YYY", strPath, False, intRet)
strTemp = strTemp & ParseServer(objStaple, "TXT", strPath, False, intRet)
If strTemp <> "" Then
strTemp = Replace(strTemp, "$(IsDownload)", IsDownload)
strTemp = Replace(strTemp, "$(IsName)", IsName)
strTemp = Replace(strTemp, "$(IsImageSize)", IsImageSize)
strTemp = Replace(strTemp, "$(IsFileSize)", IsFileSize)
strTemp = Replace(strTemp, "$(IsContent)", IsContent)
strTemp = Replace(strTemp, "$(IsCount)", IsCount)
If AddContent(objStaple, objFolder.Name, 0, strTemp, intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
End If
fso.DeleteFolder strPath
Next
End Sub
Private Sub ParseLocale(objStaple, intRet())
Dim objItem, objTemp
Dim objCmd
Dim blnKeep
Dim strName
Dim strPath
Dim size
Dim intPlace
Dim i
Set objCmd = MyKernel.Command(T_MATTER)
blnKeep = CBool(MyIO.Form("Keep") = "1")
intPlace = atoi(MyIO.Form("Place"))
For i = 0 To 9
Set objItem = MyIO.File("Attach1" & i, 0)
If objItem Is Nothing Then
'pass
Else
intRet(0) = intRet(0) + 1
If objItem.State = 0 Then
objCmd("Ext") = objItem.FileExt
objCmd("Category") = GetMatterCategory(objItem.FileExt)
If objCmd("Category") <> 0 Then
intRet(1) = intRet(1) + 1
strName = GetFileNameNoExt(objItem.FileName)
If blnKeep Then
objCmd("Title") = fso.GetFileName(objItem.FileName)
Else
objCmd("Title") = strName
End If
objCmd("Source") = objItem.FileName
objCmd("Mark") = GetMatterMark() + 1
objCmd("Intime") = GetTime(Now())
objCmd("Width") = 0
objCmd("Height") = 0
objCmd("Preview") = ""
CheckMatterFolder objCmd("Category"), objCmd("Intime")
strPath = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objCmd("Ext"), "")
objItem.SaveToFile strPath
If objCmd("Category") = wmTypeImage Then
size = ImageResize2(strPath, strPath, atoi(MyKernel.Config("KeepWidth")), atoi(MyKernel.Config("KeepHeight")))
If Not size(0) Then
size = GetFileInfo(strPath)
End If
objCmd("Width") = size(1)
objCmd("Height") = size(2)
ImageImpress strPath
ElseIf objCmd("Category") = wmTypeVideo Or objCmd("Category") = wmTypeSoft Then
If UCase(objCmd("Ext")) = "JAR" Then
Set objTemp = MyIO.File("JAD1" & i)
If objTemp Is Nothing Then
'pass
ElseIf objTemp.fileSize > 0 And objTemp.Status And UCase(objTemp.FileExt) = "JAD" Then
objTemp.Save GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objTemp.FileExt, "")
End If
Set objTemp = Nothing
End If
Set objTemp = MyIO.File("PRE1" & i)
If objTemp Is Nothing Then
'pass
ElseIf objTemp.fileSize > 0 And objTemp.Status Then
If InString(MyKernel.Config("AllowImage"), objTemp.FileExt, False) Then
objCmd("Preview") = LCase(objTemp.FileExt)
strPath = GetMatterPath(objCmd("Category"), objCmd("Intime"), objCmd("Mark"), objTemp.FileExt, "")
objTemp.Save strPath
ImageResize2 strPath, strPath, atoi(MyKernel.Config("KeepWidth")), atoi(MyKernel.Config("KeepHeight"))
ImageImpress strPath
End If
End If
Set objTemp = Nothing
End If
AddMatter objCmd
If AddContent(objStaple, objCmd("Title"), objCmd("Mark"), "", intPlace) = True Then
intRet(2) = intRet(2) + 1
End If
SetMatterMark objCmd("Mark")
End If
End If
End If
Set objItem = Nothing
Next
Set objCmd = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -