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: slightly advanced challenge! help!  XML
Forum Index » Support Forum
Author Message
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

Hi,

First of all thnx for making this script free to use.
I have installed the advanced poll succesfully.

Now i'm trying to get the poll to display the way i want it to.
I want to setup a page where:

1. people can vote
2. people can comment on the topic which they voted for
3. the form which people can use to comment with is on the same page as the poll
4. there is a list of old polls.

Here is my problem/challenge:
When someone clicks on a link to an old poll, they get to see that old poll.........but with comments that do not belong to that poll. Obviously i want every old poll to display together with the comments that belong to that poll.

My english is not good, so i hope you understand what i'm trying to explain.

Let's see if someone is able to help me......thnx in advance for your time.
Greets,
busa
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

Hi,

No one any idea how this can be done?
Any attempt would be appreciated.

Thnx
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Learn patience. i'm sure Auron or someone who is familiar with the poll script will help you as soon as they read the post.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Its matter of having the right code on you page.

Most of it is on the demo poll pages on this site. When I get a chance i'll
look at them and pick out the bits of code you'll need.

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]
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

ok thank you, didn't want to be impatient. I appreciate all who tries to help out.

regards,
Busa :o
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Lets see now...

1. people can vote
2. people can comment on the topic which they voted for
3. the form which people can use to comment with is on the same page as the poll
4. there is a list of old poll

1. in the admin area at the top of the page, click on the last image and it'll give you the file include bit and the code. The code should look something like this...

echo $php_poll->poll_process(1);

put 1, 2, or 3 or whatever for the poll id or put newest for the newest created poll or random which does guess what!? ^^

2/3. lets go!

this constructs the comment form...
comment bits out that you don't want. for example currently the email field is commented out so they don't have to fill that in.

$php_poll->set_template("poll_form");
$php_poll->set_form_error(array(
    "name" => "Please enter your name.",
// "email" => "You must specify your e-mail address.",
    "message" => "You must specify a message."
));
$html_form = $php_poll->comment_process(2); --- poll id, newest or random

echo $html_form;

not sure about this one, may need to inlcude an extra file. But let me know if it works or not.

2/3. (again) to view the comments...

$php_poll->set_template("poll_comment");
$php_poll->set_comments_per_page(5); --- no of comments per page
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments(2); --- poll id, newest or random
echo $php_poll->get_comment_pages(2); --- poll id, newest or random

4. here's the code...

$php_poll->set_template("poll_list");
$php_poll->set_date_format("m/d/Y");
echo $php_poll->view_poll_list();
echo $php_poll->get_list_pages();

not sure about the last two, you may be able to put stuff in the brackets. I'll need to check the functions they call first so i wouldn't try unless you want to experiment and let me know for future reference.

NOTE!
I haven't used the poll much over the last year or so, so, some of the code i quoted may not be right or may need extra files to be included. Its really trial and error.

Most of the stuff here i just copied and pasted from the demo polls. I must admit though it is quite easy to get some of the code yourself. But, i thought i'd do it this time for you and for others having the same problem/s.

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]
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

Auron thank you for you reply.

If i follow the steps you provided in your post, i end up with a page that is similar to the page i have allready constructed.

This is the problem i am facing:

When someone clicks on a link in the list of polls........they get to see that poll. They also see comments underneath that poll........but the comments displayed are not the comments that belong to that poll. And i obviously want to display a poll together with comments that belong to that poll.

For example:
The page is now setup to display poll ID 2. When you click on a link to an old post, let's assume that that poll has ID 4, the page displays poll ID 4. But then you see poll ID 4 together with comments that do not belong to poll ID 4.

I hope this makes sense.

On a side note:
When you hover over a link to an old poll in the poll-list, you see that that link will call a certain poll ID. I was thinking, if you can assign every commentlist a corresponding ID number, you can call a poll ID and a comments ID together. In this example this would result in something like this: .........../praatmee.php?poll_id=2ANDcomment_id=2
Hope you understand.

I have no php knowledge so, again, i will be extremely thankfull if you would try and help me.

Thnx,
Busa
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

Hi all,

Is there anyone that has an idea how this can be done? I'm hoping that it's not very difficult to do, but my php knowledge is very poor. Maybe someone with better understanding of php can pick this up.

Thank you,
Busa
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

I wouldn't want to mess with links incase i screwed them up.
Meanwhile why odn't you create a separate page for each poll with its
own comments below and and have each page link to the next one and
forget the adv. poll list code. Much easier and safer.

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]
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

What you mention is an option indeed. I have dropped the poll designing part for this website for now. Later when I begin working on the poll again i think i'll make a few changes.

Thank you for taking time out to help.....that's great!
And thanks again for a fine free script!

Regards,
Busa
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

No problem ^^ I might have a go at the poll again myself.
Btw, for future reference I didn't write it in case it crossed you mind ; )

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]
Hayabusa
Beginner
[Avatar]

Joined: 08/11/2004 05:48:52
Messages: 10
Offline

Ok, 'thank you' goes out to Chi Kien Uong (I guess) for the free script.
See ya!

Busa
Anonymous



Hayabusa...

I totally understand what you're looking to do. I had the same dilema... wanted the comments to be displayed together from newest being on top right?



$php_poll->set_template("poll_comment");
$php_poll->set_comments_per_page(5); --- no of comments per page
$php_poll->set_date_format("d/m/Y H:i");
$php_poll->data_order_by("time","desc");
echo $php_poll->view_poll_comments(2); --- poll id, newest or random
echo $php_poll->get_comment_pages(2); --- poll id, newest or random


Since the comment codes are calling the poll ID.. I figured to drop it and include a guestbook below the polls. Please respond if you're still looking to do this. I'll show you what I got
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

isn't that a quote from my post above?...

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



Auron wrote:isn't that a quote from my post above?...


yes it is

i was trying to show how the #'s represent the poll ID.. am i correct? this is great but i wanted it so that the comments are dispayed together. so far what i have is this:

<?php

/* path */
$poll_path = "/home/xxxxx/public_html/polls";

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";
require $poll_path."/include/class_plist.php";
$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();

$php_poll = new plist();
$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);
if (isset($HTTP_GET_VARS['poll_id'])) {
echo $php_poll->poll_process($HTTP_GET_VARS['poll_id']);
} else {
echo $php_poll->poll_process("random");
}

/* poll list */
$php_poll->set_template("poll_list");
$php_poll->set_date_format("m/d/Y");
echo $php_poll->view_poll_list();
echo $php_poll->get_list_pages();

/* 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->view_poll_comments(2);
echo $php_poll->view_poll_comments(3);
echo $php_poll->get_comment_pages(3);


?>

say if there was already a comment from poll #1, and if someone were to post from poll #2, the new post will be somewhere below comment post #1... grrr... hard to explain but i do hope you understand.

what i did was drop the poll comments and included the advanced guestbook instead... and it works great!!!
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum