function main()
 {
     global $db;
     do_table_header('Downloads');
     echo "<tr><td class=\"formlabel\"><b>";
     $alpha = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
     foreach ($alpha as $value) {
         echo "<a href=\"downloads.php?browse={$value}\">{$value}</a> &nbsp;";
     }
     echo "</b></td></tr>";
     if (empty($_REQUEST['browse'])) {
         $browse = 'A';
     } else {
         $browse = $_REQUEST['browse'];
     }
     $sections = FetchSections('Obsedb_Mods_sections');
     $Mods = $db->Execute("SELECT id,title,section\n\t\t\t\t\t\t\t\tFROM `Obsedb_Mods`\n\t\t\t\t\t\t\t\tWHERE `title` LIKE '" . $browse . "%'\n\t\t\t\t\t\t\t\tORDER BY `title`;");
     while ($row = $Mods->FetchNextObject()) {
         echo '<tr><td style="font-size: 8pt;" class="formlabel">';
         echo '<a href="downloads.php?do=add&id=' . $row->ID . '">[add download]</a> ';
         echo '<a href="downloads.php?do=manage&id=' . $row->ID . '">[manage downloads]</a> &nbsp; &nbsp;';
         echo ' <b>' . clean($row->TITLE) . '</b> (' . $sections["{$row->SECTION}"] . ')';
         echo '</td></tr>';
     }
     do_table_footer();
 }
 function editReview()
 {
     global $db;
     $sections = FetchSections('Obsedb_reviews_sections');
     $review = $db->Execute("SELECT * FROM `Obsedb_reviews` WHERE `id` = '{$_REQUEST['id']}';");
     do_form_header('reviews.php');
     do_table_header('Post New Review');
     do_text_row('Title', 'title', clean($review->fields['title']));
     do_select_row('Section', 'section', $sections, $review->fields['section']);
     $this->do_Mod_select_row($review->fields['Modid']);
     do_text_row("Modplay", "Modplay", clean($review->fields['Modplay']));
     do_text_row("Graphics", "graphics", clean($review->fields['graphics']));
     do_text_row("Sound", "sound", clean($review->fields['sound']));
     do_text_row("Value", "value", clean($review->fields['value']));
     do_text_row("Tilt", "tilt", clean($review->fields['tilt']));
     do_textarea_row('Introduction', 'intro', stripslashes($review->fields['intro']));
     do_textarea_row('Full Text', 'text', stripslashes($review->fields['text']));
     do_submit_row();
     echo '<input type="hidden" name="do" value="edit_review_confirm">';
     echo '<input type="hidden" name="id" value="' . $review->fields['id'] . '">';
     do_table_footer();
     echo '</form>';
 }
