$record['id'], 'p_id' => $record['p_id'], 'title' => $record['title'], 'nav_title' => $record['nav_title'], 'keywords' => $record['keywords'], 'description' => $record['description'], ); // Main Category ID if ($content['p_id'] == -1) $main_id = 0; else $main_id = ($content['p_id'] == 0) ? $content['id'] : mainID($content['p_id']); $content['topnav'] = top_nav($main_id); // Left Navigation $content['navigation'] = left_nav($main_id); // 728x15 Google Ad $content['728x15'] = file_get_contents('google/728x15.txt'); // For non-database content switch ($page) { case 'index.shtml': $template = 'template/home.tpl'; $content['content'] = $record['content']; break; case 'contact.shtml': include_once 'contact.php'; $tmp['notice'] = $notice; $content['content'] = return_template($tmp,'template/contact.tpl'); break; case 'links.shtml': include_once 'links.php'; break; default: $content['content'] = ($content['p_id'] == -1) ? $record['content'] : wrap($record['content']); break; } // merge data and template and return to $html for output $html = return_template($content,$template); } // Output HTML page echo $html; ?>