• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CForumMessage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateIBlockProperty

 public static function updateIBlockProperty($ID, $TYPE, $arMessage, $arTopic = array())
 {
     if ($ID > 0 && $arMessage["PARAM1"] != "IB" && IsModuleInstalled("iblock")) {
         $arTopic = empty($arTopic) ? CForumTopic::GetByID($arMessage["TOPIC_ID"]) : $arTopic;
         if (!empty($arTopic) && $arTopic["XML_ID"] == "IBLOCK_" . $arMessage["PARAM2"] && CModule::IncludeModule("iblock")) {
             CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array("FORUM_MESSAGE_CNT" => array("VALUE" => CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "")));
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:event_manager.php


示例2: Execute

 public function Execute()
 {
     if (!CModule::IncludeModule("forum")) {
         return CBPActivityExecutionStatus::Closed;
     }
     if (!CModule::IncludeModule("iblock")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $forumId = intval($this->ForumId);
     if ($forumId <= 0) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $iblockId = $this->IBlockId;
     $dbResult = CIBlockElement::GetProperty($iblockId, $documentId[2], false, false, array("CODE" => "FORUM_TOPIC_ID"));
     $arResult = $dbResult->Fetch();
     if (!$arResult) {
         $obProperty = new CIBlockProperty();
         $obProperty->Add(array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => "Forum topic", "CODE" => "FORUM_TOPIC_ID"));
         $obProperty->Add(array("IBLOCK_ID" => $iblockId, "ACTIVE" => "Y", "PROPERTY_TYPE" => "N", "MULTIPLE" => "N", "NAME" => "Forum message count", "CODE" => "FORUM_MESSAGE_CNT"));
         $dbResult = CIBlockElement::GetProperty($iblockId, $documentId[2], false, false, array("CODE" => "FORUM_TOPIC_ID"));
         $arResult = $dbResult->Fetch();
     }
     $forumTopicId = intval($arResult["VALUE"]);
     $arForumUserTmp = $this->ForumUser;
     $arForumUser = CBPHelper::ExtractUsers($arForumUserTmp, $documentId, true);
     $forumUserId = 1;
     $forumUserName = "Admin";
     if ($arForumUser != null) {
         $forumUserId = $arForumUser;
         $dbResult = CUser::GetByID($forumUserId);
         if ($arResult = $dbResult->Fetch()) {
             $forumUserName = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $arResult, true);
         }
     }
     $newTopic = "N";
     if ($forumTopicId <= 0) {
         $documentService = $this->workflow->GetService("DocumentService");
         $document = $documentService->GetDocument($documentId);
         $newTopic = "Y";
         $arFields = array("TITLE" => $document["NAME"], "FORUM_ID" => $forumId, "USER_START_ID" => $forumUserId, "USER_START_NAME" => $forumUserName, "LAST_POSTER_NAME" => $forumUserName, "APPROVED" => "Y");
         $forumTopicId = CForumTopic::Add($arFields);
         CIBlockElement::SetPropertyValues($documentId[2], $iblockId, $forumTopicId, "FORUM_TOPIC_ID");
     }
     $arFields = array("POST_MESSAGE" => $this->ForumPostMessage, "AUTHOR_ID" => $forumUserId, "AUTHOR_NAME" => $forumUserName, "FORUM_ID" => $forumId, "TOPIC_ID" => $forumTopicId, "APPROVED" => "Y", "NEW_TOPIC" => $newTopic, "PARAM2" => $documentId[2]);
     $forumMessageId = CForumMessage::Add($arFields, false, array("SKIP_INDEXING" => "Y", "SKIP_STATISTIC" => "N"));
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:49,代码来源:forumreviewactivity.php


示例3: OnPrepareComments

 function OnPrepareComments()
 {
     $arResult =& $this->component->arResult;
     $arParams =& $this->component->arParams;
     $arMessages =& $arResult['MESSAGES'];
     $arResult['UFS'] = array();
     if (!empty($arMessages) && !empty($arResult["USER_FIELDS"])) {
         $res = array_keys($arMessages);
         $arFilter = array("FORUM_ID" => $arParams["FORUM_ID"], "TOPIC_ID" => $arResult["FORUM_TOPIC_ID"], "APPROVED_AND_MINE" => $GLOBALS["USER"]->GetId(), ">ID" => intVal(min($res)) - 1, "<ID" => intVal(max($res)) + 1);
         if ($arResult["USER"]["RIGHTS"]["MODERATE"] == "Y") {
             unset($arFilter["APPROVED_AND_MINE"]);
         }
         $db_res = CForumMessage::GetList(array("ID" => "ASC"), $arFilter, false, 0, array("SELECT" => array_keys($arResult["USER_FIELDS"])));
         if ($db_res && ($res = $db_res->Fetch())) {
             do {
                 $arResult['UFS'][$res["ID"]] = array_intersect_key($res, $arResult["USER_FIELDS"]);
             } while ($res = $db_res->Fetch());
         }
     }
 }
开发者ID:vim84,项目名称:b-markt,代码行数:20,代码来源:ufs.php


示例4: setComment

 public function setComment($id)
 {
     $id = intval($id);
     $message = $id > 0 ? \CForumMessage::getById($id) : null;
     if (!empty($message)) {
         if ($message["TOPIC_ID"] != $this->topic["ID"]) {
             throw new ArgumentException(Loc::getMessage("ACCESS_DENIED"), self::ERROR_PERMISSION);
         }
         $this->id = $id;
         $this->message = $message;
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:12,代码来源:comment.php


示例5: while

        } while ($res = $db_files->Fetch());
        $bNeedLoop = false;
        if ($bNeedFirstMessage && !$bBreakLoop) {
            $db_files = CForumFiles::GetList(array("MESSAGE_ID" => "ASC"), array("MESSAGE_ID" => $arResult["MESSAGE_FIRST"]["ID"]));
            if ($db_files && ($res = $db_files->Fetch())) {
                $bNeedLoop = $bBreakLoop = true;
            }
        }
    }
    if (!empty($arParams["USER_FIELDS"])) {
        $db_props = CForumMessage::GetList(array("ID" => "ASC"), $arFilterProps, false, 0, array("SELECT" => $arParams["USER_FIELDS"]));
        while ($db_props && ($res = $db_props->Fetch())) {
            $arResult["MESSAGE_LIST"][$res["ID"]]["PROPS"] = array_intersect_key($res, array_flip($arParams["USER_FIELDS"]));
        }
        if ($bNeedFirstMessage) {
            $db_props = CForumMessage::GetList(array("ID" => "ASC"), array("ID" => $arResult["MESSAGE_FIRST"]["ID"]), false, 0, array("SELECT" => $arParams["USER_FIELDS"]));
            if ($db_props && ($res = $db_props->Fetch())) {
                $arResult["MESSAGE_FIRST"]["PROPS"] = array_intersect_key($res, array_flip($arParams["USER_FIELDS"]));
            }
        }
    }
}
$parser->arFiles = $arResult["FILES"];
if (!empty($arResult["MESSAGE_FIRST"])) {
    $parser->arUserfields = $arResult["MESSAGE_FIRST"]["PROPS"];
    $arResult["MESSAGE_FIRST"]["POST_MESSAGE_TEXT"] = $parser->convert($arResult["MESSAGE_FIRST"]["~POST_MESSAGE_TEXT"], $arResult["MESSAGE_FIRST"]["ALLOW"]);
    $arResult["MESSAGE_FIRST"]["FILES_PARSED"] = $parser->arFilesIDParsed;
}
foreach ($arResult["MESSAGE_LIST"] as $iID => $res) {
    $parser->arUserfields = $res["PROPS"];
    $arResult["MESSAGE_LIST"][$iID]["POST_MESSAGE_TEXT"] = $parser->convert($res["~POST_MESSAGE_TEXT"], $res["ALLOW"]);
开发者ID:vim84,项目名称:b-markt,代码行数:31,代码来源:component.php


示例6: intVal

             }
         }
     }
     if (!empty($arFiles)) {
         $arFieldsG["FILES"] = $arFiles;
     }
 }
 if ($arParams["MESSAGE_TYPE"] == "EDIT") {
     $arFieldsG["EDIT_ADD_REASON"] = $_REQUEST["EDIT_ADD_REASON"];
     $arFieldsG["EDITOR_NAME"] = $_REQUEST["EDITOR_NAME"];
     $arFieldsG["EDITOR_EMAIL"] = $_REQUEST["EDITOR_EMAIL"];
     $arFieldsG["EDIT_REASON"] = $_REQUEST["EDIT_REASON"];
 }
 $MID1 = intVal(ForumAddMessage($arParams["MESSAGE_TYPE"], $arParams["FID"], $TID1, $MID1, $arFieldsG, $strErrorMessage, $strOKMessage, false, $_POST["captcha_word"], 0, $_POST["captcha_code"], $arParams["NAME_TEMPLATE"]));
 if ($MID1 > 0) {
     $arResult["MESSAGE"] = CForumMessage::GetByID($MID1);
     $arParams["TID"] = $arResult["MESSAGE"]["TOPIC_ID"];
     $arParams["MID"] = $arResult["MESSAGE"]["ID"];
     $sText = COption::GetOptionString("forum", "FILTER", "Y") == "Y" ? $arResult["MESSAGE"]["POST_MESSAGE_FILTER"] : $arResult["MESSAGE"]["POST_MESSAGE"];
     $sURL = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("UID" => $arParams["USER_ID"], "FID" => $arParams["FID"], "TID" => $arParams["TID"], "MID" => $arParams["MID"]));
     if ($arParams['AUTOSAVE']) {
         $arParams['AUTOSAVE']->Reset();
     }
     /************** Socialnetwork notification *************************/
     $workgroups_path = "";
     if ($arParams["MODE"] == "GROUP" && IsModuleInstalled("extranet")) {
         $workgroups_path = COption::GetOptionString("socialnetwork", "workgroups_page", false, SITE_ID);
         $workgroups_path = "#GROUPS_PATH#" . substr($arParams["~URL_TEMPLATES_MESSAGE"], strlen($workgroups_path), strlen($arParams["~URL_TEMPLATES_MESSAGE"]) - strlen($workgroups_path));
     }
     $arSonetFields = array("ENTITY_TYPE" => $arParams["MODE"] == "GROUP" ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, "ENTITY_ID" => $arParams["MODE"] == "GROUP" ? $arParams["SOCNET_GROUP_ID"] : $arParams["USER_ID"], "EVENT_ID" => "forum", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $arResult["MESSAGE"]["AUTHOR_NAME"], GetMessage("SONET_FORUM_LOG_TEMPLATE")), "TITLE" => $arFieldsG["TITLE"], "MESSAGE" => $sText, "TEXT_MESSAGE" => $parser->convert4mail($sText), "URL" => $sURL, "PARAMS" => serialize(array("PATH_TO_MESSAGE" => CComponentEngine::MakePathFromTemplate(!empty($workgroups_path) ? $workgroups_path : $arParams["~URL_TEMPLATES_MESSAGE"], array("TID" => $arParams["TID"])), "PARSED" => "N")), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "SOURCE_ID" => $MID1, "RATING_TYPE_ID" => "FORUM_TOPIC", "RATING_ENTITY_ID" => intval($arParams["TID"]));
     if (intVal($arResult["MESSAGE"]["AUTHOR_ID"]) > 0) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php


