Author |
Topic |
leatherlips
Senior Member
USA
1838 Posts |
|
Massimo
Junior Member
Italy
125 Posts |
Posted - 28 July 2008 : 14:46:17
|
quote: Originally posted by Carefree
Did you add the field to the database as described earlier?
You can either do it when first creating the petition mod, or use this as an update dbs file.
Save as dbs_petition_update.asp and run in Admin Home.
Virgin forum e dbs...
update and....
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/platinum/petition.asp, line 230 < |
Massimo Farieri Snitz Italian Community =============== http://www.snitz.it http://www.superdeejay.net/forum/
|
Edited by - Massimo on 28 July 2008 14:50:45 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 28 July 2008 : 21:49:14
|
quote: Originally posted by leatherlips
I'm trying to test what you've done but I am getting an error. I updated the database and replaced the admin_petition.asp file with your code and I get this error:
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/forumbeta/admin_petition.asp, line 66 Line 66 is in red:
if Request.Form("switch") = "" then
' Do nothing
else
Session("Pswitch")=cInt(Request.Form("switch"))
end if
That's not line 66 on the one I posted. What changes were made?< |
|
|
leatherlips
Senior Member
USA
1838 Posts |
Posted - 28 July 2008 : 22:00:16
|
I re-uploaded your code and actually have this error:
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/forumbeta/admin_petition.asp, line 66 Line 66 is:
Set grs = my_conn.execute(strsql) One thing to note is when I updated the database with your addon code the message when it was finished was blank. Usually when you add a dbs file or make updates it tells you something along the lines of "created successfully". This one didn't say anything. Perhaps that's the problem?
Edit: I looked at my database and the dbs code you supplied did not seem to create what is needed.< |
Mangione Magic Forum - The Music of Chuck Mangione
My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD |
Edited by - leatherlips on 28 July 2008 22:24:25 |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 29 July 2008 : 01:19:40
|
quote: One thing to note is when I updated the database with your addon code the message when it was finished was blank. Usually when you add a dbs file or make updates it tells you something along the lines of "created successfully". This one didn't say anything. Perhaps that's the problem?
Leatherlips, I had the same and I cut and paste the dbs code and slotted it in the alternative mod set up and got a confirmation Successful. However still received the same error code as you above, once checked, line 66< |
Edited by - Andy Humm on 29 July 2008 01:20:53 |
|
|
Massimo
Junior Member
Italy
125 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 29 July 2008 : 11:20:14
|
Massimo, I'll try and fix petition.asp for you today. There were no provisions or checks made for end of file/beginning of file.< |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 29 July 2008 : 11:37:08
|
Leather & Andy - make sure that the field p_switch exists in the p_options table. If you have to manually create it, use these settings:
Field name: P_SWITCH Type: Integer Required: Yes
Choose between the following defaults:
Default value: 0 (turned off until Admin manually turns on) Default value: 1 (turned on until Admin manually turns off)
If it exists but doesn't match, change it.
Edit:
I looked at the required fields for that table. They include: P_V1_REQ P_V2_REQ P_V3_REQ P_PAGECOUNT P_T_MAIL P_W_MAIL P_T_AUTHOR P_T_REPLYTO P_T_MESSAGE
Of these, the only one without a default value is P_PAGECOUNT. Set its default value to 0 and that should fix the problem. < |
Edited by - Carefree on 29 July 2008 12:54:50 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 29 July 2008 : 12:57:16
|
If your database doesn't reside on your computer, change the default value for P_PAGECOUNT using a script like this:
MOD: Petition Pagecount Fix [P_OPTIONS] [ALTER] ALTER#P_PAGECOUNT#INT###0 [END] < |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 29 July 2008 : 16:02:13
|
CF Thank you for the prompts and code, I have manually downloaded the db, added the P_SWITCH fields and associated parameters to both P_OPTIONS and PETITIONS tables amended the P_PAGECOUNT Hey presto all works. Muchio appreciation! < |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 29 July 2008 : 19:11:03
|
Nothing is wrong with the pagecount except the situation Massimo is in - apparently he reached end-of-file and it created an error because there were no further records to match his sql string.
The pagecount routine listed on page 1 will set the default value of the pagecount field to 0 & modify existing records to rectify the EOF/BOF issue.< |
Edited by - Carefree on 29 July 2008 19:11:21 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
leatherlips
Senior Member
USA
1838 Posts |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 30 July 2008 : 01:14:58
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by leatherlips</i> <br />Carefree,
I uninstalled and reinstalled the petition database. Things seemed to be working until I turned the petition off. Then I got this error and it appeared on every page:
Line 653 is:
<font color="red">strPSwitch=rsswitch("P_SWITCH")</font id="red">
Also, once this is sorted, another idea would be to have the petition.asp page inaccessible if it is turned off. Otherwise people could still get to it. <hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
I redid the check routine:
Now, here's what you insert to detect whether it's on or off:
Change the line in blue to your menu item or whatever....
Now, to prevent someone bypassing the menu item; also to delete the website & icq fields which weren't being used; etc. Replace your "petitions.asp" with this:
<%
'################################################################################
'## Snitz Forums 2000 v3.4.06
'################################################################################
'## Copyright (C) 2000-06 Michael Anderson, Pierre Gorissen,
'## Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from our support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## manderson@snitz.com
'##
'################################################################################
'## MOD: Petition
'## Modified from the Guestbook MOD by Leatherlips
'## Based on the Guestbook MOD by Michael Reisinger (OneWayMule)
'## Added signature count feature with the help of phy1729
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
'Check Petitions on
set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
strSql="SELECT P_SWITCH FROM " & strTablePrefix & "P_OPTIONS"
set rsswitch = my_Conn.Execute(strSql)
if (not rsswitch.BOF and not rsswitch.EOF) then
strPSwitch=rsswitch("P_SWITCH")
rsswitch.close
set rsswitch=nothing
'Get Petition Count SQL
strSql = "SELECT COUNT(P_ID) AS P_COUNT FROM " & strTablePrefix & "PETITION WHERE P_MODERATED = 0"
Set countrs = my_conn.execute(strsql)
If Not countrs.EOF Then
intPCount = countrs("P_COUNT")
Else
intPCount = 0
End If
countrs.Close
Set countrs = Nothing
'Get Petition Count Code Above
end if
if strPSwitch=0 then
Response.Redirect "default.asp"
end if
strRCCode = Request.QueryString("rc")
strRC = Request.QueryString("code")
strRCP = Request.QueryString("p")
If strRC = "image" then
NullStop = False
RandCode = (strRCCode + 17456) / 50000
lenCode = Len(RandCode)
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode = NullRC & RandCode
ImageP = Mid(RandCode, strRCP,1)
Response.Redirect "images/" & ImageP & ".gif"
End If
strsql = "SELECT P_VARFIELD1, P_VARFIELD2, P_VARFIELD3, P_V1_SWITCH, P_V2_SWITCH, P_V3_SWITCH, P_V1_REQ, P_V2_REQ, P_V3_REQ, P_PAGECOUNT, P_T_MAIL, P_W_MAIL, P_T_AUTHOR, P_T_REPLYTO, P_T_MESSAGE, P_MESSAGE, P_MODERATION, P_ANTISPAM FROM " & strTablePrefix & "P_OPTIONS WHERE P_ID=1"
Set grs = my_conn.execute(strsql)
strPField1 = grs("P_VARFIELD1")
strPField2 = grs("P_VARFIELD2")
strPField3 = grs("P_VARFIELD3")
strPField1E = grs("P_V1_SWITCH")
strPField2E = grs("P_V2_SWITCH")
strPField3E = grs("P_V3_SWITCH")
strPField1Req = grs("P_V1_REQ")
strPField2Req = grs("P_V2_REQ")
strPField3Req = grs("P_V3_REQ")
strPPageCount = CLng(grs("P_PAGECOUNT"))
strPTMail = grs("P_T_MAIL")
strPWMail = grs("P_W_MAIL")
strPTAuthor = grs("P_T_AUTHOR")
strPTReplyTo = grs("P_T_REPLYTO")
strPTMessage = grs("P_T_MESSAGE")
strPWelcome = grs("P_MESSAGE")
strPModeration = grs("P_MODERATION")
strPAntispam = grs("P_ANTISPAM")
grs.Close
Set grs = Nothing
strSql = "SELECT COUNT(P_ID) AS P_COUNT FROM " & strMemberTablePrefix & "PETITION WHERE P_MODERATED = 0"
Set countrs = my_conn.execute(strsql)
If Not countrs.EOF Then
intPCount = countrs("P_COUNT")
Else
intPCount = 0
End If
countrs.Close
Set countrs = Nothing
'##### Added to prevent same email address and name to sign the petition #####
'## Forum_SQL
strSql = "SELECT P_NAME FROM " & strMemberTablePrefix & "PETITION "
strSql = strSql & " WHERE P_NAME = '" & ChkString(Trim(Request.Form("Name")), "SQLString") &"'"
set rs = my_Conn.Execute (strSql)
if rs.BOF and rs.EOF then
'## Do Nothing
else
Err_Msg = Err_Msg & "<li>This name has already signed the petition.</li>"
end if
rs.close
set rs = nothing
'## Forum_SQL
strSql = "SELECT P_EMAIL FROM " & strMemberTablePrefix & "PETITION "
strSql = strSql & " WHERE P_EMAIL = '" & Trim(chkString(Request.Form("Email"),"SQLString")) &"'"
set rs = my_Conn.Execute(TopSQL(strSql,1))
if rs.BOF and rs.EOF then
'## Do Nothing
else
Err_Msg = Err_Msg & "<li>This email address has already been used to sign the petition.</li>"
end if
set rs = nothing
'##### Above added to prevent same email address and name to sign the petition #####
strAction = Request.Querystring("action")
If strAction = "" Then
strAction = "view"
End If
strMethod = Request.QueryString("method")
If strMethod = "approve" Then
strSortPaging = "&method=approve"
Else
strSortPaging = ""
End If
strSortMethod = Request.Querystring("sortby")
If strSortMethod = "" Then
strSortMethod = "DESC"
End If
If Not IsNumeric(Request.Querystring("page")) or Request.QueryString("page") = "" Then
intPage = 1
Else
intPage = CLng(Request.QueryString("page"))
End If
Response.Write " <script language=""JavaScript"" type=""text/javascript"">" & vbNewLine & _
" function ChangePage(fnum){" & vbNewLine & _
" if (fnum == 1) {" & vbNewLine & _
" document.PageNum1.submit();" & vbNewLine & _
" }" & vbNewLine & _
" else {" & vbNewLine & _
" document.PageNum2.submit();" & vbNewLine & _
" }" & vbNewLine & _
" }" & vbNewLine & _
" </script>" & vbNewLine
If strAction <> "sign_info" Then
Response.Write " <table width=""100%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " Petition</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <table border=""1"" width=""60%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ colspan=""2"" class=""header""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><center><b>"&strForumTitle&" Petition</b></center></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """ colspan=""2"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" " & formatStr(strPWelcome) & "" & vbNewLine
Select Case intPCount
Case 0
Response.Write " <b><br><br>There are no signatures yet. Be the first one to sign this Petition!</b>" & vbNewLine
Case 1
Response.Write " <b><br><br>There is 1 signature.</b>" & vbNewLine
Case Else
Response.Write " <b><br><br>There are " & intPCount & " signatures.</b>" & vbNewLine
End Select
If mLev = 4 Then
strSql = "SELECT COUNT(P_ID) AS P_COUNT FROM " & strMemberTablePrefix & "PETITION WHERE P_MODERATED = 1"
Set countrs = my_conn.execute(strsql)
If Not countrs.EOF Then
intPUnmoderatedCount = countrs("P_COUNT")
Else
intPUnmoderatedCount = 0
End If
countrs.Close
Set countrs = Nothing
Select Case intPUnmoderatedCount
Case 0
Response.Write ""
Case 1
Response.Write " <a href=""petition.asp?action=view&method=approve"">(1 signature awaiting approval)</a>"
Case Else
Response.Write " <a href=""petition.asp?action=view&method=approve"">(" & intPUnmoderatedCount & " entries awaiting approval)</a>"
End Select
End If
Response.Write " <br /><br /><a href=""petition.asp?action=sign"">Sign it</a> | <a href=""petition.asp?action=view"">View it</a><br />" & vbNewLine &_
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine
End If
Select Case strAction
'#####################################################################################################
'### VIEW PETITION / MAIN PAGE ###
'######################################
Case "view"
If intPCount > 0 Or (mLev = 4 And intPUnmoderatedCount > 0) Then
If strMethod = "approve" And mLev = 4 Then
strsql = "SELECT P_ID, P_NAME, P_EMAIL, P_MESSAGE, P_DATE, P_VARFIELD1, P_VARFIELD2, P_VARFIELD3, P_IP FROM " & strTablePrefix & "PETITION WHERE P_MODERATED = 1 ORDER BY P_ID " & strSortMethod
Else
strsql = "SELECT P_ID, P_NAME, P_EMAIL, P_MESSAGE, P_DATE, P_VARFIELD1, P_VARFIELD2, P_VARFIELD3, P_IP FROM " & strTablePrefix & "PETITION WHERE P_MODERATED = 0 ORDER BY P_ID " & strSortMethod
End If
Set grs = Server.CreateObject("ADODB.Recordset")
grs.CursorLocation = 3
grs.CursorType = 3
grs.Open strsql, my_Conn
if not grs.BOF and not grs.EOF then
grs.PageSize = strPPageCount
grs.CacheSize = grs.PageSize
strGTotalPages = grs.PageCount
grs.absolutepage = intPage
rec = 0
intPNum=intPCount-(intPage-1)*strPPageCount
If strGTotalPages > 1 Then
Response.Write " <table border=""1"" width=""60%"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2"" align=""right"" valign=""bottom"">" & vbNewLine & _
" <table border=""0"" align=""right"">" & vbNewLine & _
" <tr>" & vbNewLine
Call DropDownPaging(1)
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
End If
Response.Write " <table border=""1"" width=""60%"" cellspacing=""0"" cellpadding=""0"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""left"" colspan=""2"" class=""header""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>" & vbNewLine
If strMethod = "approve" And mLev = 4 Then
Response.Write " <table border=""0"" cellspacing=""0"" cellpadding=""0"" width=""100%""><tr><td width=""50%"" align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Signatures Awaiting Approval</b></font></td>" & vbNewLine & _
" <td width=""50%"" align=""right""><a href=""admin_petition.asp?action=approveall"" title=""Approve All Unapproved Entries""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Approve All</font></a>" & vbNewLine & _
" <a href=""admin_petition.asp?action=deleteall"" title=""Delete All Unapproved Entries""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Delete All</font></a></td></tr></table>" & vbNewLine
Else
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """><b>Signatures</b></font>" & vbNewLine
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
do until rec = grs.PageSize or grs.eof
strTempID = grs("P_ID")
strTempName = grs("P_NAME")
strTempEmail = grs("P_EMAIL")
strTempMessage = grs("P_MESSAGE")
strTempDate = grs("P_DATE")
If grs("P_VARFIELD1") <> "" and strPField1E = 1 Then
strTempField1 = grs("P_VARFIELD1")
Else
strTempField1 = ""
End If
If grs("P_VARFIELD2") <> "" and strPField2E = 1 Then
strTempField2 = grs("P_VARFIELD2")
Else
strTempField2 = ""
End If
If grs("P_VARFIELD3") <> "" and strPField3E = 1 Then
strTempField3 = grs("P_VARFIELD3")
Else
strTempField3 = ""
End If
strTempIP = grs("P_IP")
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """ valign=""top"" colspan=""2"">" & vbNewLine & _
" <table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%""><tr><td align=""left"" width=""90%"">" & vbNewLine & _
" <font color=""" & strCategoryFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Signature #" & intPNum & ": Signed by</font>" & vbNewLine & _
" <font color=""" & strCategoryFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><span class=""spnMessageText"">" & ChkString(strTempName,"display") & "</span></b></font>" & vbNewLine & _
" <font color=""" & strCategoryFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>- " & chkDate(strTempDate," :",true) & "</font>" & vbNewLine
If mLev = 4 And trim(strTempEmail) <> "" Then
Response.Write " <a href=""mailto:" & strTempEmail & """ target=""_blank"">" & getCurrentIcon(strIconEmail,"Email Poster","align=""absmiddle"" hspace=""6""") & "</a>"
End If
If mLev > 2 Then
Response.Write " " & getCurrentIcon(strIconIP,strTempName & "'s IP Address: " & strTempIP & "","align=""absmiddle"" hspace=""6""") & vbNewLine & _
" <a href=""admin_petition.asp?action=edit&id=" & strTempID & """ title=""Edit this Signature"">" & getCurrentIcon(strIconEditTopic,"Edit this Signature","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine & _
" <a href=""admin_petition.asp?action=delete&id=" & strTempID & """ title=""Delete This Signature"">" & getCurrentIcon(strIconDeleteReply,"Delete this Signature","align=""absmiddle"" hspace=""6""")& "</a>" & vbNewLine
End If
If strMethod = "approve" And mLev = 4 Then
Response.Write " <a href=""admin_petition.asp?action=approve&id=" & strTempID & """ title=""Approve This Signature"">" & getCurrentIcon(strIconFolderModerate,"Approve This Signature","align=""absmiddle"" hspace=""6""")& "</a>" & vbNewLine
End If
Response.Write " </td><td width=""10%"" align=""right"">" & vbNewLine & _
" <a href=""#top"">" & getCurrentIcon(strIconGoUp,"Go To Top Of Page","align=""right""") & "</a>" & vbNewLine & _
" </td></tr></table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine
If trim(strTempField1) <> "" or trim(strTempField2) <> "" or trim(strTempField3) <> "" Then
Response.Write " <td bgcolor=""" & strForumCellColor & """ width=""15%"" nowrap valign=""top"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine
If trim(strTempField1) <> "" Then
Response.Write " <b>" & strPField1 & ":</b> " & strTempField1 & "<br />" & vbNewLine
End If
If trim(strTempField2) <> "" Then
Response.Write " <b>" & strPField2 & ":</b> " & strTempField2 & "<br />" & vbNewLine
End If
If trim(strTempField3) <> "" Then
Response.Write " <b>" & strPField3 & ":</b> " & strTempField3 & "<br />" & vbNewLine
End If
Response.Write " </font>" & vbNewLine & _
" </td>" & vbNewLine
End If
Response.Write " <td bgcolor=""" & strForumCellColor & """ valign=""top"" align=""left"""
If trim(strTempField1) = "" and trim(strTempField2) = "" and trim(strTempField3) = "" Then
Response.Write " width=""100%"" colspan=""2"">" & vbNewLine
Else
Response.Write " width=""85%"">" & vbNewLine
End If
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" " & formatStr(strTempMessage) & "</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
grs.MoveNext
rec = rec + 1
intPNum = intPNum - 1
Loop
grs.Close
Set grs = Nothing
end if
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""left"" colspan=""2"">" & vbNewLine & _
" <table border=""0"" width=""100%"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td> </td>" & vbNewLine
Call SortSelect()
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
If strGTotalPages > 1 Then
Response.Write " <table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td colspan=""2"">" & vbNewLine & _
" <table border=""0"" align=""left"">" & vbNewLine & _
" <tr>" & vbNewLine
Call DropDownPaging(2)
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine
End If
Response.Write " <br />" & vbNewLine
End If
'#####################################################################################################
'### SIGN PETITION ###
'##########################
Case "sign"
Response.Write " <table border=""0"" width=""60%"" cellspacing=""0"" cellpadding=""1"" align=""center"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
" <table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
" <script language=""JavaScript"" type=""text/javascript"" src=""inc_code.js""></script>" & vbNewLine & _
" <form method=""post"" action=""petition.asp?action=sign_info"" name=""PostTopic"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strCategoryCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><center><b>Sign the Petition</b></center></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>Your First & Last Name:</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <input type=""text"" name=""name"" maxlength=""50"" size=""35"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required)</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>Your Email:</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <input type=""text"" name=""email"" maxlength=""50"" value="""" size=""35"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required but will not be made public)</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
If strPField1E = 1 Then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>" & strPField1 & ":</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <input type=""text"" name=""field1"" maxlength=""100"" value="""" size=""35"">" & vbNewLine
If strPField1Req = 1 Then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required)</font>" & vbNewLine
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
If strPField2E = 1 Then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>" & strPField2 & ":</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <input type=""text"" name=""field2"" maxlength=""100"" value="""" size=""35"">" & vbNewLine
If strPField2Req = 1 Then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required)</font>" & vbNewLine
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
If strPField3E = 1 Then
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>" & strPField3 & ":</b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <input type=""text"" name=""field3"" maxlength=""100"" value="""" size=""35"">" & vbNewLine
If strPField3Req = 1 Then
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required)</font>" & vbNewLine
End If
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
%>
<!--#include file="inc_post_buttons_basic.asp""-->
<%
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""right"" width=""30%"" valign=""top"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <b>Message:</b><br /><br />" & vbNewLine & _
" <table border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
If strAllowHTML = "1" Then
Response.Write " * HTML is ON<br />" & vbNewLine
Else
Response.Write " * HTML is OFF<br />" & vbNewLine
End If
If strAllowForumCode = "1" Then
Response.Write " * <a href=""JavaScript:openWindow6('pop_forum_code.asp')"" tabindex=""-1"">Forum Code</a> is ON<br />" & vbNewLine
Else
Response.Write " * Forum Code is OFF<br />" & vbNewLine
End if
If strIcons = "1" and strShowSmiliesTable = "1" Then
' <!--#INCLUDE FILE="inc_smilies.asp" -->
End If
Response.Write " </font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""left"" width=""70%"">" & vbNewLine & _
" <textarea id=""ta1"" class=""textarea"" cols=""70"" name=""Message"" rows=""11"" wrap=""VIRTUAL"" onselect=""storeCaret(this);"" onclick=""storeCaret(this);"" onkeyup=""storeCaret(this);"" onchange=""storeCaret(this);""></textarea>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
If strPAntispam = 1 Then
HowManyNbr = 6
NumbersToShow = ""
Randomize
For I = 1 to HowManyNbr
NumbersToShow = NumbersToShow & Fix(9*Rnd)
Next
RandomizedCode = NumbersToShow * 50000 - 17456
NullStop = False
Response.Write " <tr>" & vbNewLine & _
" <td valign=""top"" align=""center"" colspan=""2"" bgcolor=""" & strCategoryCellColor & """>" & vbNewLine & _
" <b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """>Anti SPAM Confirmation</font></b>" & vbNewLine & _
" </td>"& vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td align=""center"" bgColor=""" & strPopUpTableColor & """ colspan=""2"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>As an additional security measure, please enter the 6 digit code shown below.</b></font>" & vbNewLine & _
" </td>"& vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"">" & vbNewLine
For I = 1 to HowManyNbr
Response.Write " <img src=""petition.asp?code=image&rc=" & RandomizedCode &"&p=" & I & """ border=""0"" alt=""Code"" width=""8"" height=""12"">"& vbNewLine
Next
Response.Write " <input type=""hidden"" name=""regid"" value="""& RandomizedCode &""">" & vbNewLine & _
" </td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
" <input type=""text"" size=""7"" maxlength=""6"" name=""P_code"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strDefaultFontColor & """>(required)</font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine
End If
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strPopUpTableColor & """ align=""center"" colspan=""2"">" & vbNewLine & _
" <input name=""Submit"" type=""submit"" value=""Sign Petition"">" & vbNewLine & _
" <input name=""Preview"" type=""button"" value="" Preview "" onclick=""OpenPreview()""><span id=""spell_container""></span><SCRIPT type=""text/javascript""> var googie1 = new GoogieSpell(""googiespell/"", ""./googiespell/googie.asp?lang=""); googie1.setSpellContainer(""spell_container""); googie1.decorateTextarea(""ta1"");</SCRIPT>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </form>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <br />" & vbNewLine
Case "sign_info"
strFormName = ChkString(Request.Form("name"), "SQLString")
strFormEmail = ChkString(Request.Form("email"), "SQLString")
strFormDate = DateToStr(strForumTimeAdjust)
strFormMessage = ChkString(Request.Form("message"), "message")
strFormField1 = ChkString(Request.Form("field1"),"SQLString")
strFormField2 = ChkString(Request.Form("field2"),"SQLString")
strFormField3 = ChkString(Request.Form("field3"),"SQLString")
strFormIP = Request.ServerVariables("REMOTE_ADDR")
If strFormField1 = "" Then
strFormField1 = " "
End If
If strFormField2 = "" Then
strFormField2 = " "
End If
If strFormField3 = "" Then
strFormField3 = " "
End If
If Request.Form("name") = "" Then
Err_Msg = Err_Msg & "<li>Please enter your name</li>" & vbNewLine
End If
If Request.Form("email") = "" Then
Err_Msg = Err_Msg & "<li>Please enter your email address</li>" & vbNewLine
End If
' If Request.Form("message") = "" Then
' Err_Msg = Err_Msg & "<li>Please enter a message</li>" & vbNewLine
' End if
If strPField1Req = 1 and trim(strFormField1) = "" Then
Err_Msg = Err_Msg & "<li>Please enter your " & strPField1 & "</li>" & vbNewLine
End If
If strPField2Req = 1 and trim(strFormField2) = "" Then
Err_Msg = Err_Msg & "<li>Please enter your " & strPField2 & "</li>" & vbNewLine
End If
If strPField3Req = 1 and trim(strFormField3) = "" Then
Err_Msg = Err_Msg & "<li>Please enter your " & strPField3 & "</li>" & vbNewLine
End If
If strPAntispam = 1 Then
RandCode = Request.Form("P_code")
strRCCode = Request.Form("regid")
RandCode2 = (strRCCode + 17456) / 50000
lenCode = Len(RandCode2)
NullStop = False
If LenCode < 6 and Nullstop = False then
For J = 1 to (6 - LenCode)
NullRC = NullRC & "0"
Next
NullStop = True
End If
RandCode2 = NullRC & RandCode2
If RandCode <> RandCode2 then
Err_Msg = Err_Msg & "<li>You did not enter the confirmation code or it is incorrect!</li>"
End If
End If
If Err_Msg <> "" Then
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHiLiteFontColor & """>There Was A Problem With Your Details</font></p>" & vbNewLine & _
" <table align=""center"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """><ul>" & Err_Msg & "</ul></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""JavaScript:history.go(-1)"">Go Back To Enter Data</a></font></p>" & vbNewLine
WriteFooter
Response.End
Else
strsql = "INSERT INTO " & strTablePrefix & "PETITION (P_NAME, P_EMAIL, P_MESSAGE, P_DATE, P_VARFIELD1, P_VARFIELD2, P_VARFIELD3, P_IP, P_MODERATED)"
strsql = strsql & " VALUES('" & strFormName & "', '" & strFormEmail & "', '" & strFormMessage & "', '" & strFormDate & "', '" & strFormField1 & "', '" & strFormField2 & "', '" & strFormField3 & "', '" & strFormIP & "', " & strPModeration & ")"
my_conn.execute(strsql),,adCmdText + adExecuteNoRecords
If strEmail = "1" Then
'### SEND THANK YOU EMAIL
If strPTMail = 1 and strPModeration = 0 Then
strRecipientsName = strFormName
strRecipients = strFormEmail
strFrom = strPTReplyTo
strFromName = strPTAuthor
strSubject = "Thank you for signing the "&strForumTitle&" Petition"
strMessage = strPTMessage
strSender = strFrom
%>
<!--#include file="inc_mail.asp" -->
<%
End If
'### NOTIFY ADMIN
If strPWMail = 1 Then
strRecipientsName = strPTAuthor
strRecipients = strPTReplyTo
strFrom = strFormEmail
strFromName = strFormName
strSubject = "New Signature in your Petition"
strMessage = strFormName & " has signed your petition located at " & strForumURL & "."
strSender = strFrom
%>
<!--#include file="inc_mail.asp" -->
<%
End If
End If
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Your Signature Has Been Added To The Petition!</font></p>" & vbNewLine
If strPModeration = 1 Then
Response.Write " <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>It will appear once approved by the administrator.</font></p>" & vbNewLine
End If
Response.Write " <meta http-equiv=""Refresh"" content=""30; URL=petition.asp"">" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """>Thank You!</font></p>" & vbNewLine & _
" <p align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><a href=""petition.asp"">Back To Petition</font></a></p><br />" & vbNewLine
End if
End Select
Sub SortSelect()
Response.Write " <form name=""sortmethod"" method=""get"" action=""petition.asp"">" & vbNewLine & _
" <input type=""hidden"" name=""action"" value=""view"">" & vbNewLine & _
" <input type=""hidden"" name=""method"" value=""" & strMethod & """>" & vbNewLine & _
" <td align=""right"" colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strHeadFontColor & """>" & vbNewLine & _
" <input type=""hidden"" name=""page"" value=""" & Request.querystring("page") & """>" & vbNewLine & _
" <b>Sort by: " & vbNewLine & _
" <select name=""sortby"" onChange=""document.sortmethod.submit();"" style=""font-size:10px;"">" & vbNewLine & _
" <option value=""DESC"" " & chkSelect("DESC", strSortMethod) & "> Last Post First</option>" & vbNewLine & _
" <option value=""ASC"" " & chkSelect("ASC", strSortMethod) & "> First Post First</option>" & vbNewLine & _
" </select></b></font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </form>" & vbNewLine
End Sub
sub DropDownPaging(fnum)
Response.Write " <form name=""PageNum" & fnum & """ action=""petition.asp"">" & vbNewLine & _
" <input type=""hidden"" name=""action"" value=""view"">" & vbNewLine & _
" <input type=""hidden"" name=""method"" value=""" & strMethod & """>" & vbNewLine & _
" <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """>" & vbNewLine & _
" <input name=""sortby"" type=""hidden"" value=""" & strSortMethod & """>" & vbNewLine & _
" <b>Page: <select name=""page"" size=""1"" onchange=""ChangePage(" & fnum & ");"">" & vbNewLine
for counter = 1 to strGTotalPages
if counter <> intPage then
Response.Write " <option value=""" & counter & """>" & counter & "</option>" & vbNewLine
else
Response.Write " <option selected value=""" & counter & """>" & counter & "</option>" & vbNewLine
end if
next
Response.Write " </select> of " & strGTotalPages & "</b>" & vbNewLine & _
" </font></td>" & vbNewLine & _
" </form>" & vbNewLine
end sub
WriteFooter()
%>
|
Edited by - Carefree on 30 July 2008 01:28:26 |
|
|
Topic |
|
|
|