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


PHP CTextParser::clearAllTags方法代码示例

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


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

示例1: killAllTags

 function killAllTags($text)
 {
     if (method_exists("CTextParser", "clearAllTags")) {
         return CTextParser::clearAllTags($text);
     }
     $text = strip_tags($text);
     $text = preg_replace(array("/\\<(\\/?)(quote|code|font|color|video|disk)([^\\>]*)\\>/is" . BX_UTF_PCRE_MODIFIER, "/\\[(\\/?)(b|u|i|s|list|code|quote|font|color|url|img|video|disk)([^\\]]*)\\]/is" . BX_UTF_PCRE_MODIFIER), "", $text);
     return $text;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:functions.php

示例2: killAllTags

 public static function killAllTags($text)
 {
     if (method_exists("CTextParser", "clearAllTags")) {
         return CTextParser::clearAllTags($text);
     }
     $text = strip_tags($text);
     $text = preg_replace("#<(/?)quote(.*?)>#is", "", $text);
     $text = preg_replace("#<(/?)code(.*?)>#is", "", $text);
     $text = preg_replace("#\\[(/?)(b|u|i|list|code|quote|url|img)(.*?)\\]#is", "", $text);
     $text = preg_replace("/^(\r|\n)+?(.*)\$/", "\\2", $text);
     $text = preg_replace("/^<br>+?(.*)\$/", "\\2", $text);
     return $text;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:13,代码来源:functions1.php

示例3: FormatDate

         $arResult["FIELDS_FORMATTED"][$key] = $oFormat->showField($arField);
     }
 }
 $arResult["DATE_WEEK_DAY"] = FormatDate("D", MakeTimeStamp($arParams["~ACTIVITY"]["START_END_TIME"]));
 $arResult["DATE_MONTH_DAY"] = FormatDate("j", MakeTimeStamp($arParams["~ACTIVITY"]["START_END_TIME"]));
 $arResult["IS_COMPLETED"] = $arParams["~ACTIVITY"]["COMPLETED"] == "Y";
 if (!empty($arParams["ACTIVITY"]["DESCRIPTION"])) {
     switch ($arParams["ACTIVITY"]["DESCRIPTION_TYPE"]) {
         case CCrmContentType::BBCode:
             $arResult["DESCRIPTION"] = CCrmLiveFeedComponent::ParseText(htmlspecialcharsback($arParams["ACTIVITY"]["DESCRIPTION"]), array(), array());
             break;
         case CCrmContentType::Html:
             $convertedText = htmlspecialcharsback($arParams["ACTIVITY"]["DESCRIPTION"]);
             $convertedText = preg_replace('/<br\\s*\\/*>/i', '#TMPBR#', $convertedText);
             $convertedText = preg_replace('/<\\/p>/i', '#TMPBR#', $convertedText);
             $convertedText = CTextParser::clearAllTags($convertedText);
             $convertedText = str_replace('#TMPBR#', '<br>', $convertedText);
             $arResult["DESCRIPTION"] = $convertedText;
             break;
         default:
             $arResult["DESCRIPTION"] = $arParams["ACTIVITY"]["DESCRIPTION"];
     }
 } else {
     $arResult["DESCRIPTION"] = $arParams["ACTIVITY"]["DESCRIPTION"];
 }
 if (count($arActivity["COMMUNICATIONS"]) > 1) {
     $arResult["COMMUNICATION_MORE_CNT"] = count($arActivity["COMMUNICATIONS"]) - 1;
     $arResult["CLIENTS_FOR_JS"] = array();
     $i = 0;
     foreach ($arActivity["COMMUNICATIONS"] as $arCommunication) {
         $i++;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例4: sendAddMessage

 public static function sendAddMessage($messageData, $taskData, $fromUser, $toUsers, array $eventData = array())
 {
     IncludeModuleLangFile(__FILE__);
     $user = CTaskNotifications::getUser($fromUser);
     $messageTemplate = CTaskNotifications::getGenderMessage($fromUser, "TASKS_COMMENT_MESSAGE_ADD");
     //$strMsgEditComment = CTaskNotifications::getGenderMessage($occurAsUserId, "TASKS_COMMENT_MESSAGE_EDIT");
     $messageTemplatePush = CTaskNotifications::getGenderMessage($fromUser, "TASKS_COMMENT_MESSAGE_ADD_PUSH");
     // in comment messages we can get BBCODEs that are not supported by IM. rip them out. also limit text length to 100
     $message = CTaskNotifications::clearNotificationText($messageData['POST_MESSAGE']);
     $messageCropped = self::cropMessage($message);
     CTaskNotifications::SendMessageEx($taskData["ID"], $fromUser, $toUsers, array('INSTANT' => str_replace(array("#TASK_TITLE#", "#TASK_COMMENT_TEXT#"), array($taskData["TITLE"], '[COLOR=#000000]' . $messageCropped . '[/COLOR]'), $messageTemplate), 'EMAIL' => str_replace(array("#TASK_TITLE#", "#TASK_COMMENT_TEXT#"), array($taskData["TITLE"], $message), $messageTemplate), 'PUSH' => CTaskNotifications::cropMessage($messageTemplatePush, array('USER_NAME' => CUser::FormatName(CSite::GetNameFormat(false), $user), 'TASK_TITLE' => $taskData["TITLE"], 'TASK_COMMENT_TEXT' => html_entity_decode(CTextParser::clearAllTags($message))), CTaskNotifications::PUSH_MESSAGE_MAX_LENGTH)), array('ENTITY_CODE' => 'COMMENT', 'EVENT_DATA' => $eventData, 'NOTIFY_EVENT' => 'comment', 'NOTIFY_ANSWER' => true, 'TASK_URL' => array('PARAMETERS' => array('MID' => $messageData['ID']), 'HASH' => 'message' . $messageData['ID'])));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:taskcomments.php

示例5: killAllTags

 function killAllTags($text)
 {
     if (method_exists("CTextParser", "clearAllTags")) {
         return CTextParser::clearAllTags($text);
     }
     $text = strip_tags($text);
     $text = preg_replace(array("/\\<(\\/)(quote|code)([^\\>]*)\\>/is" . BX_UTF_PCRE_MODIFIER, "/\\[(\\/)(code|quote|video|td|tr|th|table|tbody|thead|file|document|disk)([^\\]]*)\\]/is" . BX_UTF_PCRE_MODIFIER, "/\\[(\\/?)(\\*)([^\\]]*)\\]/is" . BX_UTF_PCRE_MODIFIER), " ", $text);
     $text = preg_replace(array("/\\<(\\/?)(quote|code|font|color|video)([^\\>]*)\\>/is" . BX_UTF_PCRE_MODIFIER, "/\\[(\\/?)(b|u|i|s|list|code|quote|font|color|url|img|video|td|tr|th|tbody|thead|table|file|document|disk|user|left|right|center|justify)([^\\]]*)\\]/is" . BX_UTF_PCRE_MODIFIER), "", $text);
     return $text;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:10,代码来源:functions.php


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