📄 pop_up_topic_admin.asp
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="language_files/admin_language_file_inc.asp" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Forums(TM)
'** http://www.webwizforums.com
'**
'** Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**
'** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**
'** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE
'** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'** AND DERIVATIVE WORKS IMMEDIATELY.
'**
'** If you have not received a copy of the license with this work then a copy of the latest
'** license contract can be found at:-
'**
'** http://www.webwizguide.com/license
'**
'** For more information about this software and for licensing information please contact
'** 'Web Wiz' at the address and website below:-
'**
'** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'** http://www.webwizguide.com
'**
'** Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************
'*************************** SOFTWARE AND CODE MODIFICATIONS ****************************
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Dimension variables
Dim rsSelectForum 'Holds the db recordset
Dim lngTopicID 'Holds the topic ID number to return to
Dim intNewForumID 'Holds the new forum ID if the topic is to be moved
Dim strSubject 'Holds the topic subject
Dim intTopicPriority 'Holds the priority of the topic
Dim blnLockedStatus 'Holds the lock status of the topic
Dim strCatName 'Holds the name of the category
Dim intCatID 'Holds the ID number of the category
Dim strForumName 'Holds the name of the forum to jump to
Dim lngFID 'Holds the forum id to jump to
Dim lngPollID 'Holds the poll ID
Dim lngMovedNum 'Holds the moved number if topic has been moved
Dim blnMoved 'Set to true if moved icon is to be shown
Dim blnHidden 'set to true if post is hidden
Dim sarryForumSelect 'Holds the array with all the forums
Dim intSubForumID 'Holds if the forum is a sub forum
Dim intTempRecord 'Temporay record store
Dim blnHideForum 'Holds if the jump forum is hidden or not
Dim intCurrentRecord 'Holds the recordset array position
Dim intoldForumID 'Holds the forum ID of the forum the topic was moved from
Dim strTopicIcon 'Holds the topic icon
Dim intLoop 'Loop counter
Dim dtmEventDate 'Holds the event date
Dim intEventDay 'Holds the event day
Dim intEventMonth 'Holds the event month
Dim intEventYear 'Holds the event year
Dim intEventYearEnd 'Holds the year of Calendar event
Dim intEventMonthEnd 'Holds the month of Calendar event
Dim intEventDayEnd 'Holds the day of Calendar event
Dim dtmEventDateEnd 'Holds the Calendar event date
'Read in the topic ID number
lngTopicID = CLng(Request("TID"))
'If the person is not an admin or a moderator then send them away
If lngTopicID = "" OR bannedIP() OR blnActiveMember = False OR blnBanned Then
'Clean up
Call closeDatabase()
'Redirect
Response.Redirect("insufficient_permission.asp" & strQsSID1)
End If
'Initliase the SQL query to get the topic details from the database
strSQL = "SELECT " & strDbTable & "Topic.Forum_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Priority, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Topic.Moved_ID, " & strDbTable & "Topic.Hide, " & strDbTable & "Topic.Icon, " & strDbTable & "Topic.Event_date, " & strDbTable & "Topic.Event_date_end " & _
"FROM " & strDbTable & "Topic" & strRowLock & " " & _
"WHERE " & strDbTable & "Topic.Topic_ID = " & lngTopicID & ";"
'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
rsCommon.CursorType = 2
'Set the Lock Type for the records so that the record set is only locked when it is updated
rsCommon.LockType = 3
'Query the database
rsCommon.Open strSQL, adoCon
'If there is a record returened read in the forum ID
If NOT rsCommon.EOF Then
intForumID = CInt(rsCommon("Forum_ID"))
End If
'Call the moderator function and see if the user is a moderator
If blnAdmin = False Then blnModerator = isModerator(intForumID, intGroupID)
'If the user is not a moderator or admin then keck em
If blnAdmin = false AND blnModerator = false Then
'Clean up
Call closeDatabase()
'Redirect
Response.Redirect("insufficient_permission.asp" & strQsSID1)
End If
'If this is a post back then update the database
If (Request.Form("postBack")) AND (blnAdmin OR blnModerator) Then
strSubject = Trim(Mid(Request.Form("subject"), 1, 50))
intTopicPriority = CInt(Request.Form("priority"))
blnLockedStatus = CBool(Request.Form("locked"))
intNewForumID = CInt(Request.Form("forum"))
blnMoved = CBool(Request.Form("moveIco"))
blnHidden = CBool(Request.Form("hidePost"))
strTopicIcon = Request.Form("icon")
'Read in Calendar event date
If Request.Form("eventDay") <> 0 AND Request.Form("eventMonth") <> 0 AND Request.Form("eventYear") <> 0 Then
dtmEventDate = internationalDateTime(DateSerial(Request.Form("eventYear"), Request.Form("eventMonth"), Request.Form("eventDay")))
End If
'Read in event end date
If Request.Form("eventDayEnd") <> 0 AND Request.Form("eventMonthEnd") <> 0 AND Request.Form("eventYearEnd") <> 0 Then
dtmEventDateEnd = internationalDateTime(DateSerial(Request.Form("eventYearEnd"), Request.Form("eventMonthEnd"), Request.Form("eventDayEnd")))
'If the end date is before the start date don't add it to the database
If dtmEventDate => dtmEventDateEnd OR dtmEventDate = "" Then dtmEventDateEnd = null
End If
'Get rid of scripting tags in the subject
strSubject = removeAllTags(strSubject)
'strSubject = formatInput(strSubject) 'This is manily for XSS and is now done when displayed in the forum for improved searching
'If the topic icon is not selected don't fill the db with crap and leave field empty
If strTopicIcon = strImagePath & "blank_smiley.gif" Then strTopicIcon = ""
'Clean up user input
strTopicIcon = formatInput(strTopicIcon)
strTopicIcon = removeAllTags(strTopicIcon)
'Update the recordset
With rsCommon
'Update the recorset
If intNewForumID <> 0 Then .Fields("Forum_ID") = intNewForumID
If blnMoved = false Then
.Fields("Moved_ID") = 0
ElseIf intNewForumID <> 0 AND intNewForumID <> intForumID AND blnMoved Then
.Fields("Moved_ID") = intForumID
End If
.Fields("Subject") = strSubject
.Fields("Priority") = intTopicPriority
.Fields("Locked") = blnLockedStatus
.Fields("Hide") = blnHidden
.Fields("Icon") = strTopicIcon
If blnCalendar Then .Fields("Event_date") = dtmEventDate
If blnCalendar Then .Fields("Event_date_end") = dtmEventDateEnd
'Update db
.Update
'Re-run the query as access needs time to catch up
.ReQuery
'Update topic and post count
Call updateForumStats(intForumID)
End With
End If
'Read in the topic details
If NOT rsCommon.EOF Then
'Read in the topic details
intoldForumID = CInt(rsCommon("Forum_ID"))
strSubject = rsCommon("Subject")
intTopicPriority = CInt(rsCommon("Priority"))
blnLockedStatus = CBool(rsCommon("Locked"))
lngPollID = CLng(rsCommon("Poll_ID"))
lngMovedNum = CLng(rsCommon("Moved_ID"))
blnHidden = CBool(rsCommon("Hide"))
strTopicIcon = rsCommon("Icon")
dtmEventDate = rsCommon("Event_date")
dtmEventDateEnd = rsCommon("Event_date_end")
'Split the start date of event into the various parts
If isDate(dtmEventDate) Then
intEventYear = Year(dtmEventDate)
intEventMonth = Month(dtmEventDate)
intEventDay = Day(dtmEventDate)
End If
'Split the end date of event into the various parts
If isDate(dtmEventDateEnd) Then
intEventYearEnd = Year(dtmEventDateEnd)
intEventMonthEnd = Month(dtmEventDateEnd)
intEventDayEnd = Day(dtmEventDateEnd)
End If
End If
'Close the rs
rsCommon.Close
'If this is a post back then update the topic stats in the tblTopic table
If (Request.Form("postBack")) AND (blnAdmin OR blnModerator) Then
'Update the stats for this topic in the tblTopic table
'This isn't really neccisary, but could be useful for those people whos topic stats have gone astray
Call updateTopicStats(lngTopicID)
End If
'DB hit to get forums with cats and permissions, for the forum select drop down
'Initlise the sql statement
strSQL = "" & _
"SELECT " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum.Hide, " & strDbTable & "Permissions.View_Forum " & _
"FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Category.Cat_ID=" & strDbTable & "Forum.Cat_ID " & _
"AND " & strDbTable & "Forum.Forum_ID=" & strDbTable & "Permissions.Forum_ID " & _
"AND (" & strDbTable & "Permissions.Author_ID=" & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID=" & intGroupID & ") " & _
"ORDER BY " & strDbTable & "Category.Cat_order, " & strDbTable & "Forum.Forum_Order;"
'Query the database
rsCommon.Open strSQL, adoCon
'Place the subscribed topics into an array
If NOT rsCommon.EOF Then
'Read in the row from the db using getrows for better performance
sarryForumSelect = rsCommon.GetRows()
End If
'Clean up
rsCommon.Close
Call closeDatabase()
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title>Topic Admin</title>
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<script language="JavaScript">
//Function to check form is filled in correctly before submitting
function CheckForm () {
var errorMsg = "";
var formArea = document.getElementById('frmTopicAdmin');
//Check for a subject
if (formArea.subject.value==""){
errorMsg += "\n\t<% = strTxtErrorTopicSubject %>";
}
//If there is aproblem with the form then display an error
if (errorMsg != ""){
msg = "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine1 %>\n";
msg += "<% = strTxtErrorDisplayLine2 %>\n";
msg += "<% = strTxtErrorDisplayLine %>\n\n";
msg += "<% = strTxtErrorDisplayLine3 %>\n";
errorMsg += alert(msg + errorMsg + "\n\n");
return false;
}
return true;
}
</script>
<link href="<% = strCSSfile %>default_style.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin:0px;" OnLoad="self.focus();">
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableTopRow">
<tr class="tableTopRow">
<td colspan="2">
<div style="float:left;"><h1><% = strTxtTopicAdmin %></h1></div>
<div style="float:right;">
<form name="frmDeleteTopic" id="frmDeleteTopic" method="post" action="delete_topic.asp" OnSubmit="return confirm('<% = strTxtDeleteTopicAlert %>')">
<input type="hidden" name="TID" id="TID2" value="<% = lngTopicID %>" />
<input type="submit" name="Submit" id="Submit2" value="<% = strTxtDeleteTopic %>"<% If blnDemoMode Then Response.Write(" disabled=""disabled""") %> />
</form>
</div>
</td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -