public function notifyNewArgument(Question $q, Argument $a) { global $sDB, $sTimer, $sTemplate; $sTimer->start("notifyNewArgument"); $res = $sDB->exec("SELECT `notifications`.`userId`, `notifications`.`flags`, `users`.`email`, `users`.`userName` FROM `notifications`\n LEFT JOIN `users` ON `users`.`userId` = `notifications`.`userId`\n WHERE `questionId` = '" . i($q->questionId()) . "';"); while ($row = mysql_fetch_object($res)) { // no notifications for our own arguments. /*if($a->userId() == $row->userId) { continue; }*/ $uId = new BaseConvert($row->userId); $qId = new BaseConvert($q->questionId()); $profileUrl = $sTemplate->getShortUrlBase() . "u" . $uId->val(); $unfollowUrl = $sTemplate->getShortUrlBase() . "f" . $qId->val(); $url = $a->shortUrl(); if (!SHORTURL_BASE) { $profileUrl = $sTemplate->getRoot() . "user/" . $row->userId . "/"; $unfollowUrl = $sTemplate->getRoot() . "unfollow.php?qId=" . $q->questionId(); $url = $a->fullurl(); } $subject = $sTemplate->getString("NOTIFICATION_NEW_ARGUMENT_SUBJECT"); $message = $sTemplate->getString("NOTIFICATION_NEW_ARGUMENT_BODY", array("[USERNAME]", "[AUTHOR]", "[URL]", "[QUESTION]", "[ARGUMENT]", "[UNFOLLOW_URL]", "[PROFILE_URL]"), array($row->userName, $a->author(), $url, $q->title(), $a->headline(), $unfollowUrl, $profileUrl)); $this->sendMail($row->email, "", $subject, $message); } $sTimer->stop("notifyNewArgument"); }
public function shortUrlCA() { global $sTemplate; $id = new BaseConvert($this->argumentId()); return $sTemplate->getShortUrlBase() . "c" . $id->val(); }
public function shortUrlDetails() { global $sTemplate; $id = new BaseConvert($this->questionId()); return $sTemplate->getShortUrlBase() . "d" . $id->val(); }
public function shortUrl() { global $sTemplate; $id = new BaseConvert($this->userId); return $sTemplate->getShortUrlBase() . "u" . $id->val(); }
* * This display should be, at a minimum, the Attribution Phrase displayed in the * footer of the page and linked to the Attribution URL. The link to the Attribution * URL must not contain any form of 'nofollow' attribute. * * Display of Attribution Information is required in Larger Works which are * defined in the CPAL as a work which combines Covered Code or portions * thereof with code not governed by the terms of the CPAL. *******************************************************************************/ include "commonHeaders.php"; $id62 = $sRequest->getString("id"); $id = new BaseConvert($id62, 62, 10); $type = $sRequest->getString("type"); $url = false; if ($type == "question") { $q = $sQuery->getQuestionById($id->val()); if ($q) { $url = $q->url(); } } else { if ($type == "questionDetails") { $q = $sQuery->getQuestionById($id->val()); if ($q) { $url = $q->urlDetails(); } } else { if ($type == "argument" || $type == "counterArgument") { $a = $sQuery->getArgumentById($id->val()); if ($a) { $q = $sQuery->getQuestionById($a->questionId()); if ($q) {