10/10/2018, 09:35
có bác nào pro Asp giúp em cái nha
chả là khi nhấp và reply tra lời bài viết trong diên đàn thì nó bị thế này:
error '80020009'
/thienbao1989/thienbao/new_reply_form.asp, line 189
mình tìm dòng 189 rùi mà chả biết sai cái gì có ai biết chỉ minh với.
xem dùm mình cái này nè"new_reply_form.asp": http://www32.websamba.com/bao1989198...reply_form.rar
code "new_reply_form.asp":
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_edit_post.asp" -->
<!--#include file="includes/emoticons_inc.asp" -->
<%
'************************************************* ***************************************
'** Copyright Notice
'**
'** Web Wiz Guide - Web Wiz Forums
'** http://www.webwizforums.com
'**
'** Copyright 2001-2006 Bruce Corkhill All Rights Reserved.
'**
'** This program is free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may use parts of this program in your own private work, but you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** You should have received a copy of the License along with this program;
'** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'** No official support is available for this program but you may post support questions at: -
'** http://www.webwizguide.info/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -
'**
'** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD
'**
'************************************************* ***************************************
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'Dimension variables
Dim strMode 'Holds the mode of the page
Dim intForumID 'Holds the forum ID number
Dim strMasterForumName 'Holds the main forum name
Dim intMasterForumID 'Holds the main forum ID
Dim intCatID 'Holds the cat ID
Dim strCatName 'Holds the cat name
Dim lngTopicID 'Holds the Topic ID number
Dim lngMessageID 'Holds the message ID to be edited
Dim strTopicSubject 'Holds the subject topic being replied to
Dim strQuoteUsername 'Holds the quoters username
Dim strQuoteMessage 'Holds the message to be quoted
Dim lngPostUserID 'Holds the user ID of the user to post the message
Dim blnForumLocked 'Set to true if the forum is locked
Dim blnEmailNotify 'Set to true if the users want to be notified by e-mail of a post
Dim strPostPage 'Holds the page the form is posted to
Dim intRecordPositionPageNum 'Holds the recorset page number to show the Threads for
Dim strMessage 'Holds the post message
Dim strForumName 'Holds the name of the forum
Dim intIndexPosition 'Holds the idex poistion in the emiticon array
Dim intNumberOfOuterLoops 'Holds the outer loop number for rows
Dim intLoop 'Holds the loop index position
Dim intInnerLoop 'Holds the inner loop number for columns
Dim blnTopicLocked 'Holds if the topic is locked or not
Dim intTotalRecords 'Holds the total number of records
Dim strUsername 'For login include
Dim strPassword 'For login include
Dim blnPollNoReply 'Holds if it is a poll only
Dim lngPollID 'Holds the poll ID
Dim strUploadedFiles 'Holds the names of any files or images uploaded
Dim strTopicIcon 'Holds the topic icon
'If the user is user is using a banned IP redirect to an error page
If bannedIP() Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("insufficient_permission.asp?M=I P")
End If
'Read in the message ID number to edit
lngTopicID = CLng(Request.QueryString("TID"))
lngMessageID = CLng(Request.QueryString("PID"))
intRecordPositionPageNum = CInt(Request.QueryString("PN"))
strMode = Trim(Mid(Request.QueryString("M"), 1, 2))
intTotalRecords = CLng(Request.QueryString("TR"))
'Set the page mode
If strMode = "Q" Then
strMode = "quote"
Else
strMode = "reply"
End If
'Get the message from the database to quote
If strMode = "quote" Then
'Initalise the strSQL variable with an SQL statement to get the message to be quoted
strSQL = "SELECT " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Forum_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Thread.Author_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Author.Username, " & strDbTable & "GuestName.Name " & _
"FROM (" & strDbTable & "Author" & strDBNoLock & " INNER JOIN (" & strDbTable & "Topic" & strDBNoLock & " INNER JOIN " & strDbTable & "Thread" & strDBNoLock & " ON " & strDbTable & "Topic.Topic_ID = " & strDbTable & "Thread.Topic_ID) ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) LEFT JOIN " & strDbTable & "GuestName" & strDBNoLock & " ON " & strDbTable & "Thread.Thread_ID = " & strDbTable & "GuestName.Thread_ID " & _
"WHERE " & strDbTable & "Thread.Thread_ID=" & lngMessageID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
intForumID = CInt(rsCommon("Forum_ID"))
strTopicSubject = rsCommon("Subject")
blnTopicLocked = CBool(rsCommon("Locked"))
lngTopicID = CLng(rsCommon("Topic_ID"))
strTopicSubject = rsCommon("Subject")
lngPostUserID = CLng(rsCommon("Author_ID"))
strQuoteUsername = rsCommon("Username")
strQuoteMessage = rsCommon("Message")
lngPollID = CLng(rsCommon("Poll_ID"))
'If the post being quoted is written by a guest see if they have a name
If lngPostUserID = 2 Then strQuoteUsername = rsCommon("Name")
'Clean up
rsCommon.Close
'Build up the quoted thread post
strMessage = "
"
'Else this is a basic reply so check the user can reply in this topic
Else
'Initalise the strSQL variable with an SQL statement to query the database to get the topic details
strSQL = "SELECT " & strDbTable & "Topic.Forum_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Poll_ID " & _
"FROM " & strDbTable & "Topic" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Topic.Topic_ID=" & lngTopicID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
intForumID = CInt(rsCommon("Forum_ID"))
strTopicSubject = rsCommon("Subject")
blnTopicLocked = CBool(rsCommon("Locked"))
lngPollID = CLng(rsCommon("Poll_ID"))
'blnPollNoReply = CBool(rsCommon("Reply"))
'Clean up input to prevent XXS hack
strTopicSubject = formatInput(strTopicSubject)
'Clean up
rsCommon.Close
End If
'Check the forum permissions
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "" & _
"SELECT" & strDBTop1 & " tblCategory.Cat_ID, tblCategory.Cat_name, tblForum.Forum_ID, tblForum.Sub_ID, tblForum.Forum_name, tblForum2.Forum_name AS Main_forum, tblForum.Password, tblForum.Forum_code, tblForum.Locked, tblForum.Show_topics, tblPermissions.* " & _
"FROM tblCategory" & strDBNoLock & ", tblForum" & strDBNoLock & ", tblForum AS tblForum2" & strDBNoLock & ", tblPermissions" & strDBNoLock & " " & _
"WHERE tblCategory.Cat_ID=tblForum.Cat_ID " & _
"AND tblForum.Forum_ID=tblPermissions.Forum_ID " & _
"AND (tblForum.Sub_ID=tblForum2.Forum_ID OR (tblForum.Sub_ID=0 AND tblForum.Forum_ID=tblForum2.Forum_ID)) " & _
"AND tblForum.Forum_ID=" & intForumID & " " & _
"AND (tblPermissions.Author_ID=" & lngLoggedInUserID & " OR tblPermissions.Group_ID=" & intGroupID & ") " & _
"ORDER BY tblForum.Sub_ID, tblForum.Forum_Order" & strDBLimit1 & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'If there is a record returned by the recordset then check to see if you need a password to enter it
If NOT rsCommon.EOF Then
'Read in forum details from the database
intCatID = CInt(rsCommon("Cat_ID"))
strCatName = rsCommon("Cat_name")
strForumName = rsCommon("Forum_name")
strMasterForumName = rsCommon("Main_forum")
intMasterForumID = CLng(rsCommon("Sub_ID"))
blnForumLocked = CBool(rsCommon("Locked"))
'Read in the forum permissions
blnRead = CBool(rsCommon("View_Forum"))
blnReply = CBool(rsCommon("Reply_posts"))
blnAttachments = CBool(rsCommon("Attachments"))
blnImageUpload = CBool(rsCommon("Image_upload"))
blnModerator = CBool(rsCommon("Moderate"))
blnCheckFirst = CBool(rsCommon("Display_post"))
'If the user has no read writes then kick them
If blnRead = False Then
'Reset Server Objects
rsCommon.Close
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect to a page asking for the user to enter the forum password
Response.Redirect("insufficient_permission.asp")
End If
'If the forum requires a password and a logged in forum code is not found on the users machine then send them to a login page
If rsCommon("Password") <> "" and Request.Cookies(strCookieName)("Forum" & intForumID) <> rsCommon("Forum_code") Then
'Reset Server Objects
rsCommon.Close
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect to a page asking for the user to enter the forum password
Response.Redirect("forum_password_form.asp?FID=" & intForumID)
End If
End If
'Clean up
rsCommon.Close
'Check that the poll is not a poll only and replies are allowed
If lngPollID <> 0 Then
strSQL = "SELECT " & strDbTable & "Poll.Reply " & _
"FROM " & strDbTable & "Poll" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Poll.Poll_ID=" & lngPollID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
blnPollNoReply = CBool(rsCommon("Reply"))
'Clean up
rsCommon.Close
End If
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'If active users is enabled update the active users application array
If blnActiveUsers Then
'Call active users function
saryActiveUsers = activeUsers(strTxtWritingReply, strTopicSubject, "forum_posts.asp?TID=" & lngTopicID)
End If
'If the forum level for the user on this forum is read only set the forum to be locked
If (blnRead = False AND blnModerator = False AND blnAdmin = False) Then blnForumLocked = True
'If the message has been edited remove who edited the post
If InStr(1, strMessage, "<edited>", 1) Then strMessage = removeEditorAuthor(strMessage)
'Use a session variable to pass around what forum this user is within
Session("FID") = intForumID
Session("blnAttachments") = blnAttachments
Session("blnImageUpload") = blnImageUpload
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" --><head>
<title><% = strTxtPostReply %></title>
<meta name="generator" content="Web Wiz Forums" />
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* ************************************************** *****" & _
vbCrLf & "Application: Web Wiz Forums ver. " & strVersion & "" & _
vbCrLf & "Author: Bruce Corkhill" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Available FREE: http://www.webwizforums.com" & _
vbCrLf & "Copyright: Bruce Corkhill ©2001-2006. All rights reserved" & _
vbCrLf & "************************************************* ****** */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!-- Check the from is filled in correctly before submitting -->
<script language="JavaScript">
//Function to check form is filled in correctly before submitting
function CheckForm () {
var errorMsg = "";
var formArea = document.getElementById('frmMessageForm');
<%
'If Gecko Madis API (RTE) need to strip default input from the API
If RTEenabled = "Gecko" Then Response.Write(" //For Gecko Madis API (RTE)" & vbCrLf & " if (formArea.message.value.indexOf('<br>') > -1 && formArea.message.value.length == 8) formArea.message.value = ';" & vbCrLf)
'If this is a guest posting check that they have entered their name
If lngLoggedInUserID = 2 Then
%>
//Check for a name
if (formArea.Gname.value==""){
errorMsg += " <% = strTxtNoNameError %>";
}
<%
End If
%>
//Check for message
if (formArea.message.value==""){
errorMsg += " <% = strTxtNoMessageError %>";
}
//If there is aproblem with the form then display an error
if (errorMsg != ""){
msg = "<% = strTxtErrorDisplayLine %> ";
msg += "<% = strTxtErrorDisplayLine1 %> ";
msg += "<% = strTxtErrorDisplayLine2 %> ";
msg += "<% = strTxtErrorDisplayLine %> ";
msg += "<% = strTxtErrorDisplayLine3 %> ";
errorMsg += alert(msg + errorMsg + " ");
return false;
}
//Hide submit button
document.getElementById('Submit').disabled=true;
//Show progress bar
var progressWin = document.getElementById('progressBar');
var progressArea = document.getElementById('progressFormArea');
//Position and show progress bar
progressWin.style.left = progressArea.offsetLeft + (progressArea.offsetWidth-210)/2 + 'px';
progressWin.style.top = progressArea.offsetTop + (progressArea.offsetHeight-140)/2 + 'px';
progressWin.style.display='inline'
return true;
}
</script>
<link href="<% = strCSSfile %>" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/navigation_buttons_inc.asp" -->
</head>
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
<tr>
<td class="heading"><% = strTxtPostReply %></td>
</tr>
<tr>
<td><strong><img src="<% = strImagePath %>open_folder_icon.gif" border="0" align="absmiddle"> <a href="forum.asp"><strong><% = strMainForumName %></strong></a><%
'Display the category name
Response.Write (strNavSpacer & "<a href=""forum.asp?C=" & intCatID & """><strong>" & strCatName & "</strong></a>" & strNavSpacer)
'Display if there is a main forum to the sub forums name
If intMasterForumID <> 0 Then Response.Write ("<a href=""forum_topics.asp?FID=" & intMasterForumID & """><strong>" & strMasterForumName & "</strong></a>" & strNavSpacer)
'Display forum name
If strForumName = "" Then Response.Write "<strong>" & strTxtNoForums & "</strong>" Else Response.Write ("<a href=""forum_topics.asp?FID=" & intForumID & """><strong>" & strForumName & "</strong></a>")
'Display page title
Response.Write(strNavSpacer & " " & strTxtPostReply) %><br /></strong></td>
</tr>
<tr>
<td><span class="lgText"><img src="<% = strImagePath %>subject_folder.gif" alt="<% = strTxtSubjectFolder %>" align="absmiddle"><% = strTxtTopic %>: <% = strTopicSubject %></span></td>
</tr>
</table><br /><%
'If the Post is by the logged in user or the adminstrator/moderator then display a form to reply
If (blnReply OR blnAdmin) AND blnActiveMember AND blnPollNoReply = false AND (blnForumLocked = False OR blnAdmin = True) AND (blnTopicLocked = False Or blnAdmin) Then
skin_open("")
%>
<div align="center" id="progressFormArea">
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td align="left"><% = strTxtEditPost %></td>
</tr>
<tr class="tableRow">
<td align="left">
<!--#include file="includes/message_form_inc.asp" -->
</td>
</tr>
</table>
<%skin_close%>
</div><%
'Else there is an error so show error table
Else
%>
<table class="errorTable" cellspacing="1" cellpadding="3" align="center">
<tr>
<td><strong><% = strTxtError %></strong></td>
</tr>
<tr>
<td><%
'If the users account is suspended then let them know
If blnActiveMember = False Then
'If mem suspended display message
If InStr(1, strLoggedInUserCode, "N0act", vbTextCompare) Then
Response.Write(strTxtForumMemberSuspended)
'Else account not yet active
Else
Response.Write(strTxtForumMembershipNotAct & "<br /><br />" & strTxtToActivateYourForumMem)
End If
'If email is on then place a re-send activation email link
If InStr(1, strLoggedInUserCode, "N0act", vbTextCompare) = False AND blnEmailActivation AND blnLoggedInUserEmail Then Response.Write("<br /><br /><a href=""javascript:winOpener('resend_email_activati on.asp','actMail',1,1,475,300)"">" & strTxtResendActivationEmail & "</a>")
'Else if the forum is locked display a message telling the user so
ElseIf blnForumLocked Then
Response.Write(strTxtForumLockedByAdmim)
'Display message if the topic is locked
ElseIf blnTopicLocked Then
Response.Write(strTxtSorryNoReply & "<br />" & strTxtThisTopicIsLocked)
'Else if the user does not have permision to reply in this forum
ElseIf blnReply = False AND intGroupID <> 2 Then
Response.Write(strTxtSorryYouDoNotHavePerimssionTo ReplyToPostsInThisForum & "<br /><br />")
Response.Write("<a href=""javascript:history.back(1)"">" & strTxtReturnForumTopic & "</a>")
'Display message if this is a poll only
ElseIf blnPollNoReply Then
Response.Write(strTxtThisIsAPollOnlyYouCanNotReply & "<br /><br />")
Response.Write("<a href=""javascript:history.back(1)"">" & strTxtReturnForumTopic & "</a>")
'Else the user doesn't have permission to reply in this forum
Else
Response.Write(strTxtSorryYouDoNotHavePerimssionTo ReplyToPostsInThisForum )
End If
%></td>
</tr>
</table><%
'If the user can needs to login display login box
If blnReply = False AND intGroupID = 2 AND blnActiveMember AND blnForumLocked = false AND blnTopicLocked = false Then
%><!--#include file="includes/login_form_inc.asp" --><%
End If
End If
%><br />
<br />
<div align="center"><%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnLCode = True Then
Response.Write(strFooterAds)
If blnTextLinks = True Then
Response.Write("<span class=""text"" style=""font-size:10px"">Powered by <a href=""http://www.webwizforums.com"" target=""_blank"" style=""font-size:10px"">Web Wiz Forums</a> version " & strVersion & "</span>")
Else
Response.Write("<a href=""http://www.webwizforums.com"" target=""_blank""><img src=""" & strImagePath & "web_wiz_guide.gif"" border=""0"" alt=""Powered by Web Wiz Forums version " & strVersion & """></a>")
End If
Response.Write("<br /><span class=""text"" style=""font-size:10px"">Copyright ©2001-2006 <a href=""http://www.webwizguide.info"" target=""_blank"" style=""font-size:10px"">Web Wiz Guide</a></span>")
End If
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
'Display the process time
If blnShowProcessTime Then Response.Write "<span class=""smText""><br /><br />" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "</span>"
%>
</div>
<!-- #include file="includes/footer.asp" -->
error '80020009'
/thienbao1989/thienbao/new_reply_form.asp, line 189
mình tìm dòng 189 rùi mà chả biết sai cái gì có ai biết chỉ minh với.
xem dùm mình cái này nè"new_reply_form.asp": http://www32.websamba.com/bao1989198...reply_form.rar
code "new_reply_form.asp":
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_edit_post.asp" -->
<!--#include file="includes/emoticons_inc.asp" -->
<%
'************************************************* ***************************************
'** Copyright Notice
'**
'** Web Wiz Guide - Web Wiz Forums
'** http://www.webwizforums.com
'**
'** Copyright 2001-2006 Bruce Corkhill All Rights Reserved.
'**
'** This program is free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may use parts of this program in your own private work, but you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** You should have received a copy of the License along with this program;
'** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'** No official support is available for this program but you may post support questions at: -
'** http://www.webwizguide.info/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -
'**
'** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD
'**
'************************************************* ***************************************
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Make sure this page is not cached
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'Dimension variables
Dim strMode 'Holds the mode of the page
Dim intForumID 'Holds the forum ID number
Dim strMasterForumName 'Holds the main forum name
Dim intMasterForumID 'Holds the main forum ID
Dim intCatID 'Holds the cat ID
Dim strCatName 'Holds the cat name
Dim lngTopicID 'Holds the Topic ID number
Dim lngMessageID 'Holds the message ID to be edited
Dim strTopicSubject 'Holds the subject topic being replied to
Dim strQuoteUsername 'Holds the quoters username
Dim strQuoteMessage 'Holds the message to be quoted
Dim lngPostUserID 'Holds the user ID of the user to post the message
Dim blnForumLocked 'Set to true if the forum is locked
Dim blnEmailNotify 'Set to true if the users want to be notified by e-mail of a post
Dim strPostPage 'Holds the page the form is posted to
Dim intRecordPositionPageNum 'Holds the recorset page number to show the Threads for
Dim strMessage 'Holds the post message
Dim strForumName 'Holds the name of the forum
Dim intIndexPosition 'Holds the idex poistion in the emiticon array
Dim intNumberOfOuterLoops 'Holds the outer loop number for rows
Dim intLoop 'Holds the loop index position
Dim intInnerLoop 'Holds the inner loop number for columns
Dim blnTopicLocked 'Holds if the topic is locked or not
Dim intTotalRecords 'Holds the total number of records
Dim strUsername 'For login include
Dim strPassword 'For login include
Dim blnPollNoReply 'Holds if it is a poll only
Dim lngPollID 'Holds the poll ID
Dim strUploadedFiles 'Holds the names of any files or images uploaded
Dim strTopicIcon 'Holds the topic icon
'If the user is user is using a banned IP redirect to an error page
If bannedIP() Then
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect
Response.Redirect("insufficient_permission.asp?M=I P")
End If
'Read in the message ID number to edit
lngTopicID = CLng(Request.QueryString("TID"))
lngMessageID = CLng(Request.QueryString("PID"))
intRecordPositionPageNum = CInt(Request.QueryString("PN"))
strMode = Trim(Mid(Request.QueryString("M"), 1, 2))
intTotalRecords = CLng(Request.QueryString("TR"))
'Set the page mode
If strMode = "Q" Then
strMode = "quote"
Else
strMode = "reply"
End If
'Get the message from the database to quote
If strMode = "quote" Then
'Initalise the strSQL variable with an SQL statement to get the message to be quoted
strSQL = "SELECT " & strDbTable & "Topic.Topic_ID, " & strDbTable & "Topic.Forum_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Thread.Author_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Author.Username, " & strDbTable & "GuestName.Name " & _
"FROM (" & strDbTable & "Author" & strDBNoLock & " INNER JOIN (" & strDbTable & "Topic" & strDBNoLock & " INNER JOIN " & strDbTable & "Thread" & strDBNoLock & " ON " & strDbTable & "Topic.Topic_ID = " & strDbTable & "Thread.Topic_ID) ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) LEFT JOIN " & strDbTable & "GuestName" & strDBNoLock & " ON " & strDbTable & "Thread.Thread_ID = " & strDbTable & "GuestName.Thread_ID " & _
"WHERE " & strDbTable & "Thread.Thread_ID=" & lngMessageID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
intForumID = CInt(rsCommon("Forum_ID"))
strTopicSubject = rsCommon("Subject")
blnTopicLocked = CBool(rsCommon("Locked"))
lngTopicID = CLng(rsCommon("Topic_ID"))
strTopicSubject = rsCommon("Subject")
lngPostUserID = CLng(rsCommon("Author_ID"))
strQuoteUsername = rsCommon("Username")
strQuoteMessage = rsCommon("Message")
lngPollID = CLng(rsCommon("Poll_ID"))
'If the post being quoted is written by a guest see if they have a name
If lngPostUserID = 2 Then strQuoteUsername = rsCommon("Name")
'Clean up
rsCommon.Close
'Build up the quoted thread post
strMessage = "
Được gửi bởi & strQuoteUsername &
'Else this is a basic reply so check the user can reply in this topic
Else
'Initalise the strSQL variable with an SQL statement to query the database to get the topic details
strSQL = "SELECT " & strDbTable & "Topic.Forum_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Locked, " & strDbTable & "Topic.Poll_ID " & _
"FROM " & strDbTable & "Topic" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Topic.Topic_ID=" & lngTopicID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
intForumID = CInt(rsCommon("Forum_ID"))
strTopicSubject = rsCommon("Subject")
blnTopicLocked = CBool(rsCommon("Locked"))
lngPollID = CLng(rsCommon("Poll_ID"))
'blnPollNoReply = CBool(rsCommon("Reply"))
'Clean up input to prevent XXS hack
strTopicSubject = formatInput(strTopicSubject)
'Clean up
rsCommon.Close
End If
'Check the forum permissions
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "" & _
"SELECT" & strDBTop1 & " tblCategory.Cat_ID, tblCategory.Cat_name, tblForum.Forum_ID, tblForum.Sub_ID, tblForum.Forum_name, tblForum2.Forum_name AS Main_forum, tblForum.Password, tblForum.Forum_code, tblForum.Locked, tblForum.Show_topics, tblPermissions.* " & _
"FROM tblCategory" & strDBNoLock & ", tblForum" & strDBNoLock & ", tblForum AS tblForum2" & strDBNoLock & ", tblPermissions" & strDBNoLock & " " & _
"WHERE tblCategory.Cat_ID=tblForum.Cat_ID " & _
"AND tblForum.Forum_ID=tblPermissions.Forum_ID " & _
"AND (tblForum.Sub_ID=tblForum2.Forum_ID OR (tblForum.Sub_ID=0 AND tblForum.Forum_ID=tblForum2.Forum_ID)) " & _
"AND tblForum.Forum_ID=" & intForumID & " " & _
"AND (tblPermissions.Author_ID=" & lngLoggedInUserID & " OR tblPermissions.Group_ID=" & intGroupID & ") " & _
"ORDER BY tblForum.Sub_ID, tblForum.Forum_Order" & strDBLimit1 & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'If there is a record returned by the recordset then check to see if you need a password to enter it
If NOT rsCommon.EOF Then
'Read in forum details from the database
intCatID = CInt(rsCommon("Cat_ID"))
strCatName = rsCommon("Cat_name")
strForumName = rsCommon("Forum_name")
strMasterForumName = rsCommon("Main_forum")
intMasterForumID = CLng(rsCommon("Sub_ID"))
blnForumLocked = CBool(rsCommon("Locked"))
'Read in the forum permissions
blnRead = CBool(rsCommon("View_Forum"))
blnReply = CBool(rsCommon("Reply_posts"))
blnAttachments = CBool(rsCommon("Attachments"))
blnImageUpload = CBool(rsCommon("Image_upload"))
blnModerator = CBool(rsCommon("Moderate"))
blnCheckFirst = CBool(rsCommon("Display_post"))
'If the user has no read writes then kick them
If blnRead = False Then
'Reset Server Objects
rsCommon.Close
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect to a page asking for the user to enter the forum password
Response.Redirect("insufficient_permission.asp")
End If
'If the forum requires a password and a logged in forum code is not found on the users machine then send them to a login page
If rsCommon("Password") <> "" and Request.Cookies(strCookieName)("Forum" & intForumID) <> rsCommon("Forum_code") Then
'Reset Server Objects
rsCommon.Close
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'Redirect to a page asking for the user to enter the forum password
Response.Redirect("forum_password_form.asp?FID=" & intForumID)
End If
End If
'Clean up
rsCommon.Close
'Check that the poll is not a poll only and replies are allowed
If lngPollID <> 0 Then
strSQL = "SELECT " & strDbTable & "Poll.Reply " & _
"FROM " & strDbTable & "Poll" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Poll.Poll_ID=" & lngPollID & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'Read in the details from the recordset
blnPollNoReply = CBool(rsCommon("Reply"))
'Clean up
rsCommon.Close
End If
'Clean up
Set rsCommon = Nothing
adoCon.Close
Set adoCon = Nothing
'If active users is enabled update the active users application array
If blnActiveUsers Then
'Call active users function
saryActiveUsers = activeUsers(strTxtWritingReply, strTopicSubject, "forum_posts.asp?TID=" & lngTopicID)
End If
'If the forum level for the user on this forum is read only set the forum to be locked
If (blnRead = False AND blnModerator = False AND blnAdmin = False) Then blnForumLocked = True
'If the message has been edited remove who edited the post
If InStr(1, strMessage, "<edited>", 1) Then strMessage = removeEditorAuthor(strMessage)
'Use a session variable to pass around what forum this user is within
Session("FID") = intForumID
Session("blnAttachments") = blnAttachments
Session("blnImageUpload") = blnImageUpload
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" --><head>
<title><% = strTxtPostReply %></title>
<meta name="generator" content="Web Wiz Forums" />
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* ************************************************** *****" & _
vbCrLf & "Application: Web Wiz Forums ver. " & strVersion & "" & _
vbCrLf & "Author: Bruce Corkhill" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Available FREE: http://www.webwizforums.com" & _
vbCrLf & "Copyright: Bruce Corkhill ©2001-2006. All rights reserved" & _
vbCrLf & "************************************************* ****** */" & _
vbCrLf & "//-->")
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<!-- Check the from is filled in correctly before submitting -->
<script language="JavaScript">
//Function to check form is filled in correctly before submitting
function CheckForm () {
var errorMsg = "";
var formArea = document.getElementById('frmMessageForm');
<%
'If Gecko Madis API (RTE) need to strip default input from the API
If RTEenabled = "Gecko" Then Response.Write(" //For Gecko Madis API (RTE)" & vbCrLf & " if (formArea.message.value.indexOf('<br>') > -1 && formArea.message.value.length == 8) formArea.message.value = ';" & vbCrLf)
'If this is a guest posting check that they have entered their name
If lngLoggedInUserID = 2 Then
%>
//Check for a name
if (formArea.Gname.value==""){
errorMsg += " <% = strTxtNoNameError %>";
}
<%
End If
%>
//Check for message
if (formArea.message.value==""){
errorMsg += " <% = strTxtNoMessageError %>";
}
//If there is aproblem with the form then display an error
if (errorMsg != ""){
msg = "<% = strTxtErrorDisplayLine %> ";
msg += "<% = strTxtErrorDisplayLine1 %> ";
msg += "<% = strTxtErrorDisplayLine2 %> ";
msg += "<% = strTxtErrorDisplayLine %> ";
msg += "<% = strTxtErrorDisplayLine3 %> ";
errorMsg += alert(msg + errorMsg + " ");
return false;
}
//Hide submit button
document.getElementById('Submit').disabled=true;
//Show progress bar
var progressWin = document.getElementById('progressBar');
var progressArea = document.getElementById('progressFormArea');
//Position and show progress bar
progressWin.style.left = progressArea.offsetLeft + (progressArea.offsetWidth-210)/2 + 'px';
progressWin.style.top = progressArea.offsetTop + (progressArea.offsetHeight-140)/2 + 'px';
progressWin.style.display='inline'
return true;
}
</script>
<link href="<% = strCSSfile %>" rel="stylesheet" type="text/css" />
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/navigation_buttons_inc.asp" -->
</head>
<table class="basicTable" cellspacing="0" cellpadding="3" align="center">
<tr>
<td class="heading"><% = strTxtPostReply %></td>
</tr>
<tr>
<td><strong><img src="<% = strImagePath %>open_folder_icon.gif" border="0" align="absmiddle"> <a href="forum.asp"><strong><% = strMainForumName %></strong></a><%
'Display the category name
Response.Write (strNavSpacer & "<a href=""forum.asp?C=" & intCatID & """><strong>" & strCatName & "</strong></a>" & strNavSpacer)
'Display if there is a main forum to the sub forums name
If intMasterForumID <> 0 Then Response.Write ("<a href=""forum_topics.asp?FID=" & intMasterForumID & """><strong>" & strMasterForumName & "</strong></a>" & strNavSpacer)
'Display forum name
If strForumName = "" Then Response.Write "<strong>" & strTxtNoForums & "</strong>" Else Response.Write ("<a href=""forum_topics.asp?FID=" & intForumID & """><strong>" & strForumName & "</strong></a>")
'Display page title
Response.Write(strNavSpacer & " " & strTxtPostReply) %><br /></strong></td>
</tr>
<tr>
<td><span class="lgText"><img src="<% = strImagePath %>subject_folder.gif" alt="<% = strTxtSubjectFolder %>" align="absmiddle"><% = strTxtTopic %>: <% = strTopicSubject %></span></td>
</tr>
</table><br /><%
'If the Post is by the logged in user or the adminstrator/moderator then display a form to reply
If (blnReply OR blnAdmin) AND blnActiveMember AND blnPollNoReply = false AND (blnForumLocked = False OR blnAdmin = True) AND (blnTopicLocked = False Or blnAdmin) Then
skin_open("")
%>
<div align="center" id="progressFormArea">
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td align="left"><% = strTxtEditPost %></td>
</tr>
<tr class="tableRow">
<td align="left">
<!--#include file="includes/message_form_inc.asp" -->
</td>
</tr>
</table>
<%skin_close%>
</div><%
'Else there is an error so show error table
Else
%>
<table class="errorTable" cellspacing="1" cellpadding="3" align="center">
<tr>
<td><strong><% = strTxtError %></strong></td>
</tr>
<tr>
<td><%
'If the users account is suspended then let them know
If blnActiveMember = False Then
'If mem suspended display message
If InStr(1, strLoggedInUserCode, "N0act", vbTextCompare) Then
Response.Write(strTxtForumMemberSuspended)
'Else account not yet active
Else
Response.Write(strTxtForumMembershipNotAct & "<br /><br />" & strTxtToActivateYourForumMem)
End If
'If email is on then place a re-send activation email link
If InStr(1, strLoggedInUserCode, "N0act", vbTextCompare) = False AND blnEmailActivation AND blnLoggedInUserEmail Then Response.Write("<br /><br /><a href=""javascript:winOpener('resend_email_activati on.asp','actMail',1,1,475,300)"">" & strTxtResendActivationEmail & "</a>")
'Else if the forum is locked display a message telling the user so
ElseIf blnForumLocked Then
Response.Write(strTxtForumLockedByAdmim)
'Display message if the topic is locked
ElseIf blnTopicLocked Then
Response.Write(strTxtSorryNoReply & "<br />" & strTxtThisTopicIsLocked)
'Else if the user does not have permision to reply in this forum
ElseIf blnReply = False AND intGroupID <> 2 Then
Response.Write(strTxtSorryYouDoNotHavePerimssionTo ReplyToPostsInThisForum & "<br /><br />")
Response.Write("<a href=""javascript:history.back(1)"">" & strTxtReturnForumTopic & "</a>")
'Display message if this is a poll only
ElseIf blnPollNoReply Then
Response.Write(strTxtThisIsAPollOnlyYouCanNotReply & "<br /><br />")
Response.Write("<a href=""javascript:history.back(1)"">" & strTxtReturnForumTopic & "</a>")
'Else the user doesn't have permission to reply in this forum
Else
Response.Write(strTxtSorryYouDoNotHavePerimssionTo ReplyToPostsInThisForum )
End If
%></td>
</tr>
</table><%
'If the user can needs to login display login box
If blnReply = False AND intGroupID = 2 AND blnActiveMember AND blnForumLocked = false AND blnTopicLocked = false Then
%><!--#include file="includes/login_form_inc.asp" --><%
End If
End If
%><br />
<br />
<div align="center"><%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
If blnLCode = True Then
Response.Write(strFooterAds)
If blnTextLinks = True Then
Response.Write("<span class=""text"" style=""font-size:10px"">Powered by <a href=""http://www.webwizforums.com"" target=""_blank"" style=""font-size:10px"">Web Wiz Forums</a> version " & strVersion & "</span>")
Else
Response.Write("<a href=""http://www.webwizforums.com"" target=""_blank""><img src=""" & strImagePath & "web_wiz_guide.gif"" border=""0"" alt=""Powered by Web Wiz Forums version " & strVersion & """></a>")
End If
Response.Write("<br /><span class=""text"" style=""font-size:10px"">Copyright ©2001-2006 <a href=""http://www.webwizguide.info"" target=""_blank"" style=""font-size:10px"">Web Wiz Guide</a></span>")
End If
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
'Display the process time
If blnShowProcessTime Then Response.Write "<span class=""smText""><br /><br />" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 3) & " " & strTxtSeconds & "</span>"
%>
</div>
<!-- #include file="includes/footer.asp" -->
Bài liên quan
"Variable is undefined: 'blnEvents' "
Bác tìm trong trang dó xem biến blnEvents đã được xác định chưa?
1. Ctrl + F
2. Đánh : blnEvents
3. Xem những chỗ có liên quan tới blnEvents
4. F3 ... (nếu còn)
<% Option Explicit %>
error '80020009'
/thienbao1989/thienbao/new_reply_form.asp, line 189
[=========> Bổ sung bài viết <=========]
chan nhi ko có ai trả lời dùm em cái hix
[=========> Bổ sung bài viết <=========]
ui chời ko có ai giúp em à