Example #1
0
function format_comment($text, $board)
{
    // hide >>1 references from the quoting code
    $text = preg_replace("/>>([0-9\\-]+)/", "&gtgt;\\1", $text);
    // restore >>1 references
    $handler = function ($text) use($board) {
        return preg_replace_callback("/&gtgt;([0-9]+)/", function ($matches) use($board) {
            $p = posts_check_number($matches[1]);
            $b = boards_check_name($board);
            $t = threads_get_by_reply($b, $p);
            if ($b == FALSE || $t == FALSE) {
                return addslashes($matches[1]);
            } else {
                return "<a class=\"ref|{$b}|{$t['original_post']}|{$p}\" " . "href=\"" . Config::DIR_PATH . "/{$b}/{$t['original_post']}#{$p}\">" . "&gt;&gt;{$p}</a>";
            }
        }, $text);
    };
    $text = do_wakabamark($text, $handler, 0);
    // fix <blockquote> styles for old stylesheets
    $text = preg_replace("/<blockquote>/", "<blockquote class=\"unkfunc\">", $text);
    // restore >>1 references hidden in code blocks
    $text = preg_replace("/&gtgt;/", "&gt;&gt;", $text);
    return $text;
}
Example #2
0
         // Cleanup.
         DataExchange::releaseResources();
         display_error_page($smarty, new RequiedParamError($param));
         exit(1);
     }
 }
 // Check board name.
 $board_name = boards_check_name($_REQUEST['board']);
 if ($board_name === FALSE) {
     // Cleanup.
     DataExchange::releaseResources();
     display_error_page($smarty, kotoba_last_error());
     exit(1);
 }
 // Get post, board, thread and attachment.
 $post = posts_get_visible_by_number($board_name, posts_check_number($_REQUEST['post']), $_SESSION['user']);
 $board = $post['board'];
 $thread = $post['thread'];
 $posts_attachments = array();
 $attachments = array();
 if (is_attachments_enabled($board) || $thread['with_attachments']) {
     $posts_attachments = posts_attachments_get_by_posts(array($post));
     $attachments = attachments_get_by_posts(array($post));
 }
 // Find if author of this post is admin.
 $author_admin = posts_is_author_admin($post['user']);
 //
 // Create html-code and display it.
 //
 $smarty->assign('ATTACHMENT_TYPE_FILE', Config::ATTACHMENT_TYPE_FILE);
 $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
Example #3
0
 $f['number'] = '';
 $f['ip'] = '';
 if (isset($_REQUEST['filter'])) {
     if (isset($_REQUEST['filter']['board'])) {
         if ($_REQUEST['filter']['board'] == 'all') {
             $f['board'] = 'all';
         } else {
             $f['board'] = boards_check_id($_REQUEST['filter']['board']);
         }
     }
     if (isset($_REQUEST['filter']['date_time']) && $_REQUEST['filter']['date_time'] != '') {
         $f['date_time'] = $_REQUEST['filter']['date_time'];
         $f['date_time'] = date_format(date_create($f['date_time']), 'U');
     }
     if (isset($_REQUEST['filter']['number']) && $_REQUEST['filter']['number'] != '') {
         $f['number'] = posts_check_number($_REQUEST['filter']['number']);
     }
     if (isset($_REQUEST['filter']['ip']) && $_REQUEST['filter']['ip'] != '') {
         $f['ip'] = ip2long($_REQUEST['filter']['ip']);
     }
 }
 $a['ban_type'] = '';
 $a['del_type'] = '';
 if (isset($_REQUEST['action'])) {
     if (isset($_REQUEST['action']['ban_type'])) {
         if ($_REQUEST['action']['ban_type'] == 'simple') {
             $a['ban_type'] = 'simple';
         } else {
             if ($_REQUEST['action']['ban_type'] == 'hard') {
                 $a['ban_type'] = 'hard';
             } else {