rendered paste bodyfunction boardopts(){ global $tc_db; management_adminsonly(); if (isset($_GET['updateboard']) && isset($_POST['order']) && isset($_POST['maxpages']) && isset($_POST['maxage']) && isset($_POST['messagelength'])) { if (!moderator_ismodofboard($_GET['updateboard'], $_SESSION['manageusername'])) { die(_('You are not a moderator of this board.')); } $resultsboard = $tc_db->GetAll("SELECT * FROM `" . TC_DBPREFIX . "boards` WHERE `name` = '" . mysql_real_escape_string($_GET['updateboard']) . "'"); if (count($resultsboard) > 0) { if ($_POST['order'] >= 0 && $_POST['maxpages'] >= 0 && $_POST['maxage'] >= 0 && $_POST['messagelength'] >= 0 && ($_POST['enablereporting'] == '0' || $_POST['enablereporting'] == '1') && ($_POST['enablecaptcha'] == '0' || $_POST['enablecaptcha'] == '1') && ($_POST['trial'] == '0' || $_POST['trial'] == '1') && ($_POST['popular'] == '0' || $_POST['popular'] == '1') && ($_POST['defaultstyle'] == 'Burichan' || $_POST['defaultstyle'] == 'Futaba' || $_POST['defaultstyle'] == 'Gurochan' || $_POST['defaultstyle'] == 'Photon' || $_POST['defaultstyle'] == 'Fuhrerchan')) { $filetypes = array(); while (list($postkey, $postvalue) = each($_POST)) { if (substr($postkey, 0, 9) == 'filetype_') { $filetypes[] = strtoupper(substr($postkey, 9)); } } if (isset($_POST['locked'])) { $updateboard_locked = $_POST['locked'] == "on" ? "1" : "0"; } else { $updateboard_locked = "0"; } if (($_POST['type'] == '0' || $_POST['type'] == '1' || $_POST['type'] == '2') && ($_POST['uploadtype'] == '0' || $_POST['uploadtype'] == '1' || $_POST['uploadtype'] == '2')) { $tc_db->Execute("UPDATE `" . TC_DBPREFIX . "boards` SET `type` = '" . mysql_real_escape_string($_POST['type']) . "' , `uploadtype` = '" . mysql_real_escape_string($_POST['uploadtype']) . "' , `order` = '" . mysql_real_escape_string($_POST['order']) . "' , `section` = '" . mysql_real_escape_string($_POST['section']) . "' , `desc` = '" . mysql_real_escape_string($_POST['desc']) . "' , `filetypes` = '" . implode('|', $filetypes) . "' , `locked` = '" . $updateboard_locked . "' , `maximagesize` = '" . mysql_real_escape_string($_POST['maximagesize']) . "' , `messagelength` = '" . mysql_real_escape_string($_POST['messagelength']) . "' , `maxpages` = '" . mysql_real_escape_string($_POST['maxpages']) . "' , `maxage` = '" . mysql_real_escape_string($_POST['maxage']) . "' , `maxreplies` = '" . mysql_real_escape_string($_POST['maxreplies']) . "' , `image` = '" . mysql_real_escape_string($_POST['image']) . "' , `includeheader` = '" . mysql_real_escape_string($_POST['includeheader']) . "' , `redirecttothread` = '" . mysql_real_escape_string($_POST['redirecttothread']) . "' , `forcedanon` = '" . mysql_real_escape_string($_POST['forcedanon']) . "' , `trial` = '" . mysql_real_escape_string($_POST['trial']) . "' , `popular` = '" . mysql_real_escape_string($_POST['popular']) . "' , `defaultstyle` = '" . $_POST['defaultstyle'] . "' , `enablereporting` = '" . mysql_real_escape_string($_POST['enablereporting']) . "' , `enablecaptcha` = '" . mysql_real_escape_string($_POST['enablecaptcha']) . "' , `enablenofile` = '" . mysql_real_escape_string($_POST['enablenofile']) . "' WHERE `name` = '" . mysql_real_escape_string($_GET['updateboard']) . "'"); echo _('Update successful.'); management_addlogentry(_('Updated board configuration') . " - /" . $_GET['updateboard'] . "/", 4); } else { echo _('Sorry, a generic error has occurred.'); } } else { echo _('Integer values must be entered correctly.'); } } else { echo _('Unable to locate a board named') . ' <b>' . $_GET['updateboard'] . '</b>.'; } } elseif (isset($_POST['board'])) { if (!moderator_ismodofboard($_POST['board'], $_SESSION['manageusername'])) { die(_('You are not a moderator of this board.')); } $resultsboard = $tc_db->GetAll("SELECT * FROM `" . TC_DBPREFIX . "boards` WHERE `name` = '" . mysql_real_escape_string($_POST['board']) . "'"); if (count($resultsboard) > 0) { foreach ($resultsboard as $lineboard) { echo '<div class="container"> <form action="?action=boardopts&updateboard='.$_POST['board'].'" method="post">'; /* Directory */ echo '<label for="board">'._('Directory').':</label> <input type="text" name="board" value="'.$_POST['board'].'" disabled> <div class="desc">'._('The directory of the board.').'</div><br>'; /* Description */ echo '<label for="desc">'._('Description').':</label> <input type="text" name="desc" value="'.$lineboard['desc'].'"> <div class="desc">'._('The name of the board.').'</div><br>'; /* Board type */ echo '<label for="type">Board type:</label> <select name="type"> <option value="0"'; if ($lineboard['type'] == '0') { echo ' selected'; } echo '>Normal Imageboard</option> <option value="1"'; if ($lineboard['type'] == '1') { echo ' selected'; } echo '>Text Board</option><option value="2"'; if ($lineboard['type'] == '2') { echo ' selected'; } echo '>Oekaki Imageboard</option> </select> <div class="desc">'._('The type of posts which will be accepted on this board. A normal imageboard will feature image and extended format posts, a text board will have no images, and an Oekaki board will allow users to draw images and use them in their posts.').' '._('Default').': <b>Normal Imageboard</b></div><br>'; /* Upload type */ echo '<label for="uploadtype">'._('Upload type:').'</label> <select name="uploadtype"> <option value="0"'; if ($lineboard['uploadtype'] == '0') { echo ' selected'; } echo '>'._('No embedding').'</option> <option value="1"'; if ($lineboard['uploadtype'] == '1') { echo ' selected'; } echo '>'._('Images and embedding').'</option> <option value="2"'; if ($lineboard['uploadtype'] == '2') { echo ' selected'; } echo '>'._('Embedding only').'</option> </select> <div class="desc">'._('Whether or not to allow embedding of videos.').' '._('Default')'.: <b>No Embedding</b></div><br>'; /* Order */ echo '<label for="order">'._('Order');.':</label> <input type="text" name="order" value="'.$lineboard['order'].'"> <div class="desc">'._('Order to show board in menu list, in ascending order.').' '._('Default').': <b>0</b></div><br>'; /* Section */ echo '<label for="section">'._('Section').':</label> <input type="text" name="section" value="'.$lineboard['section'].'"> <div class="desc">'._('The section the board is in. This is used for displaying the list of boards on the top and bottom of pages.').'<br>If this is set to 0, <b>it will not be shown in the menu</b>.</div><br>'; /* Locked */ echo '<label for="locked">'._('Locked').': (<img src="'.TC_BOARDSPATH.'/locked.gif" alt="Lock">)</label> <input type="checkbox" name="locked" '; if ($lineboard['locked'] == "1") { echo 'checked '; } echo '> <div class="desc">'._('Only moderators of the board and admins can make new posts/replies').'</div><br>'; /* Enable reporting */ echo '<label for="enablereporting">'._('Enable reporting:').'</label> <select name="enablereporting">'; echo ($lineboard['enablereporting'] == '1') ? '<option value="1">Yes</option><option value="0">No</option>' : '<option value="0">No</option><option value="1">Yes</option>'; echo '</select> <div class="desc">'._('Reporting allows users to report posts, adding the post to the report list.').' '._('Default').': <b>'._('Yes').'</b></div><br>'; /* Enable captcha */ echo '<label for="enablecaptcha">'._('Enable captcha:').'</label> <select name="enablecaptcha">'; echo ($lineboard['enablecaptcha'] == '1') ? '<option value="1">Yes</option><option value="0">No</option>' : '<option value="0">No</option><option value="1">Yes</option>'; echo '</select> <div class="desc">'._('Enable/disable captcha system for this board. If captcha is enabled, in order for a user to post, they must first correctly enter the text on an image.').' '._('Default').': <b>'._('No').'</b></div><br>'; /* Allowed image types */ echo '<label>'._('Allowed image types').':</label> <div class="desc">'._('What filetypes users are allowed to upload.').'</div><br>'; /* GIF */ echo '<label for="filetype_gif">GIF</label><input type="checkbox" name="filetype_gif" '; if (in_array('GIF', explode('|', $lineboard['filetypes']))) { echo 'checked '; } echo '><br>'; /* JPG */ echo '<label for="filetype_jpg">JPG</label><input type="checkbox" name="filetype_jpg" '; if (in_array('JPG', explode('|', $lineboard['filetypes']))) { echo 'checked '; } echo '><br>'; /* PNG */ echo '<label for="filetype_png">PNG</label><input type="checkbox" name="filetype_png" '; if (in_array('PNG', explode('|', $lineboard['filetypes']))) { echo 'checked '; } echo '><br>'; /* User-set filetypes */ $results_filetypes = $tc_db->GetAll("SELECT * FROM `" . TC_DBPREFIX . "filetypes`"); foreach ($results_filetypes as $line_filetypes) { echo '<label for="filetype_' . $line_filetypes['filetype'] . '">' . strtoupper($line_filetypes['filetype']) . '</label><input type="checkbox" name="filetype_' . $line_filetypes['filetype'] . '"'; if (in_array(strtoupper($line_filetypes['filetype']), explode('|', $lineboard['filetypes']))) { echo ' checked'; } echo '><br>'; } /* END Allowed image types */ /* Maximum image size */ echo '<label for="maximagesize">'._('Maximum image size').':</label> <input type="text" name="maximagesize" value="'.$lineboard['maximagesize'].'"> <div class="desc">'._('Maxmimum size of uploaded images, in <b>bytes</b>.') . ' ' . _('Default').': <b>1024000</b></div><br>'; /* Maximum message length */ echo '<label for="messagelength">'._('Maximum message length').':</label> <input type="text" name="messagelength" value="'.$lineboard['messagelength'].'"> <div class="desc">'._('Default').': <b>8192</b></div><br>'; /* Maximum board pages */ echo '<label for="maxpages">'._('Maximum board pages').':</label> <input type="text" name="maxpages" value="'.$lineboard['maxpages'].'"> <div class="desc">'._('Default').': <b>10</b></div><br>'; /* Maximum thread age */ echo '<label for="maxage">'._('Maximum thread age (Hours)').':</label> <input type="text" name="maxage" value="'.$lineboard['maxage'].'"> <div class="desc">'._('Default').': <b>96</b></div><br>'; /* Maximum thread replies */ echo '<label for="maxreplies">'._('Maximum thread replies').':</label> <input type="text" name="maxreplies" value="'.$lineboard['maxreplies'].'"> <div class="desc">'._('The number of replies a thread can have before autosaging to the back of the board.') . ' ' . _('Default').': <b>200</b></div><br>'; /* Header image */ echo '<label for="image">'._('Header image').':</label> <input type="text" name="image" value="'.$lineboard['image'].'"> <div class="desc">'._('Overrides the header set in the config file. Leave blank to use configured global header image. Needs to be a full url including http://. Set to none to show no header image.').'</div><br>'; /* Include header */ echo '<label for="includeheader">'._('Include header').':</label> <textarea name="includeheader" rows="12" cols="80">'.$lineboard['includeheader'].'</textarea> <div class="desc">'._('Raw HTML which will be inserted at the top of each page of the board.').'</div><br>'; /* Enable "no file" posting */ echo '<label for="enablenofile">.'_('Enable "no file" posting').':</label> <select name="enablenofile">'; echo ($lineboard['enablenofile'] == '1') ? '<option value="1">Yes</option><option value="0">No</option>' : '<option value="0">No</option><option value="1">Yes</option>'; echo '</select> <div class="desc">'._('If set to yes, new threads will not require an image to be posted.') . ' ' . _('Default').': <b>'._('No').'</b></div><br>'; /* Redirect to thread */ echo '<label for="redirecttothread">'._('Redirect to thread').':</label> <select name="redirecttothread">'; echo ($lineboard['redirecttothread'] == '1') ? '<option value="1">Yes</option><option value="0">No</option>' : '<option value="0">No</option><option value="1">Yes</option>'; echo '</select> <div class="desc">'._('If set to yes, users will be redirected to the thread they replied to/posted after posting. If set to no, users will be redirected to the first page of the board.') . ' ' . _('Default').': <b>'.('No').'</b></div><br>'; /* Forced anonymous */ echo '<label for="forcedanon">'._('Forced anonymous').':</label> <select name="forcedanon">'; echo ($lineboard['forcedanon'] == '1') ? '<option value="1">'._('Yes').'</option><option value="0">'._('No').'</option>' : '<option value="0">'._('No').'</option><option value="1">'._('Yes').'</option>'; echo '</select> <div class="desc">'._('If set to yes, users will not be allowed to enter a name, making everyone appear as Anonymous') . ' ' . _('Default').': <b>'._('No').'</b></div><br>'; /* Trial */ echo '<label for="trial">'._('Trial').':</label> <select name="trial">'; echo ($lineboard['trial'] == '1') ? '<option value="1">'._('Yes').'</option><option value="0">'._('No').'</option>' : '<option value="0">'._('No').'</option><option value="1">'._('Yes').'</option>'; echo '</select> <div class="desc">'._('If set to yes, this board will appear in italics in the menu') . ' ' . _('Default').': <b>'._('No').'</b></div><br>'; /* Popular */ echo '<label for="popular">'._('Popular').':</label> <select name="popular">'; echo ($lineboard['popular'] == '1') ? '<option value="1">'._('Yes').'</option><option value="0">'._('No').'</option>' : '<option value="0">'._('No').'</option><option value="1">'._('Yes').'</option>'; echo '</select> <div class="desc">'._('If set to yes, this board will appear in bold in the menu') . ' ' . _('Default').': <b>'._('No').'</b></div><br>'; /* Default style */ echo '<label for="defaultstyle">'._('Default style:').'</label> <select name="defaultstyle"> <option value="Burichan"'; echo ($lineboard['defaultstyle'] == 'Burichan') ? ' selected' : ''; echo '>Burichan</option> <option value="Futaba"'; echo ($lineboard['defaultstyle'] == 'Futaba') ? ' selected' : ''; echo '>Futaba</option> <option value="Gurochan"'; echo ($lineboard['defaultstyle'] == 'Gurochan') ? ' selected' : ''; echo '>Gurochan</option> <option value="Photon"'; echo ($lineboard['defaultstyle'] == 'Photon') ? ' selected' : ''; echo '>Photon</option> <option value="Fuhrerchan"'; echo ($lineboard['defaultstyle'] == 'Fuhrerchan') ? ' selected' : ''; echo '>Fuhrerchan</option> </select> <div class="desc">'._('The style which will be set when the user first visits the board.').' '._('Default').': <b>Futaba</b></div><br>'; /* Submit form */ echo '<input type="submit" name="submit" value="'._('Update').'">'; echo '</form> </div>'; } } else { echo _('Unable to locate a board named') . ' <b>' . $_POST['board'] . '</b>.'; } } else { echo '<form action="?action=boardopts" method="post"> <label for="board">'._('Board').':</label> '.make_boardlist_dropdown('board', moderator_boardlist($_SESSION['manageusername'])).' <input type="submit" value="'._('Go').'"> </form>'; }}