if ($user->prefs->signature != "") {
        row2(tra("Signature preview") . "<br><p class=\"text-muted\">" . tra("This is how your signature will look in the forums") . "</p>", output_transform($user->prefs->signature));
    }
    // ------------ Message display  -----------
    $forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
    $forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
    $forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : "";
    $forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
    $forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
    $forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
    $forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
    $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
    $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
    row1(tra("Message display"));
    row2(tra("What to display"), "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> " . tra("Hide avatar images") . "<br>\n    <input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> " . tra("Hide signatures") . "<br>\n    <input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> " . tra("Show images as links") . "<br>\n    <input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> " . tra("Open links in new window/tab") . "<br>\n    <input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> " . tra("Highlight special users") . "<br>\n    <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> " . tra("Display this many messages per page") . "<br />\n    ");
    row2(tra("How to sort"), tra("Threads:") . " " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>" . tra("Posts:") . " " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\n    <input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> " . tra("Jump to first new post in thread automatically") . "<br>\n    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">" . tra("Don't move sticky posts to top") . "<br>\n    ");
}
// DISABLE_FORUMS
// ------------ Message filtering  -----------
row1(tra("Message filtering"));
$filtered_userlist = get_ignored_list($user);
$forum_filtered_userlist = "";
for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
    $id = (int) $filtered_userlist[$i];
    if ($id) {
        $filtered_user = BoincUser::lookup_id($id);
        if (!$filtered_user) {
            echo "Missing user {$id}";
            continue;
        }
        $forum_filtered_userlist .= "<input class=\"btn btn-default\" type=\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"" . tra("Remove") . "\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>";
Example #2
0
echo start_table("noborder");
?>
<table width="100%">
	<tr valign="top">
	<td colspan="2">
		<?php 
show_button("forum_post.php?id={$id}", "New thread", "Add a new thread to this forum");
?>
	</td>
	<td class="right">
		<input type="hidden" name="id" value="<?php 
echo $forum->id;
?>
">
		<?php 
echo select_from_array("sort", $forum_sort_styles, $sort_style);
?>
		<input type="submit" value="Sort">
	</td>
	</tr>
</table>
</form>

<?php 
echo show_forum($forum, $start, $sort_style, $user);
echo '<p>This message board is available as an
	<a href="forum_rss.php?forumid=' . $forum->id . '&amp;setup=1">RSS feed
	<img src="img/feed_logo.png"></a></p>';
page_tail();
// This function shows the threads for the given forum
// Starting from $start,
Example #3
0
        show_button("forum_moderate_thread.php?action=delete&amp;thread=" . $thread->id . "{$tokens}", tra("Delete"), tra("Delete thread permanently"));
    }
    // let admins decide whether a news item should be exported as notice
    //
    if (is_news_forum($forum) && $logged_in_user && $logged_in_user->id == $thread->owner) {
        if ($thread->status) {
            show_button("forum_thread_status.php?action=clear&amp;id={$thread->id}", tra("Export as Notice"), "Show this message to all volunteers in the desktop GUI.  Use this only for messages of interest or importance to all volunteers.");
        } else {
            show_button("forum_thread_status.php?action=set&amp;id={$thread->id}", tra("Don't export"), tra("Don't export this news item as a Notice"));
        }
    }
}
// Display a box that allows the user to select sorting of the posts
//
echo "</td><td align=\"right\">\n    <input type=\"hidden\" name=\"id\" value=\"", $thread->id, "\">" . tra("Sort");
echo select_from_array("sort", $thread_sort_styles, $sort_style);
echo "<input class=\"btn btn-default\" type=\"submit\" value=\"" . tra('Sort') . "\">\n    </td></tr></table></form>\n";
show_posts($thread, $forum, $start, $postid, $sort_style, $filter, $logged_in_user);
if ($reply_url) {
    echo "<br>";
    show_button($reply_url, tra("Post to thread"), tra("Add a new message to this thread"));
}
echo "<p>";
switch ($forum->parent_type) {
    case 0:
        show_forum_title($category, $forum, $thread);
        break;
    case 1:
        show_team_forum_title($forum, $thread);
        break;
}
Example #4
0
                 if (isset($prev_id)) {
                     $foo[$prev_id]['next_id'] = $row['categories_id'];
                 }
                 $prev_id = $row['categories_id'];
                 if (!isset($first_id)) {
                     $first_id = $row['categories_id'];
                 }
                 $last_id = $row['categories_id'];
             }
             $foo[$last_id]['next_id'] = $foo[$value]['next_id'];
             $foo[$value]['next_id'] = $first_id;
             $new_path .= '_';
         } else {
             break;
         }
         $list = select_from_array(0);
         vam_show_top2level_category($list);
         // вывод двух первых уровней каталога
         $box->assign('BOX_CONTENT', '<ul id="CatNavi">' . $categories_string . '</ul>');
     }
     //------------  подкатегории на главной <<<<<
 } else {
     // вывод всех подкатегорий выбраной категории
     //проверить есть ли подкатегории у выбранной категории если нету то не выводить блок
     $ids = preg_split('/_/', $cPath);
     // список id дерева категорий
     // заглавная категория
     $sql = "SELECT DISTINCT c.categories_id as id,  cd.categories_name as name, c.parent_id as parent \tFROM " . TABLE_CATEGORIES . " c\n\t\t\t\tINNER JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON cd.categories_id = c.categories_id AND cd.language_id='" . (int) $_SESSION['languages_id'] . "'\n\t\t\tWHERE c.categories_status = '1'\tAND c.categories_id = " . $ids[0] . $group_check;
     $ds = vamDBquery($sql);
     $row = vam_db_fetch_array($ds, true);
     $cPath_new = vam_category_link($row['id'], $row['name']);
}
if ($user->prefs->ignore_sticky_posts) {
    $forum_ignore_sticky_posts = "checked=\"checked\"";
} else {
    $forum_ignore_sticky_posts = "";
}
if ($user->prefs->highlight_special) {
    $forum_highlight_special = "checked=\"checked\"";
} else {
    $forum_highlight_special = "";
}
$forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
$forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
row1("Message display");
row2("What to display", "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> Hide avatar images<br>\r\n\t<input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> Hide signatures<br>\r\n\t<input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> Show images as links<br>\r\n\t<input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> Open links in new window/tab<br>\r\n\t<input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> Highlight special users<br>\r\n\t");
row2("How to sort", "Threads: " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>Posts: " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\r\n\t<input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> Jump to first new post in thread automatically<br>\r\n\t<input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">Do not reorder sticky posts<br>\r\n\t<input type=\"text\" name=\"forum_minimum_wrap_postcount\" size=3 value=\"" . $forum_minimum_wrap_postcount . "\"> If a thread contains more than this number of posts<br />\r\n\t<input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> only display the first one and this many of the last ones<br />\r\n\t");
// ------------ Message filtering  -----------
row1("Message filtering");
$filtered_userlist = get_ignored_list($user);
$forum_filtered_userlist = "";
for ($i = 0; $i < sizeof($filtered_userlist); $i++) {
    $id = (int) $filtered_userlist[$i];
    if ($id) {
        $filtered_user = BoincUser::lookup_id($id);
        if (!$filtered_user) {
            echo "Missing user {$id}";
            continue;
        }
        $forum_filtered_userlist .= "<input type =\"submit\" name=\"remove" . $filtered_user->id . "\" value=\"Remove\"> " . $filtered_user->id . " - " . user_links($filtered_user) . "<br>";
    }
}
function vam_show_top2level_category(&$list)
{
    global $categories_string;
    if (count($list) == 0) {
        return;
    }
    foreach ($list as $key => $item) {
        if (!isset($item['id'])) {
            continue;
        }
        $categories_string .= '<li class="CatLevel' . $item['level'] . '">';
        $categories_string .= '<a href=';
        $cPath_new = vam_category_link($item['id'], $item['name']);
        $categories_string .= vam_href_link(FILENAME_DEFAULT, $cPath_new);
        $categories_string .= '>';
        // display category name
        $categories_string .= $item['name'];
        if (SHOW_COUNTS == 'true') {
            $products_in_category = vam_count_products_in_category($item['id']);
            if ($products_in_category > 0) {
                $categories_string .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $categories_string .= '</a>';
        $chield_list = select_from_array($item['id']);
        if (count($chield_list) > 0) {
            vam_show_top2level_category($chield_list);
        }
        $categories_string .= '</li>';
    }
}