Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Poll Plugin

(Page 3 of 5)
> > > >
Quote Reply
Re: [HeavyBombers] Poll Plugin In reply to
The installer is fixed now, everything should be fine. If you have previously installed the plugin, please uninstall it (no data will be lost), delete it completely from the system, and install the latest version.

All this confusion is due to me including some new features in the last minute before releasing it...

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Poll Plugin In reply to
Votes made from threaded mode aren't counting, at least in my forums. Any idea why?

Edit: I just tested a vote in threaded mode in your test forums and it doesn't work either.


Realiiity.com Forums

Last edited by:

ellipsiiis: Apr 28, 2002, 4:21 PM
Quote Reply
Re: [ellipsiiis] Poll Plugin In reply to
This was a bug (the poll_type template tag was not correctly set).

I fixed it, you can download the latest version from the server.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Poll Plugin In reply to
Uninstalled, downloaded and reinstalled, still doesn't work.


Realiiity.com Forums
Quote Reply
Re: [ellipsiiis] Poll Plugin In reply to
It now works on my testforum...

Can you try making a "multiple choice poll" and the vote in threaded view?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Poll Plugin In reply to
Whoops, I thought I had turned the cgi caching off on my server but I hadn't-- it seems to be working. Thanks Blush


Realiiity.com Forums
Quote Reply
New Version - 1.0.1 In reply to
I have just put a new version of the plugin (1.0.1) on the server. It seems that the "poll_ssi" function was broken with version 1.1.5 of GForum. The new version fixes that, as well as some other minor things.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Hi Ivan,



Will the latest version allow images rather than just text as a voting item?

Example: 4 pictures of baseball bats. Each different in type. To vote you would select the vote button next to the image you like.

As well, did you allow the number of voters and/or the percentage of voters to be turned off in the poll plugin?



Thanks in advance
Quote Reply
Re: [Teambldr] New Version - 1.0.1 In reply to
Hi

1. No, images are not possible yet. I'll add it to the to do list for a future version. One could do a quick hack (to display images if the poll options are of the form "Image-http://www.foo.com/bar.gif").

2. Can be done in the templates.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Thanks Ivan



Nice plugin!
Quote Reply
Re: [Teambldr] New Version - 1.0.1 In reply to
Ok GF1.1.5 user so -> uninstalled Poll 1.0, and reinstalled 1.0.1

1) I can click NEW POLL and get the poll options

2) One can fill in the options and click POST

3) When you go to view the message, it looks like a normal post with no poll info or options.

Is this cgi-caching? I do not have a dedicated server, so how would/could I disable it?


I have also verified that all the appropriate tags were modified that it calls for as well.

post_view_flat.html

post_view_printable.html

post_view_threaded.html

include_post_common_write.html

include_post_html_common_write.html

all have been modified correctly.

I see the options when I click VIEW THREADED... I do not see the poll in either post_view_flat.html or post_view_printable.html

Just in case I moved the tags around in the template - but to no avail. SO I moved them back.

As another part of the debugging process, I created a new poll and put votes in there to see if that would make a difference - no... Still only see in threaded view

One interesting note: For polls that were created prior to the upgrade, I see those just fine in all views... To me - that suggests that the templates are ok and for some reason, the new polls are not getting submitted properly.

Last edited by:

shiner: May 31, 2002, 5:30 PM
Post deleted by shiner In reply to
Quote Reply
Re: [shiner] New Version - 1.0.1 In reply to
I cannot reproduce the error you got: I upgraded a forum 1.1.4 (with plugin 1.0.0 installed) to 1.1.5, installed the new version of the plugin, and everything went fine.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Yogi,

I briefly took the if statements out of post_view_flat so the statement looked like this:

<tr>
<td colspan="2">
<%include include_poll_view.html%>
<%include include_poll_results.html%>
</td>
</tr>

Surprisingly - this was the output:

Poll: Unknown Tag: 'poll_question'
View Results (Unknown Tag: 'poll_votes' votes)

Poll: Unknown Tag: 'poll_question'
Unknown Tag: 'poll_votes' total votes

SO... where would the disconnect be? It has something to do with FLAT VIEW. Once that is resolved, the PRINT VIEW part should correct itself because it is based on the FLAT VIEW.

The biggest hang up is that I can see poll data in any view if the poll was created in 1.1.4!
Quote Reply
Re: [shiner] New Version - 1.0.1 In reply to
Can you please add the following line at the end of post_view_flat.html for testing purposes:

<%GT::Template::dump%>

and then look what it says for poll_view and poll_results.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Yogi,

They simply are not there....

The only variables that are listed containing POLL are:

post_is_poll and root_post_is_poll

Should this be 0?

'post_id' => '883',
'user_perm_edit' => '1',
'post_locked' => '0',
'post_is_poll' => '0',


However, in the threaded view... all of these are listed

