View Single Post
  #6   Spotlight this post!  
Unread 29-04-2003, 23:06
Jack's Avatar
Jack Jack is offline
FIRST Scouting Network
AKA: Andrew Schenk
FRC #0201 (The FEDS)
Team Role: Alumni
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Rochester Hills
Posts: 643
Jack is a jewel in the roughJack is a jewel in the roughJack is a jewel in the rough
Send a message via AIM to Jack
come on here brandon

ok.. don't really know the setup of the spotlight table.. but I'd guess there's some autoindex. (1-x)

So....

SELECT max(spotlight_id) FROM spotlight_list

vB query...

$pick_this_one = rand(0, $spotlight_id_max);

SELECT * FROM spotlight_list WHERE spotlight_id = $pick_this_one

Yup... there ya go.

or... I guess you could base it on session time or system time. (IE: total_spotlights % some_value)

yeah... i know... i needs 2 queries
OR... assumeing that vB has some "master config" table which takes all the fields/rows and dumps it into an array, you could have a config value max_spotlight. That's like 100 extra bytes and only requires to be run when a post is spotlighted.

Jack

PS: FYI to anyone.. Brandon really doesn't need the big roadmap i gave him .. I just wanted to have some fun

edit: the perfict way to bring down cd. Add a field to the user table which is updated every page refresh to the next spotlight_id - Would never get repeates tho
__________________
Team 201 - 2003 Great Lakes Semifinalists & 2003 Archimedes Division Finalists :|: Webmaster of www.feds201.com -> FBI Scouting
Winner of The 2003 ChiefDelphi Web Award for: User That Started The Most Non Chit Chat Threads
Winner of: 2003 FIRST Ventures with 5451.68 End Points

All about me: http://knehcsa.vze.com
**Check out the New FIRST Scouting Network**

Last edited by Jack : 29-04-2003 at 23:42.
Reply With Quote