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


PHP CSocNetGroup::GetById方法代码示例

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


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

示例1: Init

	/**
	 * <p>Метод инициализирует интеграцию.</p>
	 *
	 *
	 *
	 *
	 * @param int $SOCNET_GROUP_ID  Идентификатор рабочей группы соц. сети
	 *
	 *
	 *
	 * @param int $IBLOCK_ID  Идентификатор инфо.блока
	 *
	 *
	 *
	 * @return bool 
	 *
	 *
	 * <h4>Example</h4> 
	 * <pre>
	 * &lt;?<br>// Инициализируем интеграцию<br>$SOCNET_GROUP_ID = 14;<br>$IBLOCK_ID = 3;<br><br>if (!CWikiSocnet::Init($SOCNET_GROUP_ID, $IBLOCK_ID))<br>	echo 'Ошибка. Не удалось инициализировать интеграцию.';<br>?&gt;
	 * </pre>
	 *
	 *
	 * @static
	 * @link http://dev.1c-bitrix.ru/api_help/wiki/classes/cwikisocnet/Init.php
	 * @author Bitrix
	 */
	static function Init($SOCNET_GROUP_ID, $IBLOCK_ID)
	{
		if (self::$bInit)
			return self::$bInit;

		if (!self::IsEnabledSocnet())
			return false;

		self::$iSocNetId = $SOCNET_GROUP_ID;

		// detect work group
		$arFilter = Array();
		$arFilter['IBLOCK_ID'] = $IBLOCK_ID;
		$arFilter['SOCNET_GROUP_ID'] = self::$iSocNetId;
		$arFilter['CHECK_PERMISSIONS'] = 'N';
		$rsSection = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
		$obSection = $rsSection->GetNextElement();

		if ($obSection !== false)
		{
			$arResult = $obSection->GetFields();
			self::$iCatId = $arResult['ID'];
			self::$iCatLeftBorder = $arResult['LEFT_MARGIN'];
			self::$iCatRightBorder = $arResult['RIGHT_MARGIN'];
		}
		else
		{
			$arWorkGroup = CSocNetGroup::GetById(self::$iSocNetId);

			$arFields = Array(
				'ACTIVE' => 'Y',
				'IBLOCK_ID' => $IBLOCK_ID,
				'SOCNET_GROUP_ID' => self::$iSocNetId,
				'CHECK_PERMISSIONS' => 'N',
				'NAME' => $arWorkGroup['NAME']
			);
			$CIB_S = new CIBlockSection();
			self::$iCatId = $CIB_S->Add($arFields);
			if (self::$iCatId == false)
			{
				self::$bInit = false;
				return false;
			}
			$rsSection = CIBlockSection::GetList(Array($by=>$order), $arFilter, true);
			$obSection = $rsSection->GetNextElement();
			if ($obSection == false)
			{
				self::$bInit = false;
				return false;
			}
			$arResult = $obSection->GetFields();
			self::$iCatLeftBorder = $arResult['LEFT_MARGIN'];
			self::$iCatRightBorder = $arResult['RIGHT_MARGIN'];
		}

		self::$bInit = CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, self::$iSocNetId, 'wiki');
		return self::$bInit;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:85,代码来源:wiki_socnet.php

