// Generic dynamic template for OBCINet.org Web Site
// Designed by Katherine Koch
// July 2006
?>
include("/home/obcinet2/public_html/includes/config.php.inc"); ?>
includes("sign_in"); ?>
// First find out the name of this page
$Filename = $_SERVER['PHP_SELF'];
$query = "SELECT * FROM " . $_SESSION['db_name'] . ".CONTENT LEFT JOIN " . $_SESSION['db_name'] . ".FRAME ON " . $_SESSION['db_name'] . ".CONTENT.Frame = " . $_SESSION['db_name'] . ".FRAME.Frame_ID WHERE Filename = '$Filename';";
$res = mysql_query($query);
// Gather data
$data = mysql_fetch_array($res);
$Title = $data['Title'];
$Section_ID = $data['Section_ID'];
$Content = $data['Content'];
$Frame = $data['Frame_URI'];
?>
function content($Content) { ?>
Site Map: OBCINet.org
Having difficulty navigating this web site? Here's a table of contents with easy access to each page displayed on the site.
$query = "SELECT Section_ID, Label FROM " . $_SESSION['db_name'] . ".SECTION WHERE Level = '1' AND Visible = '1' ORDER BY Priority ASC;";
$res = mysql_query($query);
while ($row = mysql_fetch_array($res)) {
$Section_ID = $row['Section_ID'];
$Section_Label = $row['Label'];
// Print out section title
print "$Section_Label Section
\n";
$queryPages = "SELECT Page_ID, Filename, Description FROM " . $_SESSION['db_name'] . ".CONTENT WHERE Section_ID = '$Section_ID' AND Visible = '1' ORDER BY Priority ASC;";
$resPages = mysql_query($queryPages);
// Print out pages beneath this section
while ($rowPages = mysql_fetch_array($resPages)) {
$Description = $rowPages['Description'];
$Nav_Filename = $rowPages['Filename'];
$Page_ID = $rowPages['Page_ID'];
print "$Description
\n";
}
// Next, find out if there are any subsections beneath this section. If so, print them out.
$querySection = "SELECT Section_ID, Label, Level1_Parent FROM " . $_SESSION['db_name'] . ".SECTION WHERE Level ='2' AND Level1_Parent ='$Section_ID' ORDER BY SECTION.Priority ASC;";
$resSection = mysql_query($querySection);
// Print out pages beneath this section
while ($rowPages2 = mysql_fetch_array($resSection)) {
$Label = $rowPages2['Label'];
$Subsection_ID = $rowPages2['Section_ID'];
print "$Section_Label > $Label
\n";
$queryPages = "SELECT Page_ID, Filename, Description FROM " . $_SESSION['db_name'] . ".CONTENT WHERE Section_ID = '$Subsection_ID' AND Visible = '1' ORDER BY Priority ASC;";
$resPages = mysql_query($queryPages);
// Print out pages beneath this section
while ($rowPages2 = mysql_fetch_array($resPages)) {
$Description2 = $rowPages2['Description'];
$Nav_Filename2 = $rowPages2['Filename'];
$Page_ID2 = $rowPages2['Page_ID'];
print "$Description2
\n";
}
// Next, find out of there are any level 3 subsections. If so, print them out....
$querySection3 = "SELECT Section_ID, Label, Level1_Parent FROM " . $_SESSION['db_name'] . ".SECTION WHERE Level ='3' AND Level2_Parent ='$Subsection_ID' AND Visible = '1' ORDER BY SECTION.Priority ASC;";
$resSection3 = mysql_query($querySection3);
// Print out pages beneath this section
while ($rowPages3 = mysql_fetch_array($resSection3)) {
$Label = $rowPages3['Label'];
$Subsection_ID = $rowPages3['Section_ID'];
print "$Section_Label > $Description2 > $Label
\n";
$queryPages = "SELECT Page_ID, Filename, Description FROM " . $_SESSION['db_name'] . ".CONTENT WHERE Section_ID = '$Subsection_ID' AND Visible = '1' ORDER BY Priority ASC;";
$resPages = mysql_query($queryPages);
// Print out pages beneath this section
while ($rowPages3 = mysql_fetch_array($resPages)) {
$Description3 = $rowPages3['Description'];
$Nav_Filename3 = $rowPages3['Filename'];
$Page_ID3 = $rowPages3['Page_ID'];
print "$Description3
\n";
}
}
}
}
?>
} ?>
include($Frame); ?>
print "\n"; ?>