本文整理汇总了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;
}