If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Advanced Poll question - need some help  XML
Forum Index » Support Forum
Author Message
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
Auron
Expert
[Avatar]

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
[Email] [WWW]
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
Auron
Expert
[Avatar]

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)
[Email] [WWW]
Anonymous



I did that, nothing changed
Auron
Expert
[Avatar]

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)
[Email] [WWW]
Anonymous



Yes I changed it. I posted my poll pages below as a proof, hehe

[/code]
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
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum