Пример #1
0
/**
 *
 */
function post_search_generate_html($smarty, &$post, $author_admin)
{
    $post['ip'] = long2ip($post['ip']);
    if (is_geoip_enabled($post['board']) && $post['ip'] != '127.0.0.1' && strpos($post['ip'], '192.168') === false) {
        $geoip = geoip_record_by_name($post['ip']);
        $smarty->assign('country', array('name' => $geoip['country_name'], 'code' => strtolower($geoip['country_code'])));
    }
    if (is_postid_enabled($post['board'])) {
        $postid = calculate_tripcode("#{$post['ip']}");
        $smarty->assign('postid', $postid[1]);
    }
    $smarty->assign('author_admin', $author_admin);
    $smarty->assign('post', $post);
    $smarty->assign('enable_translation', is_translation_enabled($post['board']));
    return $smarty->fetch('search_post.tpl');
}
Пример #2
0
                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();
    exit(0);
} catch (KotobaException $e) {
Пример #3
0
    $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.
    DataExchange::releaseResources();
    display_exception_page($smarty, $e, is_admin() || is_mod());