function main() { global $db; if (isset($_REQUEST['id'])) { $result = $db->Execute("SELECT * FROM `Obsedb_Mods` WHERE `id` = '{$_REQUEST['id']}' LIMIT 1"); while ($row = $result->FetchNextObject()) { do_header(); $header = new Template(); $header->open_template('cheats_header'); $header->addvar('{id}', $row->ID); $header->addvar('{title}', stripslashes($row->TITLE)); $header->parse_template(); $header->print_template(); $cheats = $db->Execute("SELECT id,Modid,title,cheat FROM `Obsedb_cheats` WHERE `Modid` = '{$_REQUEST['id']}' ORDER BY `title`"); while ($cheat = $cheats->FetchNextObject()) { // CHEAT HTML echo "<b>" . clean($cheat->TITLE) . "</b><br />\n \t\t\t " . stripslashes($cheat->CHEAT) . "<br /><br />"; // END CHEAT HTML } do_footer(); } } else { do_header(); echo "<b>System Error Message</b><br />"; echo "You cannot access this page directly, please go back and select a Mod.<br />"; echo "If the problem persists, please contact the webmaster."; do_footer(); } }
function main() { global $db; // Get Mod Info if (isset($_REQUEST['id'])) { $result = $db->Execute("SELECT * FROM `Obsedb_Mods` WHERE `id` = '{$_REQUEST['id']}' LIMIT 1"); while ($row = $result->FetchNextObject()) { $cheats = $db->Execute("SELECT id,Modid FROM `Obsedb_cheats` WHERE Modid = {$_REQUEST['id']} LIMIT 1"); if ($cheats->RecordCount() >= 1) { $cheat_link = "<a href=\"cheats.php?id={$row->ID}\">Cheats</a>"; } else { $cheat_link = "Cheats"; } do_header(); $tplHeader = new Template(); $tplHeader->open_template('downloads_header'); $tplHeader->addvar('{title}', stripslashes($row->TITLE)); $tplHeader->addvar('{id}', $row->ID); $tplHeader->addvar('{cheat_link}', $cheat_link); $tplHeader->parse_template(); $tplHeader->print_template(); $downloads = $db->Execute("SELECT id,Modid,title,download FROM `Obsedb_downloads` WHERE `Modid` = '{$_REQUEST['id']}' ORDER BY `title`"); while ($download = $downloads->FetchNextObject()) { // DOWNLOAD HTML echo "<a href='" . stripslashes($download->DOWNLOAD) . "'>" . clean($download->TITLE) . "</a><br /><br />"; // END DOWNLOAD HTML } $tplFooter = new Template(); $tplFooter->open_template('downloads_footer'); $tplFooter->parse_template(); $tplFooter->print_template(); do_footer(); } } else { do_header(); echo "<b>System Error Message</b><br />"; echo "You cannot access this page directly, please go back and select a Mod.<br />"; echo "If the problem persists, please contact the webmaster."; do_footer(); } }
function mailbag_main() { global $db; do_header(); $tplHeader = new Template(); $tplHeader->open_template('mailbag_header'); $tplHeader->print_template(); $tplItem = new Template(); $tplItem->open_template('mailbag_item'); $result = $db->Execute("SELECT * FROM `Obsedb_mailbag` ORDER BY `id` DESC"); while ($row = $result->FetchNextObject()) { $tplItem->addvar('{title}', stripslashes($row->TITLE)); $tplItem->addvar('{message}', clean($row->MESSAGE)); $tplItem->addvar('{reply}', clean($row->REPLY)); $tplItem->parse_template(); $tplItem->print_template(); } $tplFooter = new Template(); $tplFooter->open_template('mailbag_footer'); $tplFooter->print_template(); do_footer(); }
function view() { global $db; if (!is_numeric($_REQUEST['id'])) { die("Critical Error: Aborting script operations."); } $result = $db->Execute("SELECT * FROM Obsedb_companies WHERE id = {$_REQUEST['id']} LIMIT 1"); $company = array(); $company['title'] = stripslashes($result->fields['title']); $company['description'] = clean($result->fields['description']); if (!empty($result->fields['homepage'])) { $company['homepage'] = '<a href="' . stripslashes($result->fields['homepage']) . '" target="_blank">' . stripslashes($result->fields['homepage']) . '</a>'; } if (!empty($result->fields['logo'])) { $company['logo'] .= "<img src=\""; $company['logo'] .= stripslashes($result->fields['logo']); $company['logo'] .= "\" alt=\"" . $company['title'] . " align=\"right\" hspace=\"2\" vspace=\"2\">"; } $result = $db->Execute("\n\t\t\tSELECT id, title, section, developer\n\t\t\tFROM Obsedb_Mods\n\t\t\tWHERE developer = " . $_REQUEST['id'] . "\n\t\t\tORDER BY title;"); while ($row = $result->FetchNextObject()) { $company['dev_links'] .= '<a href="Moddetails.php?id=' . $row->ID . '">' . stripslashes($row->TITLE) . '</a><br />'; } $result = $db->Execute("\n\t\t\tSELECT id, title, section, publisher\n\t\t\tFROM Obsedb_Mods\n\t\t\tWHERE publisher = " . $_REQUEST['id'] . "\n\t\t\tORDER BY title;"); while ($row = $result->FetchNextObject()) { $company['pub_links'] .= '<a href="Moddetails.php?id=' . $row->ID . '">' . stripslashes($row->TITLE) . '</a><br />'; } do_header(); $template = new Template(); $template->open_template('company_profile'); $template->addvar('{title}', $company['title']); $template->addvar('{homepage}', $company['homepage']); $template->addvar('{logo}', $company['logo']); $template->addvar('{description}', $company['description']); $template->parse_template(); $template->print_template(); if (!empty($company['dev_links'])) { $company_profile_devlinks = new Template(); $company_profile_devlinks->open_template('company_profile_devlinks'); $company_profile_devlinks->addvar('{links}', $company['dev_links']); $company_profile_devlinks->parse_template(); $company_profile_devlinks->print_template(); } if (!empty($company['pub_links'])) { $company_profile_publinks = new Template(); $company_profile_publinks->open_template('company_profile_publinks'); $company_profile_publinks->addvar('{links}', $company['pub_links']); $company_profile_publinks->parse_template(); $company_profile_publinks->print_template(); } do_footer(); }
function do_footer() { global $bottom; $footer = new Template(); $footer->open_template('footer'); $footer->addvar('{bottom}', $bottom); $footer->parse_template(); $footer->print_template(); }
<?php // Template Information // ====================================================================== // This template displays a table of the newest Mods that // have been added to the site. // // You can alter the number of Mods displayed by changing // the limit in the SQL statement. The default limit is 10. // ====================================================================== global $spconfig; $limit = $spconfig['frontpage_latest_Mods_limit']; $result = $db->Execute("\n SELECT g.id,g.title,p.title AS platform \n FROM Obsedb_Mods AS g, Obsedb_Mods_sections AS p \n WHERE g.section = p.id AND\n g.published = '1'\n ORDER BY `id` DESC\n LIMIT 0,{$limit};"); while ($row = $result->FetchNextObject()) { $Mods .= "<div style=\"padding: 3px;\">" . "<b><a href=\"Moddetails.php?id={$row->ID}\">" . stripslashes($row->TITLE) . "</a></b> " . "(" . stripslashes($row->PLATFORM) . ")" . "</div>\n"; } $frontpageLatestMods = new Template(); $frontpageLatestMods->open_template('frontpage_latest_Mods'); $frontpageLatestMods->addvar('{Mods}', $Mods); $frontpageLatestMods->parse_template(); $frontpageLatestMods->print_template(); unset($Mods);
<?php global $spconfig; $limit = $spconfig['frontpage_popular_Mods_limit']; $counter = 0; $ModQuery = $db->Execute("\n SELECT g.id,g.title,p.title AS platform \n FROM Obsedb_Mods AS g, Obsedb_Mods_sections AS p \n WHERE g.section = p.id AND\n g.published = '1'\n ORDER BY g.views DESC\n LIMIT 0,{$limit};"); while ($row = $ModQuery->FetchNextObject()) { $counter++; $Mods .= "<div style=\"padding: 3px;\">\n" . " <a href=\"Moddetails.php?id={$row->ID}\"><b>" . stripslashes($row->TITLE) . "</b></a> " . "({$row->PLATFORM})"; } $frontpagePopularMods = new Template(); $frontpagePopularMods->open_template('frontpage_popular_Mods'); $frontpagePopularMods->addvar('{Mods}', $Mods); $frontpagePopularMods->parse_template(); $frontpagePopularMods->print_template(); // Clear Mods variable unset($Mods);
$Modlist_header->addvar('{title}', $label_title); $Modlist_header->addvar('{genre}', $label_genre); $Modlist_header->addvar('{release}', $label_release); $Modlist_header->addvar('{section}', $label_section); $Modlist_header->parse_template(); $Modlist_header->print_template(); unset($Modlist_header); $Modlist_row = new Template(); $Modlist_row->open_template('Modlist_row'); $result = $db->Execute($sql) or die($db->ErrorMsg()); while ($row = $result->FetchNextObject()) { $bgcolor = $bgcolor == "#FFFFFF" ? "#E9E9E9" : "#FFFFFF"; $section = stripslashes($sections["{$row->SECTION}"]); $publisher = stripslashes($companies["{$row->PUBLISHER}"]); $developer = stripslashes($companies["{$row->DEVELOPER}"]); $Modlist_row->addvar('{id}', $row->ID); $Modlist_row->addvar('{title}', stripslashes($row->TITLE)); $Modlist_row->addvar('{bgcolor}', $bgcolor); $Modlist_row->addvar('{section}', $section); $Modlist_row->addvar('{genre}', stripslashes($row->GENRE)); $Modlist_row->addvar('{release}', stripslashes($row->RELEASE_DATE)); $Modlist_row->parse_template(); $Modlist_row->print_template(); } unset($Modlist_row); $Modlist_footer = new Template(); $Modlist_footer->open_template('Modlist_footer'); $Modlist_footer->print_template(); unset($Modlist_footer); do_footer(); }
} else { $download_link = "Downloads"; } $getfields = $db->Execute("SELECT * FROM Obsedb_customfields WHERE module = 'Mods' ORDER BY title"); while ($field = $getfields->FetchNextObject()) { $getvalue = $db->Execute("SELECT * FROM Obsedb_Mods_customdata WHERE Modid = {$id} AND fieldid = {$field->ID};"); if ($getvalue->fields['value'] != '') { $customfields .= "<tr><td><b>"; $customfields .= stripslashes($field->TITLE) . "</b>: "; $customfields .= stripslashes($getvalue->fields['value']) . "</td></tr>"; } } do_header(); $Mod = new Template(); $Mod->open_template('Mod_profile'); $Mod->addvar('{title}', stripslashes($row->TITLE)); $Mod->addvar('{id}', $row->ID); $Mod->addvar('{cheat_link}', $cheat_link); $Mod->addvar('{download_link}', $download_link); if (!empty($row->BOXSHOT)) { $Mod->addvar('{boxshot}', '<img src="' . $row->BOXSHOT . '">'); } else { $Mod->addvar('{boxshot}', 'No Boxshot'); } $Mod->addvar('{developer}', $developer_link); $Mod->addvar('{publisher}', $publisher_link); $Mod->addvar('{genre}', stripslashes($row->GENRE)); $Mod->addvar('{release}', stripslashes($row->RELEASE_DATE)); $Mod->addvar('{multiplayer}', stripslashes($row->MULTIPLAYER)); $Mod->addvar('{custom_fields}', $customfields); $Mod->addvar('{platform}', $platform);