Results 1 to 7 of 7

Thread: Random poll displayed

  1. #1
    Member Kesomir's Avatar
    Join Date
    Apr 2004
    Location
    London, UK
    Posts
    70

    Wink Random poll displayed

    This hack will change the poll that is displayed on your homepage from the most recent to a random one.


    OPEN modules/currentpoll.php

    FIND

    PHP Code:
    $query['pollquery'] = 'AND forumid IN(' $vba_option ['portal_poll_forumid'] . ') ORDER BY poll.pollid DESC'
    REPLACE WITH

    PHP Code:
    $query['pollquery'] = 'AND forumid IN(' $vba_option ['portal_poll_forumid'] . ') ORDER BY RAND()'
    SAVE AND UPLOAD

    That's it, you're done.

    Enjoy.


    EDIT - just did a search and found this already exists - doh! should have done that first :P
    Last edited by Kesomir; 08-12-2004 at 12:46 PM.
    Kesomir
    "It's an undocumented feature, not a bug"

    | Dynamic Staffpage :: vB3.07 :: vB3.6.1 |





  2. #2
    Super Moderator KW802's Avatar
    Join Date
    Mar 2004
    Location
    A galaxy far, far away...
    Posts
    6,606

    Default Re: Random poll displayed

    Um.... how is this different from entering RAND as the "Polls Forum ID" value?

  3. #3
    Member Kesomir's Avatar
    Join Date
    Apr 2004
    Location
    London, UK
    Posts
    70

    Default Re: Random poll displayed

    it draws a random poll from your specified forum.

    entering RAND in forum id draws random poll from ALL forums.
    Kesomir
    "It's an undocumented feature, not a bug"

    | Dynamic Staffpage :: vB3.07 :: vB3.6.1 |





  4. #4
    Super Moderator KW802's Avatar
    Join Date
    Mar 2004
    Location
    A galaxy far, far away...
    Posts
    6,606

    Default Re: Random poll displayed

    Quote Originally Posted by Kesomir
    it draws a random poll from your specified forum.

    entering RAND in forum id draws random poll from ALL forums.
    AH, OK, now that would make more sense.

  5. #5
    Junior Member
    Join Date
    Jul 2004
    Posts
    7

    Default Re: Random poll displayed

    I'm getting polls pulled from years ago, is there a way to set this feature for only polls posted in the last x days? 30 or 60?

    I've got a 'real' time sort of site (auto racing related) and pulling a poll from 2002 at Daytona and who will win is silly...

  6. #6

    Default Re: Random poll displayed

    is there a way to make it show unanswered polls first?
    such as
    order by answered, RAND
    or something like that?

  7. #7

    Default Re: Random poll displayed

    anyone?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Random Image from 4images
    By y2krazy in forum Add-On Modules & Modifications
    Replies: 18
    Last Post: 04-07-2006, 07:51 PM
  2. Showing a single poll all the time
    By theMusicMan in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 08-27-2004, 01:07 PM
  3. Random Poll
    By Kesomir in forum Troubleshooting / "How do I..." Questions
    Replies: 2
    Last Post: 07-09-2004, 04:03 PM
  4. Random Poll
    By tox in forum Troubleshooting / "How do I..." Questions
    Replies: 6
    Last Post: 07-02-2004, 11:15 AM
  5. 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
  •