| Author |
Message |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
Poll's history |
|
Is't possible to show all old polls in one separate page?
|
|
| Sat Sep 15, 2007 10:33 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
Hello again,
I would be happy if I get any answers. Please let me no if it's possible or not 
|
|
| Tue Sep 25, 2007 11:07 am |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
What about just filtering for Oldest > Newest or something? Or maybe $skip = "xx" for however many you want to skip to into your database.. you could skip like 20
Or you can filter by date
Are you using 'Polls in Posts' by FI-DD?
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Tue Sep 25, 2007 6:28 pm |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
I use SwiZZeR's poll. Could u please specify how should i write the code?
Thanx 
|
|
| Tue Sep 25, 2007 7:53 pm |
|
 |
scottdallas

Joined: 04 May 2006 Posts: 1802 Location: US |
|
|
|
Oh, I have no idea then
But, I really recommend FI-DD's ajax poll alternative. Mostly because I always wanted the flexible that you're now asking for. That's why I never used Swizzers.
_________________ www.scottdizzle.com uses cnr
last update: 07-22-08: 8:30 pm |
|
| Tue Sep 25, 2007 11:58 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Put the following code in a php file and change the path to head.php as you like.
 |  | <?php
include('head.php');
$output = '';
foreach ($sql->select(array(
'table' => 'poll',
'orderby' => array('id' => 'DESC'),
'where' => array("mainpage = 0"))) as $row) {
$answers = explode("|", $row['answers']);
$votes = explode("|", $row['votes']);
$total = 0;
for($i = 0; $i < count($answers); $i++){
$total += $votes[$i];
}
$output .= $row['question'].'<br />';
for($i = 0; $i < count($answers); $i++){
$output .= $answers[$i].': '.$votes[$i].' - ('.($total > 0 ? round($votes[$i] / $total * 100, 1) : '0').'%)<br />';
}
$output .= '<br /><br />';
}
echo $output;
?> |
Last edited by FI-DD on Fri Jul 18, 2008 10:12 am; edited 3 times in total |
|
| Fri Sep 28, 2007 2:56 pm |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
Thank you FI-DD,
I tried this code but nothing shows. The head is right modified. Do I need some include to show other polls?
|
|
| Sat Oct 06, 2007 3:35 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
There was a little mistake in the code above. Please try again.
|
|
| Mon Oct 08, 2007 3:55 pm |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
Hej FI-DD,
Are you sure you modified the code because it still dosen't work. 
|
|
| Mon Oct 08, 2007 11:56 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Of course. It's working great for me.
|
|
| Wed Oct 10, 2007 3:26 pm |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
thank you FI-DD,
It works grate. One thing more I wonder, is it possible to have the procntage form beside the quantities. like this:
good: 90 - 90%
bad 10 - 10%
thanx again
|
|
| Fri Oct 12, 2007 10:40 am |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
I changed the code above...
|
|
| Sun Oct 14, 2007 6:44 pm |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
How can I show/sort the votes chronologically. The newst vote first/on top, just like news.
|
|
| Mon Jul 14, 2008 9:16 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2668 Location: Germany |
|
|
|
Try again with the updated code above...
|
|
| Fri Jul 18, 2008 10:13 am |
|
 |
svennis
Joined: 09 Oct 2006 Posts: 54
|
|
|
|
Hi FI-DD
It's not working for me. Could you please have a look on it again.
|
|
| Sun Jul 20, 2008 9:55 am |
|
 |
|