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 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 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 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(); }
$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); $Mod->addvar('{system}', stripslashes($row->REQ_SYSTEM)); $Mod->addvar('{ram}', stripslashes($row->REQ_RAM)); $Mod->addvar('{video}', stripslashes($row->REQ_VIDEO)); $Mod->addvar('{space}', stripslashes($row->REQ_SPACE)); $Mod->addvar('{mouse}', stripslashes($row->REQ_MOUSE)); $Mod->addvar('{directx}', stripslashes($row->REQ_DIRECTX)); $Mod->addvar('{sound}', stripslashes($row->REQ_SOUND)); $Mod->addvar('{description}', clean($row->DESCRIPTION)); $Mod->addvar('{views}', stripslashes($row->VIEWS)); $Mod->parse_template(); $Mod->print_template(); build_matrix('Mods', $row->ID); if ($userinfo[id] == '0') { print "Please log in to post comments.<br />"; require_once "templates/login_form.inc.php"; } else { require_once "templates/Mods_postcomment.inc.php"; } $result = $db->Execute("SELECT id,Mod_id,username,date,comment FROM Obsedb_Mods_comments WHERE Mod_id = '{$id}' ORDER BY DATE_FORMAT(date,'%y%c%d%H%i%s')"); $x = 1; while ($row = $result->FetchNextObject()) { $row->DATE = strtotime($row->DATE); $row->DATE = date('M jS, Y g:i a', $row->DATE); if ($x == 1) { print "\n\t \t\t<div style=\"padding: 10px; background: #f5f5f5;\">\n\t \t\tby <b>{$row->USERNAME}</b> on {$row->DATE}<br />\n\t \t\t<font style='font-size: 10pt;line-height: 150%;'>{$row->COMMENT}</font></div>"; $x = 0;