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 
Poll-comments in the popup window  XML
Forum Index » Support Forum
Author Message
Anonymous



Hi,

At first: thank you for this script, it is wonderfull!

The poll works fine, but I have a problem and can not find the solution in the allready posted topics in this forum.

The poll is on the first page of my site where I have no room for the comments. So I use the popup-poll, which results are shown in a new window. But how do I get the comments in that window?

In the demo I found how to show the comments, but then they appear on my first page and not in the popup window with the results! How do I get them there?

Additional question for the next release of your script: why aren't the comments automatically shown when you enable comments in the poll-editor? The mailform does! I see in the forum that a lot of people are confused about the comments, because they are not shown when you use the standard php-code to include the poll.

Thanks for your time, I hope you can help me out.
Anonymous



Hi, I found the solution myself! I am new to php but tried things out and it works!

Before you trie the solution I found, make a copy of the original popup.php, just in case that my solution does not work out for you.

And: your poll_path in the first line of the code can be different from mine! Perhaps you need the poll_path from the original popup.php file.

Open the file popup.php, and replace the php-code between the <body>tags with this one:

-----------------------------------

<?php
$poll_path = "/home/virtual/site24/fst/var/www/html/poll";
require $poll_path."/include/class_pollcomment.php";
$php_poll = new pollcomment();

$php_poll->set_template_set("popup");
if (isset($poll_ident) && isset($action)) {
$php_poll->set_max_bar_length(110);
echo $php_poll->poll_process($poll_ident);

$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($poll_ident);
echo $php_poll->get_comment_pages($poll_ident);
}
?>

-----------------------------------

In the file where you want to show your poll you embed your poll with this code (replace the "4" in the last lines with the ID-number of your poll):

<?php
/* Include this before your html code */
include "./poll_cookie.php";
?>

<?php
/* Include this in the body of the html code where you want to show the poll*/
$poll_path = "/home/virtual/site24/fst/var/www/html/poll";

require $poll_path."/include/config.inc.php";
require $poll_path."/include/$POLLDB[class]";
require $poll_path."/include/class_poll.php";

$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();

$php_poll = new poll();

$php_poll->set_template_set("popup");
if ($php_poll->is_valid_poll_id(4)) {
echo $php_poll->display_poll(4);
}

?>
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum