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


PHP CSocNetLogTools::GetDestinationFromRights方法代码示例

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


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

示例1: FormatEvent_Blog

 function FormatEvent_Blog($arFields, $arParams, $bMail = false)
 {
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
     }
     $arResult = array("EVENT" => $arFields, "CREATED_BY" => CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail), "ENTITY" => CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, $bMail), "EVENT_FORMATTED" => array());
     $arResult["CREATED_BY"]["ACTION_TYPE"] = "wrote";
     if (!$bMail) {
         $arResult["AVATAR_SRC"] = CSocNetLogTools::FormatEvent_CreateAvatar($arFields, $arParams);
     }
     if ($bMail) {
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_" . ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP ? "GROUP" : "USER") . "_BLOG_POST_MAIL");
         //if the title duplicates message, don't show it
         $arFields["TITLE"] = strpos($arFields["MESSAGE"], $arFields["TITLE"]) === 0 ? "" : ' "' . $arFields["TITLE"] . '"';
     } else {
         $title_tmp = GetMessage("SONET_GL_EVENT_TITLE_BLOG_POST");
     }
     $post_tmp = !$bMail && array_key_exists("URL", $arFields) && strlen($arFields["URL"]) > 0 ? '<a href="' . $arFields["URL"] . '">' . $arFields["TITLE"] . '</a>' : $arFields["TITLE"];
     $title = str_replace(array("#TITLE#", "#ENTITY#", "#CREATED_BY#"), array($post_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), $title_tmp);
     $title = trim(preg_replace('/\\s+/', ' ', $title));
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "TITLE_24" => GetMessage("SONET_GL_EVENT_TITLE_BLOG_POST_24"), "TITLE_24_2" => $arFields["TITLE"], "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : $arFields["~MESSAGE"]);
     if (!$bMail) {
         if ($arParams["NEW_TEMPLATE"] != "Y" || $arFields["EVENT_ID"] == "idea") {
             if (CModule::IncludeModule("blog")) {
                 $parserLog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
                 $arImages = array();
                 $arBlogPost = CBlogPost::GetByID($arFields["SOURCE_ID"]);
                 if ($arBlogPost["HAS_IMAGES"] != "N") {
                     $res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arBlogPost['ID'], "IS_COMMENT" => "N"));
                     while ($arImage = $res->Fetch()) {
                         $arImages[$arImage['ID']] = $arImage['FILE_ID'];
                     }
                 }
             } else {
                 $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
             }
             $arAllow = array("HTML" => "N", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "N", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y");
             if (get_class($parserLog) == "blogTextParser") {
                 $arResult["EVENT_FORMATTED"]["MESSAGE"] = $parserLog->html_cut($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), true, $arImages, $arAllow), 10000);
             } else {
                 $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parserLog->convert(htmlspecialcharsback($arResult["EVENT_FORMATTED"]["MESSAGE"]), array(), $arAllow));
             }
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = str_replace("#CUT#", '<br><a href="' . $arFields["URL"] . '">' . GetMessage("SONET_GL_EVENT_BLOG_MORE") . '</a>', $arResult["EVENT_FORMATTED"]["MESSAGE"]);
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
             if ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP) {
                 $arResult["EVENT_FORMATTED"]["DESTINATION"] = array(array("STYLE" => "sonetgroups", "TITLE" => $arResult["ENTITY"]["FORMATTED"]["NAME"], "URL" => $arResult["ENTITY"]["FORMATTED"]["URL"]));
             }
         }
         $dbRight = CSocNetLogRights::GetList(array(), array("LOG_ID" => $arFields["ID"]));
         while ($arRight = $dbRight->Fetch()) {
             $arRights[] = $arRight["GROUP_CODE"];
         }
         if ($arParams["MOBILE"] == "Y") {
             $arResult["EVENT_FORMATTED"]["DESTINATION"] = CSocNetLogTools::FormatDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"], "USE_ALL_DESTINATION" => true)), $iMoreCount);
             if (intval($iMoreCount) > 0) {
                 $arResult["EVENT_FORMATTED"]["DESTINATION_MORE"] = $iMoreCount;
             }
         } else {
             $arResult["EVENT_FORMATTED"]["DESTINATION_CODE"] = CSocNetLogTools::GetDestinationFromRights($arRights, array_merge($arParams, array("CREATED_BY" => $arFields["USER_ID"])));
         }
     } else {
         $url = CSocNetLogTools::FormatEvent_GetURL($arFields);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     }
     $arResult["HAS_COMMENTS"] = intval($arFields["SOURCE_ID"]) > 0 ? "Y" : "N";
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
     }
     return $arResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:72,代码来源:log_tools.php


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