/** * Build a link to an alert's content so that the system can redirect to * it. * * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to build the * link for. * * @return string The built alert, preferably an absolute link. */ public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) { $alertContent = $alert->getExtraDetails(); $threadLink = $this->mybb->settings['bburl'] . '/' . get_thread_link((int) $alertContent['tid'], 0, 'newpost'); return $threadLink; }
public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) { $alertContent = $alert->getExtraDetails(); return MyProfileComments::get_instance()->build_comment_link($alertContent["cid"]); }
/** * Add a new alert. * * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to add. * * @return $this */ public function addAlert(MybbStuff_MyAlerts_Entity_Alert $alert) { $fromUser = $alert->getFromUser(); if (!isset($fromUser['uid'])) { $alert->setFromUser($this->mybb->user); } $alertType = $alert->getType(); $usersWhoWantAlert = $this->doUsersWantAlert($alert->getType(), array($alert->getUserId())); if ($alertType->getEnabled() && (!empty($usersWhoWantAlert) || !$alertType->getCanBeUserDisabled())) { if ($alertType->getCode() === 'quoted') { // If there is already an alert queued to the user of the type // 'post_threadauthor', don't add the alert. $extraDetails = $alert->getExtraDetails(); $tid = $extraDetails['tid']; if (isset(static::$alertQueue['post_threadauthor_' . $alert->getUserId() . '_' . $tid])) { return $this; } } $passToHook = array('alertManager' => &$this, 'alert' => &$alert); $this->plugins->run_hooks('myalerts_alert_manager_add_alert', $passToHook); // Basic duplicate checking by overwrite - only one alert for each alert type/object id combination static::$alertQueue[$alert->getType()->getCode() . '_' . $alert->getUserId() . '_' . $alert->getObjectId()] = $alert; } return $this; }
public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) { global $eas; $alertContent = $alert->getExtraDetails(); $pmLink = $this->mybb->settings['bburl'] . '/alerts.php'; return $pmLink; }
/** * Format an alert into it's output string to be used in both the main * alerts listing page and the popup. * * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to format. * * @return string The formatted alert string. */ public function formatAlert(MybbStuff_MyAlerts_Entity_Alert $alert, array $outputAlert) { $alertContent = $alert->getExtraDetails(); $pmSubject = htmlspecialchars_uni($this->parser->parse_badwords($alertContent['pm_title'])); return $this->lang->sprintf($this->lang->myalerts_pm, $outputAlert['from_user'], $pmSubject); }
/** * Build a link to an alert's content so that the system can redirect to * it. * * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to build the * link for. * * @return string The built alert, preferably an absolute link. */ public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) { $alertContent = $alert->getExtraDetails(); $postLink = $this->mybb->settings['bburl'] . '/' . get_post_link((int) $alertContent['pid'], (int) $alertContent['tid']) . '#pid' . (int) $alertContent['pid']; return $postLink; }
/** * Format an alert into it's output string to be used in both the main alerts listing page and the popup. * * @param MybbStuff_MyAlerts_Entity_Alert $alert The alert to format. * * @return string The formatted alert string. */ public function formatAlert(MybbStuff_MyAlerts_Entity_Alert $alert, array $outputAlert) { $alertContent = $alert->getExtraDetails(); return $this->lang->sprintf($this->lang->wiki_watching_alert_string, $alertContent['title']); }
public function buildShowLink(MybbStuff_MyAlerts_Entity_Alert $alert) { $alertContent = $alert->getExtraDetails(); $feedbackLink = $this->mybb->settings['bburl'] . '/tradefeedback.php?action=view&uid=' . $mybb->user['uid'] . '&fid=' . $alertContent['fid']; return $feedbackLink; }