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


PHP CBlogPost::NotifyIm方法代码示例

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


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

示例1: Execute

 public function Execute()
 {
     global $DB;
     if (!CModule::IncludeModule("socialnetwork") || !CModule::IncludeModule("blog")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $siteId = $this->PostSite ? $this->PostSite : SITE_ID;
     $ownerId = CBPHelper::ExtractUsers($this->OwnerId, $documentId, true);
     $pathToPost = COption::GetOptionString("socialnetwork", "userblogpost_page", false, $siteId);
     $pathToSmile = COption::GetOptionString("socialnetwork", "smile_page", false, $siteId);
     $blogGroupID = COption::GetOptionString("socialnetwork", "userbloggroup_id", false, $siteId);
     $blog = CBlog::GetByOwnerID($ownerId);
     if (!$blog) {
         $blog = $this->createBlog($ownerId, $blogGroupID, $siteId);
     }
     $micro = 'N';
     $title = trim($this->PostTitle);
     if (!$title) {
         $micro = 'Y';
         $title = trim(preg_replace(array("/\n+/is" . BX_UTF_PCRE_MODIFIER, '/\\s+/is' . BX_UTF_PCRE_MODIFIER), " ", blogTextParser::killAllTags($this->PostMessage)));
     }
     try {
         $postFields = array('TITLE' => $title, 'DETAIL_TEXT' => $this->PostMessage, 'DETAIL_TEXT_TYPE' => $this->PostMessageType == 'html' ? 'html' : 'text', '=DATE_PUBLISH' => $DB->CurrentTimeFunction(), 'PUBLISH_STATUS' => BLOG_PUBLISH_STATUS_PUBLISH, 'CATEGORY_ID' => '', 'PATH' => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => "#post_id#", "user_id" => $ownerId)), 'URL' => $blog['URL'], 'PERMS_POST' => array(), 'PERMS_COMMENT' => array(), 'MICRO' => $micro, 'SOCNET_RIGHTS' => $this->getSocnetRights($this->UsersTo), '=DATE_CREATE' => $DB->CurrentTimeFunction(), 'AUTHOR_ID' => $ownerId, 'BLOG_ID' => $blog['ID'], "HAS_IMAGES" => "N", "HAS_TAGS" => "N", "HAS_PROPS" => "N", "HAS_SOCNET_ALL" => "N");
         if (!empty($postFields["SOCNET_RIGHTS"]) && count($postFields["SOCNET_RIGHTS"]) == 1 && in_array("UA", $postFields["SOCNET_RIGHTS"])) {
             $postFields['HAS_SOCNET_ALL'] = 'Y';
         }
         $newId = CBlogPost::add($postFields);
         $postFields["ID"] = $newId;
         $arParamsNotify = array("bSoNet" => true, "UserID" => $ownerId, "allowVideo" => COption::GetOptionString("blog", "allow_video", "Y"), "PATH_TO_SMILE" => $pathToSmile, "PATH_TO_POST" => $pathToPost, "SOCNET_GROUP_ID" => $blogGroupID, "user_id" => $ownerId, "NAME_TEMPLATE" => CSite::GetNameFormat(false));
         CBlogPost::Notify($postFields, $blog, $arParamsNotify);
         BXClearCache(true, "/" . $siteId . "/blog/last_messages_list/");
         $arFieldsIM = array("TYPE" => "POST", "TITLE" => $postFields["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate($pathToPost, array("post_id" => $newId, "user_id" => $ownerId)), "ID" => $newId, "FROM_USER_ID" => $ownerId, "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $postFields["SOCNET_RIGHTS"], "TO_SOCNET_RIGHTS_OLD" => array());
         CBlogPost::NotifyIm($arFieldsIM);
     } catch (Exception $e) {
         $this->WriteToTrackingService($e->getMessage());
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:40,代码来源:socnetblogpostactivity.php

示例2: array

     }
 }
 $UserIP = CBlogUser::GetUserIP();
 $arComFields = array("POST_ID" => $arParams["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "POST_TEXT" => (count($arNewRightsName) > 1 ? GetMessage("B_B_SHARE") : GetMessage("B_B_SHARE_1")) . implode(", ", $arNewRightsName), "DATE_CREATE" => ConvertTimeStamp(time() + $arResult["TZ_OFFSET"], "FULL"), "AUTHOR_IP" => $UserIP[0], "AUTHOR_IP1" => $UserIP[1], "PARENT_ID" => false, "AUTHOR_ID" => $user_id, "SHARE_DEST" => implode(",", $arNewRights));
 if ($comId = CBlogComment::Add($arComFields)) {
     BXClearCache(true, "/blog/comment/" . intval($arParams["ID"] / 100) . "/" . $arParams["ID"] . "/");
     if (is_callable("CBlogComment::AddLiveComment")) {
         CBlogComment::addLiveComment($comId, "", array());
     }
     if ($arPost["AUTHOR_ID"] != $user_id) {
         $arFieldsIM = array("TYPE" => "SHARE", "TITLE" => htmlspecialcharsback($arPost["TITLE"]), "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $arParams["ID"], "user_id" => $arPost["AUTHOR_ID"])), "ID" => $arParams["ID"], "FROM_USER_ID" => $user_id, "TO_USER_ID" => array($arPost["AUTHOR_ID"]));
         CBlogPost::NotifyIm($arFieldsIM);
     }
     if (!empty($arUsers2Notify)) {
         $arFieldsIM = array("TYPE" => "SHARE2USERS", "TITLE" => htmlspecialcharsback($arPost["TITLE"]), "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $arParams["ID"], "user_id" => $arPost["AUTHOR_ID"])), "ID" => $arParams["ID"], "FROM_USER_ID" => $user_id, "TO_USER_ID" => $arUsers2Notify);
         CBlogPost::NotifyIm($arFieldsIM);
     }
 }
 /* update socnet log rights*/
 $dbRes = CSocNetLog::GetList(array("ID" => "DESC"), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $arPost["ID"]), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID"));
 if ($arRes = $dbRes->Fetch()) {
     $arLogSites = array();
     $rsLogSite = CSocNetLog::GetSite($arRes["ID"]);
     while ($arLogSite = $rsLogSite->Fetch()) {
         $arLogSites[] = $arLogSite["LID"];
     }
     $arLogSitesNew = array_merge($arLogSitesNew, $arLogSites);
     $socnetPerms = CBlogPost::GetSocNetPermsCode($arPost["ID"]);
     if (!in_array("U" . $arPost["AUTHOR_ID"], $socnetPerms)) {
         $socnetPerms[] = "U" . $arPost["AUTHOR_ID"];
     }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例3: PostIntoBuzzAsBlog


//.........这里部分代码省略.........
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH_DEF"];
         //	elseif (strlen($_POST["DATE_PUBLISH"])<=0)
         $DATE_PUBLISH = ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL");
         //	else
         //		$DATE_PUBLISH = $_POST["DATE_PUBLISH"];
         $arFields = array("DETAIL_TEXT" => $userTwit['text'], "DETAIL_TEXT_TYPE" => "text", "DATE_PUBLISH" => $DATE_PUBLISH, "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => "#post_id#", "user_id" => $arBlog["OWNER_ID"])), "URL" => $arBlog["URL"], "SOURCE_TYPE" => "twitter");
         $arFields["PERMS_POST"] = array();
         $arFields["PERMS_COMMENT"] = array();
         $arFields["MICRO"] = "N";
         if (strlen($arFields["TITLE"]) <= 0) {
             $arFields["MICRO"] = "Y";
             $arFields["TITLE"] = trim(blogTextParser::killAllTags($arFields["DETAIL_TEXT"]));
             if (strlen($arFields["TITLE"]) <= 0) {
                 $arFields["TITLE"] = GetMessage("BLOG_EMPTY_TITLE_PLACEHOLDER");
             }
         }
         $arFields["SOCNET_RIGHTS"] = array();
         if (!empty($userTwit['user_perms'])) {
             $bOne = true;
             foreach ($userTwit['user_perms'] as $v => $k) {
                 if (strlen($v) > 0 && is_array($k) && !empty($k)) {
                     foreach ($k as $vv) {
                         if (strlen($vv) > 0) {
                             $arFields["SOCNET_RIGHTS"][] = $vv;
                             if ($v != "SG") {
                                 $bOne = false;
                             }
                         }
                     }
                 }
             }
             if ($bOne && !empty($userTwit['user_perms']["SG"])) {
                 $bOnesg = false;
                 $bFirst = true;
                 $oGrId = 0;
                 foreach ($userTwit['user_perms']["SG"] as $v) {
                     if (strlen($v) > 0) {
                         if ($bFirst) {
                             $bOnesg = true;
                             $bFirst = false;
                             $v = str_replace("SG", "", $v);
                             $oGrId = IntVal($v);
                         } else {
                             $bOnesg = false;
                         }
                     }
                 }
                 if ($bOnesg) {
                     if (!CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "write_post") && !CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "moderate_post") && !CSocNetFeaturesPerms::CanPerformOperation($arParams["USER_ID"], SONET_ENTITY_GROUP, $oGrId, "blog", "full_post")) {
                         $arFields["PUBLISH_STATUS"] = BLOG_PUBLISH_STATUS_READY;
                     }
                 }
             }
         }
         $bError = false;
         /*	if (CModule::IncludeModule('extranet') && !CExtranet::IsIntranetUser())
         			{
         				if(empty($arFields["SOCNET_RIGHTS"]) || in_array("UA", $arFields["SOCNET_RIGHTS"]))
         				{
         					$bError = true;
         					$arResult["ERROR_MESSAGE"] = GetMessage("BLOG_BPE_EXTRANET_ERROR");
         				}
         			}*/
         if (!$bError) {
             preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/ies" . BX_UTF_PCRE_MODIFIER, $userTwit['text'], $arMention);
             $arFields["=DATE_CREATE"] = $DB->GetNowFunction();
             $arFields["AUTHOR_ID"] = $arParams["USER_ID"];
             $arFields["BLOG_ID"] = $arBlog["ID"];
             $newID = CBlogPost::Add($arFields);
             $socnetRightsOld = array("U" => array());
             $bAdd = true;
             $bNeedMail = false;
             if ($newID) {
                 $arFields["ID"] = $newID;
                 $arParamsNotify = array("bSoNet" => true, "UserID" => $arParams["USER_ID"], "allowVideo" => $arResult["allowVideo"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "SOCNET_GROUP_ID" => $arParams["GROUP_ID"], "user_id" => $arParams["USER_ID"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"]);
                 CBlogPost::Notify($arFields, $arBlog, $arParamsNotify);
             }
         }
         if ($newID > 0 && strlen($arResult["ERROR_MESSAGE"]) <= 0 && $arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
             BXClearCache(true, "/" . SITE_ID . "/blog/last_messages_list/");
             $arFieldsIM = array("TYPE" => "POST", "TITLE" => $arFields["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $newID, "user_id" => $arBlog["OWNER_ID"])), "ID" => $newID, "FROM_USER_ID" => $arParams["USER_ID"], "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $arFields["SOCNET_RIGHTS"], "TO_SOCNET_RIGHTS_OLD" => $socnetRightsOld["U"]);
             if (!empty($arMentionOld)) {
                 $arFieldsIM["MENTION_ID_OLD"] = $arMentionOld[1];
             }
             if (!empty($arMention)) {
                 $arFieldsIM["MENTION_ID"] = $arMention[1];
             }
             CBlogPost::NotifyIm($arFieldsIM);
             $arParams["ID"] = $newID;
             if (!empty($_POST["SPERM"]["SG"])) {
                 foreach ($_POST["SPERM"]["SG"] as $v) {
                     $group_id_tmp = substr($v, 2);
                     if (IntVal($group_id_tmp) > 0) {
                         CSocNetGroup::SetLastActivity(IntVal($group_id_tmp));
                     }
                 }
             }
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:101,代码来源:authmanager.php


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