示例2: CanUserReadGroup

 function CanUserReadGroup($userID, $groupID)
 {
     $userID = IntVal($userID);
     $groupID = IntVal($groupID);
     if ($groupID <= 0) {
         return false;
     }
     $arGroup = CSocNetGroup::GetById($groupID);
     if ($arGroup == false) {
         return false;
     }
     if ($arGroup["OPENED"] == "Y") {
         return true;
     }
     $userRoleInGroup = CSocNetUserToGroup::GetUserRole($userID, $groupID);
     if ($userRoleInGroup == false) {
         return false;
     }
     if ($userRoleInGroup == SONET_ROLES_MODERATOR || $userRoleInGroup == SONET_ROLES_OWNER || $userRoleInGroup == SONET_ROLES_USER) {
         return true;
     } else {
         return false;
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:group.php

示例3: GetMessage

?>
				</select>
			</div>

			<?php 
if ($arResult["TASK_TYPE"] != "group") {
    ?>
				<div class="filter-field">
					<label for="filter-field-employee" class="filter-field-title"><?php 
    echo GetMessage("TASKS_FILTER_WORKGROUP");
    ?>
</label>
					<?php 
    $groupName = "";
    if (intval($arParams["ADV_FILTER"]["F_GROUP_ID"]) > 0) {
        $arGroup = CSocNetGroup::GetById(intval($arParams["ADV_FILTER"]["F_GROUP_ID"]));
        if ($arGroup) {
            $groupName = $arGroup["NAME"];
        }
    }
    ?>
					<span class="webform-field webform-field-textbox<?php 
    if (!strlen($groupName)) {
        ?>
 webform-field-textbox-empty<?php 
    }
    ?>
 webform-field-textbox-clearable">
						<span class="webform-field-textbox-inner" id="task-report-filter-group">
							<input type="text" id="filter-field-group" class="webform-field-textbox" autocomplete="off" value="<?php 
    echo $groupName;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php

示例4: SendMailMessage

 function SendMailMessage($MID, $arFields = array(), $strLang = false, $mailTemplate = false)
 {
     global $USER;
     $MID = intVal($MID);
     $arMessage = array();
     $arTopic = array();
     $arForum = array();
     $arFiles = array();
     $mailTemplate = $mailTemplate === false ? "NEW_FORUM_MESSAGE" : $mailTemplate;
     $event = new CEvent();
     if ($MID > 0) {
         CTimeZone::Disable();
         $arMessage = CForumMessage::GetByIDEx($MID, array("GET_TOPIC_INFO" => "Y", "GET_FORUM_INFO" => "Y", "FILTER" => "Y"));
         CTimeZone::Enable();
         $db_files = CForumFiles::GetList(array("MESSAGE_ID" => "ASC"), array("MESSAGE_ID" => $MID));
         if ($db_files && ($res = $db_files->Fetch())) {
             do {
                 $arFiles[$res["ID"]] = CFile::GetFileArray($res["FILE_ID"]);
             } while ($res = $db_files->Fetch());
         }
     }
     if (empty($arMessage)) {
         return false;
     }
     $arTopic = $arMessage["TOPIC_INFO"];
     $arForum = $arMessage["FORUM_INFO"];
     $TID = intVal($arMessage["TOPIC_ID"]);
     $FID = intVal($arMessage["FORUM_ID"]);
     if (!is_set($arFields, "FORUM_ID")) {
         $arFields["FORUM_ID"] = $arMessage["FORUM_ID"];
     }
     if (!is_set($arFields, "FORUM_NAME")) {
         $arFields["FORUM_NAME"] = $arForum["NAME"];
     }
     if (!is_set($arFields, "TOPIC_ID")) {
         $arFields["TOPIC_ID"] = $arMessage["TOPIC_ID"];
     }
     if (!is_set($arFields, "MESSAGE_ID")) {
         $arFields["MESSAGE_ID"] = $arMessage["ID"];
     }
     if (!is_set($arFields, "TOPIC_TITLE")) {
         $arFields["TOPIC_TITLE"] = $arTopic["TITLE"];
     }
     if (!is_set($arFields, "MESSAGE_DATE")) {
         $arFields["MESSAGE_DATE"] = $arMessage["POST_DATE"];
     }
     if (!is_set($arFields, "AUTHOR")) {
         $arFields["AUTHOR"] = $arMessage["AUTHOR_NAME"];
     }
     if (!is_set($arFields, "TAPPROVED")) {
         $arFields["TAPPROVED"] = $arTopic["APPROVED"];
     }
     if (!is_set($arFields, "MAPPROVED")) {
         $arFields["MAPPROVED"] = $arMessage["APPROVED"];
     }
     if (!is_set($arFields, "FROM_EMAIL")) {
         $arFields["FROM_EMAIL"] = COption::GetOptionString("forum", "FORUM_FROM_EMAIL", "nomail@nomail.nomail");
     }
     //If the message is from socialnetwork, check if mail processor exists for this social network
     if ($arTopic["SOCNET_GROUP_ID"] > 0) {
         if (CModule::IncludeModule("mail") && CModule::IncludeModule("socialnetwork")) {
             $arMailParams = CForumEMail::GetForumFilters($FID, $arTopic["SOCNET_GROUP_ID"]);
             //If the processor exists:
             if ($arMailParams) {
                 global $DB;
                 if ($arMessage["XML_ID"] == '') {
                     //check if MSG_ID field exists, generate it if not
                     $arMessage["XML_ID"] = "M" . $MID . "." . md5(uniqid()) . "@" . ($_SERVER["SERVER_NAME"] != '' ? $_SERVER["SERVER_NAME"] : $_SERVER["SERVER_ADDR"]);
                     $DB->Query("UPDATE b_forum_message SET XML_ID='" . $DB->ForSQL($arMessage["XML_ID"]) . "' WHERE ID=" . $MID);
                 }
                 //get MSG_ID topics, it would be IN_REPLY_TO
                 if ($arTopic["XML_ID"] == '') {
                     $arTopic["XML_ID"] = "T" . $TID . "." . md5(uniqid()) . "@" . ($_SERVER["SERVER_NAME"] != '' ? $_SERVER["SERVER_NAME"] : $_SERVER["SERVER_ADDR"]);
                     $DB->Query("UPDATE b_forum_topic SET XML_ID='" . $DB->ForSQL($arTopic["XML_ID"]) . "' WHERE ID=" . $TID);
                 }
                 //fill FROM_EMAIL from AUTHOR_NAME + FROM_EMAIL or AUTHOR_EMAIL or from 'b_user' by AUTHOR_ID depending on the settings of mail processor
                 if ($arMailParams['USE_EMAIL'] == 'Y' && $arMessage["AUTHOR_EMAIL"] != '') {
                     $arFields["FROM_EMAIL"] = '"' . $arMessage['AUTHOR_NAME'] . '" <' . $arMessage['AUTHOR_EMAIL'] . '>';
                 } elseif ($arMailParams['USE_EMAIL'] == 'Y' && $arMessage["EMAIL"] != '') {
                     $arFields["FROM_EMAIL"] = '"' . $arMessage['AUTHOR_NAME'] . '" <' . $arMessage['EMAIL'] . '>';
                 } else {
                     $arFields["FROM_EMAIL"] = '"' . $arMessage['AUTHOR_NAME'] . '" <' . $arMailParams['EMAIL'] . '>';
                 }
                 if ($arMessage["NEW_TOPIC"] == "Y") {
                     $arFields["=Message-Id"] = $arFields["MSG_ID"] = "<" . $arTopic["XML_ID"] . ">";
                 } else {
                     $arFields["TOPIC_TITLE"] = "Re" . ($arMessage["TOPIC_INFO"]["POSTS"] > 1 ? "[" . $arMessage["TOPIC_INFO"]["POSTS"] . "]" : "") . ": " . $arFields["TOPIC_TITLE"];
                     $arFields["=Message-Id"] = $arFields["MSG_ID"] = "<" . $arMessage["XML_ID"] . ">";
                     $arFields["=In-Reply-To"] = $arFields["IN_REPLY_TO"] = "<" . $arTopic["XML_ID"] . ">";
                 }
                 //fill REPLY_TO from the settings of the mail processor
                 $arFields["=Reply-To"] = $arFields["REPLY_TO"] = $arMailParams["EMAIL"];
                 $arFields["FORUM_EMAIL"] = $arMailParams["EMAIL"];
                 $arSocNetGroup = CSocNetGroup::GetById($arTopic["SOCNET_GROUP_ID"]);
                 $arFields["FORUM_NAME"] = $arSocNetGroup["NAME"];
                 if ($arMailParams["SUBJECT_SUF"] != '') {
                     $arFields["TOPIC_TITLE"] .= ' ' . $arMailParams["SUBJECT_SUF"];
                 }
                 if ($arMailParams["USE_SUBJECT"] == "Y") {
                     $arFields["=Subject"] = $arFields["TOPIC_TITLE"];
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:message.php

示例5: GetMessage

					</div>
				<?php 
}
?>
				<?php 
if (sizeof($arResult["GROUPS"])) {
    ?>
					<div class="filter-field">
						<label for="filter-field-employee" class="filter-field-title"><?php 
    echo GetMessage("TASKS_REPORT_WORKGROUP");
    ?>
</label>
						<?php 
    $groupName = "";
    if (intval($arResult["FILTER"]["F_GROUP_ID"]) > 0) {
        $arGroup = CSocNetGroup::GetById(intval($arResult["FILTER"]["F_GROUP_ID"]));
        if ($arGroup) {
            $groupName = $arGroup["NAME"];
        }
    }
    ?>
						<span class="webform-field webform-field-textbox<?php 
    if (!strlen($groupName)) {
        ?>
 webform-field-textbox-empty<?php 
    }
    ?>
 webform-field-textbox-clearable">
							<span class="webform-field-textbox-inner" id="task-report-filter-group">
								<input type="text" id="filter-field-group" class="webform-field-textbox" value="<?php 
    echo $groupName;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:template.php


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