Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Not so random image?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

snaayk
Senior Member

USA
1061 Posts

Posted - 03 August 2001 :  19:23:00  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
I would like to show a random image from a folder. Easy? Yeah, I know how to show a random image everytime the page loads, but how about for the entire day? For example, this is for a gaming site and it is going to be used for enviorment in the game. So if its rainy it should be rainy all day and perhaos twice in a roll. However, all scripts I find will make the image random on every page load. Anybody have an idea???

********************
Who is this General Fault, and why is he reading my Hard Drive???

Id
Junior Member

USA
129 Posts

Posted - 03 August 2001 :  20:12:27  Show Profile  Visit Id's Homepage
you'd have to modify the global.asa file for it to work, and store some things in application variables. I'm not sure exactly what would need done with the code, but you'd need a variable that would store the date, and then you'd need to run a check against the date to see if a new image needs to be created.

Going insane one day at a time
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 04 August 2001 :  08:16:03  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

you'd have to modify the global.asa file for it to work, and store some things in application variables. I'm not sure exactly what would need done with the code, but you'd need a variable that would store the date, and then you'd need to run a check against the date to see if a new image needs to be created.

Going insane one day at a time



Hi,

In theory, you could add a table to a databases and call it Image_date or something. Have two fields. Picture and Today_date. Now write some code to check the database and see if the actual date matches the date in the database field "TODAY_DATE". If it does, then read the field Picture and display the image. Then use an application variable so you dont have to connect to the database every time a user accesses the page.

Of course, if the actual date doesnt match the date in the database then write the new date to the database, use your random image picker script to pick the new image, then write that image url to the db. Then use your application variables again.

That should work...


Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging
Go to Top of Page

snaayk
Senior Member

USA
1061 Posts

Posted - 04 August 2001 :  20:54:01  Show Profile  Visit snaayk's Homepage  Send snaayk an AOL message  Send snaayk an ICQ Message  Send snaayk a Yahoo! Message
WHOA! Let me read that a few more times.....

Thanks! I have to start playing around with it :)

********************
Who is this General Fault, and why is he reading my Hard Drive???
Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 05 August 2001 :  09:34:04  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

WHOA! Let me read that a few more times.....

Thanks! I have to start playing around with it :)

********************
Who is this General Fault, and why is he reading my Hard Drive???


If you need any more help let me know...

Regards - Spoon

Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html

www.ASlickPage.com - Private Messaging
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07