本文整理匯總了PHP中Wikia::buildUserSecretKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wikia::buildUserSecretKey方法的具體用法?PHP Wikia::buildUserSecretKey怎麽用?PHP Wikia::buildUserSecretKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Wikia
的用法示例。
在下文中一共展示了Wikia::buildUserSecretKey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ComposeMail
/**
* Returns true. Replace UNSUBSCRIBEURL with message and link to Special::Unsubscribe page
*/
public static function ComposeMail($to, &$body, &$subject)
{
global $wgCityId;
if (!$to instanceof MailAddress) {
return true;
}
# to test MW 1.16
$cityId = $wgCityId == 1927 ? $wgCityId : 177;
$name = $to->name;
$oTitle = GlobalTitle::newFromText('Unsubscribe', NS_SPECIAL, $cityId);
if (!is_object($oTitle)) {
return true;
}
$email = $to->address;
$ts = time();
# unsubscribe params
$hash_url = Wikia::buildUserSecretKey($name, 'sha256');
$url = $hash_url ? $oTitle->getFullURL(array('key' => $hash_url)) : '';
$body = str_replace('$UNSUBSCRIBEURL', $url, $body);
return true;
}
示例2: addParamsUser
protected static function addParamsUser($wiki_id, $user_name, &$params)
{
$hash_url = Wikia::buildUserSecretKey($user_name, 'sha256');
$unsubscribe_url = GlobalTitle::newFromText('Unsubscribe', NS_SPECIAL, $wiki_id)->getFullURL(array('key' => $hash_url));
$params['$USERNAME'] = $user_name;
$params['$UNSUBSCRIBEURL'] = $unsubscribe_url;
}