当前位置: 首页>>代码示例>>PHP>>正文


PHP CSocNetUserToGroup::ConfirmRequestToBeMember方法代码示例

本文整理汇总了PHP中CSocNetUserToGroup::ConfirmRequestToBeMember方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUserToGroup::ConfirmRequestToBeMember方法的具体用法?PHP CSocNetUserToGroup::ConfirmRequestToBeMember怎么用?PHP CSocNetUserToGroup::ConfirmRequestToBeMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSocNetUserToGroup的用法示例。


在下文中一共展示了CSocNetUserToGroup::ConfirmRequestToBeMember方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 $arIDs = array();
 if (strlen($errorMessage) <= 0) {
     for ($i = 0; $i <= IntVal($_POST["max_count"]); $i++) {
         if ($_POST["checked_" . $i] == "Y") {
             $arIDs[] = IntVal($_POST["id_" . $i]);
         }
     }
     if (count($arIDs) <= 0) {
         $errorMessage .= GetMessage("SONET_GRE_NOT_SELECTED") . ". ";
     }
 }
 if (strlen($errorMessage) <= 0) {
     $type = $_POST["type"] == "out" ? "out" : "in";
     if ($type == "in") {
         if ($_POST["action"] == "accept") {
             if (!CSocNetUserToGroup::ConfirmRequestToBeMember($USER->GetID(), $arResult["Group"]["ID"], $arIDs, false) && ($e = $APPLICATION->GetException())) {
                 $errorMessage .= $e->GetString();
             }
         } elseif ($_POST["action"] == "reject") {
             if (!CSocNetUserToGroup::RejectRequestToBeMember($USER->GetID(), $arResult["Group"]["ID"], $arIDs) && ($e = $APPLICATION->GetException())) {
                 $errorMessage .= $e->GetString();
             }
         }
     } else {
         if ($_POST["action"] == "reject") {
             $errorMessage = "";
             foreach ($arIDs as $relation_id) {
                 $arRelation = CSocNetUserToGroup::GetByID($relation_id);
                 if (!$arRelation) {
                     continue;
                 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: Update


//.........这里部分代码省略.........
         $arSiteID = array();
         if (is_set($arFields, "SITE_ID")) {
             if (is_array($arFields["SITE_ID"])) {
                 $arSiteID = $arFields["SITE_ID"];
             } else {
                 $arSiteID[] = $arFields["SITE_ID"];
             }
             $arFields["SITE_ID"] = false;
             $str_SiteID = "''";
             foreach ($arSiteID as $v) {
                 $arFields["SITE_ID"] = $v;
                 $str_SiteID .= ", '" . $DB->ForSql($v) . "'";
             }
         }
     }
     $db_events = GetModuleEvents("socialnetwork", "OnBeforeSocNetGroupUpdate");
     while ($arEvent = $db_events->Fetch()) {
         if (ExecuteModuleEventEx($arEvent, array($ID, &$arFields)) === false) {
             return false;
         }
     }
     if (array_key_exists("IMAGE_ID", $arFields) && is_array($arFields["IMAGE_ID"]) && (!array_key_exists("MODULE_ID", $arFields["IMAGE_ID"]) || strlen($arFields["IMAGE_ID"]["MODULE_ID"]) <= 0)) {
         $arFields["IMAGE_ID"]["MODULE_ID"] = "socialnetwork";
     }
     CFile::SaveForDB($arFields, "IMAGE_ID", "socialnetwork");
     $strUpdate = $DB->PrepareUpdate("b_sonet_group", $arFields);
     foreach ($arFields1 as $key => $value) {
         if (strlen($strUpdate) > 0) {
             $strUpdate .= ", ";
         }
         $strUpdate .= $key . "=" . $value . " ";
     }
     if (strlen($strUpdate) > 0) {
         $strSql = "UPDATE b_sonet_group SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
         $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
         if (count($arSiteID) > 0) {
             $strSql = "DELETE FROM b_sonet_group_site WHERE GROUP_ID=" . $ID;
             $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
             $strSql = "INSERT INTO b_sonet_group_site(GROUP_ID, SITE_ID) " . "SELECT " . $ID . ", LID " . "FROM b_lang " . "WHERE LID IN (" . $str_SiteID . ") ";
             $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
             $arLogID = array();
             $dbResult = CSocNetLog::GetList(array(), array("LOG_RIGHTS" => "SG" . $ID), false, false, array("ID"));
             while ($arResult = $dbResult->Fetch()) {
                 $DB->Query("DELETE FROM b_sonet_log_site WHERE LOG_ID = " . $arResult["ID"] . "", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
                 $DB->Query("\n\t\t\t\t\t\tINSERT INTO b_sonet_log_site(LOG_ID, SITE_ID)\n\t\t\t\t\t\tSELECT " . $arResult["ID"] . ", LID\n\t\t\t\t\t\tFROM b_lang\n\t\t\t\t\t\tWHERE LID IN (" . $str_SiteID . ")\n\t\t\t\t\t", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
                 $arLogID[] = $arResult["ID"];
             }
             $dbResult = CSocNetLog::GetList(array(), array("!ID" => $arLogID, "ENTITY_ID" => $ID, "ENTITY_TYPE" => SONET_ENTITY_GROUP), false, false, array("ID"));
             while ($arResult = $dbResult->Fetch()) {
                 $DB->Query("DELETE FROM b_sonet_log_site WHERE LOG_ID = " . $arResult["ID"] . "", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
                 $DB->Query("\n\t\t\t\t\t\tINSERT INTO b_sonet_log_site(LOG_ID, SITE_ID)\n\t\t\t\t\t\tSELECT " . $arResult["ID"] . ", LID\n\t\t\t\t\t\tFROM b_lang\n\t\t\t\t\t\tWHERE LID IN (" . $str_SiteID . ")\n\t\t\t\t\t", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
             }
         }
         unset($GLOBALS["SONET_GROUP_CACHE"][$ID]);
         if (defined("BX_COMP_MANAGED_CACHE")) {
             if ($bClearCommonTag) {
                 $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group");
             }
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_group_" . $ID);
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group_G" . $ID);
             $GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_user2group");
         }
         $GLOBALS["USER_FIELD_MANAGER"]->Update("SONET_GROUP", $ID, $arFields);
         $events = GetModuleEvents("socialnetwork", "OnSocNetGroupUpdate");
         while ($arEvent = $events->Fetch()) {
             ExecuteModuleEventEx($arEvent, array($ID, &$arFields));
         }
         if (CModule::IncludeModule("search")) {
             $arGroupNew = CSocNetGroup::GetByID($ID);
             if ($arGroupNew) {
                 if ($arGroupNew["ACTIVE"] == "N" && $arGroupOld["ACTIVE"] == "Y") {
                     CSearch::DeleteIndex("socialnetwork", "G" . $ID);
                 } elseif ($arGroupNew["ACTIVE"] == "Y") {
                     $BODY = CSocNetTextParser::killAllTags($arGroupNew["~DESCRIPTION"]);
                     $BODY .= $GLOBALS["USER_FIELD_MANAGER"]->OnSearchIndex("SONET_GROUP", $ID);
                     $arSearchIndexSiteID = array();
                     $rsGroupSite = CSocNetGroup::GetSite($ID);
                     while ($arGroupSite = $rsGroupSite->Fetch()) {
                         $arSearchIndexSiteID[$arGroupSite["LID"]] = str_replace("#group_id#", $ID, COption::GetOptionString("socialnetwork", "group_path_template", "/workgroups/group/#group_id#/", $arGroupSite["LID"]));
                     }
                     $arSearchIndex = array("SITE_ID" => $arSearchIndexSiteID, "LAST_MODIFIED" => $arGroupNew["DATE_ACTIVITY"], "PARAM1" => $arGroupNew["SUBJECT_ID"], "PARAM2" => $ID, "PARAM3" => "GROUP", "PERMISSIONS" => $arGroupNew["VISIBLE"] == "Y" ? array('G2') : array('SG' . $ID . '_A', 'SG' . $ID . '_E', 'SG' . $ID . '_K'), "PARAMS" => array("socnet_group" => $ID, "entity" => "socnet_group"), "TITLE" => $arGroupNew["~NAME"], "BODY" => $BODY, "TAGS" => $arGroupNew["~KEYWORDS"]);
                     CSearch::Index("socialnetwork", "G" . $ID, $arSearchIndex, True);
                 }
                 if ($arGroupNew["OPENED"] == "Y" && $arGroupOld["OPENED"] == "N") {
                     $dbRequests = CSocNetUserToGroup::GetList(array(), array("GROUP_ID" => $ID, "ROLE" => SONET_ROLES_REQUEST, "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER), false, false, array("ID"));
                     if ($dbRequests) {
                         $arIDs = array();
                         while ($arRequests = $dbRequests->GetNext()) {
                             $arIDs[] = $arRequests["ID"];
                         }
                         CSocNetUserToGroup::ConfirmRequestToBeMember($GLOBALS["USER"]->GetID(), $ID, $arIDs, $bAutoSubscribe);
                     }
                 }
             }
         }
     } elseif (!$GLOBALS["USER_FIELD_MANAGER"]->Update("SONET_GROUP", $ID, $arFields)) {
         $ID = False;
     }
     return $ID;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:group.php

示例3: array

 if ($_SERVER["REQUEST_METHOD"] == "POST" && (strlen($_POST["save"]) > 0 || strlen($_POST["reject"]) > 0) && check_bitrix_sessid()) {
     $errorMessage = "";
     $arIDs = array();
     if (strlen($errorMessage) <= 0) {
         for ($i = 0; $i <= IntVal($_POST["max_count"]); $i++) {
             if ($_POST["checked_" . $i] == "Y") {
                 $arIDs[] = IntVal($_POST["id_" . $i]);
             }
         }
         if (count($arIDs) <= 0) {
             $errorMessage .= GetMessage("SONET_C12_NOT_SELECTED") . ". ";
         }
     }
     if (strlen($errorMessage) <= 0) {
         if (strlen($_POST["save"]) > 0) {
             if (!CSocNetUserToGroup::ConfirmRequestToBeMember($GLOBALS["USER"]->GetID(), $arResult["Group"]["ID"], $arIDs, $bAutoSubscribe) && ($e = $APPLICATION->GetException())) {
                 $errorMessage .= $e->GetString();
             }
         } elseif (strlen($_POST["reject"]) > 0) {
             if (!CSocNetUserToGroup::RejectRequestToBeMember($GLOBALS["USER"]->GetID(), $arResult["Group"]["ID"], $arIDs) && ($e = $APPLICATION->GetException())) {
                 $errorMessage .= $e->GetString();
             }
         }
     }
     if (strlen($errorMessage) > 0) {
         $arResult["ErrorMessage"] = $errorMessage;
     }
 }
 $parser = new CSocNetTextParser(LANGUAGE_ID, $arParams["PATH_TO_SMILE"]);
 $arResult["Requests"] = false;
 $dbRequests = CSocNetUserToGroup::GetList(array("DATE_CREATE" => "ASC"), array("GROUP_ID" => $arResult["Group"]["ID"], "ROLE" => SONET_ROLES_REQUEST, "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER), false, $arNavParams, array("ID", "USER_ID", "DATE_CREATE", "DATE_UPDATE", "MESSAGE", "USER_NAME", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_LOGIN", "USER_PERSONAL_PHOTO", "USER_PERSONAL_GENDER"));
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例4: IntVal

									$arIDs[] = IntVal($_POST["id_".$i]);
							}

							if (count($arIDs) <= 0)
								$errorMessage .= GetMessage("SONET_GRE_NOT_SELECTED").". ";
						}

						if (strlen($errorMessage) <= 0)
						{
							$type = ($_POST["type"] == "out" ? "out" : "in");
							if ($type == "in")
							{
								if ($_POST["action"] == "accept")
								{
									if (
										!CSocNetUserToGroup::ConfirmRequestToBeMember($GLOBALS["USER"]->GetID(), $arResult["Group"]["ID"], $arIDs, false)
										&& ($e = $APPLICATION->GetException())
									)
										$errorMessage .= $e->GetString();
								}
								elseif ($_POST["action"] == "reject")
								{
									if (
										!CSocNetUserToGroup::RejectRequestToBeMember($GLOBALS["USER"]->GetID(), $arResult["Group"]["ID"], $arIDs)
										&& ($e = $APPLICATION->GetException())
									)
										$errorMessage .= $e->GetString();
								}
							}
							else
							{
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php


注:本文中的CSocNetUserToGroup::ConfirmRequestToBeMember方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。