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


PHP forumTextParser::strip_words方法代码示例

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


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

示例1: array

                 $files[$res["MESSAGE_ID"]] = $files[$res["MESSAGE_ID"]] ?: array();
                 $files[$res["MESSAGE_ID"]][$res["FILE_ID"]] = $res;
             }
             if (!empty($arParams["USER_FIELDS"])) {
                 $db_props = CForumMessage::GetList(array("ID" => "ASC"), array("@ID" => $ids), false, 0, array("SELECT" => $arParams["USER_FIELDS"]));
                 while ($res = $db_props->Fetch()) {
                     $props[$res["ID"]] = array_intersect_key($res, array_flip($arParams["USER_FIELDS"]));
                 }
             }
             $arAllow = array("HTML" => $arParams["ALLOW_HTML"], "ANCHOR" => $arParams["ALLOW_ANCHOR"], "BIU" => $arParams["ALLOW_BIU"], "IMG" => $arParams["ALLOW_IMG"], "VIDEO" => $arParams["ALLOW_VIDEO"], "LIST" => $arParams["ALLOW_LIST"], "QUOTE" => $arParams["ALLOW_QUOTE"], "CODE" => $arParams["ALLOW_CODE"], "FONT" => $arParams["ALLOW_FONT"], "SMILES" => $arParams["ALLOW_SMILES"], "NL2BR" => $arParams["ALLOW_NL2BR"], "TABLE" => $arParams["ALLOW_TABLE"], "UPLOAD" => $arParams["ALLOW_UPLOAD"], "ALIGN" => $arParams["ALLOW_ALIGN"]);
             foreach ($arTopics as &$topic) {
                 $topic['MESSAGE']["POST_MESSAGE_TEXT"] = $parser->convert($topic['MESSAGE']["~POST_MESSAGE_TEXT"], array_merge($arAllow, array("SMILES" => $topic["MESSAGE"]["USE_SMILES"] == "Y" ? $arParams["ALLOW_SMILES"] : "N", "USERFIELDS" => $props[$topic["MESSAGE"]["ID"]])), "html", $files[$topic["MESSAGE"]["ID"]]);
                 if ($arParams['TOPIC_POST_MESSAGE_LENGTH'] > 0) {
                     $symbols_len = strlen(strip_tags($topic['MESSAGE']["POST_MESSAGE_TEXT"]));
                     if ($symbols_len > $arParams['TOPIC_POST_MESSAGE_LENGTH']) {
                         $strip_text = $parser->strip_words($topic['MESSAGE']["POST_MESSAGE_TEXT"], $arParams['TOPIC_POST_MESSAGE_LENGTH']);
                         if ($symbols_len > $arParams['TOPIC_POST_MESSAGE_LENGTH']) {
                             $strip_text = $strip_text . "...";
                         }
                         $topic['MESSAGE']["POST_MESSAGE_TEXT"] = $parser->closetags($strip_text);
                     }
                 }
                 $topic['MESSAGE']["FILES"] = $files[$topic["MESSAGE"]["ID"]];
                 $topic['MESSAGE']["FILES_PARSED"] = $parser->arFilesIDParsed;
                 unset($topic["MESSAGE"]["USE_SMILES"]);
             }
         }
     }
 }
 $arResult['TOPICS'] = CForumCacheManager::Compress($arTopics);
 $arResult['FORUMS'] = CForumCacheManager::Compress($arForums);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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