function main()
 {
     global $db;
     do_table_header("Obsedb CMS Mod Library");
     print "<tr><td style=\"background: #fff;\">";
     $phpVersion = phpversion();
     if ($phpVersion >= 5) {
         print '<h3 style="padding-left: 5px;"><span style="color: green;">Beta</span></h3>';
         if (!isset($_REQUEST['platform'])) {
             $xmlfile = simplexml_load_file('http://content.Obsedbcms.com/platforms.xml');
             foreach ($xmlfile as $platform) {
                 print '<div style="font-size: 10pt; padding: 10px; width: 300px; background-color: #fff; border: 1px solid #f5f5f5;">';
                 print '<a href="content.php?platform=' . $platform->var . '">' . $platform->title . '</a>';
                 print '</div><br />';
             }
         } else {
             $xmlfile = simplexml_load_file('http://content.Obsedbcms.com/' . $_REQUEST[platform]);
             foreach ($xmlfile as $Mod) {
                 print '<div style="padding: 10px; width: 300px; background-color: #fff; border: 1px solid #f5f5f5;">';
                 print '<div style="font-size: 10pt;">' . $Mod->title . '</div>';
                 print '<a href="content.php?do=import_Mod&Mod=' . $Mod->url . '">Import Mod</a>';
                 print '</div><br />';
             }
         }
     } else {
         print '<h3 style="margin: 0px;"><span style="color: green;">Error</span></h3>';
         print "You must have PHP version 5 or greater to access the content download system.";
     }
     print "</td></tr>";
     do_table_footer();
 }
 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 add_section()
 {
     do_form_header("screenshots.php");
     do_table_header("Add Section");
     do_text_row("Title", "title");
     do_submit_row("Add Section");
     echo '<input type="hidden" name="do" value="add_section_confirm">';
     do_table_footer();
     do_form_footer();
 }
Example #4
0
function edit_template($title)
{
    global $db;
    do_table_header("Manage Templates");
    $result = $db->Execute("SELECT * FROM Obsedb_templates WHERE `title` = '{$title}';");
    do_form_header('templates.php');
    do_blank_row("Editing Template");
    print "<tr><td class=\"formlabel\">\n" . "<textarea rows=\"20\" cols=\"70\" name=\"html\">" . stripslashes($result->fields['html']) . "</textarea></td></tr>";
    do_submit_row("Save Template");
    print '<input type="hidden" name="title" value="' . $title . '">';
    print '<input type="hidden" name="do" value="save">';
    do_table_footer();
    do_form_footer();
}
 function manage()
 {
     global $db;
     $result = $db->Execute("SELECT id,title\n\t\t\t\t\tFROM `Obsedb_Mods`\n\t\t\t\t\tWHERE `id` = '{$_REQUEST['id']}';");
     do_table_header("Cheats: " . clean($result->fields['title']));
     $result = $db->Execute("SELECT id,title,Modid\n\t\t\t\t\tFROM `Obsedb_cheats`\n\t\t\t\t\tWHERE `Modid` = '{$_REQUEST['id']}'\n\t\t\t\t\tORDER BY `title`;");
     echo '<tr><td style="font-size: 8pt;" class="formlabel">';
     if ($result->RecordCount() == 1) {
         echo '<b>There is 1 cheat for this Mod.</b>';
     } else {
         echo '<b>There are ' . $result->RecordCount() . ' cheats for this Mod.</b>';
     }
     echo '</td></tr>';
     while ($row = $result->FetchNextObject()) {
         echo "<tr>\n\t\t\t\t\t<td style='font-size: 8pt;' class='formlabel'>\n\t\t\t\t\t<a href=\"cheats.php?do=edit&id={$row->ID}\">[edit cheat]</a>\n\t\t\t\t\t<a href=\"cheats.php?do=delete&id={$row->ID}\">[delete]</a> &nbsp;\n\t\t\t\t\t" . clean($row->TITLE) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>";
     }
     do_table_footer();
 }
