本文整理匯總了PHP中Argument::shortUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Argument::shortUrl方法的具體用法?PHP Argument::shortUrl怎麽用?PHP Argument::shortUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Argument
的用法示例。
在下文中一共展示了Argument::shortUrl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: notifyNewArgument
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");
}