if (count($posts)) {
    echo "<span class=title>" . tra("Messages matching your query:") . "</span>";
    start_table();
    $n = 1;
    $options = get_output_options($logged_in_user);
    $options->setHighlightTerms($search_list);
    foreach ($posts as $post) {
        $thread = BoincThread::lookup_id($post->thread);
        if (!$thread) {
            continue;
        }
        $forum = BoincForum::lookup_id($thread->forum);
        if (!$forum) {
            continue;
        }
        if (!is_forum_visible_to_user($forum, $logged_in_user)) {
            continue;
        }
        if (!$show_hidden_posts) {
            if ($thread->hidden) {
                continue;
            }
            if ($post->hidden) {
                continue;
            }
        }
        show_post_and_context($post, $thread, $forum, $options, $n);
        $n++;
    }
    end_table();
}
Exemple #2
0
//
// This file was modified by contributors of "BOINC Web Tweak" project.
// display the threads in a forum.
require_once '../inc/util.inc';
require_once '../inc/time.inc';
require_once '../inc/forum.inc';
require_once '../inc/pm.inc';
$id = get_int("id");
$sort_style = get_int("sort", true);
$start = get_int("start", true);
if (!$start) {
    $start = 0;
}
$forum = BoincForum::lookup_id($id);
$user = get_logged_in_user(false);
if (!is_forum_visible_to_user($forum, $user)) {
    error_page("Not visible");
}
BoincForumPrefs::lookup($user);
if (!$sort_style) {
    // get the sort style either from the logged in user or a cookie
    if ($user) {
        $sort_style = $user->prefs->forum_sorting;
    } else {
        if (isset($_COOKIE['sorting'])) {
            list($sort_style, $thread_style) = explode("|", $_COOKIE['sorting']);
        }
    }
} else {
    // set the sort style
    if ($user) {