Example #6
0
function list_sections()
{
    global $db;
    do_module_header('Sections', 'Manage all the sections of your website');
    do_table_header('Mod Sections');
    do_blank_row('<a href="Mods.php?do=add_section">Add Section</a>');
    $result = $db->Execute("SELECT id,title FROM `Obsedb_Mods_sections` ORDER BY `title`");
    while ($row = $result->FetchNextObject()) {
        do_blank_row("<b>" . stripslashes($row->TITLE) . "</b>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='Mods.php?do=Edit+Section&id={$row->ID}'>Change the section name</a>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='Mods.php?do=Delete+Section&id={$row->ID}'>Delete the section</a>");
    }
    do_table_footer();
    do_table_header('News Sections');
    do_blank_row('<a href="news.php?do=add_section">Add Section</a>');
    $result = $db->Execute("SELECT id,title FROM `Obsedb_news_sections` ORDER BY `title`");
    while ($row = $result->FetchNextObject()) {
        do_blank_row("<b>" . stripslashes($row->TITLE) . "</b>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='news.php?do=Edit+Section&id={$row->ID}'>Change the section name</a>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='news.php?do=Delete+Section&id={$row->ID}'>Delete the section</a>");
    }
    do_table_footer();
    do_table_header('Previews Sections');
    do_blank_row('<a href="previews.php?do=add_section">Add Section</a>');
    $result = $db->Execute("SELECT id,title FROM `Obsedb_previews_sections` ORDER BY `title`");
    while ($row = $result->FetchNextObject()) {
        do_blank_row("<b>" . stripslashes($row->TITLE) . "</b>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='previews.php?do=Edit+Section&id={$row->ID}'>Change the section name</a>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='previews.php?do=Delete+Section&id={$row->ID}'>Delete the section</a>");
    }
    do_table_footer();
    do_table_header('Reviews Sections');
    do_blank_row('<a href="reviews.php?do=add_section">Add Section</a>');
    $result = $db->Execute("SELECT id,title FROM `Obsedb_reviews_sections` ORDER BY `title`");
    while ($row = $result->FetchNextObject()) {
        do_blank_row("<b>" . stripslashes($row->TITLE) . "</b>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='reviews.php?do=Edit+Section&id={$row->ID}'>Change the section name</a>");
        do_blank_row("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &middot; <a href='reviews.php?do=Delete+Section&id={$row->ID}'>Delete the section</a>");
    }
    do_table_footer();
}
Example #7
0
 function editAnnouncementForm()
 {
     global $db;
     $result = $db->Execute("SELECT * FROM `Obsedb_announcements` WHERE `id` = '{$_REQUEST['id']}'");
     do_form_header('index2.php');
     do_table_header('Edit Announcement');
     do_text_row($this->phrase['username'], 'user', $result->fields['user']);
     do_text_row($this->phrase['title'], 'title', stripslashes($result->fields['title']));
     do_textarea_row($this->phrase['message'], 'text', stripslashes($result->fields['text']));
     do_submit_row('Save Changes');
     do_table_footer();
     echo '<input type="hidden" name="do" value="edit_confirm">';
     echo '<input type="hidden" name="id" value="' . $_REQUEST[id] . '">';
     echo '</form>';
 }
