Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 How to increase Max. Number of Poll Mod Answers?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Zenfor
Junior Member

372 Posts

Posted - 15 December 2015 :  18:16:04  Show Profile  Reply with Quote
I want to do a US president poll and there are more than 15 running right now. How can I increase the Max. number above 15? Thanks.

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 15 December 2015 :  19:43:25  Show Profile  Reply with Quote
First, you'll need to add additional fields to the forum_polls table, following the same pattern as the ANSWER15, COUNT15 currently provided. To do that, you can either manually add them, or use something like this. It's untested, but should work.

"pollchange.asp"


<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If (Session(strCookieURL & "Approval") <> "15916941253") Or (MemberID <> intAdminMemberID) Then
	scriptname = Split(Request.ServerVariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(UBound(scriptname)) & "?" & Request.ServerVariables("Query_String")
End If
If Request("Qty") > "" Then
	If IsNumeric(Request("Qty")) Then
		For i = 16 to 15 + Request("Qty")
			strSql = "ALTER TABLE " & strTablePrefix & "POLLS ADD COLUMN ANSWER" & CSTR(I) & " VARCHAR(100) NULL"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
			strSql = "ALTER TABLE " & strTablePrefix & "POLLS ADD COLUMN COUNT" & CSTR(I) & " INT NULL 0"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		Next
		Response.Write "Completed."
		WriteFooter
		Response.End
	End If
Else
	Response.Write	"<form action=""pollchange.asp"" method=""post"">" & vbNewLine & _
		"	<table align=""center"" width=""300"" border=""1"" bgColor=""" & strPageBGColor & """ cellpadding=""4"">" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td align=""right"" width=""250"" bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
		"				<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Additional Answers: </font>" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"			<td align=""center"" bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
		"				<input type=""text"" style=""width:98%; align:center; text-align:center; color:maroon; font-weight:bold;"" name=""Qty"" maxlength=""2"" />" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td style=""line-height:50%;"" bgColor=""transparent"" align=""center"" colspan=""2"">" & vbNewLine & _
		"       <input style=""color:" & strHeadFontColor & "; font-weight:bold; font-family:" & strDefaultFontFace & "; padding:3px 6px 3px 6px; border:1px solid " & strTableBorderColor & "; text-shadow:0px 1px 1px #000; font-weight:bold; text-decoration:none; border-radius:25px; -webkit-border-radius:25px; background:"&strHColor&";"" type=""Submit"" class=""button2"" name=""submit"" value=""Submit"" />" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine & _
		"	</table>" & vbNewLine & _
		"</form>" & vbNewLine
	WriteFooter
End If
%>


Look in the following files and change instances of 15 to the desired quantity:

config.asp
Dim strHidePoll, strVResults, PCount, nCount, txtAns(), vPercent(100), vAnswers(15), vCount(15)


active_polls.asp - all
admin_poll.asp - all
inc_poll.asp - all
pop_poll.asp - all
post.asp - those related to poll mod (should be seven)
topic.asp - those related to poll mod (should be twelve)

admin_poll.asp will take a bit more work, sorry. You'll need to expand the <select></select> for strMaxVotes or replace it with a input type=text.

I redid this whole thing on my modular to use a new variable in lieu of the 15 throughout. That way it can be changed in the admin page and not have to edit all the pages each time.

Edited by - Carefree on 18 December 2015 11:40:27
Go to Top of Page

Zenfor
Junior Member

372 Posts

Posted - 18 December 2015 :  08:59:11  Show Profile  Reply with Quote
Thank you!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 18 December 2015 :  10:47:08  Show Profile  Reply with Quote
You're welcome.
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 18 December 2015 :  10:54:18  Show Profile  Reply with Quote
I wrote my own poll mod years ago. I put my choices on a separate table than the questions. That way you could have as many or few choices as you wanted and their wasn't a lot of wasted space on the Poll table

The code is long gone but the choice columns probably looked something like this.

ChoiceID(auto)- PollID- ChoiceTxt- Votes

    _-/Cripto9t\-_
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07