function unsubscribe($forum, $thread, $user) { BoincSubscription::delete($user->id, $thread->id); if (!BoincSubscription::lookup($user->id, $thread->id)) { page_head(tra("Unsubscription successful")); show_forum_header($user); show_title($forum, $thread); echo "<p>" . tra("You are no longer subscribed to %1. You will no longer receive notifications for this thread.", "<b>" . cleanup_title($thread->title) . "</b>"); } else { page_head(tra("Unsubscription failed")); echo "<p>" . tra("We are currently unable to unsubscribe you from %1. Please try again later..", "<b>" . cleanup_title($thread->title) . "</b>"); } echo "</p><p><br /><a href=\"forum_thread.php?id=" . $thread->id . "\">" . tra("Return to thread") . "</a></p>"; page_tail(); }
$logged_in_user->prefs->update("thread_sorting={$sort_style}"); } else { list($forum_style, $old_style) = parse_forum_cookie(); } send_cookie('sorting', implode("|", array($forum_style, $sort_style)), true); } else { // get the sorting style from the user or a cookie if ($logged_in_user) { $sort_style = $logged_in_user->prefs->thread_sorting; } else { list($forum_style, $sort_style) = parse_forum_cookie(); } } } page_head($title, 'jumpToUnread();'); $is_subscribed = $logged_in_user && BoincSubscription::lookup($logged_in_user->id, $thread->id); show_forum_header($logged_in_user); echo "<p>"; switch ($forum->parent_type) { case 0: $category = BoincCategory::lookup_id($forum->category); show_forum_title($category, $forum, $thread); break; case 1: show_team_forum_title($forum, $thread); break; } if (false) { if ($forum->parent_type == 0) { if ($category->is_helpdesk && !$thread->status) { if ($logged_in_user) {