Tech Reviews, Guides, Articles, and Forums for PC Hardware, Modding, and Gaming Enthusiasts
Fury-Tech Forums

Go Back   Fury-Tech Forums > Software Forums > Programming and Coding

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2004, 11:54 AM
Packetrat's Avatar
Greater Overmind
Greater Overmind
 
Join Date: Feb 2003
Location: Colorado
Posts: 887
Rep Power: 6
Packetrat is on a distinguished road
Default Predictable Randomness

If it can be done, and it can be done without rewriting PHP, I'd like to have a quote generator that is both random and predictable. That way I can print out quotes that are always the same on a given date, but tomorrow's quote would be randomly different. So, I have a series of quote ids in my database and i want to pick one based on today's date without having a lot of repitition. I guess it would then be called "Today's Quote" and I'd be able to have people discuss "Today's Quote."

I thought of running a random generator script once and then storing the id until the next day, but that didn't sound as fun as having a script that somehow magically chose the same quote every day... ya know, the more I think about this, the more unlikely it sounds achievable. Throw the thing to the dogs :2guns: if you can't come up with anything....
__________________
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. - Galileo Galilei

Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. - Thomas Jefferson (3rd US President, author of the Declaration of Independence)

Justice is the [ultimate goal] of government. It is the [ultimate goal] of civil society. It ever has been and ever will be pursued until it be obtained, or until liberty be lost in the pursuit. - James Madison (4th US President, "father" of the US Constitution)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-23-2004, 11:19 AM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Um, maybe I'm just a little daft, but I have no idea what you're talking about. :huh:

Are you saying that you want a random quote generator that doesn't repeat itself very often? Or that always says the same quote for a specific date, day of week, etc?

I don't get it! But it can probably be done.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-23-2004, 11:49 AM
Packetrat's Avatar
Greater Overmind
Greater Overmind
 
Join Date: Feb 2003
Location: Colorado
Posts: 887
Rep Power: 6
Packetrat is on a distinguished road
Default

Quote:
Originally Posted by Tekime
Um, maybe I'm just a little daft, but I have no idea what you're talking about. :huh:
lol - I don't blame you. I usually come to the forums with a question like this when I'm in a state of daftness myself, not knowing where to start off and all that. This is what I want:

I have a list of quotes in my database; that list could change from 3 entries to 400 entries over time. Each day, however, as in each day of time in existence, I want to be able to display a different, random quote on my page. What I'm trying to get away from is every time the page loads, a new, random quote appears. For each day, I want one and only one quote, but still yet random over the days of time.

I'll probably just store the id somehow and do it that way... :nuts:
__________________
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. - Galileo Galilei

Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. - Thomas Jefferson (3rd US President, author of the Declaration of Independence)

Justice is the [ultimate goal] of government. It is the [ultimate goal] of civil society. It ever has been and ever will be pursued until it be obtained, or until liberty be lost in the pursuit. - James Madison (4th US President, "father" of the US Constitution)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-27-2004, 11:23 AM
Tekime's Avatar
Administrator
Great Diviner
 
Join Date: Aug 2002
Location: Maine
Posts: 5,248
Rep Power: 10
Tekime is on a distinguished road
Send a message via AIM to Tekime Send a message via MSN to Tekime Send a message via Yahoo to Tekime
Default

Okay, I gotcha now. You could create a lastViewed date field and update the current time every time you view one. Then you could just select the quote with the oldest date when the date of the most recently accessed quote is equal to or greater than 24 hours less than today's date.
__________________
ABIT NF8 | Athlon 64 2800+ | 1GB Corsair XMS PC-3200 | MSI GeForce 6600GT

My blog, business, Twitter, ryze, LinkedIn, Digg, Facebook
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-28-2004, 01:53 PM
Packetrat's Avatar
Greater Overmind
Greater Overmind
 
Join Date: Feb 2003
Location: Colorado
Posts: 887
Rep Power: 6
Packetrat is on a distinguished road
Default

Right on. Sounds like a plan. Thx
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Currently Viewing
Go Back   Fury-Tech Forums > Software Forums > Programming and Coding




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
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 09:27 PM.


PHP Scripts
BidVerve Directory
PageRank Script
SEO Scripts
37 SEO Scripts
List Cleaner Script
Keyword Cleaner
Directory Script
Directory Script

Directories
BidVerve Directory
BidVerve Directory
Nerve Directories
Nerve Directories
Directory Grow
Directory Grow

Our Supporters
entertainment sites
online casino

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.