Ejemplo n.º 1
0
// it will apply the changes by calling methods on the forum
require_once '../inc/forum_email.inc';
require_once '../inc/forum.inc';
require_once '../inc/bbcode_html.inc';
require_once '../inc/akismet.inc';
require_once '../inc/news.inc';
check_get_args(array("id", "title", "force_title", "tnow", "ttok", "export"));
$logged_in_user = get_logged_in_user();
BoincForumPrefs::lookup($logged_in_user);
check_banished($logged_in_user);
$forumid = get_int("id");
$forum = BoincForum::lookup_id($forumid);
if (DISABLE_FORUMS && !is_admin($logged_in_user)) {
    error_page("Forums are disabled");
}
if (!user_can_create_thread($logged_in_user, $forum)) {
    error_page(tra("Only project admins may create a thread here. However, you may reply to existing threads."));
}
check_post_access($logged_in_user, $forum);
$title = post_str("title", true);
if (!$title) {
    $title = get_str("title", true);
}
$force_title = get_str("force_title", true);
$export = post_str("export", true);
$content = post_str("content", true);
$preview = post_str("preview", true);
$warning = null;
if ($content && $title && !$preview) {
    if (post_str('add_signature', true) == "add_it") {
        $add_signature = true;
Ejemplo n.º 2
0
        break;
    case 1:
        $team = BoincTeam::lookup_id($forum->category);
        page_head(tra("Team message board for %1", "<a href=team_display.php?teamid={$team->id}>{$team->name}</a>"));
        show_forum_header($user);
        show_team_forum_title($forum);
        break;
}
echo '
    <p>
    <form action="forum_forum.php" method="get">
    <table width="100%" cellspacing="0" cellpadding="0" class="forum_toplinks">
    <tr valign="top">
    <td colspan=2>
';
if (user_can_create_thread($user, $forum)) {
    show_button("forum_post.php?id={$id}", tra("New thread"), tra("Add a new thread to this forum"));
}
echo "</td>\n    <td valign=top align=\"right\">\n    <input type=\"hidden\" name=\"id\" value=\"{$forum->id}\">\n";
echo select_from_array("sort", $forum_sort_styles, $sort_style);
echo "<input class=\"btn btn-default\" type=\"submit\" value=\"Sort\">\n    </td>\n    </tr>\n    </table>\n    </form>\n";
show_forum($forum, $start, $sort_style, $user);
echo "\n    <p>" . tra("This message board is available as an %1RSS feed%2", "<a href=forum_rss.php?forumid={$forum->id}&setup=1>", " <img src=img/feed_logo.png></a>");
page_tail();
// This function shows the threads for the given forum
// Starting from $start,
// using the given $sort_style (as defined in forum.php)
// and using the features for the logged in user in $user.
//
function show_forum($forum, $start, $sort_style, $user)
{