subscribe($user); if ($thread->isSubscribed($user)){ page_head("Subscription Successful"); show_forum_title($thread->getForum(), $thread); echo "
You are now subscribed to ", cleanup_title($thread->getTitle()), ". You will receive an email whenever someone posts to the thread."; } else { page_head("Subscription failed"); echo "
We are currently unable to subscribe you to this thread (", cleanup_title($thread->getTitle()), "). Please try again later.."; } echo "
"; page_tail(); } function unsubscribe($thread, $user=null) { $thread->unsubscribe($user); if (!$thread->isSubscribed($user)){ page_head("Unsubscription Successful"); show_forum_title($thread->getForum(), $thread); echo "You are no longer subscribed to ", cleanup_title($thread->getTitle()), ". You will no longer receive notifications for this thread."; } else { page_head("Unsubscription failed"); echo "
We are currently unable to unsubscribe you to this thread (", cleanup_title($thread->getTitle()), "). Please try again later.."; } echo "
"; page_tail(); } if ($thread && $action) { $user = re_get_logged_in_user(true); if ($action == "subscribe") { subscribe($thread, $user); exit(); } else if ($action == "unsubscribe") { unsubscribe($thread, $user); exit(); } else { show_result_page(null, false, $thread); exit(); } } else { error_page("Unknown subscription action"); } ?>