/** * Removes a topic from a user's list of email subscriptions. * * @param \tx_mmforum_base $forumObj The plugin object * @return string An error message in case the redirect attempt to * the previous page fails. */ static function delete(tx_mmforum_base $forumObj) { $feUserId = intval($GLOBALS['TSFE']->fe_user->user['uid']); $topicId = intval($forumObj->piVars['tid']); if ($feUserId && $topicId) { // Executing database operation $this->databaseHandle->exec_DELETEquery('tx_mmforum_topicmail', 'user_id = ' . $feUserId . ' AND topic_id = ' . $topicId . $forumObj->getStoragePIDQuery()); } // Redirecting visitor back to previous page $forumObj->redirectToReferrer(); return $forumObj->pi_getLL('subscr.delSuccess') . '<br />' . $forumObj->pi_getLL('redirect.error') . '<br />'; }