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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Problem integrating Poll Mod with Portal Mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

StephenD
Senior Member

Australia
1044 Posts

Posted - 18 June 2003 :  20:43:34  Show Profile  Send StephenD a Yahoo! Message
My problem is this, I have included inc_poll.asp on portal.asp where I want it and it is visible OK. Only, hitting the vote or view buttons does nothing. My portal page is in the same directory as the forum and I've added the javascript to it's own inc_header.

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 19 June 2003 :  07:49:45  Show Profile
A link to your forum?

Support Snitz Forums
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 19 June 2003 :  14:45:06  Show Profile  Send StephenD a Yahoo! Message
URL for test forum sent by email.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 21 June 2003 :  11:05:09  Show Profile
Well, I tested a new featured poll on your site. Clicking any of the poll buttons (view results or vote) takes me to search.asp. The poll mod javascript code submits the form called 'Poll'. But your search form doesn't have a form name. I am thinking it cannot find a form called 'Poll' so it submits the form that has no name (ie. your search form). So give your search form a name. And any form that doesn't have a name, give it a name.

You have 2 other forms (apart from your search form) called 'form1' and 'form2'. These have ID tags that has the same name as the form name. I would suggest you add an ID tag to the poll form:
<form method="POST" action="topic.asp?TOPIC_ID=3473" id="Poll" name="Poll">
You should be able to find the form tags in the inc_poll.asp file.

Let me know if it works for you.

Support Snitz Forums
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 21 June 2003 :  22:43:03  Show Profile  Send StephenD a Yahoo! Message
Hi Davio

Here is my modified line 145 from inc_poll.asp
	Response.Write "		<form method=""POST"" action=""topic.asp?TOPIC_ID=" & pTopic_id & id="Poll" & """ name=""Poll"">" & vbNewline


This still doesn't seem to work. Here are the modified form sections from portal.asp :
sub DisplaySearch(byval Width)

	call StartTable(Width, "Portal Search")
	
	Response.Write "			<form method=""post"" action="""& sThisPage &""" onSubmit=""if (this.txtSearch.value != ''){return true}else{return false}"" id=Pform1 name=Pform1>" &vbCrLf &_
			"			<input type=""hidden"" name=""Method_Type"" value=""Search"">" &vbCrLf &_
			"			<input type=""text"" name=""txtSearch"" style=""width:100%"" maxlength=""50""><br>" &vbCrLf &_
			"			<input type=""submit"" name=""btnSubmit"" value=""Search"">" &vbCrLf &_		
			"			</form>" &vbCrLf
	Response.Write	"          	<a href=""websearch.asp" & """>" & getCurrentIcon(strIconUrl,"Web Search","align=""absmiddle""") & "</a> <a href=""websearch.asp" & """>Websearch</a><br />" & vbNewLine
	                        
	call EndTable()				

end sub


sub DisplayForumSearch(byval Width)

	call StartTable(Width, "Forum Search")
	
	Response.Write "			<form method=""post"" action=""search.asp?mode=DoIt"">" &vbCrLf &_
			"			<option type=""hidden"" name=""SearchMessage"" value=""0"">" &vbCrLf &_
			"			<option type=""hidden"" name=""Forum"" value=""0"">" &vbCrLf &_
			"			<option type=""hidden"" name=""andor"" value=""1"">" &vbCrLf &_
			"			<option type=""hidden"" name=""SearchMember"" value=""0"">" &vbCrLf &_
			"			Search For<br><input type=""text"" name=""Search"" style=""width:100%"" maxlength=""40""><br>" &vbCrLf &_
			"	        By Date<br><select name=""SearchDate"" style=""width:100%"">" & vbNewLine & _
			"			<option value=""0"">Any Date</option>" & vbNewLine & _
			"			<option value=""1"">Since Yesterday</option>" & vbNewLine & _
			"			<option value=""2"">Since 2 Days Ago</option>" & vbNewLine & _
			"			<option value=""5"">Since 5 Days Ago</option>" & vbNewLine & _
			"			<option value=""7"">Since 7 Days Ago</option>" & vbNewLine & _
			"			<option value=""14"">Since 14 Days Ago</option>" & vbNewLine & _
			"			<option value=""30"">Since 30 Days Ago</option>" & vbNewLine & _
			"			<option value=""60"">Since 60 Days Ago</option>" & vbNewLine & _
			"			<option value=""120"">Since 120 Days Ago</option>" & vbNewLine & _
			"			<option value=""365"">In the Last Year</option>" & vbNewLine & _
			"			</select><br>" & vbNewLine & _
			"			<input type=""submit"" name=""btnSubmit"" value=""Search""><br>" &vbCrLf &_		
			"			<a href=""search.asp"">more options</a><br>" &vbCrLf

	call EndTable()	

end sub


The form1 and form2 tags came from inc_login.asp which I have modified below:

