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 #2
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}\">";
        }
    }
}
 function edit_Mods()
 {
     global $db, $spconfig;
     do_form_header('configuration.php');
     do_table_header('Mods Module Settings');
     do_select_row('Show tool icons in admin', 'Mod_tools', array('0' => 'Disabled', '1' => 'Enabled'), $spconfig['Mod_tools']);
     do_select_row('Open tool icons in new windows', 'Mod_tools_popups', array('0' => 'Disabled', '1' => 'Enabled'), $spconfig['Mod_tools_popups']);
     do_submit_row('Submit');
     do_table_footer();
     print '<input type="hidden" name="do" value="Mods_save">';
     do_form_footer();
 }
Example #4
0
function do_Mod_select_row($Modid = '')
{
    global $db;
    $result = $db->Execute("SELECT g.id,g.title,p.title AS `platform` FROM Obsedb_Mods AS g, Obsedb_Mods_sections AS p WHERE g.section = p.id ORDER BY p.title ASC, g.title ASC");
    $Mods['0'] = 'None';
    while ($row = $result->FetchNextObject()) {
        $Mods[$row->ID] = stripslashes($row->TITLE) . " (" . stripslashes($row->PLATFORM) . ")";
    }
    do_select_row("Mod", "Modid", $Mods, $Modid);
}
Example #5
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();
 }
Example #6
0
    $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') {
    $rs = $db->Execute("SELECT * FROM `Obsedb_news` WHERE `id` = '-1'");
    $record = array('title' => $_REQUEST['title'], 'author' => $_REQUEST['author'], 'section' => $_REQUEST['section'], 'intro' => $_REQUEST['intro'], 'text' => $_REQUEST['text'], 'date' => $_REQUEST['date'], 'newsimage' => $_REQUEST['newsimage']);
    $sql = $db->GetInsertSQL($rs, $record);
    $db->Execute($sql);
    SPMessage('Success | News has been successfully added.', 'news.php');