PDA

View Full Version : Specify Poll by Poll ID, not Forum ID


gfd
10-05-2004, 04:57 PM
Hello,
I'd like to set up a forum which will contain all the polls for my website.
Several polls will be sometimes active at the same time.

The problem is that the poll displayed on the home page is specified by the forum ID and I'm going to have all the polls in the same forum.

Is there any way I can change this so that I can specify the poll ID instead?

If not, does anybody know how I can write my own module that can do this?

Do I use the same templates the current module uses and make a different php page to include (based on the cyrrentpoll.php)? What do I have to change in this php page?

thanks

Brian
10-06-2004, 12:34 PM
Open your currentpoll.php file and look for:

forumid IN

Replace that with:

poll.pollid IN

Our Sponsors
 

memobug
10-06-2004, 02:20 PM
That is very, very close, but it won't quite do it. In the code, polls are sorted by DESC, so you would get the same darn poll even if you specified several.

Instead,

1. in currentpoll.php replace that line (around line #22)


### MEC REPLACE $query['pollquery'] = 'AND forumid IN(' . $vba_options['portal_poll_forumid'] . ') ORDER BY poll.pollid DESC';
$query['pollquery'] = 'AND poll.pollid IN(' . $vba_options['portal_poll_forumid'] . ') ORDER BY RAND()';
###


2. Now in your CMPS defaults screen, you can use a list of poll ids in place of the line that formerly held the poll forum ID. Separate them with a single comma and no spaces. Order doesn't matter. For example.

12,22,13

To get the poll id numbers you can hover over the Edit Poll link on your forum and it will show in the navbar.

Regards,

Matt

gfd
10-07-2004, 05:48 AM
Excellent!
works like a charm :)

thank you very very much