fName = strDBNTFUserName
fPassword = ChkString(Request.Form("Password"), "SQLString")


Response.Write	"      <table width=""150"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"" bgcolor=""" & strHeadCellColor & """>" & vbNewLine & _
		"			<tr>" & vbNewLine & _
		"				<td valign=""top"" width=""150"">" & vbNewLine & _
		"				<table table width=""100%"" border=""0"" cellspacing=""1"" cellpadding=""4"" align=""center"">" & vbNewLine & _
		"				<tr>" & vbNewLine & _
		"					<td valign=""top"" align=""center"" bgcolor=""" & strCategoryCellColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Merchant Login</font></b></td>" & vbNewLine & _
		"				</tr>" & vbNewLine & _
		"				<tr>" & vbNewLine & _
		"					<td bgcolor=""" & strForumCellColor & """ valign=""top"">" & vbNewLine & _
		"					 <table border=""0"" cellpadding=""6"" cellspacing=""0"" width=""90%"" align=""center"">" & vbNewLine & _
		"						<tr valign=""top"">" & vbNewLine & _
		"						<td valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine
		
if (mlev = 0) then		
if RequestMethod = "POST" and strLoginStatus = 0 then Response.Write("                      <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHiLiteFontColor & """>Your username and/or password was incorrect.</font><br />" & vbNewLine)
Response.Write "							<form action=""" & Request.ServerVariables("URL") & """ method=""post"" id=""Login1"" name=""Login1"">" & vbNewLine & _
		"							<input type=""hidden"" name=""Method_Type"" value=""login"">" & vbNewLine & _		
		"                            <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
		"                            Username:<br />" & vbNewLine & _
		"                            <input type=""text"" name=""Name"" size=""14"" maxLength=""25"" tabindex=""1"" value="""" style=""width:100px;"">" & vbNewLine & _
		"                            <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
        "                          </td></tr>" & vbNewLine & _
		"                          <tr>" & vbNewLine & _
		"                            <td valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
		"                            Password:<br />" & vbNewLine & _
		"                            <input type=""password"" name=""Password"" size=""14"" tabindex=""2"" maxLength=""25"" value="""" style=""width:100px;"">" & vbNewLine
		if strGfxButtons = "1" then
	Response.Write	"                            <input src=""" & strImageUrl & "button_login.gif"" type=""image"" border=""0"" value=""Login"" id=""submit1"" name=""submit1"" tabindex=""3""></font>" & vbNewLine
else
	Response.Write	"                            <input class=""button"" type=""submit"" value=""Login"" id=""submit1"" name=""submit1"" tabindex=""3""></font>" & vbNewLine
end if 
Response.Write "                       </td>" & vbNewLine & _
		"                          </tr>" & vbNewLine & _
		"                          <tr>" & vbNewLine & _
		"                            <td><font face=""" & strDefaultFontFace & """ size=-3""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
		"                            <input type=""checkbox"" name=""SavePassWord"" tabindex=""4"" value=""true"" checked> Save Password</font></td>" & vbNewLine & _
			"                          </tr>" & vbNewLine & _
		"                      <tr>" & vbNewLine & _
		"                      <script language=""JavaScript"" type=""text/javascript"">document.Login1.Name.focus();</script>" & vbNewLine & _
		"                      <td><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><br /><b>Login Questions:</b><br />" & vbNewLine & _
		"                      <span style=""font-size: 6px;""><br /></span>" & vbNewLine & _
		"                      <acronym title=""Do I have to register?""><span class=""spnMessageText""><a href=""" & strForumURL & "faq.asp#register""" & dWStatus("Do I have to register?") & ">Do I have to register?</a></span></acronym><br />" & vbNewLine
		
if strEmail = "1" then Response.Write("                      <acronym title=""Choose a new password if you have forgotten your current one.""><span class=""spnMessageText""><a href=""" & strForumURL & "password.asp""" & dWStatus("Choose a new password if you have forgotten your current one.") & ">Forgot your Password?</a></span></acronym><br /><br />" & vbNewLine) else Response.Write("                      <br />" & vbNewLine)
Response.Write	"                      Not a Merchant?<br />"

