vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Add-On Modules & Modifications

 
 
Thread Tools Display Modes
  #1  
Old 08-12-2004, 12:42 PM
Kesomir's Avatar
Kesomir Kesomir is offline
Member
 
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
__________________
Kesomir
"It's an undocumented feature, not a bug"

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





Last edited by Kesomir; 08-12-2004 at 12:46 PM.
  #2  
Old 08-12-2004, 01:11 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
Default Re: Random poll displayed

Um.... how is this different from entering RAND as the "Polls Forum ID" value?
  #3  
Old 08-12-2004, 05:03 PM
Kesomir's Avatar
Kesomir Kesomir is offline
Member
 
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  
Old 08-12-2004, 05:04 PM
KW802's Avatar
KW802 KW802 is offline
Administrator
 
Join Date: Mar 2004
Location: A galaxy far, far away...
Posts: 5,030
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  
Old 09-20-2004, 01:26 AM
DMC DMC is offline
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  
Old 05-06-2005, 08:44 AM
moses moses is offline
Member
 
Join Date: Oct 2004
Posts: 68
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  
Old 05-26-2005, 08:56 AM
moses moses is offline
Member
 
Join Date: Oct 2004
Posts: 68
Default Re: Random poll displayed

anyone?
__________________
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Image from 4images y2krazy Add-On Modules & Modifications 18 04-07-2006 07:51 PM
Showing a single poll all the time theMusicMan Troubleshooting / "How do I..." Questions 3 08-27-2004 01:07 PM
Random Poll Kesomir Troubleshooting / "How do I..." Questions 2 07-09-2004 04:03 PM
Random Poll tox Troubleshooting / "How do I..." Questions 6 07-02-2004 11:15 AM
Poll problem contramontanum Troubleshooting / "How do I..." Questions 2 06-21-2004 12:46 PM


All times are GMT -4. The time now is 12:27 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.