954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

I'm looking for a certain type of script (desc. within)

Ok here is what I want to do:

I am going to have a "6 upcoming events" (baseball games) section on my website but I want to be able to enter all of the games on one day and have it show the 6 upcoming games on the website. The thing Is I want to able to enter them all and ignore the ones that have already happened (a date will be one field I am entering). Has anyone seen a script that could help me with this?

g0rb4ch3v
Junior Poster in Training
86 posts since Oct 2003
Reputation Points: 10
Solved Threads: 0
 

The first thing that came to my mind was a javascript solution, but here is a php solution:
[PHP]
<?php

if (date('Y-m-d',strtotime('6/1/2005')) >= date('Y-m-d',time())) {
echo "
June 1: Game 1, blah, blah, blah";
}

if (date('Y-m-d',strtotime('6/15/2005')) >= date('Y-m-d',time())) {
echo "
June 15: Game 2, blah, blah, blah";
}

if (date('Y-m-d',strtotime('7/03/2005')) >= date('Y-m-d',time())) {
echo "
July 3: Game 3: blah, blah, blah";
}

?>
[/PHP]

You could also do a DHTML solution where you place each game within a DIV or SPAN. Give each DIV or SPAN an id equal to the game date. Then have a javascript fire onload that looks at all the DIVs or SPANs and if date is less than today, set (element).style.display="none";

PHP solution means you don't have to worry about any browser compatibility issues.

Troy
Posting Whiz
362 posts since Jun 2005
Reputation Points: 36
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You