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(); }
$forum = BoincForum::lookup("parent_type=1 and category={$user->teamid}"); if ($forum) { show_forum_summary($forum, $i++); } } end_table(); if ($user) { $subs = BoincSubscription::enum("userid={$user->id}"); if (count($subs)) { echo "<p><span class=title>" . tra("Subscribed threads") . "</span><p>"; show_thread_and_context_header(); $i = 0; foreach ($subs as $sub) { $thread = BoincThread::lookup_id($sub->threadid); if (!$thread) { BoincSubscription::delete($user->id, $sub->threadid); continue; } if ($thread->hidden) { continue; } show_thread_and_context($thread, $user, $i++); } end_table(); } } page_tail(); flush(); BoincForumLogging::cleanup(); $cvs_version_tracker[] = "\$Id\$"; //Generated automatically - do not edit