function 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') . ' ' . $_GET['updateboard'] . '.'; } } 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 '
'; /* Directory */ echo '
'._('The directory of the board.').'

'; /* Description */ echo '
'._('The name of the board.').'

'; /* Board type */ echo '
'._('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').': Normal Imageboard

'; /* Upload type */ echo '
'._('Whether or not to allow embedding of videos.').' '._('Default')'.: No Embedding

'; /* Order */ echo '
'._('Order to show board in menu list, in ascending order.').' '._('Default').': 0

'; /* Section */ echo '
'._('The section the board is in. This is used for displaying the list of boards on the top and bottom of pages.').'
If this is set to 0, it will not be shown in the menu.

'; /* Locked */ echo '
'._('Only moderators of the board and admins can make new posts/replies').'

'; /* Enable reporting */ echo '
'._('Reporting allows users to report posts, adding the post to the report list.').' '._('Default').': '._('Yes').'

'; /* Enable captcha */ echo '
'._('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').': '._('No').'

'; /* Allowed image types */ echo '
'._('What filetypes users are allowed to upload.').'

'; /* GIF */ echo '
'; /* JPG */ echo '
'; /* PNG */ echo '
'; /* User-set filetypes */ $results_filetypes = $tc_db->GetAll("SELECT * FROM `" . TC_DBPREFIX . "filetypes`"); foreach ($results_filetypes as $line_filetypes) { echo '
'; } /* END Allowed image types */ /* Maximum image size */ echo '
'._('Maxmimum size of uploaded images, in bytes.') . ' ' . _('Default').': 1024000

'; /* Maximum message length */ echo '
'._('Default').': 8192

'; /* Maximum board pages */ echo '
'._('Default').': 10

'; /* Maximum thread age */ echo '
'._('Default').': 96

'; /* Maximum thread replies */ echo '
'._('The number of replies a thread can have before autosaging to the back of the board.') . ' ' . _('Default').': 200

'; /* Header image */ echo '
'._('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.').'

'; /* Include header */ echo '
'._('Raw HTML which will be inserted at the top of each page of the board.').'

'; /* Enable "no file" posting */ echo '
'._('If set to yes, new threads will not require an image to be posted.') . ' ' . _('Default').': '._('No').'

'; /* Redirect to thread */ echo '
'._('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').': '.('No').'

'; /* Forced anonymous */ echo '
'._('If set to yes, users will not be allowed to enter a name, making everyone appear as Anonymous') . ' ' . _('Default').': '._('No').'

'; /* Trial */ echo '
'._('If set to yes, this board will appear in italics in the menu') . ' ' . _('Default').': '._('No').'

'; /* Popular */ echo '
'._('If set to yes, this board will appear in bold in the menu') . ' ' . _('Default').': '._('No').'

'; /* Default style */ echo '
'._('The style which will be set when the user first visits the board.').' '._('Default').': Futaba

'; /* Submit form */ echo ''; echo '
'; } } else { echo _('Unable to locate a board named') . ' ' . $_POST['board'] . '.'; } } else { echo '
'.make_boardlist_dropdown('board', moderator_boardlist($_SESSION['manageusername'])).'
'; } }