Exemplo n.º 1
0
    $smarty->assign('ATTACHMENT_TYPE_FILE', Config::ATTACHMENT_TYPE_FILE);
    $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
    $smarty->assign('ATTACHMENT_TYPE_VIDEO', Config::ATTACHMENT_TYPE_VIDEO);
    $smarty->assign('ATTACHMENT_TYPE_IMAGE', Config::ATTACHMENT_TYPE_IMAGE);
    $smarty->assign('page_title', NULL);
    $post_html = $smarty->fetch('header.tpl');
    // Set default post author name if enabled.
    if (!$board['force_anonymous'] && $board['default_name'] && !$post['name']) {
        $post['name'] = $board['default_name'];
    }
    // Requied for simple and original post templates :(
    $smarty->assign('is_board_view', FALSE);
    $smarty->assign('show_favorites', TRUE);
    // Original post or reply.
    if ($thread['original_post'] == $post['number']) {
        $post_html .= post_original_generate_html($smarty, $board, $thread, $post, $posts_attachments, $attachments, false, null, false, null, false, $author_admin, false, false);
    } else {
        $post_html .= post_simple_generate_html($smarty, $board, $thread, $post, $posts_attachments, $attachments, false, null, $author_admin, false, false);
    }
    echo $post_html . $smarty->fetch('footer.tpl');
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.
    DataExchange::releaseResources();
    if (!isset($smarty)) {
        $smarty = new SmartyKotobaSetup();
    }
    display_exception_page($smarty, $e, is_admin() || is_mod());
    exit(1);
Exemplo n.º 2
0
         if ($t['id'] == $f['thread']['id']) {
             $smarty->assign('show_favorites', false);
             break;
         }
     }
     foreach ($posts as $p) {
         if ($t['id'] == $p['thread']['id']) {
             // Find if author of this post is admin.
             $author_admin = posts_is_author_admin($p['user']);
             // Set default post author name if enabled.
             if (!$board['force_anonymous'] && $board['default_name'] && !$p['name']) {
                 $p['name'] = $board['default_name'];
             }
             // Original post or reply.
             if ($t['original_post'] == $p['number']) {
                 $original_post_html = post_original_generate_html($smarty, $board, $t, $p, $posts_attachments, $attachments, true, $_SESSION['lines_per_post'], true, $_SESSION['posts_per_thread'], true, $author_admin, is_geoip_enabled($board), is_postid_enabled($board));
             } else {
                 $simple_posts_html .= post_simple_generate_html($smarty, $board, $t, $p, $posts_attachments, $attachments, true, $_SESSION['lines_per_post'], $author_admin, is_geoip_enabled($board), is_postid_enabled($board));
             }
         }
     }
     $smarty->assign('original_post_html', $original_post_html);
     $smarty->assign('simple_posts_html', $simple_posts_html);
     $threads_html .= $smarty->fetch('thread.tpl');
     $simple_posts_html = '';
 }
 $smarty->assign('threads_html', $threads_html);
 $smarty->assign('hidden_threads', $hidden_threads);
 $smarty->display('board_view.tpl');
 // Cleanup.
 DataExchange::releaseResources();
Exemplo n.º 3
0
    $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
    $smarty->assign('ATTACHMENT_TYPE_VIDEO', Config::ATTACHMENT_TYPE_VIDEO);
    $smarty->assign('ATTACHMENT_TYPE_IMAGE', Config::ATTACHMENT_TYPE_IMAGE);
    $smarty->assign('show_favorites', TRUE);
    $smarty->assign('is_board_view', FALSE);
    $simple_posts_html = '';
    foreach ($posts as $p) {
        // Find if author of this post is admin.
        $author_admin = posts_is_author_admin($p['user']);
        // Set default post author name if enabled.
        if (!$board['force_anonymous'] && $board['default_name'] !== null && $p['name'] === null) {
            $p['name'] = $board['default_name'];
        }
        // Original post or reply.
        if ($thread['original_post'] == $p['number']) {
            $original_post_html = post_original_generate_html($smarty, $board, $thread, $p, $posts_attachments, $attachments, false, null, false, null, false, $author_admin, is_geoip_enabled($board), is_postid_enabled($board));
        } else {
            $simple_posts_html .= post_simple_generate_html($smarty, $board, $thread, $p, $posts_attachments, $attachments, false, null, $author_admin, is_geoip_enabled($board), is_postid_enabled($board));
        }
    }
    favorites_mark_readed($_SESSION['user'], $thread['id']);
    $smarty->assign('original_post_html', $original_post_html);
    $smarty->assign('simple_posts_html', $simple_posts_html);
    $smarty->assign('threads_html', $smarty->fetch('thread.tpl'));
    $smarty->assign('hidden_threads', $hidden_threads);
    $smarty->display('thread_view.tpl');
    // Cleanup.
    DataExchange::releaseResources();
    exit(0);
} catch (KotobaException $e) {
    // Cleanup.