$start=microtime();
$ns= ereg("MSIE|Gecko",$HTTP_USER_AGENT) ? 0:1;
$q=ereg_replace("^([0-9]+).*$","\\1",$QUERY_STRING);
$seasons=array('fall', 'winter', 'spring');
$page=''; $season_id='';
mysql_connect('localhost','root','nidec');
mysql_select_db('shorecrest');
if ($q>0) {
$res=mysql_query("SELECT team, season FROM teams WHERE id=$q");
if (mysql_num_rows($res)) {
list($team,$season_id)=mysql_fetch_row($res);
$season=$seasons[$season_id];
}
} else $q=0;
$schedule_link='Schedule';
$news_link='News';
$gallery_link='Gallery';
if (ereg("__",$QUERY_STRING)){$left_link=$schedule_link; $right_link=$news_link;}
else if (ereg("_",$QUERY_STRING)){$left_link=$schedule_link; $right_link=$gallery_link;}
else {$left_link=$news_link; $right_link=$gallery_link;}
if ($QUERY_STRING=='_') {$left_link=''; $right_link='News';}
if (!$QUERY_STRING) {$left_link=''; $right_link='Coming Up';}
if ($season_id==9) {$left_link=''; $right_link='';}
?>
Shorecrest Athletics
>

$res=mysql_query("SELECT id, team, season FROM teams
WHERE season<4 ORDER BY season, SUBSTRING_INDEX(team,' ',-1), team");
while($row=mysql_fetch_array($res)) {
if ($page!=$row[season]) {
if ($row[season]>0) echo " |
\n\n";?>
}
if (eregi(" Basketball",$row[team])) $flag='Basketball';
if (eregi(" Soccer",$row[team])) $flag='Soccer';
if ($flag!=$tmp) {?> |
}?>
$tmp=$flag;
$row[team]=eregi_replace(" Basketball| Soccer","",$row[team]);?>
|
|
$page=$row[season];
}?>
$res=mysql_query("SELECT id, team FROM teams WHERE season=9 ORDER BY id");
while($row=mysql_fetch_array($res)) {?>
}?>
Shorecrest Home
Contact Us
 |
 |

Coming Up
$res=mysql_query("SELECT teams.team AS team, DATE_FORMAT(date,'%b %d') AS format,
DATE_FORMAT(date,'%a') AS day, time, opponent, location
FROM schedules, teams WHERE schedules.team=teams.id AND
TO_DAYS(date)-TO_DAYS(NOW()) BETWEEN 0 AND 14
ORDER BY date");
$n=0;
while($row=mysql_fetch_array($res)) { $n++;?>
| | | | | |
}?>
} else {
$res=mysql_query("SELECT id, title, text, caption FROM news WHERE title!='Schedule' AND team=$q AND display=1 ORDER BY date DESC");
$n=0;
while($row=mysql_fetch_array($res)) {
echo "".$row[title]."\n\n";
if (file_exists('pics/'.$row[id].'.jpg')) {
$dim=GetImageSize('pics/'.$row[id].'.jpg');
$n++; $align= ($n%2) ? 'right' : 'left';
echo '
 |
'.$row[caption].'
';
}
echo $row[text]."
\n";
}
}
} else if (ereg("__",$QUERY_STRING)) {?>
Gallery
$res=mysql_query("SELECT id, caption FROM gallery WHERE team=$q ORDER BY date, id DESC");
while($row=mysql_fetch_array($res)) {
if (file_exists('pics/g'.$row[id].'.jpg')) $dim=GetImageSize('pics/g'.$row[id].'.jpg');
if ($dim) echo ' '
."".$row[caption]."\n";
}?>
}else if (ereg("_",$QUERY_STRING)) {
$res=mysql_query("SELECT id, title, text, caption FROM news WHERE title!='Schedule' AND team=$q AND display=1 ORDER BY date, id DESC");
$n=0;
while($row=mysql_fetch_array($res)) {
echo "".$row[title]."\n\n";
if (file_exists('pics/'.$row[id].'.jpg')) {
$dim=GetImageSize('pics/'.$row[id].'.jpg');
$n++; $align= ($n%2) ? 'right' : 'left';
echo '
 |
'.$row[caption].'
';
}
echo $row[text]."
\n";
}
} else {?>
Schedule
$res=mysql_query("SELECT DATE_FORMAT(date,'%b %d') AS format,
DATE_FORMAT(date,'%a') AS day, time, opponent, location, result
FROM schedules WHERE team=$q ORDER BY date");
$n=0;
while($row=mysql_fetch_array($res)) { $n++;?>
| | | | | |
}?>
$res=mysql_query("SELECT text FROM news WHERE title='Schedule' AND team=$q AND display=1 ORDER BY date DESC");
while($row=mysql_fetch_array($res)) echo "".$row[text]."\n";
}?>
$res=mysql_query("SELECT id, link, id*0.0001+rand() FROM banners ORDER BY 3 LIMIT 1");
list($id,$link)=mysql_fetch_row($res);
if (file_exists('pics/b'.$id.'.gif')) {
$dim=GetImageSize('pics/b'.$id.'.gif');
if ($link) echo '';
echo ' ';
if ($link) echo "\n";
}?>
©2001 Created and Powered by TrueFire.com
|