Example #8
0
    do_submit_row('Install');
    do_table_footer();
    echo '<input type="hidden" name="do" value="install2">';
    do_form_footer();
}
if ($_REQUEST['do'] == 'install2') {
    $record["title"] = $_REQUEST['title'];
    $record["url"] = $_REQUEST['filename'];
    $db->AutoExecute("Obsedb_modules", $record, 'INSERT');
    SPMessage('Success | Module has been added to control panel', 'modules.php');
}
if ($do == 'edit') {
    $result = $db->Execute("\n        SELECT * FROM Obsedb_modules\n        WHERE `id` = '{$id}'");
    do_form_header('modules.php');
    do_table_header('Module Configuration');
    do_text_row('Name', 'title', stripslashes($result->fields['title']));
    do_text_row('Target', 'url', stripslashes($result->fields['url']));
    do_submit_row('Save Changes');
    do_table_footer();
    print '<input type="hidden" name="do" value="edit_confirm">';
    print '<input type="hidden" name="id" value="' . $id . '">';
    do_form_footer();
}
if ($do == 'edit_confirm') {
    $title = $cp->getParam('title');
    $url = $cp->getParam('url');
    $record = array('title' => $title, 'url' => $url);
    $db->AutoExecute('Obsedb_modules', $record, "UPDATE", "`id` = '{$id}'");
    SPMessage("Module configuration has been saved.");
}
$cp->footer();
function generate_matrix($type)
{
    global $db;
    // Related News
    $result = $db->Execute("\n\t\tSELECT * FROM `Obsedb_matrix`\n\t\tWHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'news';");
    do_table_header("Related News");
    echo '<TR><TD CLASS="formlabel">';
    while ($row = $result->FetchNextObject()) {
        $article = $db->Execute("\n\t\t\tSELECT id,title\n\t\t\tFROM `Obsedb_news`\n\t\t\tWHERE `id` = '{$row->RELID}';");
        echo '<a href="rcm_matrix.php?type=news&do=viewmatrix&id=' . $article->fields['id'] . '">';
        echo stripslashes($article->fields['title']);
        echo '</a>';
        echo " ( <A HREF=\"rcm_matrix.php?do=delete_resource&did={$row->ID}&type={$type}&id={$_REQUEST['id']}\">Delete</A> )<BR />";
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=' . $type . '&reltype=news&id=' . $_REQUEST['id'] . '">Create New Link</a></b>';
    echo '</TD></TR>';
    do_table_footer();
    do_table_header("Related Mods");
    echo '<TR><TD CLASS="formlabel">';
    $result = $db->Execute("\n\t\tSELECT * FROM `Obsedb_matrix`\n\t\tWHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'Mods'\n\t");
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_Mods` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=Mods&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=Mods&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
    do_table_header("Related Pages");
    $result = $db->Execute("SELECT * FROM `Obsedb_matrix` WHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'pages'");
    echo '<tr><td class="formlabel" colspan="2">';
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_pages` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=pages&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=pages&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
    do_table_header('Related Reviews');
    echo "<tr><td class=\"formlabel\" colspan=\"2\">";
    $result = $db->Execute("SELECT * FROM `Obsedb_matrix` WHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'reviews'");
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_reviews` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=reviews&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=reviews&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
    do_table_header('Related Previews');
    $result = $db->Execute("SELECT * FROM `Obsedb_matrix` WHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'previews'");
    echo '<tr><td class="formlabel" colspan="2">';
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_previews` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=previews&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=previews&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
    do_table_header('Related Companies');
    $result = $db->Execute("SELECT * FROM `Obsedb_matrix` WHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'companies'");
    echo '<tr><td class="formlabel" colspan="2">';
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_companies` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=companies&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=companies&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
    do_table_header('Related Screenshots');
    $result = $db->Execute("SELECT * FROM `Obsedb_matrix` WHERE `ctype` = '{$type}' AND `cid` = '{$_REQUEST['id']}' AND `reltype` = 'screenshots'");
    echo '<tr><td class="formlabel" colspan="2">';
    while ($row = $result->FetchNextObject()) {
        $Mod = $db->Execute("SELECT id,title FROM `Obsedb_screenshots` WHERE `id` = '{$row->RELID}'");
        echo '<a href="rcm_matrix.php?type=screenshots&do=viewmatrix&id=', $Mod->fields['id'], '">', stripslashes($Mod->fields['title']), '</a>';
        echo ' (<a href="rcm_matrix.php?do=delete_resource&did=' . $row->ID . '&type=' . $type . '&id=' . $_REQUEST[id] . '">Delete</a>)<br />';
    }
    echo '<b><a href="rcm_matrix.php?do=create&type=', $type, '&reltype=screenshots&id=', $_REQUEST[id], '">Create New Link</a></b>';
    echo '</td></tr>';
    do_table_footer();
}
 function main()
 {
     global $db;
     $sections = 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');
     do_table_header('View all companies by title');
     echo "<tr><td class=\"formlabel\">";
     foreach ($sections as $key => $value) {
         echo "<b><a href=\"companies.php?s={$value}\">{$value}</a></b> &nbsp;";
     }
     echo "</td></tr>";
     do_table_footer();
     do_form_header('companies.php');
     do_table_header('All Companies');
     if (isset($_REQUEST['s'])) {
         $where = "WHERE Obsedb_companies.title LIKE '" . $_REQUEST[s] . "%'";
     }
     $result = $db->Execute("SELECT Obsedb_companies.id,Obsedb_companies.title,Obsedb_companies.homepage\n\t\t\t\t\t\tFROM Obsedb_companies\n\t\t\t\t\t\t{$where}\n\t\t\t\t\t\tORDER BY Obsedb_companies.title;");
     echo '<tr>';
     echo '<td bgcolor="#DDDDDD" style="border-bottom: 1px solid #808080; border-top: 1px solid #808080;"><b>Title</b></td>';
     echo '<td bgcolor="#DDDDDD" style="border-bottom: 1px solid #808080; border-top: 1px solid #808080;"><b>Homepage</b></td>';
     echo '</tr>';
     while ($row = $result->FetchNextObject()) {
         $bgcolor = $bgcolor == "#FFFFFF" ? "#F1EFE2" : "#FFFFFF";
         echo '<tr><td bgcolor="' . $bgcolor . '">';
         echo '<label for="id' . $row->ID . '">';
         echo '<input type="radio" id="id' . $row->ID . '" name="id" VALUE="' . $row->ID . '">' . stripslashes($row->TITLE);
         echo '</label>';
         echo '</td>';
         echo '<td bgcolor="' . $bgcolor . '">' . stripslashes($row->HOMEPAGE) . '</td>';
         echo '</tr>';
     }
     echo '<tr><td colspan="2" bgcolor="#FFFFFF">';
     echo '<input type="submit" name="do" value="Edit Company">';
     echo '<input type="submit" name="do" value="Delete Company">';
     echo '<input type="submit" name="do" value="View Matrix">';
     echo '</tr></td>';
     do_table_footer();
     do_form_footer();
 }
Example #11
0
function GenerateForm($target, $title, $do, $fieldarray, $hiddendata = '', $upload = 'false')
{
    // ==============================
    // Generate a form from an array
    // ==============================
    if ($upload == 'false') {
        do_form_header($target);
    } else {
        print '<form method="post" action="' . $target . '" enctype="multipart/form-data">';
    }
    do_table_header($title);
    foreach ($fieldarray as $key => $value) {
        switch ($value["type"]) {
            case 'text':
                do_text_row($value["title"], $value["name"], $value["value"]);
                break;
            case 'submit':
                do_submit_row($value["title"]);
                break;
            case 'textarea':
                do_table_footer();
                do_table_header($value["title"]);
                do_textarea_row('', $value["name"], $value["value"]);
                break;
            case 'select':
                do_select_row($value["title"], $value["name"], $value["value"], $value["selected"]);
                break;
            case 'spacer':
                do_table_footer();
                do_table_header($value["title"]);
                break;
            case 'file':
                print "<tr><td class=\"formlabel\" align=\"right\"><b>" . $value["title"] . "</b></td>";
                print "<td class=\"formlabel\"><input type=\"file\" name=\"" . $value["name"] . "\"></td></tr>";
                break;
            case 'blank':
                do_blank_row($value["title"]);
                break;
        }
    }
    do_table_footer();
    echo '<input type="hidden" name="do" value="' . $do . '">';
    if (!empty($hiddendata)) {
        foreach ($hiddendata as $key => $value) {
            echo "<input type=\"hidden\" name=\"{$key}\" value=\"{$value}\">";
        }
    }
}
Example #12
0
 function add_poll()
 {
     global $db;
     do_form_header('polls.php');
     do_table_header('Add New Poll');
     do_text_row('Title', 'title');
     do_table_footer();
     do_table_header('Poll Options');
     do_text_row('Option 1', 'option1');
     do_text_row('Option 2', 'option2');
     do_text_row('Option 3', 'option3');
     do_text_row('Option 4', 'option4');
     do_text_row('Option 5', 'option5');
     do_text_row('Option 6', 'option6');
     do_text_row('Option 7', 'option7');
     do_text_row('Option 8', 'option8');
     do_text_row('Option 9', 'option9');
     do_text_row('Option 10', 'option10');
     do_submit_row('Add Poll');
     do_table_footer();
     echo '<input type="hidden" name="do" value="add_poll_confirm">';
     do_form_footer();
     echo "You may add more options later if you need more than ten.";
 }
 function edit_phrases($category, $label)
 {
     global $db, $cp;
     $phrases = $cp->getPhrases($category);
     do_form_header('configuration.php');
     do_table_header($label);
     foreach ($phrases as $key => $value) {
         do_text_row($key, $key, $value);
     }
     do_submit_row('Save Phrases');
     do_table_footer();
     print "<input type=\"hidden\" name=\"category\" value=\"" . $category . "\">";
     print "<input type=\"hidden\" name=\"do\" value=\"save_phrases\">";
     do_form_footer();
 }
    function viewStatistics()
    {
        global $db;
        $result = $db->Execute("SELECT id FROM Obsedb_cheats");
        $totalCheats = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_companies");
        $totalCompanies = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_downloads");
        $totalDownloads = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_Mods");
        $totalMods = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_news");
        $totalNews = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_previews");
        $totalPreviews = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_reviews");
        $totalReviews = $result->RecordCount();
        $result = $db->Execute("SELECT id FROM Obsedb_screenshots");
        $totalScreenshots = $result->RecordCount();
        do_table_header('Database Statistics');
        echo '
			<tr>
				<td class="formlabel">';
        echo '
			<table border="0" cellspacing="0" cellpadding="5" width="100%">
			<tr>
			<td align="center"><strong>Total Cheats</strong><br />' . $totalCheats . '</td>
			<td align="center"><strong>Total Companies</strong><br />' . $totalCompanies . '</td>
			<td align="center"><strong>Total Downloads</strong><br />' . $totalDownloads . '</td>
			</tr>
			<tr>
			<td align="center"><strong>Total Mods</strong><br />' . $totalMods . '</td>
			<td align="center"><strong>Total Articles</strong><br />' . $totalNews . '</td>
			<td align="center"><strong>Total Previews</strong><br />' . $totalPreviews . '</td>
			</tr>
			<tr>
			<td align="center"><strong>Total Reviews</strong><br />' . $totalReviews . '</td>
			<td align="center"><strong>Total Screenshots</strong><br />' . $totalScreenshots . '</td>
			<td align="center"></td>
			</tr>
			</table>';
        echo '
				</td>
			</tr>';
        do_table_footer();
    }
Example #15
0
function edit_section()
{
    global $db;
    $result = $db->Execute("SELECT * FROM Obsedb_screenshots_sections WHERE id = {$_REQUEST['id']}");
    if ($result) {
        $row = $result->FetchRow();
        do_form_header("screenshots.php");
        do_table_header("Edit Section");
        do_text_row("Title", "title", stripslashes($row[title]));
        do_submit_row("Update");
        echo '<input type="hidden" name="do" value="edit_section_confirm">';
        echo '<input type="hidden" name="id" value="' . $row[id] . '">';
        do_table_footer();
        do_form_footer();
    }
}
    function manageSections()
    {
        global $db;
        do_form_header('reviews.php');
        do_table_header('Sections');
        $result = $db->Execute("SELECT id,title FROM `Obsedb_reviews_sections` ORDER BY `title`");
        while ($row = $result->FetchNextObject()) {
            $bgcolor = $bgcolor == "#ECECFF" ? "#FFFFFF" : "#ECECFF";
            echo '<tr><td bgcolor="' . $bgcolor . '" colspan="2"><input type="radio" value="' . $row->ID . '" name="id"> ' . stripslashes($row->TITLE) . '</td></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>';
    }
 function manage_users()
 {
     global $db;
     do_form_header('administrators.php');
     do_table_header($this->phrase['manage_users']);
     $result = $db->Execute("SELECT * FROM `Obsedb_members` ORDER BY `PSEUDO`");
     while ($row = $result->FetchNextObject()) {
         echo "<tr><td class=\"formlabel\"><input type=\"checkbox\" name=\"id\" value=\"{$row->ID}\"></td>" . "<td class=\"formlabel\" width=\"100%\"><b>{$row->PSEUDO}</b></td></tr>";
     }
     echo "<tr><td colspan=\"2\" class=\"formlabel\">" . "<input type=\"submit\" name=\"do\" value=\"" . $this->phrase['do_edit_user'] . "\"> " . "<input type=\"submit\" name=\"do\" value=\"" . $this->phrase['do_delete_user'] . "\"> " . "<input type=\"submit\" name=\"do\" value=\"" . $this->phrase['do_reset_password'] . "\"> " . "</td></tr>";
     do_table_footer();
     echo "</form>";
 }
Example #18
0
function search2()
{
    global $db;
    do_table_header('Search results for "<i>' . stripslashes($_REQUEST['keywords']) . '</i>"');
    switch ($_REQUEST['type']) {
        case 'null':
            die('Error: You must select a type of content to search.');
            break;
        case 'companies':
            $result = $db->Execute("SELECT * FROM `Obsedb_companies` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=company&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'Mods':
            $result = $db->Execute("SELECT * FROM `Obsedb_Mods` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=Mods&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'links':
            $result = $db->Execute("SELECT * FROM `Obsedb_links` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=links&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'news':
            $result = $db->Execute("SELECT * FROM `Obsedb_news` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=news&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'previews':
            $result = $db->Execute("SELECT * FROM `Obsedb_previews` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=previews&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'reviews':
            $result = $db->Execute("SELECT * FROM `Obsedb_reviews` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=reviews&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
        case 'pages':
            $result = $db->Execute("SELECT * FROM `Obsedb_pages` WHERE `title` LIKE '{$_REQUEST['keywords']}%' ORDER BY `title`");
            while ($row = $result->FetchNextObject()) {
                echo "<tr><td><a href=\"rcm_matrix.php?type=pages&do=viewmatrix&id={$row->ID}\">" . stripslashes($row->TITLE) . " (View Matrix)</a></td></tr>";
            }
            break;
    }
    do_table_footer();
}
Example #19
0
 function edit_settings()
 {
     global $db, $LANG, $spconfig;
     do_form_header('Mods.php');
     do_table_header($LANG['Mods_config']);
     $options = array('0' => $LANG['disabled'], '1' => $LANG['enabled']);
     do_select_row($LANG['show_tools'], 'Mod_tools', $options, $spconfig['Mod_tools']);
     do_select_row($LANG['popup_tools'], 'Mod_tools_popups', $options, $spconfig['Mod_tools_popups']);
     do_submit_row($LANG['save_settings']);
     do_table_footer();
     echo '<input type="hidden" name="do" value="save_settings">';
     do_form_footer();
 }
 function edit()
 {
     global $db;
     $result = $db->Execute("SELECT * FROM Obsedb_customfields WHERE id = {$_REQUEST['id']};");
     $field = $result->FetchRow();
     do_form_header('customfields.php');
     do_table_header('Edit Custom Field');
     do_text_row('Field Name', 'title', stripslashes($field['title']));
     echo '<tr>' . '<td class="formlabel" align="right"><b>Module</b></td>' . '<td class="formlabel">' . '<select name="module">';
     if ($field['module'] == 'Mods') {
         echo '<option value="Mods" selected>Mods Manager</option>';
     } else {
         echo '<option value="Mods">Mods Manager</option>';
     }
     echo '</select>' . '</td></tr>';
     echo '<tr>' . '<td class="formlabel" align="right"><b>Field Type</b></td>' . '<td class="formlabel">' . '<select name="type">';
     if ($field['type'] == 'text') {
         echo '<option value="text" selected>Single-Line Text Box</option>';
     } else {
         echo '<option value="text">Single-Line Text Box</option>';
     }
     if ($field['type'] == 'textarea') {
         echo '<option value="textarea" selected>WYSIWYG Editor</option>';
     } else {
         echo '<option value="textarea">WYSIWYG Editor</option>';
     }
     echo '</select>' . '</td></tr>';
     do_submit_row('Update');
     do_table_footer();
     echo '<input type="hidden" name="do" value="edit_confirm">';
     echo '<input type="hidden" name="id" value="' . $_REQUEST['id'] . '">';
     do_form_footer();
 }