Beispiel #1
0
    } else {
        $main_content .= '<br />Login first.';
    }
}
if ($action == 'new_topic') {
    if ($logged) {
        if (canPost($account_logged) || $group_id_of_acc_logged >= $group_not_blocked) {
            $players_from_account = $SQL->query("SELECT " . $SQL->tableName('players') . "." . $SQL->fieldName('name') . ", " . $SQL->tableName('players') . "." . $SQL->fieldName('id') . " FROM " . $SQL->tableName('players') . " WHERE " . $SQL->tableName('players') . "." . $SQL->fieldName('account_id') . " = " . (int) $account_logged->getId())->fetchAll();
            $section_id = (int) $_REQUEST['section_id'];
            $main_content .= '<a href="?subtopic=forum">Boards</a> >> <a href="?subtopic=forum&action=show_board&id=' . $section_id . '">' . $sections[$section_id] . '</a> >> <b>Post new thread</b><br />';
            if (isset($sections[$section_id])) {
                if ($section_id == 1 && $group_id_of_acc_logged < $group_not_blocked) {
                    $errors[] = 'Only moderators and admins can post on news board.';
                }
                $quote = (int) $_REQUEST['quote'];
                $text = trim(codeLower($_REQUEST['text']));
                $char_id = (int) $_REQUEST['char_id'];
                $post_topic = trim($_REQUEST['topic']);
                $smile = (int) $_REQUEST['smile'];
                $saved = false;
                if (isset($_REQUEST['save'])) {
                    $lenght = 0;
                    for ($i = 0; $i <= strlen($post_topic); $i++) {
                        if (ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126) {
                            $lenght++;
                        }
                    }
                    if ($lenght < 1 || strlen($post_topic) > 60) {
                        $errors[] = 'Too short or too long topic (short: ' . $lenght . ' long: ' . strlen($post_topic) . ' letters). Minimum 1 letter, maximum 60 letters.';
                    }
                    $lenght = 0;
Beispiel #2
0
    } else {
        $main_content .= '<br />Faça o login primeiro.';
    }
}
if ($action == 'new_topic') {
    if ($logged) {
        if (canPost($account_logged) || $group_id_of_acc_logged >= $group_not_blocked) {
            $players_from_account = $SQL->query("SELECT `players`.`name`, `players`.`id` FROM `players` WHERE `players`.`account_id` = " . (int) $account_logged->getId())->fetchAll();
            $section_id = (int) $_REQUEST['section_id'];
            $main_content .= '<div style="float: right; border:1px solid #888; padding: 5px; background: ' . $config['site']['darkborder'] . ';"><a href="?subtopic=forum">Seções</a> >> <a href="?subtopic=forum&action=show_board&id=' . $section_id . '">' . $sections[$section_id] . '</a> >> <b>Postar novo tópico</b></div><br /><br />';
            if (isset($sections[$section_id])) {
                if ($section_id == 1 && $group_id_of_acc_logged < $group_not_blocked || $section_id == 7 && $group_id_of_acc_logged < $group_not_blocked) {
                    $errors[] = 'Apenas moderadores e admins podem postar nessa seção.';
                }
                $quote = (int) $_REQUEST['quote'];
                $text = stripslashes(trim(codeLower($_REQUEST['text'])));
                $char_id = (int) $_REQUEST['char_id'];
                $post_topic = stripslashes(trim($_REQUEST['topic']));
                $smile = (int) $_REQUEST['smile'];
                $saved = false;
                if (isset($_REQUEST['save'])) {
                    $lenght = 0;
                    for ($i = 0; $i <= strlen($post_topic); $i++) {
                        if (ord($post_topic[$i]) >= 33 && ord($post_topic[$i]) <= 126) {
                            $lenght++;
                        }
                    }
                    if ($lenght < 4 || strlen($post_topic) > 60) {
                        $errors[] = 'Muito longo ou múito pequeno. Mínimo: 4 lettra. Máximo: 60 letras.';
                    }
                    $lenght = 0;