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(); }
function sql_query() { do_form_header("dbtools.php"); do_table_header("SQL Query Tool"); echo '<tr><td class="formlabel"><textarea name="query" rows="5" cols="50"></textarea><br />'; echo 'Please do not enter more than one query at a time.</td></tr>'; do_submit_row("Go"); do_table_footer(); echo '<input type="hidden" name="do" value="run_query">'; do_form_footer(); }
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(); }
do_table_footer(); echo '</form>'; } if ($_REQUEST['do'] == 'edit_section_confirm') { $rs = $db->Execute("SELECT * FROM `Obsedb_links_sections` WHERE `id` = '{$_REQUEST['id']}'"); $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>'; }
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_previews` WHERE `id` = '-1'"); $record = array('title' => $_REQUEST['title'], 'section' => $_REQUEST['section'], 'intro' => $_REQUEST['intro'], 'text' => $_REQUEST['text']); $sql = $db->GetInsertSQL($rs, $record); $db->Execute($sql); echo '<center>Preview has been successfully added, <a href="previews.php">click here to continue</a>.</center>'; } if ($_REQUEST['do'] == 'manage_sections') { do_form_header('previews.php'); do_table_header('Sections'); $result = $db->Execute("SELECT id,title FROM `Obsedb_previews_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'] == 'add_page') { do_form_header('pages.php'); do_table_header('Add Page'); do_text_row('Page Title', 'title'); do_table_footer(); do_table_header('Page Content'); do_textarea_row('', 'content'); do_submit_row("Continue"); do_table_footer(); echo '<input type="hidden" name="do" value="add_page_confirm">'; echo '</form>'; } if ($_REQUEST['do'] == 'Edit Page') { $menuitem = $db->Execute("SELECT * FROM `Obsedb_pages` WHERE `id` = '{$_REQUEST['id']}'"); do_form_header('pages.php'); do_table_header('Edit Page'); do_text_row('Page Title', 'title', clean($menuitem->fields['title'])); do_table_footer(); do_table_header('Page Content'); do_textarea_row('', 'content', stripslashes($menuitem->fields['content'])); do_submit_row('Continue'); do_table_footer(); echo '<input type="hidden" name="id" value="' . $menuitem->fields['id'] . '">'; echo '<input type="hidden" name="do" value="edit_page_confirm">'; echo '</form>'; } if ($_REQUEST['do'] == 'add_page_confirm') { $rs = $db->Execute("SELECT * FROM `Obsedb_pages` WHERE `id` = '-1'"); $record = array('title' => $_REQUEST['title'], 'content' => $_REQUEST['content']); $sql = $db->GetInsertSQL($rs, $record);
} if ($_REQUEST['do'] == 'Edit Poll Options') { $result = $db->Execute("SELECT *\n\t\t\t\t\t\t\tFROM Obsedb_polls_options\n\t\t\t\t\t\t\tWHERE poll_id = {$_REQUEST['id']}\n\t\t\t\t\t\t\tORDER BY id DESC"); do_form_header('polls.php'); do_table_header('Poll Options'); while ($row = $result->FetchNextObject()) { $bgcolor = $bgcolor == "#ECECFF" ? "#FFFFFF" : "#ECECFF"; 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'])) {
do_text_row('Title', 'title'); do_text_row('Filename', 'filename'); 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.");
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> "; } 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(); }
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 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>"; }
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'); } if ($_REQUEST['do'] == 'manage_sections') { do_form_header('news.php'); do_table_header('Sections'); $result = $db->Execute("SELECT id,title FROM `Obsedb_news_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" 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>'; }
<?php switch ($_REQUEST['do']) { case 'save_profile': $refresh = "profile.php"; break; } include "global.php"; $cp->header(); echo '<font style="font-size: 12pt; font-weight: bold;">Manage Your Profile</font>'; echo '<p>'; if (!isset($_REQUEST['do'])) { $result = $db->Execute("SELECT * FROM `Obsedb_members` WHERE `ID` = '" . $_SESSION['pwzid'] . "'"); do_form_header('profile.php'); do_table_header('Personal Details'); do_text_row('Username', 'username', stripslashes($result->fields['PSEUDO'])); do_text_row('E-mail Address', 'email', stripslashes($result->fields['EMAIL'])); echo '<tr> <td class="formlabel" align="right"><b>Current Password</b></td> <td class="formlabel"><input type="password" name="curpass"></td> </tr>'; echo '<tr> <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();
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>'; }
do_textarea_row('Reply', 'reply', stripslashes($mailbag->fields['reply'])); do_submit_row(); echo '<input type="hidden" name="do" value="edit_mailbag_confirm">'; echo '<input type="hidden" name="id" value="' . $mailbag->fields['id'] . '">'; 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') {
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 search_content() { global $db; do_form_header('rcm_matrix.php'); do_table_header('Search Content'); do_text_row('Keywords', 'keywords'); echo '<tr> <td class="formlabel" align="right"><b>Content Type</b></td> <td class="formlabel"><select name="type">' . '<option value="null"> - </option>' . '<option value="companies"> Companies</option>' . '<option value="Mods"> Mods</option>' . '<option value="news"> News</option>' . '<option value="pages"> Pages</option>' . '<option value="previews"> Previews</option>' . '<option value="reviews"> Reviews</option>' . '</select></td></tr>'; do_submit_row('Begin Search'); do_table_footer(); echo '<input type="hidden" name="do" value="search2">'; echo '</form>'; }
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 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(); }
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_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 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>'; }
</select> </td> </tr>'; echo '<tr><td class="formlabel" align="right"><b>Open link in a new window</b></td> <td class="formlabel"> <input type="checkbox" name="target" value="_blank"> </td></tr>'; do_submit_row('Continue'); do_table_footer(); echo '<input type="hidden" name="do" value="add_link_confirm">'; echo '</form>'; } } if ($_REQUEST['do'] == 'Edit Link') { $menuitem = $db->Execute("SELECT * FROM `Obsedb_menu_items` WHERE `id` = '{$_REQUEST['id']}'"); do_form_header('menu_manager.php'); do_table_header('Edit Menu Item'); do_text_row('Link Title', 'title', stripslashes($menuitem->fields['title'])); do_text_row('URL', 'url', stripslashes($menuitem->fields['url'])); do_text_row('Order', 'ordering', stripslashes($menuitem->fields['ordering'])); echo '<tr><td class="formlabel"><b>Location</b></td> <td class="formlabel"> <select name="location">'; $locations = array('left' => 'Left Menu', 'right' => 'Right Menu', 'top' => 'Top Menu', 'bottom' => 'Bottom Menu'); foreach ($locations as $key => $value) { if ($menuitem->fields['location'] == $key) { echo "<option value=\"{$key}\" selected>{$value}</option>"; } else { echo "<option value=\"{$key}\">{$value}</option>"; } }