Rick, just an idea.... wouldn't the use of a database make this alot easier for you ?? 
then you can just sort your db results by date

-----Original Message-----
From: Rick Proctor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 4:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] RE: Events Listings


Hi Everyone,

I want to thank the response I've gotten for this posts but unfortunately
non of them have helped significantly. I don't know PHP that well so ideas
you give me I can't implement.

If someone could either
A.) Do it for me :-)
B.) Show some examples that directly relate to me

It would be more than greatly appreciated.

I can usely figure things out, but I guess I'm just slow to this.

Rick

-----Original Message-----
From: Rick Proctor [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 23, 2001 9:15 PM
To: [EMAIL PROTECTED]
Subject: Events Listings


Hello,

I have a script that does TV/Tour listings for artist, I need it to sort the
list automatically so that it goes in date order but I have absolutely no
idea. I have put together the script with little to no PHP skills so it look
pretty horrific.

If you could help me out with figuring out how to fix it, it would be muchly
appreciated.

The code is below

Rick

<?php
if ($max_days == ""){
$max_days = 365;
}
$current_day = date( "z");
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\"
bgcolor=\"#000000\">\n";
echo "<tr bgcolor=\"#E5E5E5\"><td colspan=\"6\" align=\"right\"><b>alanis
guide</b></td></tr>\n";
echo "<tr bgcolor=\"#E5E5E5\">\n";
echo "<td align=\"center\"><font face=\"Arial\" size=\"1\"
bgcolor=\"#E5E5E5\">date</FONT></td>\n";
echo "<td align=\"center\"><font face=\"Arial\" size=\"1\"
bgcolor=\"#E5E5E5\">time</FONT></td>\n";
echo "<td align=\"center\"><font face=\"Arial\" size=\"1\"
bgcolor=\"#E5E5E5\">where</FONT></td>\n";
echo "<td align=\"center\"><font face=\"Arial\" size=\"1\"
bgcolor=\"#E5E5E5\">what</FONT></td>\n";
echo "<td align=\"center\"><font face=\"Arial\" size=\"1\"
bgcolor=\"#E5E5E5\">days till</FONT></td>\n";
echo "</tr>\n";

//Create Function
function create($listing, $max_days){
list ($month, $day, $year, $time,$channel,$show) = split('/', $listing);
$year = "20$year";
if ($channel == "VH1"){
$url = "http://www.vh1.com";;
}
if ($channel == "MTV"){
$url = "http://www.mtv.com";;
}
if ($channel == "COM"){
$url = "http://www.comedycentral.com";;
}
if ($channel == "HBO"){
$url = "http://www.hbo.com";;
}
if ($channel == "HBOZ"){
$url = "http://www.hbo.com";;
}
if ($channel == "HBOS"){
$url = "http://www.hbo.com";;
}
if ($channel == "TRIO"){
$url = "http://www.triotv.com";;
}
$current_day = date( "z");
$show_day = date( "z", mktime( 0, 0, 0, $month, $day, $year ) );
$time_till_event = $show_day - $current_day;

if ($time_till_event < $max_days){

if ($time_till_event == '0'){
$time_till_event = "Today";
}
if ($time_till_event == '1'){
$time_till_event = "Tomorrow";
}
if ($time_till_event < 0){
return;
}
if ($url != ''){
$start = "<a href=\"$url\">";
$end = "</a>";
}
if ($confirmed == 'yes'){
$image = "images/yes.gif";
}
if ($confirmed == 'no'){
$image = "images/no.gif";
}

echo "<tr bgcolor=\"#E5E5E5\">\n";
echo "<td><font face=\"Arial\"
size=\"1\">$start$month.$day.$year$end</FONT></td>\n";
echo "<td><font face=\"Arial\" size=\"1\">$start$time$end</FONT></td>\n";
echo "<td><font face=\"Arial\" size=\"1\">$start$channel$end</FONT></td>\n";
echo "<td><font face=\"Arial\" size=\"1\">$start$show$end</FONT></td>\n";
echo "<td align=\"center\"><font face=\"Arial\"
size=\"1\">$start$time_till_event$end</FONT></td>\n";
echo "</tr>\n";
}
else{
return;
}
}
//Dates

$listing = "06/24/01/04:00 pm/VH1/Saturday Night Live 25: The Music";
create($listing, $max_days);
$listing = "06/24/01/05:00 pm/VH1/Before They Were Rock Stars";
create($listing, $max_days);
$listing = "06/24/01/11:00 pm/HBOZ/Reverb";
create($listing, $max_days);
$listing = "06/28/01/01:00 am/HBOZ/Reverb";
create($listing, $max_days);
$listing = "06/28/01/11:00 am/VH1/VH1: All Access";
create($listing, $max_days);
$listing = "06/28/01/10:00 pm/VH1/VH1: All Access";
create($listing, $max_days);
$listing = "06/28/01/11:30 pm/VH1/VH1: All Access";
create($listing, $max_days);
$listing = "06/29/01/09:30 pm/HBOS/Sex And The City";
create($listing, $max_days);
$listing = "06/30/01/07:00 pm/VH1/VH1: All Access";
create($listing, $max_days);
$listing = "07/01/01/01:00 am/TRIO/Paris Concert for Amnesty International";
create($listing, $max_days);
$listing = "07/09/01/09:00 am/TRIO/Alanis Morissette & Stevie Nicks";
create($listing, $max_days);
$listing = "07/09/01/03:00 pm/TRIO/Alanis Morissette & Stevie Nicks";
create($listing, $max_days);
$listing = "07/13/01/12:00 pm/MTV/MTV and Rolling Stone's 100 Greatest Pop
Songs ";
create($listing, $max_days);
$listing = "07/13/01/08:00 pm/MTV/MTV and Rolling Stone's 100 Greatest Pop
Songs ";
create($listing, $max_days);
$listing = "07/27/01/09:00 am/TRIO/Alanis Morissette & Stevie Nicks";
create($listing, $max_days);
$listing = "07/27/01/03:00 pm/TRIO/Alanis Morissette & Stevie Nicks";
create($listing, $max_days);
$listing = "07/01/01//Ottawa, ON/Canada Day";
create($listing, $max_days);
$listing = "07/03/01//Kristiansand, NOR/Quart Festival ";
create($listing, $max_days);
$listing = "07/05/01//Stockholm, SWE/Annex ";
create($listing, $max_days);
$listing = "07/06/01//Sundsvall, SWE/City Festival ";
create($listing, $max_days);
$listing = "07/07/01//Odense, DEN/Midtfyns Festival ";
create($listing, $max_days);
$listing = "07/09/01//Hamburg, GER/Stadtpark ";
create($listing, $max_days);
$listing = "07/11/01//Montreux, SWI/Montreux Jazz Festival ";
create($listing, $max_days);
$listing = "07/12/01//Brescia, ITA/Piazza Duomo ";
create($listing, $max_days);
$listing = "07/13/01//Palermo, ITA/To Be Announced ";
create($listing, $max_days);
$listing = "07/28/01//Nigata, JPN/Fuji Rock Festival ";
create($listing, $max_days);
$listing = "07/31/01//Anchorage, AK/Egan Civic & Conv. Ctr. ";
create($listing, $max_days);


echo "<tr align=\"center\" bgcolor=\"#E5E5E5\"><td colspan=\"6\"><font
size=\"-2\">All shows are Eastern Standard Time unless otherwise
noted</font></td></tr>\n";
echo "</table>\n";
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to