Dashby I think you are missing what I was saying. Your creating more files than necessary. I'm talking about gallery.php being the only relevant file for the gallery (for example) not having a gallery_keywords.php and gallery_title.php files as well... That's just unnecessary and creates a lot of files to maintain. I'm not sure how else to explain it tho. This is an older site that doesn't use my page class, so the index might help you understand what i mean (since you can see the items being set it in, instead of the related files)
index.php
<?php
include("./includes/variables.php"); #import global vars
include($includes."conn.php"); #connect to MySQL
include($includes."functions.php"); #global functions
GLOBAL $content;
$action = isset($_GET['action']) ? $_GET['action'] : '';
switch($action) { #Determine content
case "about":
$title = "About Us";
$keywords = ",board,directors,history,mission,staff";
include($includes."about.php");
break;
case "contact":
case "consub":
$title = "Contact Form";
$keywords = ",contact,form,information";
include($includes."contact.php");
break;
case "foster":
$title = "Foster Care";
$keywords = ",foster care,foster";
include($includes."foster.php");
break;
case "reading":
$title = "Recommended Reading";
$keywords = ",books,articles,reading";
include($includes."reading.php");
break;
case "post":
$title = "Post Placement Support";
$keywords = ",placement,support,continuing";
include($includes."post.php");
break;
case "terms":
$title = "Terms and Definitions";
$keywords = ",definitions,terms,support,help";
include($includes."terms.php");
break;
include($includes."support.php");
break;
case "process":
$title = "The Adoption Process";
$keywords = ",process,information,help,learning";
include($includes."process.php");
break;
case "start":
$title = "Getting Started with Adoption";
$keywords = ",starting,information";
include($includes."start.php");
break;
case "ainfo":
$title = "Adoption Information";
include($includes."ainfo.php");
break;
case "class":
case "grants":
case "listing":
case "nls":
case "story":
case "donate":
include($includes."info.php");
break;
case "view":
include($includes."view.php");
break;
case "vol":
case "volsub":
$title = "Volunteer at NOAS";
$keywords = ",volunteer,sign up,help,support";
include($includes."volunteer.php");
break;
case "faq";
$title = "Frequently Asked Question";
$keywords = ",faq,frequently,asked,question";
include($includes."faq.php");
break;
case "links";
$title = "Related Links";
$keywords = ",websites,links,external,related";
include($includes."links.php");
break;
case "waiting":
$keywords = ",waiting,active,children,kids";
include($includes."waiting.php");
break;
case "photos":
$keywords = ",photos";
include($includes.'photos.php');
break;
default:
include($includes."home.php");
break;
}
include($includes."header.php"); #start html document
include($includes."leftnav.php"); #insert leftnav menu
echo "<div id=\"main\">";
if ( $action == "about" || $action == "class" ) { #Determine if right nav pages
include($includes."rightnav.php");
}
echo $content;
echo "\n</div>\n";
include($includes."footer.php"); #Add Copyright & close HTML doc
?>
For setting in the related php page check out my info.php file (which as you can see a lot of cases point to)
<?php
switch ( $action ) {
case "grants":
$title = "Grant Reports";
$keywords = ",grant reports,past grants,grant";
$sql = "SELECT * FROM {$dbgrant} ORDER BY grant_pub_date DESC";
$result = mysql_query($sql,$conn);
$content .= 'PRIVATE CONTENT - Hidden for public forum.';
while( $row = mysql_fetch_assoc($result) ) {
$content .= '<div class="waiting" style="width:666px;height:'. $row['grant_div_height'] .'px;" onclick="window.open(\''. $siteurl .'resources/files/grants/'. $row['grant_file_names'] .'.pdf\',\'_blank\')">
<img src="'. $siteurl .'resources/files/grants/thumbs/'. $row['grant_file_names'] .'.jpg" border="0" alt="'. strtoupper($row['grant_file_names']) .'" class="profile" style="float:left;" />
<h2>'. $row['grant_title'] .'</h2>
<strong>Published: '. date("F Y",$row['grant_pub_date']) .'</strong><br />
<p>'. $row['grant_desc'] .'</p>
</div>';
}
break;
case "listing":
$title = "News and Events";
$keywords = ",press,press releases,news,events,past,upcoming";
$content .= headlines("upcoming_events");
$content .= headlines("events",2);
$content .= headlines("press",5);
break;
case "nls":
$title = "Newsletters";
$keywords = ",newsletters,periodical,updates";
$content .= 'PRIVATE CONTENT - Hidden for public forum.';
$nlsql = "SELECT * FROM $dbnl ORDER BY nl_release DESC";
$nlresult = mysql_query($nlsql,$conn) or DIE("Database error!<br />". mysql_error());
while( $nl = mysql_fetch_array($nlresult) ) {
$content .= "<a href=\"{$siteurl}resources/files/newsletters/{$nl['nl_file']}\">".date("F Y",$nl['nl_release'])."</a><br />";
}
break;
case "class":
$title = "Classes";
$keywords = ",pre-service,continuin ed,classes,education,support";
$groupsql = "SELECT * FROM $dbcgroup INNER JOIN $dbaloc ON id_location=class_location ORDER BY class_reg_deadline ASC";
$groupresult = mysql_query( $groupsql, $conn ) or DIE("Database Error!<br />". mysql_error() );
$content .='PRIVATE CONTENT - Hidden for public forum.';
$content .= "<div style=\"height:10px;clear:both;\"></div>";
while( $group = mysql_fetch_array($groupresult) ) {
$content .= "<table width=\"675px\">";
$content .= "<tr><td colspan=\"2\"><a name=\"{$group['id_class_group']}\"></a><h1 class=\"classgroup\">{$group['class_group_name']}</h1>\n";
$content .= "<h4>Registration Deadline: ".date("M d, Y",$group['class_reg_deadline'])."</h4>\n";
$content .= "<h4>Location: {$group['loc_title']} office</h4></td></tr>\n";
$daysql = "SELECT * FROM $dbcday WHERE class_group={$group['id_class_group']} ORDER BY class_day_start ASC";
$dayresult = mysql_query( $daysql, $conn ) or DIE("Database Error!<br />". mysql_error() );
while( $day = mysql_fetch_array($dayresult) ) {
$topicsql = "SELECT * FROM $dbctopic INNER JOIN {$dbctitle} ON id_class_title=class_name WHERE class_group={$group['id_class_group']} AND class_day={$day['id_class_day']} ORDER BY class_start_time ASC";
$topicresult = mysql_query( $topicsql, $conn ) or DIE("Database Error!<br />". mysql_error() );
$content .= "<tr><td width=\"125px\"><h2 class=\"classday\">".date("M j",$day['class_day_start'])."</h2>\n".date("g a",($day['class_day_start']+7200))." to ".date("g a",($day['class_day_end']+7200))."</td><td><table>";
while ( $topic = mysql_fetch_array($topicresult) ) {
$content .= "<tr><td width=\"100px\">".date("g a",($topic['class_start_time']+7200))." - ".date("g a",($topic['class_end_time']+7200))."</td><td>";
if( $topic['class_title'] == "Lunch" || $topic['class_title'] == "Dinner" ) {
$content .= "<i>{$topic['class_title']}</i>";
} else {
$content .= "{$topic['class_title']}";
}
$content .= "</td></tr>";
}
$content .= "</table></td></tr>";
}
$content .= "</table><div style=\"height:25px;\"></div>";
}
break;
case "donate":
$title = "Donation Information";
$keywords = ",donate,support,volunteer";
$content .= 'PRIVATE CONTENT - Hidden for public forum.';
break;
case "story":
if( !ISSET($_GET['news']) ) {
$content .= "Article ID not recognized.";
break;
} else {
$news = $_GET['news'];
}
$storyqry = "SELECT * FROM $dbnews WHERE id_news=$news";
$storyresult = mysql_query( $storyqry, $conn ) or DIE("Error with database<br />". mysql_error());
$story = mysql_fetch_array( $storyresult );
$title = "Press Release: {$story['news_hl']}";
$content .= "<h1 class=\"center\">{$story['news_hl']}</h1>{$story['news_story']}";
break;
default:
$content .= "This Section is under construction or you have reached a page that doesn't exist, please check back later.";
}
?>