Author |
Message |
08/03/2013 19:46:24
|
nwflyer04
Newbie
Joined: 04/03/2013 14:38:55
Messages: 3
Offline
|
I have struggled to get AP 3.0 working but I have succeeded despite myself. Very little help as far as documentation and even the forum responses are sometimes vague.
Here is what I need. I need to have the submitted comments show up along with the results. I get the results just fine. After looking through the forum it has been suggested to use Demo 2. I am OK with that but I am new to using PHP and script language. If I use Demo 2 where do I put the code? Do I use the entire code? The code is broken out into sections. Path - Poll - Poll comments
I have experimented but can't get the page that contains my Polls to display the comments. Can someone that understands AP 3.0 tell me what needs to be added and where?
Any help is greatly appreciated.
By the way I did install AP 3.0 and get polls customized and created with the help from this forum's suggestions. It's just that it is like putting together a puzzle for us new folks new to PHP.
|
|
08/03/2013 22:07:24
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
You mean like this http://proxy2.de/poll/demo_2.php ?
Jst copy the code to the left of it changing the (1) to whatever the id of your poll is.
BTW it's actually Advanced Poll 2.09 still the change to 3 in the code was a mistake.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
08/03/2013 22:32:46
|
nwflyer04
Newbie
Joined: 04/03/2013 14:38:55
Messages: 3
Offline
|
Carbonize,
Thanks for the response. I see you help many who send questions to this board. Please pardon my ignorance, I really am new to this. DO I copy the entire three blocks of code to the .php page my poll sits on? Do I copy it to the same place in my .php page my current poll code sits?
<div id="content" style="position: absolute; width: 616px; height: 849px; z-index: 0; left: 246px; top: 238px; visibility: visible;" class="auto-style24">
<div id="Poll1" class="auto-style28" style="position: absolute; width: 238px; height: 210px; z-index: 1; left: 9px; top: 7px; visibility: visible">
<?php
include_once "/hermes/bosoraweb052/b2872/ipw.nwflyers/public_html/poll/db/booth.php";
echo $php_poll->poll_process(4);
?>
</div>
Thanks for your response.
|
|
08/03/2013 22:36:15
|
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
|
I've never used AP and Auron was the expert but if memory serves put the cookie and booth includes at the very start of the file before anything else and then the rest where you want it to appear in the page.
|
Carbonize
I am not the maker of the Advanced Guestbook
get Lazarus |
|
09/03/2013 20:35:00
|
nwflyer04
Newbie
Joined: 04/03/2013 14:38:55
Messages: 3
Offline
|
Carbonize thanks again for the response and support. Sorry for the long winded response but I hope this helps some who might be struggling.
To all others seeking help with showing results and comments from your poll on the same page as the poll itself. Here is what I had to do.
First off you only have to put the cookie.php code before the html code. However in my case the only way it works is if I put the actual root path. You can find this at your host site under server information.
NOTE: Your path should be in the form /home/users/web1111/pr.username/dir where pr is an abbreviation for IPOWER, username is your hosting account username, and dir may be an additional directory such as public_html, or docroot, or root, or even empty. So it looks like something like this
<?php
// Important! You have to include it before your html code
include_once /home/users/web1111/pr.username/public_html/poll/db/poll_cookie.php";
?>
Instead of this:
<?php
/* Include this before your html code */
include_once "./poll_cookie.php";
?>
Then I copied the code from the demo's left side like Carbonize stated right into the section of the page I wanted it. . With just a few tweaks.
<?php
/* path */
$poll_path = dirname(__FILE__); Here I had to put exact path to poll as I stated above.
$poll_path = dirname("/home/users/web1111/pr.username/public_html/poll/db/booth.php"); Like This
require_once $poll_path."/include/config.inc.php";
require_once $poll_path."/include/$POLLDB[class]";
require_once $poll_path."/include/class_poll.php";
require_once $poll_path."/include/class_pollcomment.php";
$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();
$php_poll = new pollcomment();
echo $php_poll->poll_process(5); Here I had to add this line to get the poll to display. Otherwise all I would display is the results and comments. You couldn't actually vote. Substitute 5 your poll #
/* poll */
$php_poll->set_template_set("template name"); Here I changed simple to my template name
$php_poll->set_max_bar_length(125);
$php_poll->set_max_bar_height(10);
echo $php_poll->view_poll_result(1);
/* 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); Change 1 to the number of your poll
?>
That is how I got it to work. Now my poll page shows the poll and when you click show results you get the results. Below the results the comments are displayed. This has been a learning experience to say the least. Now I am working on hiding the email address. If anyone needs questions answered contact me offline.
Carbonize thanks again for all your help on the forum.
|
|
|