function edit_section_confirm()
 {
     global $db;
     $record = array('title' => $_REQUEST['title']);
     $db->AutoExecute('Obsedb_screenshots_sections', $record, 'UPDATE', "id = {$_REQUEST['id']}");
     SPMessage('Success | Section has been updated.', 'screenshots.php');
 }
 function save()
 {
     global $db;
     $record = array('title' => $_REQUEST['title'], 'homepage' => $_REQUEST['homepage'], 'description' => $_REQUEST['description'], 'logo' => $_REQUEST['logo']);
     $db->AutoExecute('Obsedb_companies', $record, 'UPDATE', "id = '" . $_REQUEST[id] . "'");
     SPMessage('Success | Company has been updated.', 'companies.php');
 }
Example #3
0
function save_template($title, $html)
{
    global $db;
    $html = addslashes($html);
    $result = $db->Execute("UPDATE `Obsedb_templates` SET `html` = '{$html}' WHERE `title` = '{$title}'");
    SPMessage("Changes have been saved.");
}
 function edit_confirm()
 {
     global $db, $cp;
     $phone = $cp->getParam('phone');
     $rs = $db->Execute("SELECT * FROM `Obsedb_members` WHERE `ID` = '{$_REQUEST['id']}'");
     $record = array('PSEUDO' => $_REQUEST['pseudo'], 'EMAIL' => $_REQUEST['email'], 'fname' => $_REQUEST['fname'], 'lname' => $_REQUEST['lname'], 'phone' => $phone);
     $rssql = $db->GetUpdateSQL($rs, $record);
     $db->Execute($rssql);
     SPMessage($this->phrase['editAccountCommit']);
 }
 function save_phrases()
 {
     global $db, $cp;
     $category = $cp->getParam('category');
     $phrases = $cp->getPhrases($category);
     foreach ($phrases as $key => $value) {
         $this->savePhrase($category, $key, $_REQUEST[$key]);
     }
     SPMessage("Phrases have been updated.");
 }
Example #6
0
 function delete()
 {
     global $db;
     $db->Execute("DELETE FROM `Obsedb_polls` WHERE `id` = '{$_REQUEST['id']}'");
     $db->Execute("DELETE FROM `Obsedb_polls_options` WHERE `poll_id` = '{$_REQUEST['id']}'");
     SPMessage('Success | Poll has been removed', 'polls.php');
 }
