本文整理汇总了PHP中CSocServAuthManager::SendUserMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocServAuthManager::SendUserMessage方法的具体用法?PHP CSocServAuthManager::SendUserMessage怎么用?PHP CSocServAuthManager::SendUserMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocServAuthManager
的用法示例。
在下文中一共展示了CSocServAuthManager::SendUserMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SendSocialservicesMessages
public static function SendSocialservicesMessages()
{
$oAuthManager = new CSocServAuthManager();
$arActiveSocServ = $oAuthManager->GetActiveAuthServices(array());
if (!(isset($arActiveSocServ["Twitter"]) && isset($arActiveSocServ["Twitter"]["__active"])) || !function_exists("hash_hmac")) {
return false;
}
$ttl = 86400;
$cache_id = 'socserv_mes_user';
$obCache = new CPHPCache();
$cache_dir = '/bx/socserv_mes_user';
$arSocServMessage = array();
if ($obCache->InitCache($ttl, $cache_id, $cache_dir)) {
$arSocServMessage = $obCache->GetVars();
} else {
$dbSocServMessage = CSocServMessage::GetList(array(), array('SUCCES_SENT' => 'N'), false, array("nTopCount" => 5), array("ID", "SOCSERV_USER_ID", "PROVIDER", "MESSAGE"));
while ($arSocMessage = $dbSocServMessage->Fetch()) {
$arSocServMessage[] = $arSocMessage;
}
if (empty($arSocServMessage)) {
if ($obCache->StartDataCache()) {
$obCache->EndDataCache($arSocServMessage);
}
}
}
if (is_array($arSocServMessage) && !empty($arSocServMessage)) {
foreach ($arSocServMessage as $arSocMessage) {
$arResult = CSocServAuthManager::SendUserMessage($arSocMessage['SOCSERV_USER_ID'], $arSocMessage['PROVIDER'], $arSocMessage['MESSAGE'], $arSocMessage['ID']);
if ($arResult !== false && is_array($arResult) && !preg_match("/error/i", join(",", array_keys($arResult)))) {
self::MarkMessageAsSent($arSocMessage['ID']);
}
}
}
return "CSocServAuthManager::SendSocialservicesMessages();";
}
示例2: OnAfterTMDayStart
function OnAfterTMDayStart($arFields)
{
global $USER;
$arResult = array();
$arResult['ENABLED'] = CUserOptions::GetOption("socialservices", "user_socserv_enable", "N", $USER->GetID());
if($arResult['ENABLED'] == 'Y')
{
$arResult['STARTSEND'] = CUserOptions::GetOption("socialservices", "user_socserv_start_day", "N", $USER->GetID());
if($arResult['STARTSEND'] == 'Y')
{
$arResult['STARTTEXT'] = CUserOptions::GetOption("socialservices", "user_socserv_start_text", GetMessage("JS_CORE_SS_WORKDAY_START"), $USER->GetID());
$arResult['SOCSERVARRAY'] = unserialize(CUserOptions::GetOption("socialservices", "user_socserv_array", "array()", $USER->GetID()));
if(is_array($arResult['SOCSERVARRAY']) && count($arResult['SOCSERVARRAY']) > 0)
{
foreach($arResult['SOCSERVARRAY'] as $id => $providerName)
CSocServAuthManager::SendUserMessage($id, $providerName, $arResult['STARTTEXT']);
}
}
}
}