📄 user_photo_code.asp
字号:
<!--#include file="CommonCode.asp"-->
<!--#include file="../Include/PowerEasy.Common.Purview.asp"-->
<!--#include file="../Include/PowerEasy.Common.Manage.asp"-->
<!--#include file="../Include/PowerEasy.Common.Content.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Dim PhotoID, AuthorName, Status, ManageType
Dim ClassID, SpecialID, OnTop, IsElite, IsHot, Created
Dim tClass, ClassName, RootID, ParentID, Depth, ParentPath, Child, arrChildID, ParentDir, ClassDir, ClassPurview
Sub Execute()
ChannelID = PE_CLng(Trim(Request("ChannelID")))
If ChannelID > 0 Then
Call GetChannel(ChannelID)
Else
FoundErr = True
ErrMsg = ErrMsg & "<li>请指定要查看的频道ID!</li>"
Response.Write ErrMsg
Exit Sub
End If
PhotoID = Trim(Request("PhotoID"))
ClassID = PE_CLng(Trim(Request("ClassID")))
Status = Trim(Request("Status"))
AuthorName = Trim(Request("AuthorName"))
strField = Trim(Request("Field"))
If Status = "" Then
Status = 9
Else
Status = PE_CLng(Status)
End If
If IsValidID(PhotoID) = False Then
PhotoID = ""
End If
If Action = "" Then Action = "Manage"
FileName = "User_Photo.asp?ChannelID=" & ChannelID & "&Action=" & Action & "&ManageType=" & ManageType
strFileName = FileName & "&ClassID=" & ClassID & "&Field=" & strField & "&keyword=" & Keyword
If AuthorName <> "" Then
AuthorName = ReplaceBadChar(AuthorName)
strFileName = strFileName & "&AuthorName=" & AuthorName
End If
If XmlDoc.Load(Server.MapPath(InstallDir & "Language/Gb2312_Channel_" & ChannelID & ".xml")) = False Then XmlDoc.Load (Server.MapPath(InstallDir & "Language/Gb2312.xml"))
Response.Write "<table align='center'><tr align='center' valign='top'>"
If CheckUser_ChannelInput() Then
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Add'><img src='images/Photo_add.gif' border='0' align='absmiddle'><br>添加" & ChannelShortName & "</a></td>"
End If
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Status=9'><img src='images/Photo_all.gif' border='0' align='absmiddle'><br>所有" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Status=-1'><img src='images/Photo_draft.gif' border='0' align='absmiddle'><br>草 稿</a></td>"
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Status=0'><img src='images/Photo_unpassed.gif' border='0' align='absmiddle'><br>待审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Status=3'><img src='images/Photo_passed.gif' border='0' align='absmiddle'><br>已审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Status=-2'><img src='images/Photo_reject.gif' border='0' align='absmiddle'><br>未被采用的" & ChannelShortName & "</a></td>"
Response.Write "</tr></table>" & vbCrLf
Select Case Action
Case "Add"
Call Add
Case "Modify"
Call Modify
Case "SaveAdd", "SaveModify"
Call SavePhoto
Case "Show"
Call Show
Case "Del"
Call Del
Case "Manage"
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
End Sub
Sub main()
Call GetClass
If FoundErr = True Then Exit Sub
Call ShowJS_Main(ChannelShortName)
Response.Write "<br>"
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22'>" & GetRootClass() & "</td>"
Response.Write " </tr>" & GetChild_Root() & ""
Response.Write "</table><br>"
Call ShowContentManagePath(ChannelShortName & "管理")
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='2' class='border'>"
Response.Write "<form name='myform' method='Post' action='User_Photo.asp' onsubmit='return ConfirmDel();'><tr>"
Dim rsPhotoList, sql
sql = "select P.PhotoID,P.ClassID,C.ClassName,C.ParentDir,C.ClassDir,P.PhotoName,P.Keyword,P.Author,P.UpdateTime,P.Inputer,P.Editor,P.Hits,P.OnTop,P.Elite,P.Status,P.Stars,P.InfoPoint,P.PhotoThumb from PE_Photo P"
sql = sql & " left join PE_Class C on P.ClassID=C.ClassID where P.ChannelID=" & ChannelID & " and P.Deleted=" & PE_False & " and P.Inputer='" & UserName & "' "
If AuthorName <> "" Then
sql = sql & " and P.Author='" & AuthorName & "|' "
End If
Select Case Status
Case 3
sql = sql & " and P.Status=3"
Case 0
sql = sql & " and (P.Status=0 Or P.Status=1 Or P.Status=2)"
Case -1
sql = sql & " and P.Status=-1"
Case -2
sql = sql & " and P.Status=-2"
End Select
If ClassID > 0 Then
If Child > 0 Then
sql = sql & " and P.ClassID in (" & arrChildID & ")"
Else
sql = sql & " and P.ClassID=" & ClassID
End If
End If
If Keyword <> "" Then
Select Case strField
Case "PhotoName"
sql = sql & " and P.PhotoName like '%" & Keyword & "%' "
Case "PhotoIntro"
sql = sql & " and P.PhotoIntro like '%" & Keyword & "%' "
Case "Author"
sql = sql & " and P.Author like '%" & Keyword & "%' "
Case "Inputer"
sql = sql & " and P.Inputer='" & Keyword & "' "
Case Else
sql = sql & " and P.PhotoName like '%" & Keyword & "%' "
End Select
End If
sql = sql & " order by P.PhotoID desc"
Set rsPhotoList = Server.CreateObject("ADODB.Recordset")
rsPhotoList.Open sql, Conn, 1, 1
If rsPhotoList.BOF And rsPhotoList.EOF Then
totalPut = 0
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>" & GetStrNoItem(ClassID, Status) & "<br><br></td></tr>"
Else
totalPut = rsPhotoList.RecordCount
If CurrentPage < 1 Then
CurrentPage = 1
End If
If (CurrentPage - 1) * MaxPerPage > totalPut Then
If (totalPut Mod MaxPerPage) = 0 Then
CurrentPage = totalPut \ MaxPerPage
Else
CurrentPage = totalPut \ MaxPerPage + 1
End If
End If
If CurrentPage > 1 Then
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rsPhotoList.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Dim PhotoNum, PhotoPath
PhotoNum = 0
Do While Not rsPhotoList.EOF
Response.Write "<td class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'""><table width='100%' cellpadding='0' cellspacing='0'>"
Response.Write "<tr><td colspan='2' align='center'><a href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Show&PhotoID=" & rsPhotoList("PhotoID") & "'><img src='" & GetPhotoThumb(rsPhotoList("PhotoThumb")) & "' width='130' height='90' border='0'></a></td></tr>"
If rsPhotoList("ClassID") <> ClassID Then
Response.Write "<tr><td align='right'>栏目名称:</td><td><a href='" & FileName & "&ClassID=" & rsPhotoList("ClassID") & "'>[" & rsPhotoList("ClassName") & "]</a></td></tr>"
End If
Response.Write "<tr><td align='right'>" & ChannelShortName & "名称:</td><td>"
Response.Write "<a href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Show&PhotoID=" & rsPhotoList("PhotoID") & "' title='" & GetLinkTips(rsPhotoList("PhotoName"), rsPhotoList("Author"), rsPhotoList("UpdateTime"), rsPhotoList("Hits"), rsPhotoList("Keyword"), rsPhotoList("Stars"), rsPhotoList("InfoPoint")) & "'>" & rsPhotoList("PhotoName") & "</a>"
Response.Write "</td></tr>"
Response.Write "<tr><td align='right'>添 加 者:</td><td><a href='" & FileName & "&field=Inputer&keyword=" & rsPhotoList("Inputer") & "' title='点击将查看此用户录入的所有" & ChannelShortName & "'>" & rsPhotoList("Inputer") & "</a></td></tr>"
Response.Write "<tr><td align='right'>点 击 数:</td><td>" & rsPhotoList("Hits") & "</td></tr>"
Response.Write "<tr><td align='right'>" & ChannelShortName & "属性:</td><td>" & GetInfoProperty(rsPhotoList("OnTop"), rsPhotoList("Hits"), rsPhotoList("Elite")) & "</td></tr>"
Response.Write "<tr><td align='right'>审核状态:</td><td>" & GetInfoStatus(rsPhotoList("Status")) & "</td></tr>"
Response.Write "<tr><td align='right'>操作选项:</td><td><input name='PhotoID' type='checkbox' onclick='unselectall()' id='PhotoID' value='" & rsPhotoList("PhotoID") & "'>"
Response.Write "</td></tr>"
Response.Write "<tr><td colspan='2' align='center'>"
If rsPhotoList("Inputer") = UserName And (rsPhotoList("Status") <= 0 Or EnableModifyDelete = 1) Then
Response.Write "<a href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Modify&PhotoID=" & rsPhotoList("PhotoID") & "'>修改</a> "
Response.Write "<a href='User_Photo.asp?ChannelID=" & ChannelID & "&Action=Del&PhotoID=" & rsPhotoList("PhotoID") & "' onclick=""return confirm('确定要删除此" & ChannelShortName & "吗?删除后你还可以从回收站中还原。');"">删除</a> "
End If
Response.Write "</td></tr>"
Response.Write "</table></td>"
PhotoNum = PhotoNum + 1
If PhotoNum Mod 4 = 0 Then
Response.Write "</tr><tr>"
End If
If PhotoNum >= MaxPerPage Then Exit Do
rsPhotoList.MoveNext
Loop
End If
rsPhotoList.Close
Set rsPhotoList = Nothing
Response.Write "</table>"
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
Response.Write " <tr>"
Response.Write " <td width='200' height='30'><input name='chkAll' type='checkbox' id='chkAll' onclick='CheckAll(this.form)' value='checkbox'>选中本页显示的所有" & ChannelShortName & "</td><td>"
Response.Write "<input name='submit1' type='submit' value='删除选定的" & ChannelShortName & "' onClick=""document.myform.Action.value='Del'"" >"
Response.Write "<input name='Action' type='hidden' id='Action' value=''>"
Response.Write "<input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
Response.Write " </td></tr>"
Response.Write "</table>"
Response.Write "</td>"
Response.Write "</form></tr></table>"
If totalPut > 0 Then
Response.Write ShowPage(strFileName, totalPut, MaxPerPage, CurrentPage, True, True, ChannelItemUnit & ChannelShortName & "", True)
End If
Response.Write "<br>"
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0' class='border'>"
Response.Write " <tr class='tdbg'>"
Response.Write " <td width='80' align='right'><strong>" & ChannelShortName & "搜索:</strong></td>"
Response.Write " <td>"
Response.Write "<table border='0' cellpadding='0' cellspacing='0'>"
Response.Write "<form method='Get' name='SearchForm' action='" & FileName & "'>"
Response.Write "<tr><td height='28' align='center'>"
Response.Write "<select name='Field' size='1'>"
Response.Write "<option value='PhotoName' selected>" & ChannelShortName & "名称</option>"
Response.Write "<option value='PhotoIntro'>" & ChannelShortName & "简介</option>"
Response.Write "<option value='Author'>" & ChannelShortName & "作者</option>"
Response.Write "</select>"
Response.Write "<select name='ClassID'><option value=''>所有栏目</option>" & User_GetClass_Option(1, 0) & "</select>"
Response.Write "<input type='text' name='keyword' size='20' value='关键字' maxlength='50' onFocus='this.select();'>"
Response.Write "<input type='submit' name='Submit' value='搜索'>"
Response.Write "<input name='ManageType' type='hidden' id='ManageType' value='" & ManageType & "'>"
Response.Write "<input name='ChannelID' type='hidden' id='ChannelID' value='" & ChannelID & "'>"
Response.Write "</td></tr></form></table>"
Response.Write " </td></tr>"
Response.Write "</table>"
Response.Write "<br><b>说明:</b><br> " & ChannelShortName & "属性中的各项含义:<font color=blue>顶</font>----固顶" & ChannelShortName & ",<font color=red>热</font>----热门" & ChannelShortName & ",<font color=green>荐</font>----推荐" & ChannelShortName & "<br><br>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -