$row['id'], 'p_id' => $row['p_id'], 'title' => $row['title'], 'nav_title' => $row['nav_title'], 'keywords' => $row['keywords'], 'description' => $row['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']); // Left Navigation $content['navigation'] = left_nav($main_id); // Google 120x90 Left Nav $content['google120x90'] = file_get_contents('google/120x90_generic_nav.txt'); // Google 728x15 Bottom $content['google468x15'] = file_get_contents('google/468x15_article_bottom.txt'); // Default template $template = (isGenericPage($page)) ? 'template/generic.tpl' : 'template/article.tpl'; // For non-database content switch (true) { // Home Page case ($page == 'index.shtml'): $template = 'template/home.tpl'; break; // Contact Form case ($page == 'contact.shtml'): include_once 'scripts/contact.php'; $tmp['notice'] = $notice; $content['content'] = $row['content']; $content['content'] .= return_template($tmp,'template/contact.tpl'); break; default: $content['content'] = ($content['p_id'] == -1) ? $row['content'] : wrap($row['content']); break; } // Copyright date $content['copyright-date'] = date('Y',time()); //get page name $content['page_name'] = parseUrl($_SERVER['REQUEST_URI']); // StatCounter $content['statcounter'] = (statCounter($main_id)) ? file_get_contents(statCounter($main_id)) : ''; // Sources used in the Ad Server $zones['source'] = getSource($main_id); // 728x90 Leaderboard $content['728x90-leaderboard-all'] = return_template($zones,'advertisement/zones/728x90_leaderboard_all.tpl'); // 728x90 Leaderboard bottom $content['728x90-leaderboard-bottom'] = return_template($zones,'advertisement/zones/728x90_bottom_ad.tpl'); // 160x600 Leaderboard $content['160x600-right-all'] = return_template($zones,'advertisement/zones/160x600_right_all.tpl'); // merge data and template and return to $html for output $html = return_template($content,$template); } // Output HTML page echo $html; ?>