示例7: AddComment_Wiki

 static function AddComment_Wiki($arFields)
 {
     if (!CModule::IncludeModule('iblock')) {
         return false;
     }
     if (!CModule::IncludeModule('socialnetwork')) {
         return false;
     }
     $ufFileID = array();
     $ufDocID = array();
     $dbResult = CSocNetLog::GetList(array('ID' => 'DESC'), array('TMP_ID' => $arFields['LOG_ID']), false, false, array('ID', 'SOURCE_ID', 'PARAMS', 'URL'));
     $bFound = false;
     if ($arLog = $dbResult->Fetch()) {
         if (strlen($arLog['PARAMS']) > 0) {
             $arFieldsParams = explode('&', $arLog['PARAMS']);
             if (is_array($arFieldsParams) && count($arFieldsParams) > 0) {
                 foreach ($arFieldsParams as $tmp) {
                     list($key, $value) = explode('=', $tmp);
                     if ($key == 'forum_id') {
                         $FORUM_ID = intval($value);
                         break;
                     }
                 }
             }
         }
         if ($FORUM_ID > 0 && intval($arLog['SOURCE_ID']) > 0) {
             $bFound = true;
         }
     }
     if ($bFound) {
         $arElement = false;
         $arFilter = array('ID' => $arLog['SOURCE_ID']);
         $arSelectedFields = array('IBLOCK_ID', 'ID', 'NAME', 'TAGS', 'CODE', 'IBLOCK_SECTION_ID', 'DETAIL_PAGE_URL', 'CREATED_BY', 'PREVIEW_PICTURE', 'PREVIEW_TEXT', 'PROPERTY_FORUM_TOPIC_ID', 'PROPERTY_FORUM_MESSAGE_CNT');
         $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
         if ($db_res && ($res = $db_res->GetNext())) {
             $arElement = $res;
         }
         if ($arElement) {
             // check iblock properties
             CSocNetLogTools::AddComment_Review_CheckIBlock($arElement);
             $dbMessage = CForumMessage::GetList(array(), array('PARAM2' => $arElement['ID']));
             if (!($arMessage = $dbMessage->Fetch())) {
                 // Add Topic and Root Message
                 $TOPIC_ID = CSocNetLogTools::AddComment_Review_CreateRoot($arElement, $FORUM_ID, false);
                 $bNewTopic = true;
             } else {
                 $TOPIC_ID = $arMessage['TOPIC_ID'];
             }
             if (intval($TOPIC_ID) > 0) {
                 // Add comment
                 $messageID = false;
                 $arFieldsMessage = array('POST_MESSAGE' => $arFields['TEXT_MESSAGE'], 'USE_SMILES' => 'Y', 'PARAM2' => $arElement['ID'], 'APPROVED' => 'Y');
                 $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arTmp);
                 if (is_array($arTmp)) {
                     if (array_key_exists("UF_SONET_COM_DOC", $arTmp)) {
                         $GLOBALS["UF_FORUM_MESSAGE_DOC"] = $arTmp["UF_SONET_COM_DOC"];
                     } elseif (array_key_exists("UF_SONET_COM_FILE", $arTmp)) {
                         $arFieldsMessage["FILES"] = array();
                         foreach ($arTmp["UF_SONET_COM_FILE"] as $file_id) {
                             $arFieldsMessage["FILES"][] = array("FILE_ID" => $file_id);
                         }
                     }
                 }
                 $messageID = ForumAddMessage('REPLY', $FORUM_ID, $TOPIC_ID, 0, $arFieldsMessage, $sError, $sNote);
                 if (!$messageID) {
                     $strError = GetMessage('SONET_ADD_COMMENT_SOURCE_ERROR');
                 } else {
                     $dbAddedMessageFiles = CForumFiles::GetList(array("ID" => "ASC"), array("MESSAGE_ID" => $messageID));
                     while ($arAddedMessageFiles = $dbAddedMessageFiles->Fetch()) {
                         $ufFileID[] = $arAddedMessageFiles["FILE_ID"];
                     }
                     $ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("FORUM_MESSAGE", "UF_FORUM_MESSAGE_DOC", $messageID, LANGUAGE_ID);
                     CSocNetLogTools::AddComment_Review_UpdateElement($arElement, $TOPIC_ID, $bNewTopic);
                     $userID = $GLOBALS["USER"]->GetID();
                     if (CModule::IncludeModule("im") && intval($arElement["CREATED_BY"]) > 0 && $arElement["CREATED_BY"] != $userID) {
                         $rsUnFollower = CSocNetLogFollow::GetList(array("USER_ID" => $arElement["CREATED_BY"], "CODE" => "L" . $arLog["ID"], "TYPE" => "N"), array("USER_ID"));
                         $arUnFollower = $rsUnFollower->Fetch();
                         if (!$arUnFollower) {
                             $arMessageFields = array("MESSAGE_TYPE" => IM_MESSAGE_SYSTEM, "TO_USER_ID" => $arElement["CREATED_BY"], "FROM_USER_ID" => $userID, "LOG_ID" => $arLog["ID"], "NOTIFY_TYPE" => IM_NOTIFY_FROM, "NOTIFY_MODULE" => "wiki", "NOTIFY_EVENT" => "comment");
                             $arParams["TITLE"] = str_replace(array("\r\n", "\n"), " ", $arElement["NAME"]);
                             $arParams["TITLE"] = TruncateText($arParams["TITLE"], 100);
                             $arParams["TITLE_OUT"] = TruncateText($arParams["TITLE"], 255);
                             $arTmp = CSocNetLogTools::ProcessPath(array("ELEMENT_URL" => $arLog["URL"]), $arElement["CREATED_BY"]);
                             $serverName = $arTmp["SERVER_NAME"];
                             $url = $arTmp["URLS"]["ELEMENT_URL"];
                             $arMessageFields["NOTIFY_TAG"] = "WIKI|COMMENT|" . $arElement['ID'];
                             $arMessageFields["NOTIFY_MESSAGE"] = GetMessage("WIKI_SONET_FROM_LOG_IM_COMMENT", array("#title#" => strlen($url) > 0 ? "<a href=\"" . $url . "\" class=\"bx-notifier-item-action\">" . htmlspecialcharsbx($arParams["TITLE"]) . "</a>" : htmlspecialcharsbx($arParams["TITLE"])));
                             $arMessageFields["NOTIFY_MESSAGE_OUT"] = GetMessage("WIKI_SONET_FROM_LOG_IM_COMMENT", array("#title#" => htmlspecialcharsbx($arParams["TITLE"]))) . (strlen($url) > 0 ? " (" . $serverName . $url . ")" : "") . "#BR##BR#" . $arFields["TEXT_MESSAGE"];
                             CIMNotify::Add($arMessageFields);
                         }
                     }
                 }
             } else {
                 $strError = GetMessage('SONET_ADD_COMMENT_SOURCE_ERROR');
             }
         } else {
             $strError = GetMessage('SONET_ADD_COMMENT_SOURCE_ERROR');
         }
     } else {
         $strError = GetMessage('SONET_ADD_COMMENT_SOURCE_ERROR');
//.........这里部分代码省略.........
开发者ID:rasuldev,项目名称:torino,代码行数:101,代码来源:wiki_socnet.php


示例8: array

					$res["SRC"] = CFile::GetFileSRC($res);
					if ($arMessages[$res["MESSAGE_ID"]]["~ATTACH_IMG"] == $res["FILE_ID"])
					{
					// attach for custom
						$arMessages[$res["MESSAGE_ID"]]["~ATTACH_FILE"] = $res;
						$arMessages[$res["MESSAGE_ID"]]["ATTACH_IMG"] = CFile::ShowFile($res["FILE_ID"], 0,
							$arParams["IMAGE_SIZE"], $arParams["IMAGE_SIZE"], true, "border=0", false);
						$arMessages[$res["MESSAGE_ID"]]["ATTACH_FILE"] = $arMessages[$res["MESSAGE_ID"]]["ATTACH_IMG"];
					}
					$arMessages[$res["MESSAGE_ID"]]["FILES"][$res["FILE_ID"]] = $res;
					$arResult["FILES"][$res["FILE_ID"]] = $res;
				}while ($res = $db_files->Fetch());
			}
			if (!empty($arParams["USER_FIELDS"]))
			{
				$db_props = CForumMessage::GetList(array("ID" => "ASC"), $arFilterProps, false, 0, array("SELECT" => $arParams["USER_FIELDS"]));
				while ($db_props && ($res = $db_props->Fetch()))
				{
					$arMessages[$res["ID"]]["PROPS"] = array_intersect_key($res, array_flip($arParams["USER_FIELDS"]));
				}
			}
			/************** Message info ***************************************/
			$parser->arFiles = $arResult["FILES"];
			foreach ($arMessages as $iID => $res)
				$arMessages[$iID]["POST_MESSAGE_TEXT"] = $parser->convert($res["~POST_MESSAGE_TEXT"], array_merge($res["ALLOW"], array("USERFIELDS" => $res["PROPS"])));
		}

