Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is this possible in PHP/JavaScript?

Name: Anonymous 2007-12-28 10:56

I am making two pages.  The first one displays a picture depending on the day - so if it's January 10 2008, the displayed pic is 2008-01-10.jpg

Next, I want to make a calendar, with each day linking to the appropriate pic of the day.  However, I want to make it so it's impossible to view pics before their day, either by not making them hyperlinks, or by making it so nothing happens when they are clicked on.  Problem is, I have no clue as to how to approach this problem aside from making 365 if-else blocks.

Any ideas?

Name: Anonymous 2007-12-28 14:11

>>1

[pseudocode]
set date D to [1st Jan 2008]
do while date D < [1st Jan 2009]
   output opening html for date D
   if date D <= today then
      link to picture
   else
      don't link to picture
   endif
   output closing html for date D
   advance date D by one day
loop
[/pseudocode]


To prevent people from manually going to the pictures, you might want to name (and link to) them with using a hash function of the date and a secret not known to the user.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List