if strProhibitNewMembers = "1" then
	Response.Write	"<font size=""" & strFooterFontSize & """ color=""" & strHiLiteFontColor & """>Only registered Merchants are able to log in</font></font></td>" & vbNewLine
else
end if


' new code################################################## </td> line under this new
else
	Response.Write	"        <form action=""" & Request.ServerVariables("URL") & """ method=""post"" id=""login2"" name=""login2"">" & vbNewLine & _
			"        <input type=""hidden"" name=""Method_Type"" value=""logout"">" & vbNewLine & _
			"        <tr>" & vbNewLine & _
			"          <td align=""center"">" & vbNewLine & _
			"			<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Welcome Back!<br />"
	if strAuthType="nt" then
		Response.Write	"<b>" & Session(strCookieURL & "username") & " (" & Session(strCookieURL & "userid") & ")</b></font>" & vbNewLine
	else 
		if strAuthType = "db" then 
			Response.Write	"<b>" & ChkString(strDBNTUserName, "display") & "</b></font></td>" & vbNewLine
			if strGfxButtons = "1" then
				Response.Write	"<input src=""" & strImageUrl & "button_logout.gif"" type=""image"" border=""0"" value=""Logout"" id=""submit1"" name=""Logout"" tabindex=""-1"">"
			else
				Response.Write	"<input type=""submit"" value=""Logout"" id=""submit1"" name=""submit1"" tabindex=""-1"">"
			end if 
		end if 
	end if 
Response.Write	"          </td>" & vbNewLine & _
		"        </tr>" & vbNewLine
	if (mlev = 4) or (lcase(strNoCookies) = "1") then
		Response.Write	"        <tr>" & vbNewLine & _
				"          <td align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><a href=""" & strForumURL & "admin_home.asp""" & dWStatus("Access the Forum Admin Functions...") & " tabindex=""-1"">Admin Options</a>"
		if mLev = 4 and (strEmailVal = "1" and strRestrictReg = "1" and strEmail = "1" and User_Count > 0) then Response.Write(" | <a href=""" & strForumURL & "admin_accounts_pending.asp""" & dWStatus("(" & User_Count & ") Member(s) awaiting approval") & " tabindex=""-1"">(" & User_Count & ") Member(s) awaiting approval</a>")
Response.Write	"<br /><br /></font></td>" & vbNewLine & _
		"        </tr>" & vbNewLine
	end if
Response.Write	"        </form>" & vbNewLine
end if
Response.Write	"      </table>" & vbNewLine & _
		"    </td>" & vbNewLine & _
		"  </tr>" & vbNewLine & _
		"</table>" & vbNewLine & _
		"    </td>" & vbNewLine & _
		"        </form>" & vbNewLine & _
		"        </tr>" & vbNewLine & _
		"      </table>" & vbNewLine
%>


This still doesn't allow the poll buttons to work. What am I doing wrong here?
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 22 June 2003 :  00:37:32  Show Profile
No no. You didn't have to change anything.

There are 2 things you needed to do. Add a name for your forum search form. From the code you posted, it's in the DisplayForumSearch() sub. Here's the line you need to modify:
Response.Write "			<form method=""post"" action=""search.asp?mode=DoIt"" name=""search"" id=""search"">" &vbCrLf &_
That's it for your search form.

The second thing I need you to do was to do was add an ID tag to the poll form. This is what it should look like:
Response.Write "		<form method=""POST"" action=""topic.asp?TOPIC_ID=" & pTopic_id & """ name=""Poll"" id=""Poll"">" & vbNewline
And that's it.

Make sure you undo those changes you made before doing what I just suggested. Changing the name of the login form is gonna give you more problems.

Support Snitz Forums
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 22 June 2003 :  01:03:40  Show Profile  Send StephenD a Yahoo! Message
Davio, sorry about that ... I've undone my changes and modified those 2 lines but the poll mod buttons are still disabled.??

Here are links to text versions of inc_login, inc_poll and portal

http://www.global-e.com.au/portal.txt
http://www.global-e.com.au/inc_login.txt
http://www.global-e.com.au/inc_poll.txt


Edited by - StephenD on 22 June 2003 01:04:15
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 22 June 2003 :  18:29:44  Show Profile
I used Mozilla before to view your site. When clicking the poll buttons it takes me to the search page. I decided to use IE, in case thier might be some javascript error that Mozilla isn't reporting. And sure enough, I get a javascript error when clicking the poll buttons. It says "document.Poll.Method_Type is null or not an object. Line 44."

Line 44 is reffering to the poll mod javascript code:
function submitPoll(btnPressed) {
	btnPressed.disabled=true;
	if (btnPressed.name == "results") {
		document.Poll.Method_Type.value = "guest_vote";
	} else {
		document.Poll.Method_Type.value = "member_vote";
	}
	document.Poll.submit();
}
There is probably some small thing I am over looking but I can't find what the problem is. I'll look it over again.

Support Snitz Forums
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 22 June 2003 :  18:57:51  Show Profile  Send StephenD a Yahoo! Message
Well, it's definitely the search functions in portal.asp that are causing the conflict. If I exclude the search from the portal page in the portal management options ... the Poll Mod functions as it should.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 22 June 2003 :  19:07:30  Show Profile
That gives me somewhere to focus on. Ok, put back the search form let me take a look at the code again.

Support Snitz Forums
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 22 June 2003 :  19:23:05  Show Profile  Send StephenD a Yahoo! Message
Back on..
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07