Example #3
0
    $db->Execute($sql);
    echo '<a href="screenshots.php">Click Here to Continue</a>';
}
if ($_REQUEST['do'] == 'Delete Screenshot') {
    $result = $db->Execute("\n        SELECT * FROM Obsedb_screenshots \n        WHERE `id` = '{$_REQUEST['id']}'");
    $path = $PATH_TRANSLATED;
    $path = str_replace("/user/screenshots.php", "/", $path);
    unlink($path . $result->fields['thumb']);
    unlink($path . $result->fields['screen']);
    $db->Execute("DELETE FROM `Obsedb_screenshots` WHERE `id` = '{$_REQUEST['id']}'");
    SPMessage("Screenshot has been removed.");
}
if ($_REQUEST['do'] == 'manage_sections') {
    do_form_header('screenshots.php');
    do_table_header('Sections');
    $sections = FetchSections('Obsedb_screenshots_sections');
    foreach ($sections as $key => $value) {
        $BGCOLOR = $BGCOLOR == "#ECECFF" ? "#FFFFFF" : "#ECECFF";
        echo "<tr>\n               <td bgcolor=\"{$BGCOLOR}\" colspan=\"2\">\n                  <input type=\"radio\" value=\"{$key}\" name=\"id\">" . stripslashes($value) . "\n               </td>\n            </tr>";
    }
    echo '<tr>
         <td colspan="2">
            <input type="submit" name="do" value="Edit Section">
            <input type="submit" name="do" value="Delete Section">
         </td>
        </tr>';
    do_table_footer();
    echo '</form>';
}
if ($_REQUEST['do'] == 'Delete Section') {
    $db->Execute("DELETE FROM `Obsedb_screenshots_sections` WHERE `id` = '{$_REQUEST['id']}'");
Example #4
0
switch ($_REQUEST['do']) {
    case 'search_Mods':
        $location .= " > <a href=\"search.php\">Advanced Search</a> > <b>Search Results</b>";
        break;
    default:
        $location .= " > <b>Advanced Search</b>";
        break;
}
require_once "global.php";
do_header();
if (!isset($_REQUEST['do'])) {
    include "templates/search_main.inc.php";
}
if ($_REQUEST['do'] == 'search_Mods') {
    // Cache section names
    $sections = FetchSections('Obsedb_Mods_sections');
    // Cache companies
    $companies = FetchCompanies();
    // Field validation
    if (empty($_REQUEST['keywords'])) {
        echo "Error: No keywords entered.<br />";
    } else {
        if ($_REQUEST['platform'] != 'all') {
            $platform = "`section` = '" . $_REQUEST['platform'] . "' ";
        } else {
            $platform = "`section` LIKE '%' ";
        }
        if ($_REQUEST['exact'] == '1') {
            $title = "`title` = '" . $_REQUEST['keywords'] . "' ";
        } else {
            $title = "`title` LIKE '%" . $_REQUEST['keywords'] . "%' ";
Example #5
0
    $rs = $db->Execute("SELECT * FROM `Obsedb_links` WHERE `id` = '-1'");
    $record = array('title' => $_REQUEST['title'], 'url' => $_REQUEST['url'], 'section' => $_REQUEST['section']);
    $sql = $db->GetInsertSQL($rs, $record);
    $db->Execute($sql);
    echo '<center>Link has been successfully added, <a href="links.php">click here to continue</a>.</center>';
}
if ($_REQUEST['do'] == 'edit_link_confirm') {
    $rs = $db->Execute("SELECT * FROM `Obsedb_links` WHERE `id` = '{$_REQUEST['id']}'");
    $record = array('title' => $_REQUEST['title'], 'url' => $_REQUEST['url'], 'section' => $_REQUEST['section']);
    $sql = $db->GetUpdateSQL($rs, $record);
    $db->Execute($sql);
    SPMessage('Success: Link has been updated.', 'links.php');
}
if ($_REQUEST['do'] == 'Edit Link') {
    $link = $db->Execute("SELECT * FROM `Obsedb_links` WHERE `id` = '" . $_REQUEST['id'] . "'");
    $sections = FetchSections('Obsedb_links_sections');
    $fields = array('title' => array('type' => 'text', 'title' => 'Title', 'name' => 'title', 'value' => clean($link->fields['title'])), 'url' => array('type' => 'text', 'title' => 'URL', 'name' => 'url', 'value' => clean($link->fields['url'])), 'section' => array('type' => 'select', 'title' => 'Section', name => 'section', 'value' => $sections, 'selected' => $link->fields['section']), 'submit' => array('type' => 'submit', 'title' => 'Save Link'));
    $hidden = array('id' => $_REQUEST['id']);
    GenerateForm('links.php', 'Edit Link', 'edit_link_confirm', $fields, $hidden);
}
if ($_REQUEST['do'] == 'add_section') {
    do_form_header('links.php');
    do_table_header("Add Section");
    do_text_row("Title", "title");
    do_submit_row();
    echo '<input type="hidden" name="do" value="add_section_confirm">';
    do_table_footer();
    echo '</form>';
}
if ($_REQUEST['do'] == 'Edit Section') {
    $section = $db->Execute("SELECT * FROM `Obsedb_links_sections` WHERE `id` = '{$_REQUEST['id']}'");
<table border="0" cellspacing="0" cellpadding="5" width="100%">
      <tr>
         <td width="100%"><b>Latest Reviews</b></td>
      </tr>


<?php 
global $spconfig;
$limit = $spconfig['frontpage_reviews_limit'];
$bgcolor = '';
$ReviewSections = FetchSections('Obsedb_reviews_sections');
$ReviewQuery = $db->Execute("SELECT id,title,section FROM `Obsedb_reviews` ORDER BY `id` DESC LIMIT 0,{$limit}");
while ($ReviewRow = $ReviewQuery->FetchNextObject()) {
    $bgcolor = $bgcolor == "#FFFFFF" ? "#E9E9E9" : "#FFFFFF";
    ?>

<tr>
   <td bgcolor="<?php 
    echo $bgcolor;
    ?>
" colspan="3" style="padding: 3px;">
      <font style="font-size: 11px;">
      <?php 
    echo $ReviewSections["{$ReviewRow->SECTION}"];
    ?>
: <a href="reviews.php?do=view&id=<?php 
    echo $ReviewRow->ID;
    ?>
"><?php 
    echo stripslashes($ReviewRow->TITLE);
    ?>
Example #7
0
 function edit_Mod()
 {
     global $db, $LANG;
     $Mod = $db->Execute("SELECT * FROM `Obsedb_Mods` WHERE `id` = '{$_REQUEST['id']}';");
     $row = $Mod->FetchNextObject();
     $sections = FetchSections('Obsedb_Mods_sections');
     $companies = FetchSections('Obsedb_companies');
     $esrb = array('N/A' => 'N/A', 'RP - Rating Pending' => 'RP - Rating Pending', 'EC - Early Childhood' => 'EC - Early Childhood', 'E - Everyone' => 'E - Everyone', 'E10+ - Everyone 10+' => 'E10+ - Everyone 10+', 'T - Teen' => 'T - Teen', 'M - Mature' => 'M - Mature', 'AO - Adults Only' => 'AO - Adults Only');
     $coop = array('Unknown' => 'Unknown', 'No' => 'No', 'Yes' => 'Yes');
     $form = array('1' => array('type' => 'text', 'title' => $LANG['title'], 'name' => 'title', 'value' => stripslashes($row->TITLE)), '2' => array('type' => 'select', 'title' => $LANG['section'], 'name' => 'section', 'value' => $sections, 'selected' => $row->SECTION), '3' => array('type' => 'select', 'title' => $LANG['developer'], 'name' => 'developer', 'value' => $companies, 'selected' => $row->DEVELOPER), '4' => array('type' => 'select', 'title' => $LANG['publisher'], 'name' => 'publisher', 'value' => $companies, 'selected' => $row->PUBLISHER), '5' => array('type' => 'select', 'title' => $LANG['esrb_rating'], 'name' => 'esrb', 'value' => $esrb, 'selected' => $row->ESRB), '6' => array('type' => 'text', 'title' => $LANG['genre'], 'name' => 'genre', 'value' => stripslashes($row->GENRE)), '7' => array('type' => 'text', 'title' => $LANG['release_date'], 'name' => 'release_date', 'value' => stripslashes($row->RELEASE_DATE)), '8' => array('type' => 'text', 'title' => $LANG['multiplayer'], 'name' => 'multiplayer', 'value' => stripslashes($row->MULTIPLAYER)), '9' => array('type' => 'text', 'title' => $LANG['boxshot'], 'name' => 'boxshot', 'value' => stripslashes($row->BOXSHOT)), '10' => array('type' => 'select', 'title' => $LANG['coop'], 'name' => 'coop', 'value' => $coop, 'selected' => $row->COOP), '11' => array('type' => 'textarea', 'title' => $LANG['description'], 'name' => 'description', 'value' => $row->DESCRIPTION), '12' => array('type' => 'spacer', 'title' => $LANG['minimum']), '13' => array('type' => 'text', 'title' => $LANG['system'], 'name' => 'req_system', 'value' => stripslashes($row->REQ_SYSTEM)), '14' => array('type' => 'text', 'title' => $LANG['ram'], 'name' => 'req_ram', 'value' => stripslashes($row->REQ_RAM)), '15' => array('type' => 'text', 'title' => $LANG['video_memory'], 'name' => 'req_video', 'value' => stripslashes($row->REQ_VIDEO)), '16' => array('type' => 'text', 'title' => $LANG['harddrive'], 'name' => 'req_space', 'value' => stripslashes($row->REQ_SPACE)), '17' => array('type' => 'text', 'title' => $LANG['mouse'], 'name' => 'req_mouse', 'value' => stripslashes($row->REQ_MOUSE)), '18' => array('type' => 'text', 'title' => $LANG['directx'], 'name' => 'req_directx', 'value' => stripslashes($row->REQ_DIRECTX)), '19' => array('type' => 'text', 'title' => $LANG['sound'], 'name' => 'req_sound', 'value' => stripslashes($row->REQ_SOUND)), '20' => array('type' => 'spacer', 'title' => 'Upload Box Art'), '23' => array('type' => 'blank', 'title' => 'This will overwrite your current boxart.'), '21' => array('type' => 'file', 'title' => 'Image', 'name' => 'image'), '22' => array('type' => 'spacer', 'title' => 'Custom Fields'));
     $result = $db->Execute("SELECT * FROM Obsedb_customfields WHERE module = 'Mods' ORDER BY title;");
     while ($row = $result->FetchNextObject()) {
         $field = $db->Execute("SELECT * FROM Obsedb_Mods_customdata WHERE Modid = {$_REQUEST['id']} AND fieldid = {$row->ID};");
         $form[] = array('type' => $row->TYPE, 'title' => $row->TITLE, 'name' => "field{$row->ID}", 'value' => stripslashes($field->fields['value']));
     }
     $form[] = array('type' => 'submit', 'title' => 'Save Mod');
     $hidden = array('id' => $_REQUEST['id']);
     GenerateForm('Mods.php', $LANG['edit_Mod'], 'edit_Mod_confirm', $form, $hidden, 'true');
 }
Example #8
0
    do_table_footer();
    do_form_footer();
}
if ($_REQUEST['do'] == 'edit_section_confirm') {
    $rs = $db->Execute("SELECT * FROM `Obsedb_news_sections` WHERE `id` = '{$_REQUEST['id']}'");
    $record = array('title' => $_REQUEST['title']);
    $sql = $db->GetUpdateSQL($rs, $record);
    $db->Execute($sql);
    SPMessage('Success | Changes have been saved.', 'news.php');
}
if ($_REQUEST['do'] == 'add_section_confirm') {
    $db->Execute("INSERT INTO `Obsedb_news_sections` (title) VALUES ('{$_REQUEST['title']}');");
    SPMessage('Success | Section has been successfully created.', 'news.php');
}
if ($_REQUEST['do'] == 'add_news') {
    $sections = FetchSections('Obsedb_news_sections');
    do_form_header('news.php');
    do_table_header('Post New Article');
    do_text_row('Title', 'title');
    do_text_row('Author', 'author');
    do_select_row('Section', 'section', $sections);
    do_text_row('Creation Date', 'date', date($spconfig['date_format']));
    listArticleImages();
    do_textarea_row('Introduction', 'intro');
    do_textarea_row('Full Text', 'text');
    do_submit_row();
    echo '<input type="hidden" name="do" value="add_news_confirm">';
    do_table_footer();
    echo '</form>';
}
if ($_REQUEST['do'] == 'add_news_confirm') {
Example #9
0
 function main()
 {
     global $db;
     if (isset($_REQUEST['section'])) {
         $where = "WHERE Obsedb_news.section = {$_REQUEST['section']}";
     }
     // Globalize Variables
     $search = $_REQUEST['search'];
     $keyword = $_REQUEST['keyword'];
     $month = $_REQUEST['month'];
     $year = $_REQUEST['year'];
     do_header();
     echo '<form method="post" action="archive.php">';
     echo '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
     echo '<tr>';
     echo '<td width="25%">Keywords:</td>';
     echo '<td width="25%">Month:</td>';
     echo '<td width="25%">Year:</td>';
     echo '<td width="25%"></td>';
     echo '</tr>';
     echo '<tr>';
     echo '<td width="25%"><input type="text" name="keyword" size="15"></td>';
     echo '<td width="25%"><select name="month">';
     echo '<option value="' . date("m") . '">' . date("F") . '</option>';
     echo '<option value="01">January</option>';
     echo '<option value="02">February</option>';
     echo '<option value="03">March</option>';
     echo '<option value="04">April</option>';
     echo '<option value="05">May</option>';
     echo '<option value="06">June</option>';
     echo '<option value="07">July</option>';
     echo '<option value="08">August</option>';
     echo '<option value="09">September</option>';
     echo '<option value="10">October</option>';
     echo '<option value="11">November</option>';
     echo '<option value="12">December</option>';
     echo '</select></td>';
     echo '<td width="25%"><select name="year">';
     $thisyear = date("Y");
     $startyear = $thisyear;
     while ($startyear >= $thisyear - 5) {
         if ($startyear == $thisyear) {
             echo "<option value=\"{$startyear}\" selected>{$startyear}</option>";
         } else {
             echo "<option value=\"{$startyear}\">{$startyear}</option>";
         }
         $startyear--;
     }
     echo '</select></td>';
     echo '<td width="25%"><input type="submit" value="List Articles" name="submit"></td>';
     echo '</tr>';
     echo '</table>';
     echo '<input type="hidden" name="search" value="1">';
     echo '</form>';
     echo '<table border="0" cellspacing="0" cellpadding="4" width="100%">';
     $sections = FetchSections("Obsedb_news_sections");
     $specialdata = "<b>News Sections</b><br />";
     foreach ($sections as $key => $value) {
         $specialdata .= "&nbsp;";
         $specialdata .= '<a href="archive.php?section=' . $key . '">' . stripslashes($value) . '</a><br />';
     }
     $specialdata .= "<br />";
     // Decide which query to use
     if ($search == 1) {
         if (!empty($keyword)) {
             $where = " AND `title` LIKE '%{$keyword}%'";
         }
         $result = $db->Execute("SELECT id,title,author,date,section FROM Obsedb_news WHERE date LIKE '" . $year . "." . $month . ".%' {$where} ORDER BY date DESC");
     } else {
         $result = $db->Execute("SELECT id,title,author,date,section FROM Obsedb_news ORDER BY date DESC LIMIT 0,50");
     }
     while ($row = $result->FetchNextObject()) {
         echo '<tr>';
         echo '<td><a href="index.php?do=viewarticle&id=' . $row->ID . '">' . $row->TITLE . '</a></td>';
         echo '<td>' . $row->DATE . '</td>';
         echo '<td>' . $row->AUTHOR . '</td>';
         echo '</tr>';
     }
     echo '</table><br /><br />';
     do_footer();
 }