Results 1 to 4 of 4

Thread: Specify Poll by Poll ID, not Forum ID

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    8

    Default Specify Poll by Poll ID, not Forum ID

    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
    Last edited by gfd; 10-05-2004 at 05:05 PM.

  2. #2
    Administrator Brian's Avatar
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,460

    Default Re: Specify Poll by Poll ID, not Forum ID

    Open your currentpoll.php file and look for:

    forumid IN

    Replace that with:

    poll.pollid IN

  3. #3
    Senior Member
    Join Date
    Aug 2004
    Posts
    121

    Default Re: Specify Poll by Poll ID, not Forum ID

    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)

    Code:
    ### 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
    Last edited by memobug; 10-06-2004 at 02:24 PM.

  4. #4
    Junior Member
    Join Date
    Sep 2004
    Posts
    8

    Default Re: Specify Poll by Poll ID, not Forum ID

    Excellent!
    works like a charm

    thank you very very much

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help: Forum stopped working :(
    By SelRahc in forum Troubleshooting / "How do I..." Questions
    Replies: 11
    Last Post: 09-24-2004, 11:09 AM
  2. Poll results stretched across screen
    By Zen in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 08-12-2004, 05:46 AM
  3. Slight Forum Changes
    By Brian in forum Site Feedback & Updates
    Replies: 0
    Last Post: 07-08-2004, 06:19 PM
  4. Poll problem
    By contramontanum in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 06-21-2004, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •