本文整理匯總了PHP中CSocNetUserToGroup::__SpeedFileCheckMessages方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSocNetUserToGroup::__SpeedFileCheckMessages方法的具體用法?PHP CSocNetUserToGroup::__SpeedFileCheckMessages怎麽用?PHP CSocNetUserToGroup::__SpeedFileCheckMessages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSocNetUserToGroup
的用法示例。
在下文中一共展示了CSocNetUserToGroup::__SpeedFileCheckMessages方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: DeleteRelation
//.........這裏部分代碼省略.........
$groupID = IntVal($groupID);
if ($groupID <= 0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_GROUPID"), "ERROR_GROUPID");
return false;
}
$dbResult = CSocNetUserToGroup::GetList(
array(),
array(
"GROUP_ID" => $groupID,
"USER_ID" => $userID,
),
false,
false,
array("ID", "ROLE", "GROUP_VISIBLE")
);
if ($arResult = $dbResult->Fetch())
{
if ($arResult["ROLE"] != SONET_ROLES_USER && $arResult["ROLE"] != SONET_ROLES_MODERATOR)
return false;
if (CSocNetUserToGroup::Delete($arResult["ID"]))
{
$arGroupSiteID = array();
$rsGroupSite = CSocNetGroup::GetSite($groupID);
while($arGroupSite = $rsGroupSite->Fetch())
{
$arGroupSiteID[] = $arGroupSite["LID"];
//get server name
$rsSites = CSite::GetByID($arGroupSite["LID"]);
$arSite = $rsSites->Fetch();
$serverName = $arSite["SERVER_NAME"];
if (strlen($serverName) <= 0)
{
if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0)
$serverName = SITE_SERVER_NAME;
else
$serverName = COption::GetOptionString("main", "server_name", $GLOBALS["SERVER_NAME"]);
}
if (strlen($serverName) > 0)
{
$protocol = (CMain::IsHTTPS() ? "https" : "http");
$serverName = $protocol."://".$serverName;
}
}
$fullWorkgroupsUrl = $serverName.COption::GetOptionString("socialnetwork", "workgroups_page", false, $arGroupSiteID["0"]);
$logID = CSocNetLog::Add(
array(
"ENTITY_TYPE" => SONET_ENTITY_GROUP,
"ENTITY_ID" => $groupID,
"EVENT_ID" => "system",
"=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(),
"TITLE_TEMPLATE" => false,
"TITLE" => "unjoin",
"MESSAGE" => $userID,
"URL" => $fullWorkgroupsUrl,
"MODULE_ID" => false,
"CALLBACK_FUNC" => false,
"USER_ID" => $userID,
"SITE_ID" => $arGroupSiteID
),
false
);
if (intval($logID) > 0)
{
$tmpID = $logID;
CSocNetLog::Update($logID, array("TMP_ID" => $tmpID));
CSocNetLogRights::Add($logID, array("SA", "U".$userID, "S".SONET_ENTITY_GROUP.$groupID, "S".SONET_ENTITY_GROUP.$groupID."_".SONET_ROLES_OWNER, "S".SONET_ENTITY_GROUP.$groupID."_".SONET_ROLES_MODERATOR, "S".SONET_ENTITY_GROUP.$groupID."_".SONET_ROLES_USER));
CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $tmpID);
}
}
else
{
$errorMessage = "";
if ($e = $APPLICATION->GetException())
$errorMessage = $e->GetString();
if (StrLen($errorMessage) <= 0)
$errorMessage = GetMessage("SONET_UR_ERROR_CREATE_USER2GROUP");
$GLOBALS["APPLICATION"]->ThrowException($errorMessage, "ERROR_DELETE_RELATION");
return false;
}
}
else
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_NO_USER2GROUP"), "ERROR_NO_MEMBER_REQUEST");
return false;
}
CSocNetUserToGroup::__SpeedFileCheckMessages($userID);
return true;
}
示例2: DeleteRelation
function DeleteRelation($userID, $groupID)
{
global $APPLICATION;
$userID = IntVal($userID);
if ($userID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_USERID"), "ERROR_USER_ID");
return false;
}
$groupID = IntVal($groupID);
if ($groupID <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_UR_EMPTY_GROUPID"), "ERROR_GROUPID");
return false;
}
$dbResult = CSocNetUserToGroup::GetList(array(), array("GROUP_ID" => $groupID, "USER_ID" => $userID), false, false, array("ID", "ROLE", "GROUP_VISIBLE", "GROUP_NAME"));
if ($arResult = $dbResult->Fetch()) {
if ($arResult["ROLE"] != SONET_ROLES_USER && $arResult["ROLE"] != SONET_ROLES_MODERATOR) {
return false;
}
if (CSocNetUserToGroup::Delete($arResult["ID"])) {
if (IsModuleInstalled("im")) {
$arNotifyParams = array("TYPE" => "unjoin", "RELATION_ID" => $arResult["ID"], "USER_ID" => $userID, "GROUP_ID" => $groupID, "GROUP_NAME" => $arResult["GROUP_NAME"]);
CSocNetUserToGroup::NotifyImToModerators($arNotifyParams);
CSocNetSubscription::DeleteEx($userID, "SG" . $groupID);
}
} else {
$errorMessage = "";
if ($e = $APPLICATION->GetException()) {
$errorMessage = $e->GetString();
}
if (StrLen($errorMessage) <= 0) {
$errorMessage = GetMessage("SONET_UR_ERROR_CREATE_USER2GROUP");
}
$GLOBALS["APPLICATION"]->ThrowException($errorMessage, "ERROR_DELETE_RELATION");
return false;
}
} else {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_NO_USER2GROUP"), "ERROR_NO_MEMBER_REQUEST");
return false;
}
CSocNetUserToGroup::__SpeedFileCheckMessages($userID);
return true;
}
示例3: array
$arTmpData["URL_MESSAGE"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_MESSAGE_FORM_MESS"], array("user_id" => $arUserRequests["FROM_USER_ID"], "message_id" => $arUserRequests["ID"]));
$arTmpData["URL_BAN"] = "EventType=Message&userID=" . $arUserRequests["FROM_USER_ID"] . "&action=ban";
$arTmpData["CAN_ANSWER"] = $arUserRequests["MESSAGE_TYPE"] == SONET_MESSAGE_PRIVATE && $canAnsver ? "Y" : "N";
$arTmpData["CAN_BAN"] = !CSocNetUser::IsUserModuleAdmin($arUserRequests["FROM_USER_ID"], $site) && $arUserRequests["MESSAGE_TYPE"] == SONET_MESSAGE_PRIVATE ? "Y" : "N";
if ($arTmpData["CAN_ANSWER"] == "Y") {
$arTmpData["BUTTONS"] = array(array("NAME" => GetMessage("SONET_C2_ANSWER"), "ID" => "reply", "ONCLICK" => "function () \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\twindow.open('" . $arTmpData["URL_MESSAGE"] . "', '', 'location=yes,status=no,scrollbars=yes,resizable=yes,width=700,height=550,top='+Math.floor((screen.height - 550)/2-14)+',left='+Math.floor((screen.width - 700)/2-5));\n\t\t\t\t\t\t\t\t\t\t_this.Next();\n\t\t\t\t\t\t\t\t\t\t_this.oData.splice(_this.oCurrentMessagePointer-1, 1);\n\t\t\t\t\t\t\t\t\t\tif (_this.oCurrentMessagePointer > 0)\n\t\t\t\t\t\t\t\t\t\t\t_this.oCurrentMessagePointer--;\n\t\t\t\t\t\t\t\t\t\t_this.adjustPaging();\n\t\t\t\t\t\t\t\t\t\t_this.ShowContent(_this.oCurrentMessagePointer);\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}"));
}
$arData[] = $arTmpData;
}
// while
}
// if bGet
}
if (count($arData) <= 0 || $arData[0] != "*") {
CSocNetMessages::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
CSocNetUserToGroup::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
CSocNetUserRelations::__SpeedFileCheckMessages($GLOBALS["USER"]->GetID());
}
global $tmpSite;
$tmpSite = $site;
function date_cmp($a, $b)
{
global $tmpSite, $DB;
$ts_a = $DB->CharToDateFunction($a["DATE"], "FULL", $tmpSite);
$ts_b = $DB->CharToDateFunction($b["DATE"], "FULL", $tmpSite);
if ($ts_a == $ts_b) {
return 0;
}
return $ts_a < $ts_b ? -1 : 1;
}
usort($arData, "date_cmp");