function getThreeAnnouncements()
{
$handle = openFile( "announcements", "r");
if ( $handle != -1 )
{
$ann = fgets($handle);
for ($i=0; (!feof($handle) && $i<3); $i++)
{
//echo $ann;
$pieces = explode("|", $ann);
echo "
$pieces[0]: $pieces[1]
";
$ann = fgets($handle);
}
if ( $i == 0 )
{
noAnnouncements();
}
}
else
{
noAnnouncements();
}
}
function getAnnouncements()
{
$handle = openFile( "announcements", "r" );
if ( $handle != -1 )
{
$ann = fgets($handle);
for ($i=0; !feof($handle); $i++)
{
//echo $ann;
$pieces = explode("|", $ann);
echo "$pieces[0]: $pieces[1]
";
$ann = fgets($handle);
}
if ( $i == 0 )
{
noAnnouncements();
}
}
else
{
noAnnouncements();
}
}
function openFile( $fileName, $options )
{
if ( file_exists( $fileName ) )
$handle = fopen( $fileName, $options );
else
$handle = -1;
return $handle;
}
function getNotes()
{
$handle = openFile( "notes", "r" );
if ( $handle != -1 )
{
$notes = fgets($handle);
for( $i=0; !feof($handle); $i++)
{
//first piece is chapter number, second piece is description, last piece is file name
$pieces = explode("|", $notes);
if ( strlen($pieces[0]) == 1 )
{
echo "
";
}
else if ( strlen( $pieces[1] ) == 0 )
{
echo "$pieces[0]
";
}
else if ( !strstr( $pieces[0], "##" ) )
{
echo "
";
}
$notes = fgets($handle);
}
if ( $i == 0 )
{
echo "We don't have any notes yet, check back soon.
";
}
}
else
{
echo "We don't have any notes yet, check back soon.
";
}
}
function noAnnouncements()
{
echo date("n/j/Y");
echo ": No announcements";
}
?>
$pages = array(
"ann" => "announce.php",
"notes" => "notes.php",
"projects" => "projects.php",
//"p1" => "projects/p1/p1.php",
//"p2" => "projects/p2/p2.php",
//"p3" => "projects/p3/p3.php",
//"p4" => "projects/p4/p4.php",
//"p5" => "projects/p5/p5.php",
//"p6" => "projects/p6/p6.php",
"hw" => "homework.php",
"links" => "links.php",
);
$menuLinks = array(
"Home" => "home",
"Announcements" => "ann",
"Projects" => "projects",
"Homework" => "hw",
"Notes" => "notes",
"Links" => "links"
);
$pagesProjects = array(
// "p1" => "Project 1",
// "p2" => "Project 2",
// "p3" => "Project 3",
// "p4" => "Project 4",
// "p5" => "Project 5",
// "p6" => "Project 6",
);
/*$dropDownMenus = array(
"Projects"
);
*/
$dropDownMapping = array(
"Projects" => $pagesProjects
);
$projects = array(
// "Project 1" => "July 7",
// "Project 2" => "July 12",
// "Project 3" => "July 19",
// "Project 4" => "July 26",
// "Project 5" => "August 2",
// "Project 6" => "August 9"
);
$title = "CS2604 - Data Structures and File Processing";
?>
echo $title ?>
|
require("footer.php");?> |
|
|
|
|