current_user_poll_permission
poll 1 poll_answer_answer poll_answer_id poll_answer_percentage poll_answer_votes poll_enabled 1 poll_id 15 poll_id_fk poll_loop $VAR = [
{
'post_id_fk' => '883',
'poll_answer_id' => '47',
'poll_answer_percentage' => '0',
'poll_id_fk' => '15',
'poll_answer_answer' => 'oen',
'poll_answer_votes' => '0'
},
{
'post_id_fk' => '883',
'poll_answer_id' => '48',
'poll_answer_percentage' => '0',
'poll_id_fk' => '15',
'poll_answer_answer' => 'tewo',
'poll_answer_votes' => '0'
},
{
'post_id_fk' => '883',
'poll_answer_id' => '49',
'poll_answer_percentage' => '0',
'poll_id_fk' => '15',
'poll_answer_answer' => 'hor',
'poll_answer_votes' => '0'
}
];
poll_question test eotpsg poll_type 0 poll_view 1 poll_votes 0
post_is_poll
user_poll_permission

Quote Reply
Re: [shiner] New Version - 1.0.1 In reply to
In flat view, root_post_is_poll should be 1 for polls, post_is_poll can be empty (or zero).

Can you edit Poll.pm (add the red things), and tell me what happens when you add a new poll:

Code:
# Update Post table
my $c = $DB->table('Post');
$c->update ( { post_is_poll => '1' }, { post_id => $post_id }) or die $GT::SQL::error;

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
A fatal error has occurred:
Failed to execute query: 'UPDATE gforum_Post SET WHERE post_id = ?' Reason: You have an error in your SQL syntax near 'WHERE post_id = 884' at line 1 at /home/sites/site30/web/cgi-bin/forum/admin/Plugins/GForum/Poll.pm line 135.


Please enable debugging in setup for more details.
Quote Reply
Re: [shiner] New Version - 1.0.1 In reply to
This is very strange. So somehow, the Post table is not updated, when you write a new poll.

Even stranger (at least to me), is the fact that you can view these new polls in threaded/print view. Is that really correct?

What database are you using?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Ivan,

I can only view in the threaded view - and yes, I can see the poll question and results of newly created polls when in threaded view. Print View is related and based on Flat view. I am presuming that once flat view is fixed - print view will also have been corrected.

I am using the MySQL database that my host set up for me and the standard tables that g-forum creates. I have done nothing out of the norm - I simply upgraded and what once worked, no longer works. I have uninstalled poll, removed the tags, deleted poll, re-installed poll, re-insert the tags - but no luck.

Since I edited poll.pm with the above addition, I can not post polls - you just get the error message.


To see this marvel in action - go here:

http://www.investingdd.com/.../gforum.cgi?post=888

Nothing in flat view, but you see it in threaded...
Quote Reply
Re: [shiner] New Version - 1.0.1 In reply to
The problem really seems to be that the "post_is_poll" field is not updated when you write a poll. If it doesn't find this field set to 1, no poll will be displayed.

It also makes sense that you are still able to see the polls in threaded view, because the plugin does a different kind of lookup in that case.

Have you got a "post_is_poll" field in your Post table? What does the entry in the defs/gforum_Post.def of this field look like?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
The last field in the gforum_post table is post_is_poll

gforum_post.def was the answer... There was no post_is_poll information in there. I overwrote the file with a back-up version. I can now see the polls in flat/print/threaded views. There is one quirk that I believe is in the template - but in flat, I ONLY see the poll and not the post... Still working on it.




- Quick update, to fix the see only the poll and not the post problem, I just restored the view_post_flat template and re-inserted the tag. That worked.

It appears that all of the problems have gone away now. Thank you very much for helping me troubleshoot this. I would never have known to go to the def file. Thanks!

Last edited by:

shiner: Jun 3, 2002, 5:35 AM
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Hi Yogi,



I just installed the poll plugin to give it a try. Everything has gone smooth with just a couple exceptions:

1. When I tried to do the template mod for post_view_threaded.html you state to insert the code "<%if poll_view%> <%include include_poll_view.html%> <%elsif poll_results%> <%include include_poll_results.html%> <%endif%>" just before <%body_table%>. THis would be fine but there are 4 times when that tag is used. TO which location are you reffering?

2. When I tried to do the template mod for post_view_threaded.html you state to insert the code "<%if poll_view%> <%include include_poll_view.html%> <%elsif poll_results%> <%include include_poll_results.html%> <%endif%>" just before <%loop post_loop%> <%body_table%>. This would be fine but only the <%loop post_loop%> shows up in the code and not the <%body_table%>. Any ideas?

3. On the forum_view.html template mod you state to insert the code 3 times. When I do I get three buttons.

Were there template changes between 1.1.4 and 1.1.6 that would make these template modifications different?



Thanks in advance,
Quote Reply
Re: [Teambldr] New Version - 1.0.1 In reply to
Hi

1. I mean the one in
Code:
<%body_table%>
<tr>
<td>
<br>
<%include include_post_display.html%>
<br>
</td>
</tr>
<%/body_table%>

2. I assume you mean fo the template post_view_printable.html. There is indeed no <%body_table%> tag, and you can just place it before <%loop post_loop%>.

3. There are three occurances of the "Post New" button on the page. If you insert the code before each of them, it will be fine.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] New Version - 1.0.1 In reply to
Thanks Yogi!

3. The code was slightly different on the third placement:

<input type="submit"<%unless user_forum_permission >= 5%> disabled<%endunless%> name="do=post_write;forum=<%forum_id%>" value="Post New" class="submit">

It kind of threw me. But I think I have the mods done now.



Thanks again.
> > > >