/************** Message List/***************************************/
		if ($arParams["CACHE_TIME"] > 0)
		{
			$cache->StartDataCache();
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:component.php


示例9: __deprecated_Add


//.........这里部分代码省略.........
         $arFiles = array();
         if (!empty($_REQUEST["FILES"])) {
             foreach ($_REQUEST["FILES"] as $key) {
                 $arFiles[$key] = array("FILE_ID" => $key);
                 if (!in_array($key, $_REQUEST["FILES_TO_UPLOAD"])) {
                     $arFiles[$key]["del"] = "Y";
                 }
             }
         }
         if (!empty($_FILES)) {
             $res = array();
             foreach ($_FILES as $key => $val) {
                 if (substr($key, 0, strLen("FILE_NEW")) == "FILE_NEW" && !empty($val["name"])) {
                     $arFiles[] = $_FILES[$key];
                 }
             }
         }
         if (!empty($arFiles)) {
             $arFieldsG["FILES"] = $arFiles;
         }
     }
     $TOPIC_ID = $forumTopicId > 0 ? $forumTopicId : $TID;
     $MESSAGE_ID = 0;
     $MESSAGE_TYPE = $TOPIC_ID > 0 ? "REPLY" : "NEW";
     if (COption::GetOptionString("tasks", "task_comment_allow_edit") && ($MESSAGE_ID = intval($commentId))) {
         $MESSAGE_TYPE = "EDIT";
     }
     $strErrorMessage = '';
     $strOKMessage = '';
     $MID = ForumAddMessage($MESSAGE_TYPE, $forumId, $TOPIC_ID, $MESSAGE_ID, $arFieldsG, $strErrorMessage, $strOKMessage, false, $_POST["captcha_word"], 0, $_POST["captcha_code"], $nameTemplate);
     if ($MID <= 0 || !empty($strErrorMessage)) {
         $arErrorCodes[] = array('code' => 'message is not added 2', 'title' => empty($strErrorMessage) ? NULL : $strErrorMessage);
     } else {
         $arMessage = CForumMessage::GetByID($MID);
         if ($forumTopicId <= 0) {
             $forumTopicId = $TID = intVal($arMessage["TOPIC_ID"]);
         }
         $outForumTopicId = intVal($forumTopicId);
         if ($componentName !== null) {
             ForumClearComponentCache($componentName);
         }
         // NOTIFICATION
         $arTask["ACCOMPLICES"] = $arTask["AUDITORS"] = array();
         $rsMembers = CTaskMembers::GetList(array(), array("TASK_ID" => $arTask["ID"]));
         while ($arMember = $rsMembers->Fetch()) {
             if ($arMember["TYPE"] == "A") {
                 $arTask["ACCOMPLICES"][] = $arMember["USER_ID"];
             } elseif ($arMember["TYPE"] == "U") {
                 $arTask["AUDITORS"][] = $arMember["USER_ID"];
             }
         }
         $arEmailUserIDs = array($arTask["RESPONSIBLE_ID"], $arTask["CREATED_BY"]);
         $arEmailUserIDs = array_unique(array_merge($arEmailUserIDs, $arTask["ACCOMPLICES"], $arTask["AUDITORS"]));
         $currentUserPos = array_search($givenUserId, $arEmailUserIDs);
         if ($currentUserPos !== false) {
             unset($arEmailUserIDs[$currentUserPos]);
         }
         $parser = new CTextParser();
         $parser->imageWidth = $imageWidth;
         $parser->imageHeight = $imageHeight;
         $parser->smiles = $arSmiles;
         $parser->allow = array("HTML" => $arForum["ALLOW_HTML"], "ANCHOR" => $arForum["ALLOW_ANCHOR"], "BIU" => $arForum["ALLOW_BIU"], "IMG" => "N", "VIDEO" => "N", "LIST" => $arForum["ALLOW_LIST"], "QUOTE" => $arForum["ALLOW_QUOTE"], "CODE" => $arForum["ALLOW_CODE"], "FONT" => $arForum["ALLOW_FONT"], "SMILES" => "N", "UPLOAD" => $arForum["ALLOW_UPLOAD"], "NL2BR" => $arForum["ALLOW_NL2BR"], "TABLE" => "Y");
         $arAllow = NULL;
         $MESSAGE = HTMLToTxt($parser->convertText($commentText, $arAllow));
         // remove [ url] for socialnetwork log
         $MESSAGE = preg_replace("/(\\s\\[\\s(http:\\/\\/|https:\\/\\/|ftp:\\/\\/))(.*?)(\\s\\])/is", "", $MESSAGE);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:67,代码来源:taskcomments.php


示例10: str_replace

     $componentPage = str_replace("_short", "", $componentPage);
 } elseif ($componentPage == "user_files_element_history_get" || $componentPage == "group_files_element_history_get") {
     $APPLICATION->RestartBuffer();
     $ob->SendHistoryFile($arResult["VARIABLES"]["element_id"], 0, false, $_REQUEST);
     die;
 } elseif ($componentPage == "user_files_webdav_bizproc_history_get" || $componentPage == "group_files_webdav_bizproc_history_get") {
     $APPLICATION->RestartBuffer();
     $ob->SendHistoryFile($arResult["VARIABLES"]["element_id"], $arResult["VARIABLES"]["id"]);
     die;
 } elseif (($componentPage == "user_files_section_edit" || $componentPage == "group_files_section_edit") && strToUpper($_REQUEST["use_light_view"]) == "Y") {
     $componentPage .= "_simple";
 } elseif ($componentPage == "user_files_element_comment" || $componentPage == "group_files_element_comment") {
     $topicID = intval($arResult["VARIABLES"]['topic_id']);
     $messageID = intval($arResult["VARIABLES"]['message_id']);
     if ($topicID > 0 && $messageID > 0 && CModule::IncludeModule('forum')) {
         $dbMessage = CForumMessage::GetList(array(), array('FORUM_ID' => $arParams['FILES_FORUM_ID'], 'TOPIC_ID' => $topicID, 'NEW_TOPIC' => 'Y', 'PARAM1' => 'IB'));
         if ($dbMessage && ($arMessage = $dbMessage->Fetch())) {
             $elementID = intval($arMessage['PARAM2']);
             if ($elementID > 0) {
                 // check if this iblock
                 $dbElement = CIBlockElement::GetList(array(), array('ID' => $elementID), false, false, array('IBLOCK_ID'));
                 if ($dbElement && ($arElement = $dbElement->Fetch()) && $arElement['IBLOCK_ID'] == $arParams['IBLOCK_ID']) {
                     $elementUrl = '';
                     if (is_array($arResult['USER']) && isset($arResult['USER']['ID'])) {
                         $elementUrl = str_replace("#user_id#", $arResult['USER']['ID'], $arResult['PATH_TO_USER_FILES_ELEMENT']);
                     } elseif (is_array($arResult['GROUP']) && isset($arResult['GROUP']['ID'])) {
                         $elementUrl = str_replace("#group_id#", $arResult['GROUP']['ID'], $arResult['PATH_TO_GROUP_FILES_ELEMENT']);
                     }
                     if (!empty($elementUrl)) {
                         $arParams["FORM_ID"] = "webdavForm" . $arParams["IBLOCK_ID"];
                         $elementUrl = str_replace('#element_id#', $elementID, $elementUrl);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:webdav.php


示例11: AddComment_News

 function AddComment_News($arFields)
 {
     if (!CModule::IncludeModule("forum")) {
         return false;
     }
     if (!CModule::IncludeModule("iblock")) {
         return false;
     }
     if (!CModule::IncludeModule("socialnetwork")) {
         return false;
     }
     $dbResult = CSocNetLog::GetList(array("ID" => "DESC"), array("TMP_ID" => $arFields["LOG_ID"]), false, false, array("ID", "SOURCE_ID", "PARAMS"));
     $bFound = false;
     if ($arLog = $dbResult->Fetch()) {
         if (intval($arLog["SOURCE_ID"]) > 0) {
             $arFilter = array("ID" => $arLog["SOURCE_ID"]);
             $arSelectedFields = array("IBLOCK_ID", "ID", "CREATED_BY", "NAME", "PROPERTY_FORUM_TOPIC_ID", "PROPERTY_FORUM_MESSAGE_CNT");
             $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
             if ($db_res && ($res = $db_res->GetNext())) {
                 $arElement = $res;
                 $val = COption::GetOptionString("intranet", "sonet_log_news_iblock_forum");
                 if (strlen($val) > 0) {
                     $arIBlockForum = unserialize($val);
                 } else {
                     $arIBlockForum = array();
                 }
                 if (array_key_exists($arElement["IBLOCK_ID"], $arIBlockForum)) {
                     $FORUM_ID = $arIBlockForum[$arElement["IBLOCK_ID"]];
                 }
                 if (intval($FORUM_ID) > 0) {
                     CSocNetLogTools::AddComment_Review_CheckIBlock($arElement);
                     $dbMessage = CForumMessage::GetList(array(), array("PARAM2" => $arElement["ID"]));
                     if (!($arMessage = $dbMessage->Fetch())) {
                         // Add Topic
                         $TOPIC_ID = CSocNetLogTools::AddComment_Review_CreateRoot($arElement, $FORUM_ID);
                         $bNewTopic = true;
                     } else {
                         $TOPIC_ID = $arMessage["TOPIC_ID"];
                     }
                     if (intval($TOPIC_ID) > 0) {
                         // Add comment
                         $messageID = false;
                         $bError = false;
                         if (CForumMessage::CanUserAddMessage($TOPIC_ID, $GLOBALS["USER"]->GetUserGroupArray(), $GLOBALS["USER"]->GetID(), false)) {
                             $bSHOW_NAME = true;
                             $res = CForumUser::GetByUSER_ID($GLOBALS["USER"]->GetID());
                             if ($res) {
                                 $bSHOW_NAME = $res["SHOW_NAME"] == "Y";
                             }
                             if ($bSHOW_NAME) {
                                 $AUTHOR_NAME = $GLOBALS["USER"]->GetFullName();
                             }
                             if (strlen(Trim($AUTHOR_NAME)) <= 0) {
                                 $AUTHOR_NAME = $GLOBALS["USER"]->GetLogin();
                             }
                             if (strlen($AUTHOR_NAME) <= 0) {
                                 $bError = true;
                             }
                         }
                         if (!$bError) {
                             $arFieldsMessage = array("POST_MESSAGE" => $arFields["TEXT_MESSAGE"], "USE_SMILES" => "Y", "APPROVED" => "Y", "PARAM2" => $arElement["ID"], "AUTHOR_NAME" => $AUTHOR_NAME, "AUTHOR_ID" => IntVal($GLOBALS["USER"]->GetParam("USER_ID")), "FORUM_ID" => $FORUM_ID, "TOPIC_ID" => $TOPIC_ID, "NEW_TOPIC" => "N", "GUEST_ID" => $_SESSION["SESS_GUEST_ID"], "ADD_TO_LOG" => "N");
                             $AUTHOR_IP = ForumGetRealIP();
                             $AUTHOR_IP_tmp = $AUTHOR_IP;
                             $AUTHOR_REAL_IP = $_SERVER['REMOTE_ADDR'];
                             if (COption::GetOptionString("forum", "FORUM_GETHOSTBYADDR", "N") == "Y") {
                                 $AUTHOR_IP = @gethostbyaddr($AUTHOR_IP);
                                 if ($AUTHOR_IP_tmp == $AUTHOR_REAL_IP) {
                                     $AUTHOR_REAL_IP = $AUTHOR_IP;
                                 } else {
                                     $AUTHOR_REAL_IP = @gethostbyaddr($AUTHOR_REAL_IP);
                                 }
                             }
                             $arFieldsMessage["AUTHOR_IP"] = $AUTHOR_IP !== False ? $AUTHOR_IP : "<no address>";
                             $arFieldsMessage["AUTHOR_REAL_IP"] = $AUTHOR_REAL_IP !== False ? $AUTHOR_REAL_IP : "<no address>";
                             $messageID = CForumMessage::Add($arFieldsMessage, false);
                             if (intVal($messageID) <= 0) {
                                 $bError = true;
                             } else {
                                 if (CModule::IncludeModule("statistic")) {
                                     $arForum = CForumNew::GetByID($FORUM_ID);
                                     $F_EVENT1 = $arForum["EVENT1"];
                                     $F_EVENT2 = $arForum["EVENT2"];
                                     $F_EVENT3 = $arForum["EVENT3"];
                                     if (strlen($F_EVENT3) <= 0) {
                                         $arForumSite_tmp = CForumNew::GetSites($FORUM_ID);
                                         $F_EVENT3 = CForumNew::PreparePath2Message($arForumSite_tmp[SITE_ID], array("FORUM_ID" => $FORUM_ID, "TOPIC_ID" => $TOPIC_ID, "MESSAGE_ID" => $messageID));
                                     }
                                     CStatistic::Set_Event($F_EVENT1, $F_EVENT2, $F_EVENT3);
                                 }
                                 CForumMessage::SendMailMessage($messageID, array(), false, "NEW_FORUM_MESSAGE");
                                 CSocNetLogTools::AddComment_Review_UpdateElement($arElement, $TOPIC_ID, $bNewTopic);
                             }
                         }
                     }
                 }
             }
         }
     }
     if (intval($messageID) <= 0) {
         $strError = GetMessage("SONET_ADD_COMMENT_SOURCE_ERROR");
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:include.php


示例12: IntVal

								<?php 
                }
                ?>
							</td>
						</tr>
						<?php 
            }
            $currentGroupID = IntVal($ar_Forum["FORUM_GROUP_ID"]);
        }
        ?>
<tr class="forumbody"><?php 
        if ($perm >= "Q") {
            $GlobPerm = true;
            ?>
<td align="center" class="forumbodytext" valign="top">&nbsp;<?php 
            $mCnt = CForumMessage::GetList(array(), array("FORUM_ID" => $ar_Forum["ID"], "APPROVED" => "N"), true);
            if ($mCnt > 0) {
                ?>
<a href="appr_message.php?FID=<?php 
                echo $ar_Forum["ID"];
                ?>
" title="<?php 
                echo GetMessage("FL_MESSAGE_NOT_APPROVED");
                ?>
">(<?php 
                echo $mCnt;
                ?>
)</a><?php 
            }
            ?>
</td><?php 
开发者ID:,项目名称:,代码行数:31,代码来源:


示例13: isset

    return 0;
}
if ($arParams["SHOW_VOTE"] == "Y") {
    CModule::IncludeModule("vote");
    $permission = isset($arParams['PERMISSION']) && intval($arParams['PERMISSION'] > 0 || $arParams['PERMISSION'] === 0) ? intval($arParams['PERMISSION']) : CVoteChannel::GetGroupPermission($arParams["VOTE_CHANNEL_ID"]);
    if ($permission < 2) {
        $arParams["SHOW_VOTE"] = "N";
    }
    $res = array_intersect($USER->GetUserGroupArray(), $arParams["VOTE_GROUP_ID"]);
    $arParams["SHOW_VOTE"] = empty($res) ? "N" : $arParams["SHOW_VOTE"];
}
/********************************************************************
				Data
********************************************************************/
if ($arParams["MESSAGE_TYPE"] == "EDIT") {
    $arMessage = CForumMessage::GetByIDEx($arParams["MID"], array("GET_FORUM_INFO" => "N", "GET_TOPIC_INFO" => "Y", "FILTER" => "N"));
    if (empty($arMessage)) {
        ShowError(GetMessage("F_ERROR_MESSAGE_NOT_FOUND"));
        return 0;
    }
    $arResult["TOPIC"] = $arMessage["TOPIC_INFO"];
    $arResult["TOPIC_FILTER"] = CForumTopic::GetByID($arMessage["TOPIC_ID"]);
    $arResult["MESSAGE"] = $arMessage;
    $arResult["MESSAGE"]["FILES"] = array();
    $db_res = CForumFiles::GetList(array(), array("MESSAGE_ID" => $arParams["MID"]));
    if ($db_res && ($res = $db_res->Fetch())) {
        do {
            $arResult["MESSAGE"]["FILES"][$res["FILE_ID"]] = $res;
        } while ($res = $db_res->Fetch());
    }
    if ($arParams["SHOW_VOTE"] == "Y" && $arMessage["PARAM1"] == "VT" && intVal($arMessage["PARAM2"]) > 0) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php


示例14: updateIBlockProperty

 public static function updateIBlockProperty($ID, $TYPE, $arMessage)
 {
     if ($ID > 0 && $arMessage["PARAM1"] != "IB" && !empty($arMessage["PARAM2"]) && CModule::IncludeModule("iblock")) {
         CIBlockElement::SetPropertyValuesEx($arMessage["PARAM2"], 0, array("FORUM_MESSAGE_CNT" => array("VALUE" => CForumMessage::GetList(array(), array("TOPIC_ID" => $arMessage["TOPIC_ID"], "APPROVED" => "Y", "!PARAM1" => "IB"), true), "DESCRIPTION" => "")));
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:6,代码来源:event_manager.php


示例15: UpdateCrmActivityComment

 public static function UpdateCrmActivityComment($arFields)
 {
     if (!isset($arFields["SOURCE_ID"]) || intval($arFields["SOURCE_ID"]) <= 0) {
         return false;
     }
     $ufFileID = array();
     $ufDocID = array();
     $dbResult = CSocNetLog::GetList(array(), array("ID" => $arFields["LOG_ID"]), false, false, array('ID', 'ENTITY_ID'));
     if ($arLog = $dbResult->Fetch()) {
         $dbCrmActivity = CCrmActivity::GetList(array(), array('ID' => $arLog['ENTITY_ID'], 'CHECK_PERMISSIONS' => 'N'));
         if (($arCrmActivity = $dbCrmActivity->Fetch()) && $arCrmActivity['TYPE_ID'] == CCrmActivityType::Task && CModule::IncludeModule("forum")) {
             $messageId = intval($arFields["SOURCE_ID"]);
             if ($arForumMessage = CForumMessage::GetByID($messageId)) {
                 $arFieldsMessage = array("POST_MESSAGE" => $arFields["TEXT_MESSAGE"], "USE_SMILES" => "Y", "APPROVED" => "Y", "SONET_PERMS" => array("bCanFull" => true));
                 $GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("SONET_COMMENT", $arTmp);
                 if (is_array($arTmp)) {
                     if (array_key_exists("UF_SONET_COM_DOC", $arTmp)) {
                         $GLOBALS["UF_FORUM_MESSAGE_DOC"] = $arTmp["UF_SONET_COM_DOC"];
                     } elseif (array_key_exists("UF_SONET_COM_FILE", $arTmp)) {
                         $arFieldsMessage["FILES"] = array();
                         foreach ($arTmp["UF_SONET_COM_FILE"] as $file_id) {
                             $arFieldsMessage["FILES"][$file_id] = array("FILE_ID" => $file_id);
                         }
                         if (!empty($arFieldsMessage["FILES"])) {
                             $arFileParams = array("FORUM_ID" => $arForumMessage["FORUM_ID"], "TOPIC_ID" => $arForumMessage["TOPIC_ID"]);
                             if (CForumFiles::CheckFields($arFieldsMessage["FILES"], $arFileParams, "NOT_CHECK_DB")) {
                                 CForumFiles::Add(array_keys($arFieldsMessage["FILES"]), $arFileParams);
                             }
                         }
                     }
                 }
                 $messageID = ForumAddMessage("EDIT", $arForumMessage["FORUM_ID"], $arForumMessage["TOPIC_ID"], $messageId, $arFieldsMessage, $sError, $sNote);
                 unset($GLOBALS["UF_FORUM_MESSAGE_DOC"]);
                 // get UF DOC value and FILE_ID there
                 if ($messageID > 0) {
                     $dbAddedMessageFiles = CForumFiles::GetList(array("ID" => "ASC"), array("MESSAGE_ID" => $messageID));
                     while ($arAddedMessageFiles = $dbAddedMessageFiles->Fetch()) {
                         $ufFileID[] = $arAddedMessageFiles["FILE_ID"];
                     }
                     $ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("FORUM_MESSAGE", "UF_FORUM_MESSAGE_DOC", $messageID, LANGUAGE_ID);
                 }
             } else {
                 $sError = GetMessage("CRM_SL_UPDATE_COMMENT_SOURCE_ERROR");
             }
             return array("ERROR" => $sError, "NOTES" => $sNote, "UF" => array("FILE" => $ufFileID, "DOC" => $ufDocID));
         }
     }
     return array("NO_SOURCE" => "Y");
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:49,代码来源:livefeed.php


示例16: array

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CForumNew类代码示例发布时间:2022-05-23
下一篇:
PHP CForumFiles类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap