Author |
Topic  |
DJSOUNDS
Starting Member
33 Posts |
Posted - 14 May 2003 : 03:25:07
|
I have installed Poll Mod 2.05 now (had 2.? before but upgraded to 2.05 in an attempt to fix this problem). If I create a poll with two choices, only one choice shows up when displayed. If I go in to edit that poll, choice number 1 drops down to the choice 5 slot and choice 2 is gone all together. At one time it worked fine (my last recollection was about two months ago), but I tried it recently and discovered this problem. I don't know when it happened or for how long. Here are links to my topic.asp and post.asp (I believe the problem to be here). Added post_info.txt
Links Removed
This is really strange and I've spent two days searching this forum and trying to fix the problem. I hope that someone can help me. |
Edited by - DJSOUNDS on 17 May 2003 08:06:48 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 14 May 2003 : 12:25:54
|
I need to see your post_info.asp file too.
Although this isn't related to your problem but in your post.asp file lines 1195 - 1197, you need to comment them out (by putting a single quote ' at the front of the line) or deleting them.
And you haven't updated your topic.asp file with the code from the 2.0.5 version. |
Support Snitz Forums
|
Edited by - Davio on 14 May 2003 12:31:50 |
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 14 May 2003 : 13:55:22
|
quote: Originally posted by Davio
I need to see your post_info.asp file too.
Although this isn't related to your problem but in your post.asp file lines 1195 - 1197, you need to comment them out (by putting a single quote ' at the front of the line) or deleting them.
And you haven't updated your topic.asp file with the code from the 2.0.5 version.
post_info file added above and comment out added as you suggest to forum file. Replaced topic.txt file with one from test forum.
Thanks Davio for your time on this. |
Edited by - DJSOUNDS on 14 May 2003 14:07:08 |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 01:39:46
|
Hmmm, this is a real puzzle. Your files seem fairly ok. Except for your topic.asp file which still has the old poll mod code in it. But I don't see anything in that file that would cause the behavior you are experiencing.
Can you check in your database to see that the poll answers are in the database for each poll? I want to see if: 1) the data is not properly being submitted to the database 2) or if the topic.asp file is not retrieving all of the data from the database. |
Support Snitz Forums
|
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 01:49:07
|
Updated topic.txt file with 2.0.5 changes and added it to live forum. Still no change in problem.
Used a File Compare tool to compare all asp files from Poll Mod with files from forum. Still no change. Used File Compare tool to compare "all" asp files in Forum directory with a previous backup from 3 weeks ago. Lines in all files match. Problem must have been there for a while.
Could I have a problem with the forum database itself (missing columns or column order wrong)? |
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 01:50:26
|
quote: Originally posted by Davio
Hmmm, this is a real puzzle. Your files seem fairly ok. Except for your topic.asp file which still has the old poll mod code in it. But I don't see anything in that file that would cause the behavior you are experiencing.
Can you check in your database to see that the poll answers are in the database for each poll? I want to see if: 1) the data is not properly being submitted to the database 2) or if the topic.asp file is not retrieving all of the data from the database.
You beat me posting. Ok. I'll check the table right now. |
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 01:57:24
|
quote: Originally posted by Davio
Hmmm, this is a real puzzle. Your files seem fairly ok. Except for your topic.asp file which still has the old poll mod code in it. But I don't see anything in that file that would cause the behavior you are experiencing.
Can you check in your database to see that the poll answers are in the database for each poll? I want to see if: 1) the data is not properly being submitted to the database 2) or if the topic.asp file is not retrieving all of the data from the database.
Hello Davio. The choices are dropping into the ANSWER5 field and all votes go the the COUNT5 field. Any idea? |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 02:08:17
|
Ok, update your topic.txt file with the changes you made, then I will give you some code to insert into the topic.asp file, so we can do some debugging. |
Support Snitz Forums
|
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 02:09:33
|
quote: Originally posted by Davio
Ok, update your topic.txt file with the changes you made, then I will give you some code to insert into the topic.asp file, so we can do some debugging.
I already added the updated file above. |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 02:25:00
|
Ok, after line 191 in your topic.asp file, add this bit of code:Response.Write nCount & ":" & rsPoll("ANSWER" & CStr(nCount)) & "<br>" The code looks something like this after you add it:For nCount = 1 to 15
Response.Write nCount & ":" & rsPoll("ANSWER" & CStr(nCount)) & "<br>"
'Loop through answer and count fields for the poll
'and store them in arrays This will output some data on the topic.asp page when viewing a poll. |
Support Snitz Forums
|
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 02:37:23
|
quote: Originally posted by Davio
Ok, after line 191 in your topic.asp file, add this bit of code:Response.Write nCount & ":" & rsPoll("ANSWER" & CStr(nCount)) & "<br>" The code looks something like this after you add it:For nCount = 1 to 15
Response.Write nCount & ":" & rsPoll("ANSWER" & CStr(nCount)) & "<br>"
'Loop through answer and count fields for the poll
'and store them in arrays This will output some data on the topic.asp page when viewing a poll.
Done |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 02:43:36
|
You say the poll answers are in the database?
Look in the FORUM_POLLS table. Search for TOPIC_ID 390. And tell me how many answers are there in the ANSWER fields. If you see only 1 answer in the ANSWER5 field, with the value "Beats me" and all the other answer field are blank, then we need to start looking at the post.asp and post_info.asp files. |
Support Snitz Forums
|
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 02:51:02
|
quote: Originally posted by Davio
You say the poll answers are in the database?
Look in the FORUM_POLLS table. Search for TOPIC_ID 390. And tell me how many answers are there in the ANSWER fields. If you see only 1 answer in the ANSWER5 field, with the value "Beats me" and all the other answer field are blank, then we need to start looking at the post.asp and post_info.asp files.
It's just as you said. Beats me in ANSWER5 and no answers in any other field. |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 02:56:04
|
Ok, lets move on to the post_info.asp file. After line 996 in your post_info.asp file, I want to add this bit of code:Response.Write strSql
Response.End |
Support Snitz Forums
|
 |