Example #7
0
        $module->insertReview();
        break;
    case 'Delete Review':
        $module->deleteReview();
        break;
    case 'Delete Section':
        $module->deleteSection();
        break;
    case 'Edit Review':
        $module->editReview();
        break;
    case 'edit_review_confirm':
        $module->updateReview();
        break;
    case 'Edit Section':
        $module->editSection();
        break;
    case 'edit_section_confirm':
        $module->updateSection();
        break;
    case 'manage_sections':
        $module->manageSections();
        break;
    default:
        $module->manageReviews();
        break;
}
if ($_REQUEST['do'] == 'View Matrix') {
    SPMessage("Loading content matrix...", "rcm_matrix.php?do=viewmatrix&type=previews&id={$_REQUEST['id']}");
}
$cp->footer();
Example #8
0
            copy($_FILES["image"]["tmp_name"], $aNewName) or die("Could not copy to {$aNewName}");
            if ($spconfig['screenshots_thumbnailing'] == '1') {
                $aNewName2 = $aCurBasePath . $_REQUEST['Modid'] . "_" . "thumb_" . $image_name;
                $thumbnail = imagecreatefromjpeg($aNewName);
                $width = imagesx($thumbnail);
                $height = imagesy($thumbnail);
                $new_width = 120;
                $new_height = floor($height * (120 / $width));
                do_table_header("More Debug Information");
                do_blank_row("\$aNewName = {$aNewName}");
                do_blank_row("\$aNewName2 = {$aNewName2}");
                do_blank_row("\$width = {$width}");
                do_blank_row("\$height = {$height}");
                do_blank_row("\$new_width = {$new_width}");
                do_blank_row("\$new_height = {$new_height}");
                do_table_footer();
                $tmp_img = imagecreatetruecolor($new_width, $new_height);
                imagecopyresized($tmp_img, $thumbnail, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
                imagejpeg($tmp_img, $aNewName2);
            } else {
                $aNewName2 = $aNewName;
            }
        }
    }
    $RS = $db->Execute("\n      SELECT Obsedb_screenshots.id, Obsedb_screenshots.title, Obsedb_screenshots.thumb, Obsedb_screenshots.screen,\n      Obsedb_screenshots.section\n      FROM `Obsedb_screenshots`\n      WHERE Obsedb_screenshots.id = '0'");
    $record = array('title' => $_REQUEST['title'], 'thumb' => "media/screenshots/" . $_REQUEST['Modid'] . "_thumb_" . $image_name, 'screen' => "media/screenshots/" . $_REQUEST['Modid'] . "_" . $image_name, 'section' => $_REQUEST['Modid']);
    $sql = $db->GetInsertSQL($RS, $record);
    $db->Execute($sql);
    SPMessage("Screenshot has been successfully added.");
}
$cp->footer();
Example #9
0
    $record = array('title' => $_REQUEST['title']);
    $sql = $db->GetUpdateSQL($rs, $record);
    $db->Execute($sql);
    SPMessage('Success: Section has been updated.', 'links.php?do=manage_sections');
}
if ($_REQUEST['do'] == 'add_section_confirm') {
    $db->Execute("INSERT INTO `Obsedb_links_sections` (title) VALUES ('{$_REQUEST['title']}');");
    SPMessage('Success: Section has been created.', 'links.php?do=manage_sections');
}
if ($_REQUEST['do'] == 'manage_sections') {
    do_form_header('links.php');
    do_table_header('Sections');
    $result = $db->Execute("SELECT id,title FROM `Obsedb_links_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>';
}
if ($_REQUEST['do'] == 'Delete Section') {
    $db->Execute("DELETE FROM `Obsedb_links_sections` WHERE `id` = '{$_REQUEST['id']}'");
    SPMessage('Success: Section has been deleted.', 'links.php?do=manage_sections');
}
$cp->footer();
 function edit_confirm()
 {
     global $db;
     $rs = $db->Execute("SELECT * FROM `Obsedb_downloads` WHERE `id` = '{$_REQUEST['id']}';");
     $record = array('title' => $_REQUEST['title'], 'download' => $_REQUEST['download']);
     $sql = $db->GetUpdateSQL($rs, $record);
     $db->Execute($sql);
     SPMessage('Success: Changes have been saved.', 'downloads.php');
 }
Example #11
0
    do_table_footer();
    echo '</form>';
}
if ($_REQUEST['do'] == 'edit_mailbag_confirm') {
    $rs = $db->Execute("SELECT * FROM `Obsedb_mailbag` WHERE `id` = '{$_REQUEST['id']}'");
    $record = array('title' => $_REQUEST['title'], 'message' => $_REQUEST['message'], 'reply' => $_REQUEST['reply']);
    $sql = $db->GetUpdateSQL($rs, $record);
    $db->Execute($sql);
    SPMessage("Success | Changes have been saved.", "mailbag.php");
}
if ($_REQUEST['do'] == 'add_mailbag') {
    do_form_header('mailbag.php');
    do_table_header('Add Letter');
    do_text_row('Title', 'title');
    do_textarea_row('Message', 'message');
    do_textarea_row('Reply', 'reply');
    do_submit_row();
    echo '<input type="hidden" name="do" value="add_mailbag_confirm">';
    do_table_footer();
    echo '</form>';
}
if ($_REQUEST['do'] == 'add_mailbag_confirm') {
    $record = array('title' => $_REQUEST['title'], 'message' => $_REQUEST['message'], 'reply' => $_REQUEST['reply']);
    $db->AutoExecute('Obsedb_mailbag', $record, 'INSERT');
    SPMessage("Success | Letter has been added.", "mailbag.php");
}
if ($_REQUEST['do'] == 'Delete Letter') {
    $db->Execute("DELETE FROM `Obsedb_mailbag` WHERE `id` = '{$_REQUEST['id']}'");
    SPMessage("Success | Letter has been deleted.", "mailbag.php");
}
$cp->footer();
Example #12
0
    echo '<tr>
			<td colspan="2" class="formlabel">
				<input type="submit" name="do" value="Edit Section" style="border: outset 1px; color: #000000; background-image: url(../images/admin/button.jpg); font-weight: bold; padding: 2px;">
				<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_news_sections WHERE id = {$_REQUEST['id']}");
    SPMessage('Success | Section has been removed.', 'news.php?do=manage_sections');
}
if ($_REQUEST['do'] == 'Delete News') {
    $db->Execute("DELETE FROM Obsedb_news WHERE id = {$_REQUEST['id']}");
    SPMessage('Success | Article has been removed.', 'news.php');
}
$cp->footer();
function listArticleImages($selected = '')
{
    echo '
		<tr>
			<td class="formlabel" style="text-align: right; font-weight: bold;">Article Image</td>
			<td class="formlabel"><select name="newsimage">
			    <option value="">None</option>';
    $directory = "../images/news_icons/";
    if (is_dir($directory)) {
        if ($dh = opendir($directory)) {
            while (($file = readdir($dh)) !== false) {
                if ($file != '.' && $file != '..') {
                    if ($selected == $file) {
Example #13
0
			<td class="formlabel" align="right"><b>New Password</b></td>
			<td class="formlabel"><input type="password" name="newpass" size="60"></td>
		  </tr>';
    echo '<tr>
			<td class="formlabel" align="right"><b>Confirm New Password</b></td>
			<td class="formlabel"><input type="password" name="newpass_confirm" size="60"></td>
		  </tr>';
    do_submit_row('Update Profile');
    do_table_footer();
    echo '<input type="hidden" name="do" value="save_profile">';
    echo '</form>';
}
if ($_REQUEST['do'] == 'save_profile') {
    $rs = $db->Execute("SELECT * FROM `Obsedb_members` WHERE `ID` = '" . $_SESSION['pwzid'] . "'");
    $record = array('PSEUDO' => $_REQUEST['username'], 'EMAIL' => $_REQUEST['email']);
    if (isset($_REQUEST['curpass'])) {
        if (md5($_REQUEST['curpass']) == $rs->fields['PASS']) {
            $sql = $db->GetUpdateSQL($rs, $record);
            $db->Execute($sql);
            if (!empty($_REQUEST['newpass']) && $_REQUEST['newpass'] == $_REQUEST['newpass_confirm']) {
                $db->Execute("UPDATE `Obsedb_members` SET `PASS` = '" . md5($_REQUEST[newpass]) . "' WHERE `id` = '" . $_SESSION['pwzid'] . "'");
            }
        } else {
            echo 'ERROR: Please enter your current password again.';
            exit;
        }
    }
    SPMessage('Success | Your profile has been updated.', 'profile.php');
}
echo '</p>';
$cp->footer();
 function updateSection()
 {
     global $db;
     $rs = $db->Execute("SELECT * FROM `Obsedb_reviews_sections` WHERE `id` = '{$_REQUEST['id']}'");
     $record = array('title' => $_REQUEST['title']);
     $sql = $db->GetUpdateSQL($rs, $record);
     $db->Execute($sql);
     SPMessage("Success | Section has been saved.", "reviews.php");
 }
 function delete()
 {
     global $db;
     $db->Execute("DELETE FROM Obsedb_customfields WHERE id = {$_REQUEST['id']};");
     $db->Execute("DELETE FROM Obsedb_Mods_customdata WHERE fieldid = {$_REQUEST['id']};");
     SPMessage('Success | Field has been removed.', 'customfields.php');
 }
Example #16
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();
Example #17
0
 function save_settings()
 {
     global $db, $LANG, $spconfig;
     $db->Execute("UPDATE Obsedb_configuration SET `value` = '{$_REQUEST['Mod_tools']}' WHERE `key` = 'Mod_tools'");
     $db->Execute("UPDATE Obsedb_configuration SET `value` = '{$_REQUEST['Mod_tools_popups']}' WHERE `key` = 'Mod_tools_popups'");
     SPMessage($LANG['settings_success'], 'Mods.php');
 }
Example #18
0
 function deleteAnnouncementCommit()
 {
     global $db;
     $db->Execute("DELETE FROM `Obsedb_announcements` WHERE `id` = '{$_REQUEST['id']}'");
     SPMessage($this->phrase['deleteAnnouncementCommit'], 'index2.php');
 }
Example #19
0
        echo "<TR>\n\t\t\t\t<TD BGCOLOR='{$bgcolor}' COLSPAN='2'>\n\t\t\t\t<INPUT TYPE='radio' name='id' value='{$row->ID}'>\n\t\t\t\t" . stripslashes($row->TEXT) . "</TD>\n\t\t\t  </TR>";
    }
    echo "\n\t\t\t<TR>\n\t\t\t\t<TD COLSPAN='2' CLASS='formlabel'>\n\t\t\t\t<INPUT TYPE='submit' NAME='do' VALUE='Edit Option'>\n\t\t\t\t<INPUT TYPE='submit' NAME='do' VALUE='Delete Option'>\n\t\t\t\t</TD>\n\t\t\t</TR>";
    do_table_footer();
    do_form_footer();
}
if ($_REQUEST['do'] == 'Edit Option') {
    $option = $db->Execute("SELECT * FROM Obsedb_polls_options WHERE id = '{$_REQUEST['id']}'") or die($db->ErrorMsg());
    do_form_header('polls.php');
    do_table_header('Editing Poll Option');
    do_text_row('Text', 'text', stripslashes($option->fields['text']));
    do_submit_row('Save Changes');
    do_table_footer();
    echo '<input type="hidden" name="id" value="' . $option->fields['id'] . '">';
    echo '<input type="hidden" name="do" value="edit_option_confirm">';
    do_form_footer();
}
if ($_REQUEST['do'] == 'edit_option_confirm') {
    $result = array('text' => $_REQUEST['text']);
    $db->AutoExecute('Obsedb_polls_options', $result, 'UPDATE', "id = '{$_REQUEST['id']}'");
    SPMessage("Success | Changes have been saved.", "polls.php");
}
if ($_REQUEST['do'] == 'Delete Option') {
    if (!empty($_REQUEST['id'])) {
        $db->Execute("DELETE FROM Obsedb_polls_options WHERE id = '{$_REQUEST['id']}'");
        SPMessage("Success | Option has been removed", "polls.php");
    } else {
        echo "Error - you must select an option to delete";
    }
}
$cp->footer();