I added the Poll plugin, and created a poll with 'yes' and 'no' as choices. I did a test, selecting the 'no' option. The page was refreshed but both the 'yes' and 'no' percentages and vote counts were displayed as 0% and 0, respectively. I had to refresh the page to see the correct numbers. Is refreshing really required?
browser = firefox 1.0.4
hmmm... after refreshing the page, I now have a total vote count of 2, but yes votes -> 0 and no votes -> 1
serendipity_plugin_pollbox
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: serendipity_plugin_pollbox
Which version of the poll plugin and which serendipity version are you using? Are you using both the event and the sidebar plugin, or only the sidebar plugin?
A URL to your site would also be helpful.
Regards,
Garvin
A URL to your site would also be helpful.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Try to install the event plugin as well, I think this should help
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Both plugins (ver 2.05) are now installed. I cast another 'no' vote. The page was refreshed and the %, totals were displayed. There were 3 no votes, 0 yes votes. The total votes was shown as 4.
Here are the contents of the serendipity_polls and serendipity_polls_options tables;
mysql> select * from serendipity_polls_options;
+----+--------+-------+-------+-----------+
| id | pollid | title | votes | timestamp |
+----+--------+-------+-------+-----------+
| 9 | 4 | Yes | 0 | NULL |
| 10 | 4 | No | 4 | NULL |
+----+--------+-------+-------+-----------+
2 rows in set (0.00 sec)
mysql> select * from serendipity_polls;
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
| id | title | content | active | votes | timestamp |
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
| 4 | Are you satisfied with the job your elected Senators and Representatives are doing? | NULL | 1 | 5 | 1133251683 |
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
1 row in set (0.00 sec)
Here are the contents of the serendipity_polls and serendipity_polls_options tables;
mysql> select * from serendipity_polls_options;
+----+--------+-------+-------+-----------+
| id | pollid | title | votes | timestamp |
+----+--------+-------+-------+-----------+
| 9 | 4 | Yes | 0 | NULL |
| 10 | 4 | No | 4 | NULL |
+----+--------+-------+-------+-----------+
2 rows in set (0.00 sec)
mysql> select * from serendipity_polls;
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
| id | title | content | active | votes | timestamp |
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
| 4 | Are you satisfied with the job your elected Senators and Representatives are doing? | NULL | 1 | 5 | 1133251683 |
+----+-------------------------------------------------------------------------------------+---------+--------+-------+------------+
1 row in set (0.00 sec)
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hm, but the SQL data says there were 4 votes? Can you start with a fresh voting, now that you have both plugins installed?
(I'm sorry, I rarely use that plugin)
Regards,
Garvin
(I'm sorry, I rarely use that plugin)
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I have noted that down and will look at it somewhen this week, thanks for giving me a pointer!
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
How about this change in showPoll() ?
[/code]
Code: Select all
function showPoll($pollid = null) {
global $serendipity;
echo '<strong>' . $this->poll['title'] . '</strong>';
echo '<form action="' . serendipity_currentURL() . '" method="post">';
if ($pollid || $_SESSION["pollHasVoted{$this->poll['id']}"] || $serendipity['COOKIE']["p
ollHasVoted{$this->poll['id']}"]) {
$this->showResults();
} elseif (isset($serendipity['POST']['goVote'])) {
$_SESSION["pollHasVoted{$this->poll['id']}"] = true;
$this->setCookie("pollHasVoted{$this->poll['id']}", 'true');
// ---- bgn ----
if ( isset($serendipity['POST']['vote']) ) {
$this->addVote($this->poll['id'], $serendipity['POST']['vote']);
$this->showResults();
} else {
$this->showOptions();
}
// ---- end ----
} else {
$this->showOptions();
}
echo '</form>';
}
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Actually, that's nearly perfect. I just committed the change!
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/