Sat, 23 Nov 2024
Total Visits
35384359
Visitors today:
1530
Main Menu
Home
Free Scripts
Forum
Guestbook
Repository
Contact
Our Sponsors
Chi Kien Uong
Geranienstraße 30
71034 Böblingen
Deutschland / Germany
If you are not registered or logged in, you may still use these forums but with limited features.
Show recent topics
Search
Hottest Topics
Member Listing
FAQ
Register
/
Login
Display Results of all Polls
Forum Index
»
Support Forum
Author
Message
15/06/2005 16:21:10
Subject:
Display Results of all Polls
HaveNoFear
Newbie
Joined: 15/06/2005 16:16:16
Messages: 2
Offline
Hello. I need to display all results of my polls at one page.
Here my php code for the future include:
<?php /* path */ $poll_path = "/home/teamlea5/public_html/poll"; require $poll_path."/include/config.inc.php"; require $poll_path."/include/class_poll.php"; require $poll_path."/include/class_pollcomment.php"; $php_poll = new pollcomment(); /* poll */ $php_poll->set_template_set("plain"); $php_poll->set_max_bar_length(125); $php_poll->set_max_bar_height(10); echo $php_poll->view_poll_result(1); echo $php_poll->view_poll_result(2); echo $php_poll->view_poll_result(3); echo $php_poll->view_poll_result(4); echo $php_poll->view_poll_result(5); echo $php_poll->view_poll_result(6); echo $php_poll->view_poll_result(7); /* poll comments */ $php_poll->set_template("poll_comment"); $php_poll->set_comments_per_page(5); $php_poll->set_date_format("d/m/Y H:i"); $php_poll->data_order_by("time","desc"); echo $php_poll->view_poll_comments(1); echo $php_poll->get_comment_pages(1); ?>
And here is result -
http://teamleague.ru/pages/showbets.php
But including
echo $php_poll->view_poll_result(x);
for each poll it's not perfect.. How can i modify my code?
P.S. Sorry for my english
16/06/2005 21:14:43
Subject:
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
Only way to make it more efficient would be to use a loop to go through them all.
Carbonize
I am not the maker of the Advanced Guestbook
get
Lazarus
16/06/2005 22:03:13
Subject:
Auron
Expert
Joined: 23/06/2003 22:02:17
Messages: 1053
Offline
for ($i = 0; $ < 8; $++) { echo $php_poll->view_poll_result($i); }
Change 0 to the starting poll' id number.
Change 8 to the ending poll' id number.
Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
16/06/2005 22:06:02
Subject:
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
Naturally changing the 8 for the number of your last poll. Would you start it from 0 though? I thought the first three polls were demo ones ?
Carbonize
I am not the maker of the Advanced Guestbook
get
Lazarus
16/06/2005 22:43:18
Subject:
HaveNoFear
Newbie
Joined: 15/06/2005 16:16:16
Messages: 2
Offline
Thx, It will help.
And now a new question:
How Can i display Resulit for only
active
polls
?
22/07/2008 04:49:58
Subject:
EricCai
Newbie
Joined: 18/07/2008 17:30:46
Messages: 2
Offline
hi HaveNoFear,
when i run the code you show,there are some error informations
Fatal error: Call to a member function fetch_array() on a non-object in C:\AppServ\www\vote\include\class_poll.php on line 36
can you show me how to solve it? thanks a lot.
Forum Index
»
Support Forum
Go to:
Select a forum
General Discussion
Support Forum
German Forum
Advanced Guestbook Forum
Advanced Guestbook Modifications
Based on the open source
JForum