Author |
Message |
02/07/2003 07:33:19
|
Anonymous
|
I want to display the latest poll with the comments below it, but I can't seem to figure out how to do it.
I have this:
$php_poll->set_template_set("simple");
if (isset($HTTP_GET_VARS['poll_id'])) {
echo $php_poll->poll_process($HTTP_GET_VARS['poll_id']);
} else {
echo $php_poll->poll_process("newest");
$latestpoll = $php_poll->poll_process("newest");
}
That displays the latest poll. But this below:
$php_poll->set_template("poll_comment");
$php_poll->set_comments_per_page(4);
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments(newest);
echo $php_poll->get_comment_pages(newest);
Doesn't work, I have to put a number in there instead of "newest" in order to make it work.
How can I get this to display the latest comments as well? Any ideas?
Thanks,
Mike
|
|
02/07/2003 17:42:59
|
Auron
Expert
Joined: 23/06/2003 22:02:17
Messages: 1053
Offline
|
If you had to put a number in instead of 'newest' say for example your latest poll is number 21 then in your second bit of code replace the 'newest' bit with 21 and it should display the comments associated with that poll.
Hope that helps!
Auron
|
|
08/12/2003 01:14:15
|
Anonymous
|
Hmm,
Is it not possible to get the comments to display the newest poll? I don't feel like updating my page every time I add a new poll, I want it to be dynamic.
Cheers,
Sebastian
|
|
08/12/2003 19:16:43
|
Auron
Expert
Joined: 23/06/2003 22:02:17
Messages: 1053
Offline
|
the word newest must be double quotes " <--
Auron
|
Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought) |
|
09/12/2003 08:36:48
|
Anonymous
|
I did that, nothing changed
|
|
09/12/2003 16:33:30
|
Auron
Expert
Joined: 23/06/2003 22:02:17
Messages: 1053
Offline
|
Did you change this...
Chandler Mike wrote:$php_poll->set_template("poll_comment");
$php_poll->set_comments_per_page(4);
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments(newest);
echo $php_poll->get_comment_pages(newest);
To this?
Chandler Mike wrote:$php_poll->set_template("poll_comment");
$php_poll->set_comments_per_page(4);
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments("newest");
echo $php_poll->get_comment_pages("newest");
Auron
|
Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought) |
|
10/12/2003 01:23:23
|
Anonymous
|
Yes I changed it. I posted my poll pages below as a proof, hehe
[/code]
|
|
29/12/2003 02:53:18
|
Anonymous
|
I'd like also to view in my index page only the question
of poll, so,
I put like the demo example #4
this code
/* path */
$poll_path = "/web/htdocs/www.padan.org/home/PADAN.IT/sondagg";
require $poll_path."/include/config.inc.php";
require $poll_path."/include/$POLLDB[class]";
require $poll_path."/include/class_poll.php";
require $poll_path."/include/class_pollcomment.php";
$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();
$php_poll = new pollcomment();
/* question */
echo $php_poll->get_poll_question(2);
but it show me only the 2nd ID
if i write newest or "newest" instead of 2
it doesn't work...
what i have to do to show the lastest question
without editing every time the code manually?!?
thanx a lot
|
|
|