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


PHP CBlogTools::DeleteDoubleBR方法代码示例

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


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

示例1: array

         $arTmp["urlToAuthor"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arPost["AUTHOR_ID"]));
         $arTmp["AuthorName"] = CBlogUser::GetUserName($arPost["BLOG_USER_ALIAS"], $arPost["AUTHOR_NAME"], $arPost["AUTHOR_LAST_NAME"], $arPost["AUTHOR_LOGIN"]);
         if ($itemCnt == 0) {
             $arTmp["FIRST"] = "Y";
         }
         $text = preg_replace("#\\[img\\](.+?)\\[/img\\]#is", "", $arPost["~DETAIL_TEXT"]);
         $text = preg_replace("#\\[url(.+?)\\](.*?)\\[/url\\]#is", "\\2", $text);
         $text = preg_replace("#\\[video(.+?)\\](.+?)\\[/video\\]#is", "", $text);
         $text = preg_replace("#^(.+?)<cut[\\s]*(/>|>).*?\$#is", "\\1", $text);
         $text = preg_replace("#^(.+?)\\[cut[\\s]*(/\\]|\\]).*?\$#is", "\\1", $text);
         $text = preg_replace("#(\\[|<)(/?)(b|u|i|list|code|quote|url|img|color|font|/*)(.*?)(\\]|>)#is", "", $text);
         $text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
         $text1 = $text;
         $title = $p->convert($text1, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N"));
         $text = $p->convert($text, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "N"));
         $text = CBlogTools::DeleteDoubleBR($text);
         $arTmp["TEXT_FORMATED"] = $text;
         $arTmp["DATE_PUBLISH_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arTmp["DATE_PUBLISH"], CSite::GetDateFormat("FULL")));
         if ($arTmp["MICRO"] == "Y") {
             $arTmp["TITLE"] = TruncateText(str_replace(array("<br />", "<br>", "'", "&quot;", "&lt;", "&gt;"), "", $title), 60);
             $arTmp["~TITLE"] = htmlspecialcharsback($arTmp["TITLE"]);
         }
         $itemCnt++;
         $arResult[] = $arTmp;
         $ids[] = $arTmp["ID"];
     }
     $arResult["IDS"] = $ids;
 }
 if ($arParams["CACHE_TIME"] > 0) {
     $cache->EndDataCache(array("templateCachedData" => $this->GetTemplateCachedData(), "arResult" => $arResult));
 }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: array

     $arPostsAll[] = $arPost;
 }
 if (!empty($arIdToGet)) {
     $arResult["userCache"] = CBlogUser::GetUserInfoArray($arIdToGet, $arParams["PATH_TO_USER"], array("AVATAR_SIZE" => $arParams["AVATAR_SIZE"]));
     foreach ($arResult["userCache"] as $userId => $arUserCache) {
         $arUserCache["~AUTHOR_NAME"] = CUser::FormatName($arParams["NAME_TEMPLATE"], array("LAST_NAME" => $arUserCache["~LAST_NAME"], "NAME" => $arUserCache["~NAME"], "SECOND_NAME" => $arUserCache["~SECOND_NAME"], "LOGIN" => $arUserCache["~LOGIN"]), $arParams["SHOW_LOGIN"], false);
         $arUserCache["AUTHOR_NAME"] = htmlspecialcharsbx($arUserCache["~AUTHOR_NAME"]);
         $arResult["userCache"][$userId] = $arUserCache;
     }
 }
 $db_user = CUser::GetById($GLOBALS["USER"]->GetId());
 $arResult["USER"] = $db_user->Fetch();
 foreach ($arPostsAll as $arPost) {
     $text = preg_replace($patt, $repl, $arPost["~DETAIL_TEXT"]);
     $text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
     $text = CBlogTools::DeleteDoubleBR($p->convert($text, true, false, $allow));
     $arPost["~CLEAR_TEXT"] = $text;
     $arPost["CLEAR_TEXT"] = $p->wrap_long_words($text);
     $arPost["perms"] = $arResult["perms"];
     if (!$bGroupMode && $arParams["USER_ID"] == $user_id && (empty($arParams["4ME"]) || $arPost["AUTHOR_ID"] == $user_id)) {
         $arPost["perms"] = BLOG_PERMS_FULL;
     } elseif (!$bGroupMode && $arParams["USER_ID"] != $user_id || strlen($arParams["4ME"]) > 0) {
         $arPost["perms"] = CBlogPost::GetSocNetPostPerms($arPost["ID"], true);
     }
     $arUser = $arResult["userCache"][$arPost["AUTHOR_ID"]];
     $arPost["~AUTHOR_NAME"] = $arUser["~AUTHOR_NAME"];
     $arPost["AUTHOR_NAME"] = $arUser["AUTHOR_NAME"];
     $arPost["AUTHOR_AVATAR"] = $arUser["PERSONAL_PHOTO_resized"];
     $arPost["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_POST"], array("post_id" => CBlogPost::GetPostID($arPost["ID"], $arPost["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["BLOG_OWNER_ID"]));
     $arPost["urlToPosts"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_BLOG_POSTS"], array("user_id" => $arPost["BLOG_OWNER_ID"]));
     $arPost["urlToPostsImportant"] = CComponentEngine::MakePathFromTemplate($arParams["~PATH_TO_POST_IMPORTANT"], array("user_id" => $arPost["BLOG_OWNER_ID"]));
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例3: preg_replace

         }
         $text = preg_replace(array("#\\[img\\](.+?)\\[/img\\]#ie", "/\\[document id=\\d+([^\\]]*)\\]/is"), "", $arPost["~DETAIL_TEXT"]);
         $text = preg_replace("#\\[url(.+?)\\](.*?)\\[/url\\]#is", "\\2", $text);
         $text = preg_replace("#\\[video(.+?)\\](.+?)\\[/video\\]#ie", "", $text);
         $text = preg_replace("#^(.+?)<cut[\\s]*(/>|>).*?\$#is", "\\1", $text);
         $text = preg_replace("#^(.+?)\\[cut[\\s]*(/\\]|\\]).*?\$#is", "\\1", $text);
         $text = preg_replace("#(\\[|<)(/?)(b|u|i|list|code|quote|url|img|color|font|right|left|center|justify|/*)(.*?)(\\]|>)#is", "", $text);
         $text1 = $text = TruncateText($text, $arParams["MESSAGE_LENGTH"]);
         $text = $p->convert($text, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "N"));
         $text = CBlogTools::DeleteDoubleBR($text);
         $arTmp["TEXT_FORMATED"] = $text;
         $arTmp["DATE_PUBLISH_FORMATED"] = FormatDate($arParams["DATE_TIME_FORMAT"], MakeTimeStamp($arTmp["DATE_PUBLISH"], CSite::GetDateFormat("FULL")));
         if ($arTmp["MICRO"] == "Y") {
             $text1 = TruncateText($text1, 60);
             $text1 = $p->convert($text1, true, false, array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "Y", "NL2BR" => "N"));
             $text1 = CBlogTools::DeleteDoubleBR($text1);
             $arTmp["TITLE"] = str_replace(array("<br />", "<br>"), "", $text1);
             $arTmp["~TITLE"] = htmlspecialcharsback($arTmp["TITLE"]);
             if (strlen($arTmp["TITLE"]) <= 0) {
                 $arTmp["TITLE"] = $arPost["TITLE"];
                 $arTmp["~TITLE"] = $arPost["~TITLE"];
             }
         }
         $user = CUser::GetByID($arPost["AUTHOR_ID"]);
         $arTmp["arUser"] = $user->Fetch();
         $itemCnt++;
         $arResult[] = $arTmp;
         $ids[] = $arTmp["ID"];
     }
     $arResult["IDS"] = $ids;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例4: DeleteDoubleBR

	function DeleteDoubleBR($text)
	{
		if(strpos($text, "<br />\r<br />") !== false)
		{
			$text = str_replace("<br />\r<br />", "<br />", $text);
			return CBlogTools::DeleteDoubleBR($text);
		}
		if(strpos($text, "<br /><br />") !== false)
		{
			$text = str_replace("<br /><br />", "<br />", $text);
			return CBlogTools::DeleteDoubleBR($text);
		}

		if(strpos($text, "<br />") == 0 && strpos($text, "<br />") !== false)
		{
			$text = substr($text, 6);
		}
		return $text;
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:19,代码来源:functions.php


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