|
DJSOUNDS
Starting Member
33 Posts |
Posted - 15 May 2003 : 02:59:14
|
quote: Originally posted by Davio
Ok, lets move on to the post_info.asp file. After line 996 in your post_info.asp file, I want to add this bit of code:Response.Write strSql
Response.End
Done  |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 15 May 2003 : 03:12:24
|
This is what the sql query is after creating a new poll:
INSERT INTO FORUM_POLLS (CAT_ID, FORUM_ID, TOPIC_ID, P_WHOVOTES, ANSWER1, COUNT1, ANSWER2, COUNT2, ANSWER3, COUNT3, ANSWER4, COUNT4, ANSWER5, COUNT5, ANSWER6, COUNT6, ANSWER7, COUNT7, ANSWER8, COUNT8) VALUES (3, 21, 393, 'everyone', '', 0, '', 0, '', 0, '', 0, 'yep', 0, '', 0, '', 0, '', 0)
As you can see, it is only submitting the 5th answer. The other answers are blank, although I entered something in them.
We are getting somewhere. Starting at line 841, you will find this bit of code:if Request.Form("poll") = "1" then
ReDim txtAns(strMaxVotes)
for i = 1 to strMaxVotes
if trim(Request.Form("answer" & CStr(i))) <> "" then
txtAns(i) = chkString(Request.Form("answer" & CStr(i)),"SQLString")
Response.Write i & ":" & chkString(Request.Form("answer" & CStr(i)),"SQLString") & "<br>"
else
txtAns(i) = ""
end if
next
end if Add the code in red. This is still in the post_info.asp file. |
Support Snitz Forums
|
Edited by - Davio on 15 May 2003 03:13:39 |
 |
|
Topic  |
|