Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Poll's history
Goto page 1, 2  Next
 
Reply to topic    Forum Index » Help View previous topic
View next topic
Poll's history
Author Message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Poll's history Reply with quote
Is't possible to show all old polls in one separate page?
Sat Sep 15, 2007 10:33 pm View user's profile Send private message
Guest








Please login to hide the ads.

svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
Hello again,
I would be happy if I get any answers. Please let me no if it's possible or not Surprised
Tue Sep 25, 2007 11:07 am View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
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 Smile
last update: 07-22-08: 8:30 pm
Tue Sep 25, 2007 6:28 pm View user's profile Send private message Visit poster's website AIM Address
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
I use SwiZZeR's poll. Could u please specify how should i write the code?
Thanx Wink
Tue Sep 25, 2007 7:53 pm View user's profile Send private message
scottdallas



Joined: 04 May 2006
Posts: 1802
Location: US

Post Reply with quote
Oh, I have no idea then Embarassed

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 Smile
last update: 07-22-08: 8:30 pm
Tue Sep 25, 2007 11:58 pm View user's profile Send private message Visit poster's website AIM Address
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Put the following code in a php file and change the path to head.php as you like.

Code:
<?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 View user's profile Send private message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
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 View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
There was a little mistake in the code above. Please try again.
Mon Oct 08, 2007 3:55 pm View user's profile Send private message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
Hej FI-DD,
Are you sure you modified the code because it still dosen't work. Sad
Mon Oct 08, 2007 11:56 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Of course. It's working great for me.
Wed Oct 10, 2007 3:26 pm View user's profile Send private message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
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 View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
I changed the code above...
Sun Oct 14, 2007 6:44 pm View user's profile Send private message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
How can I show/sort the votes chronologically. The newst vote first/on top, just like news.
Mon Jul 14, 2008 9:16 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2668
Location: Germany

Post Reply with quote
Try again with the updated code above...
Fri Jul 18, 2008 10:13 am View user's profile Send private message
svennis



Joined: 09 Oct 2006
Posts: 54

Post Reply with quote
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.