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


PHP CForumFiles::GetByMessageID方法代码示例

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


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

示例1: FormatComment_Forum

 function FormatComment_Forum($arFields, $arParams, $bMail = false, $arLog = array())
 {
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, $arFields["MAIL_LANGUAGE_ID"]);
     }
     $arResult = array("EVENT_FORMATTED" => array());
     if ($bMail) {
         $arResult["CREATED_BY"] = CSocNetLogTools::FormatEvent_GetCreatedBy($arFields, $arParams, $bMail);
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arLog, $arParams, $bMail);
     } elseif ($arParams["USE_COMMENT"] != "Y") {
         $arResult["ENTITY"] = CSocNetLogTools::FormatEvent_GetEntity($arFields, $arParams, false);
     }
     $title_tmp = $bMail ? GetMessage("SONET_GL_EVENT_TITLE_" . ($arFields["ENTITY_TYPE"] == SONET_SUBSCRIBE_ENTITY_GROUP ? "GROUP" : "USER") . "_FORUM_MESSAGE_MAIL") : GetMessage("SONET_GL_EVENT_TITLE_FORUM_MESSAGE");
     $topic_tmp = !$bMail && array_key_exists("URL", $arLog) && strlen($arLog["URL"]) > 0 ? '<a href="' . $arLog["URL"] . '">' . $arLog["TITLE"] . '</a>' : $arLog["TITLE"];
     $title = str_replace(array("#TITLE#", "#ENTITY#", "#CREATED_BY#"), array($topic_tmp, $arResult["ENTITY"]["FORMATTED"], $bMail ? $arResult["CREATED_BY"]["FORMATTED"] : ""), $title_tmp);
     static $parser = false;
     if (CModule::IncludeModule("forum")) {
         if (!$parser) {
             $parser = new forumTextParser(LANGUAGE_ID);
         }
         $parser->pathToUser = $parser->userPath = $arParams["PATH_TO_USER"];
         $parser->bMobile = $arParams["MOBILE"] == "Y";
         $parser->LAZYLOAD = isset($arParams["LAZYLOAD"]) && $arParams["LAZYLOAD"] == "Y" ? "Y" : "N";
         $arFields["FILES"] = CForumFiles::GetByMessageID($arFields["SOURCE_ID"]);
     }
     $arResult["EVENT_FORMATTED"] = array("TITLE" => $title, "MESSAGE" => $bMail ? $arFields["TEXT_MESSAGE"] : htmlspecialcharsBack($arFields["MESSAGE"]), "FILES" => !!$arFields["FILES"] ? array_keys($arFields["FILES"]) : array());
     if (!$bMail) {
         if ($arParams["MOBILE"] != "Y") {
             static $parserLog = false;
             if (!$parserLog) {
                 $parserLog = new logTextParser(false, $arParams["PATH_TO_SMILE"]);
             }
             $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"] = $parserLog->html_cut($parserLog->convert($arResult["EVENT_FORMATTED"]["MESSAGE"], array(), array("HTML" => "Y", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "LOG_IMG" => "N", "QUOTE" => "Y", "LOG_QUOTE" => "N", "CODE" => "Y", "LOG_CODE" => "N", "FONT" => "Y", "LOG_FONT" => "N", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "MULTIPLE_BR" => "N", "VIDEO" => "Y", "LOG_VIDEO" => "N", "USERFIELDS" => $arFields["UF"])), 500);
         }
         $parser = is_object($parser) ? $parser : (is_object($parserLog) ? $parserLog : new logTextParser(false, $arParams["PATH_TO_SMILE"]));
         if (get_class($parser) == "forumTextParser") {
             $parser->arUserfields = $arFields["UF"];
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parser->convert($arResult["EVENT_FORMATTED"]["MESSAGE"], array("HTML" => "N", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y", "USERFIELDS" => $arFields["UF"], "USER" => "Y"), "html", $arResult["EVENT_FORMATTED"]["FILES"]));
             $arResult["EVENT_FORMATTED"]["PARSED_FILES"] = $parser->arFilesIDParsed;
         } else {
             $arResult["EVENT_FORMATTED"]["MESSAGE"] = htmlspecialcharsbx($parser->convert($arResult["EVENT_FORMATTED"]["MESSAGE"], array(), array("HTML" => "N", "ALIGN" => "Y", "ANCHOR" => "Y", "BIU" => "Y", "IMG" => "Y", "QUOTE" => "Y", "CODE" => "Y", "FONT" => "Y", "LIST" => "Y", "SMILES" => "Y", "NL2BR" => "Y", "VIDEO" => "Y", "LOG_VIDEO" => "N", "SHORT_ANCHOR" => "Y", "USERFIELDS" => $arFields["UF"])));
         }
         if ($arParams["MOBILE"] != "Y" && $arParams["NEW_TEMPLATE"] != "Y") {
             $arResult["EVENT_FORMATTED"]["IS_MESSAGE_SHORT"] = CSocNetLogTools::FormatEvent_IsMessageShort($arResult["EVENT_FORMATTED"]["MESSAGE"], $arResult["EVENT_FORMATTED"]["SHORT_MESSAGE"]);
         }
     } else {
         if (strlen($arFields["URL"]) > 0) {
             $url = $arFields["URL"];
         } elseif (strlen($arLog["PARAMS"]) > 0 && unserialize($arLog["PARAMS"])) {
             $arTmp = unserialize($arLog["PARAMS"]);
             if (array_key_exists("PATH_TO_MESSAGE", $arTmp) && strlen($arTmp["PATH_TO_MESSAGE"]) > 0) {
                 $url = CComponentEngine::MakePathFromTemplate($arTmp["PATH_TO_MESSAGE"], array("MID" => $arFields["SOURCE_ID"]));
             }
         }
         $url = strlen($url) > 0 ? CSocNetLogTools::FormatEvent_GetURL(array("ID" => $arLog["ID"], "URL" => $url)) : CSocNetLogTools::FormatEvent_GetURL($arLog);
         if (strlen($url) > 0) {
             $arResult["EVENT_FORMATTED"]["URL"] = $url;
         }
     }
     if ($bMail && strlen($arFields["MAIL_LANGUAGE_ID"]) > 0) {
         IncludeModuleLangFile(__FILE__, LANGUAGE_ID);
     }
     return $arResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:64,代码来源:log_tools.php


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