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


PHP forumTextParser::GetFeatures方法代码示例

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


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

示例1: is_array

$parser->MaxStringLen = $arParams["WORD_LENGTH"];
$parser->image_params["width"] = $parser->image_params["height"] = $arParams["IMAGE_SIZE"];
$_REQUEST["FILES"] = is_array($_REQUEST["FILES"]) ? $_REQUEST["FILES"] : array();
$_REQUEST["FILES_TO_UPLOAD"] = is_array($_REQUEST["FILES_TO_UPLOAD"]) ? $_REQUEST["FILES_TO_UPLOAD"] : array();
if (is_set($_REQUEST, "result")) {
    switch (strToLower($_REQUEST["result"])) {
        case "message_add":
        case "mid_add":
        case "reply":
            $arNote[] = array("id" => "message_add", "text" => GetMessage("F_MESS_SUCCESS_ADD"));
            break;
    }
    unset($_GET["result"]);
    DeleteParam(array("result"));
}
$arAllow = forumTextParser::GetFeatures($arResult["FORUM"]);
/********************************************************************
				/Default params # 2
********************************************************************/
ForumSetLastVisit($arParams["FID"], $arParams["TID"]);
ForumSetReadTopic($arParams["FID"], $arParams["TID"]);
/********************************************************************
				Action
********************************************************************/
$dir = dirname(__FILE__);
include str_replace(array("\\", "//"), "/", $dir . "/") . "action.php";
/********************************************************************
				/Action
********************************************************************/
if (!empty($arError)) {
    $e = new CAdminException($arError);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例2: array

        }
        $res = array($PARENT_ID => __array_merge($arResult["GROUPS"][$PARENT_ID], $res));
        $PARENT_ID = $arResult["GROUPS"][$PARENT_ID]["PARENT_ID"];
        $res = array("GROUPS" => $res);
        if ($PARENT_ID > 0) {
            $res = __array_merge($arResult["GROUPS"][$PARENT_ID], $res);
        }
    }
    if ($bResult == true) {
        $arGroups = __array_merge($arGroups, $res);
    }
}
$arResult["GROUPS_FORUMS"] = $arGroups;
/*******************************************************************/
foreach ($arResult["FORUMS_ALL"] as $key => $res) {
    $arResult["FORUMS_ALL"][$key]["ALLOW"] = forumTextParser::GetFeatures($res);
    $arResult["FORUMS_ALL"][$key]["URL"] = array("FORUM" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["ID"])), "~FORUM" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $res["ID"])));
    $arResult["FORUMS_ALL"][$key]["list"] = $arResult["FORUMS_ALL"][$key]["URL"]["FORUM"];
    $arResult["FORUMS_ALL"][$key]["~list"] = $arResult["FORUMS_ALL"][$key]["URL"]["~FORUM"];
}
/************** getting list topics ********************************/
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
if ($arParams["mode"] == "lta" || $arParams["mode"] == "lt") {
    $arFilter = array("AUTHOR_ID" => $arParams["UID"], "APPROVED" => "Y");
    $arOrder = array("FIRST_POST" => "DESC");
    if (is_set($arFilterFromForm, "fid")) {
        $arFilter["FORUM_ID"] = $arFilterFromForm["fid"];
    } else {
        $arFilter["@FORUM_ID"] = array_keys($arResult["FORUMS_ALL"]);
    }
    if ($arParams["mode"] == "lta") {
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:component.php

示例3: Fetch

 function Fetch()
 {
     global $DB;
     $arFields = array();
     if ($res = parent::Fetch()) {
         if (COption::GetOptionString("forum", "MESSAGE_HTML", "N") == "Y" || COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
             $res["POST_MESSAGE_HTML"] = trim($res["POST_MESSAGE_HTML"]);
             $res["POST_MESSAGE_FILTER"] = trim($res["POST_MESSAGE_FILTER"]);
             if (empty($res["POST_MESSAGE_HTML"]) && COption::GetOptionString("forum", "MESSAGE_HTML", "N") == "Y" || empty($res["POST_MESSAGE_FILTER"]) && COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
                 $arForum = CForumNew::GetByID($res["FORUM_ID"]);
                 if (COption::GetOptionString("forum", "FILTER", "Y") == "Y" && empty($res["POST_MESSAGE_FILTER"])) {
                     $arFields["POST_MESSAGE_FILTER"] = CFilterUnquotableWords::Filter($res["POST_MESSAGE"]);
                     $arFields["POST_MESSAGE_FILTER"] = empty($arFields["POST_MESSAGE_FILTER"]) ? "*" : $arFields["POST_MESSAGE_FILTER"];
                 }
                 if (COption::GetOptionString("forum", "MESSAGE_HTML", "N") == "Y" && empty($res["POST_MESSAGE_HTML"])) {
                     /* Info about one file is saved in old table field ATTACH_IMG */
                     $arFiles = false;
                     if (intval($res["ATTACH_IMG"]) > 0) {
                         $arFiles = array();
                         $db_files = CForumFiles::GetList(array("MESSAGE_ID" => "ASC"), array("MESSAGE_ID" => $res["ID"]));
                         if ($db_files && ($res_file = $db_files->Fetch())) {
                             do {
                                 $res_file["SRC"] = CFile::GetFileSRC($res);
                                 $arFiles[$res_file["ID"]] = $res_file;
                             } while ($res_file = $db_files->Fetch());
                         }
                     }
                     $parser = new forumTextParser(LANGUAGE_ID);
                     $allow = forumTextParser::GetFeatures($arForum);
                     $allow['SMILES'] = $res["USE_SMILES"] == "Y" ? $allow['SMILES'] : "N";
                     $POST_MESSAGE_HTML = is_set($arFields, "POST_MESSAGE_FILTER") ? $arFields["POST_MESSAGE_FILTER"] : $res["POST_MESSAGE"];
                     $arFields["POST_MESSAGE_HTML"] = $parser->convert($POST_MESSAGE_HTML, $allow, "html", $arFiles);
                 }
                 $strUpdate = $DB->PrepareUpdate("b_forum_message", $arFields);
                 $strSql = "UPDATE b_forum_message SET " . $strUpdate . " WHERE ID = " . intVal($res["ID"]);
                 if ($DB->QueryBind($strSql, $arFields, false, "File: " . __FILE__ . "<br>Line: " . __LINE__)) {
                     foreach ($arFields as $key => $val) {
                         $res[$key] = $val;
                     }
                 }
             }
         }
         if (COption::GetOptionString("forum", "FILTER", "Y") == "Y") {
             if (is_set($res, "HTML") || is_set($res, "FM_HTML")) {
                 $arr = @unserialize(is_set($res, "HTML") ? $res["HTML"] : $res["FM_HTML"]);
                 if (empty($arr) || !is_array($arr)) {
                     $arr = array("AUTHOR_NAME" => $res["AUTHOR_NAME"], "AUTHOR_EMAIL" => $res["AUTHOR_EMAIL"], "EDITOR_NAME" => $res["EDITOR_NAME"], "EDITOR_EMAIL" => $res["EDITOR_EMAIL"], "EDIT_REASON" => $res["EDIT_REASON"]);
                     foreach ($arr as $key => $val) {
                         if (!empty($val)) {
                             $val = CFilterUnquotableWords::Filter($val);
                             $arr[$key] = empty($val) ? "*" : $val;
                         } else {
                             $arr[$key] = '';
                         }
                     }
                     $arFields = array("HTML" => serialize($arr));
                     $strUpdate = $DB->PrepareUpdate("b_forum_message", $arFields);
                     $strSql = "UPDATE b_forum_message SET " . $strUpdate . " WHERE ID = " . intVal($res["ID"]);
                     $DB->QueryBind($strSql, $arFields, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
                 }
                 foreach ($arr as $key => $val) {
                     $res["~" . $key] = $res[$key];
                     $res["" . $key] = $val;
                 }
             }
             if (!empty($res["FT_HTML"])) {
                 $arr = @unserialize($res["FT_HTML"]);
                 if (is_array($arr) && !empty($arr["TITLE"])) {
                     foreach ($arr as $key => $val) {
                         $res["~FT_" . $key] = $res["FT_" . $key];
                         $res["FT_" . $key] = $val;
                     }
                 }
             }
             if (!empty($res["F_HTML"])) {
                 $arr = @unserialize($res["F_HTML"]);
                 if (is_array($arr)) {
                     foreach ($arr as $key => $val) {
                         $res["~F_" . $key] = $res["F_" . $key];
                         $res["F_" . $key] = $val;
                     }
                 }
                 if (!empty($res["FT_TITLE"])) {
                     $res["F_TITLE"] = $res["FT_TITLE"];
                 }
             }
         }
         if (!empty($this->sNameTemplate)) {
             $arTmp = array();
             foreach (array("AUTHOR_ID" => "AUTHOR_NAME", "EDITOR_ID" => "EDITOR_NAME", "USER_START_ID" => "USER_START_NAME") as $id => $name) {
                 if (array_key_exists($id, $res)) {
                     $tmp = "";
                     if (!empty($res[$id])) {
                         if (in_array($res[$id], $arTmp)) {
                             $tmp = $arTmp[$res[$id]];
                         } else {
                             $arTmp[$res[$id]] = $tmp = !empty($res[$name . "_FRMT"]) ? $res[$name . "_FRMT"] : CForumUser::GetFormattedNameByUserID($res[$id], $this->sNameTemplate, $id == "AUTHOR_ID" ? $res : array());
                         }
                     }
                     $res[$name] = !empty($tmp) ? $tmp : $res[$name];
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:message.php

示例4: Add

	function Add($arFields, $strUploadDir = false, $arParams = array())
	{
		global $DB;

		$strUploadDir = ($strUploadDir === false ? "forum/upload" : $strUploadDir);

		if (!CForumMessage::CheckFields("ADD", $arFields))
			return false;

		$arForum = CForumNew::GetByID($arFields["FORUM_ID"]);
		$arParams["SKIP_STATISTIC"] = ($arParams["SKIP_STATISTIC"] == "Y" ? "Y" : "N");
		$arParams["SKIP_INDEXING"] = ($arParams["SKIP_INDEXING"] == "Y" || $arForum["INDEXATION"] != "Y" ? "Y" : "N");

		$POST_MESSAGE = $arFields["POST_MESSAGE"];
		$parser = new forumTextParser(LANGUAGE_ID);
		$allow = forumTextParser::GetFeatures($arForum);
		$allow['SMILES'] = (($arFields["USE_SMILES"] != "Y") ? 'N' : $allow['SMILES']);
		if (COption::GetOptionString("forum", "FILTER", "Y") == "Y")
		{
			$POST_MESSAGE = CFilterUnquotableWords::Filter($POST_MESSAGE);
			$arFields["POST_MESSAGE_FILTER"] = (empty($POST_MESSAGE) ? "*" : $POST_MESSAGE);
		}
/***************** Attach ******************************************/
		$arFiles = array();
		if (is_array($arFields["ATTACH_IMG"]))
			$arFields["FILES"] = array($arFields["ATTACH_IMG"]);
		unset($arFields["ATTACH_IMG"]);
		if (is_array($arFields["FILES"]) && !empty($arFields["FILES"]))
		{
			$res = array("FORUM_ID" => $arFields["FORUM_ID"], "USER_ID" => $arFields["AUTHOR_ID"], "upload_dir" => $strUploadDir);
			$arFiles = CForumFiles::Save($arFields["FILES"], $res, false);
			if (!empty($arFiles))
			{
				$arFiles = array_keys($arFiles);
				sort($arFiles);
				$arFields["ATTACH_IMG"] = $arFiles[0];
				$arFields["ATTACHED_FILES"] = $arFiles;
			}
			unset($arFields["FILES"]);
		}
/***************** Attach/******************************************/
		if (COption::GetOptionString("forum", "MESSAGE_HTML", "N") == "Y")
			$POST_MESSAGE = $parser->convert($POST_MESSAGE, $allow, "html", $arFiles);
		$arFields["POST_MESSAGE_HTML"] = $POST_MESSAGE;
/***************** Event onBeforeMessageAdd ************************/
		foreach(GetModuleEvents("forum", "onBeforeMessageAdd", true) as $arEvent)
		{
			if (ExecuteModuleEventEx($arEvent, array(&$arFields, &$strUploadDir)) === false)
				return false;
		}
/***************** /Event ******************************************/
		if (empty($arFields))
			return false;
		$arInsert = $DB->PrepareInsert("b_forum_message", $arFields, $strUploadDir);

		$strDatePostField = "";
		$strDatePostValue = "";
		if (!is_set($arFields, "POST_DATE"))
		{
			$strDatePostField = ", POST_DATE";
			$strDatePostValue = ", ".$DB->GetNowFunction()."";
		}

		$strSql = "INSERT INTO b_forum_message(".$arInsert[0].$strDatePostField.") VALUES(".$arInsert[1].$strDatePostValue.")";
		$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		$ID = intVal($DB->LastID());
/***************** Attach ******************************************/
		if (!empty($arFiles))
			CForumFiles::UpdateByID($arFiles, array("FORUM_ID" => $arFields["FORUM_ID"],
				"TOPIC_ID" => $arFields["TOPIC_ID"], "MESSAGE_ID" => $ID));
/***************** Attach/******************************************/
/***************** Quota *******************************************/
		$_SESSION["SESS_RECOUNT_DB"] = "Y";

		$GLOBALS["USER_FIELD_MANAGER"]->Update("FORUM_MESSAGE", $ID, $arFields);
		if ($arParams["SKIP_STATISTIC"] == "Y" && $arParams["SKIP_INDEXING"] == "Y")
			return $ID;
		$arMessage = CForumMessage::GetByIDEx($ID, array("GET_FORUM_INFO" => "N", "GET_TOPIC_INFO" => "Y", "FILTER" => "Y"));

		if ($arParams["SKIP_STATISTIC"] != "Y")
		{
			if (intVal($arMessage["AUTHOR_ID"]) > 0)
			{
				CForumUser::SetStat($arMessage["AUTHOR_ID"], array("MESSAGE" => $arMessage));
			}
			CForumTopic::SetStat($arMessage["TOPIC_ID"],  array("MESSAGE" => $arMessage));
			CForumNew::SetStat($arMessage["FORUM_ID"],  array("MESSAGE" => $arMessage));
		}
/***************** Events onAfterMessageAdd ************************/
		foreach(GetModuleEvents("forum", "onAfterMessageAdd", true) as $arEvent)
			ExecuteModuleEventEx($arEvent, array(&$ID, $arMessage, $arMessage["TOPIC_INFO"], $arMessage["FORUM_INFO"], $arFields));
/***************** /Events *****************************************/
		if ($arMessage["APPROVED"] == "Y")
		{
			if ($arParams["SKIP_INDEXING"] != "Y" && CModule::IncludeModule("search"))
			{
				$arMessage["POST_MESSAGE"] = (COption::GetOptionString("forum", "FILTER", "Y") == "Y" ?
					$arMessage["POST_MESSAGE_FILTER"] : $arMessage["POST_MESSAGE"]);
				$arParams = array(
					"PERMISSION" => array(),
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:message.php

示例5: array

    return 0;
} else {
    $arFilter = !empty($arParams["FID_RANGE"]) ? array("@ID" => $arParams["FID_RANGE"]) : array();
    $arFilter["LID"] = SITE_ID;
    if (!CForumUser::IsAdmin()) {
        $arFilter["PERMS"] = array($USER->GetGroups(), 'A');
    }
    $arFilter["ACTIVE"] = "Y";
    $db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), $arFilter, false, 0, array("sNameTemplate" => $arParams["NAME_TEMPLATE"]));
    if ($db_res && ($res = $db_res->Fetch())) {
        do {
            foreach ($res as $key => $val) {
                $res["~" . $key] = $val;
                $res[$key] = htmlspecialcharsbx($val);
            }
            $res["ALLOW"] = forumTextParser::GetFeatures($res);
            $res["~FORUM_DESCRIPTION"] = $res["~DESCRIPTION"];
            $res["FORUM_DESCRIPTION"] = $res["DESCRIPTION"];
            $res["~FORUM_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $res["ID"]));
            $res["FORUM_LINK"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $res["ID"]));
            $res["~URL"] = "http://" . $arResult["SERVER_NAME"] . $res["~FORUM_LINK"];
            $res["URL"] = "http://" . htmlspecialcharsEx($arResult["SERVER_NAME"]) . $res["FORUM_LINK"];
            $arResult["FORUMS"][$res["ID"]] = $res;
        } while ($res = $db_res->Fetch());
    }
    if (empty($arResult["FORUMS"])) {
        ShowError(GetMessage("F_EMPTY_FORUMS"));
        CHTTP::SetStatus("404 Not Found");
        return false;
    } elseif ($arParams["MODE_DATA"] == "topic" && $arParams["TID"] <= 0) {
        ShowError(GetMessage("F_EMPTY_TOPIC_ID"));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例6: forumTextParser

if ($arParams["FORUM_ID"]) {
    $FORUM_TOPIC_ID = 0;
    if ($arParams["REPORT_ID"]) {
        $dbReport = CTimeManReportFull::GetByID($arParams["REPORT_ID"]);
        $arReport = $dbReport->Fetch();
        $FORUM_TOPIC_ID = $arReport["FORUM_TOPIC_ID"];
    } else {
        if ($arParams['ENTRY_ID']) {
            $dbRes = CTimeManEntry::GetByID($arParams['ENTRY_ID']);
            $arEntry = $dbRes->Fetch();
            $FORUM_TOPIC_ID = $arEntry["FORUM_TOPIC_ID"];
        }
    }
    if ($FORUM_TOPIC_ID > 0) {
        CModule::IncludeModule("forum");
        $parser = new forumTextParser(LANGUAGE_ID);
        $allow = forumTextParser::GetFeatures(CForumNew::GetByID($arParams["FORUM_ID"]));
        $db_res = CForumMessage::GetList(array("ID" => "ASC"), array("TOPIC_ID" => $FORUM_TOPIC_ID));
        while ($ar_res = $db_res->Fetch()) {
            $dbAuthor = CUser::GetByID($ar_res["AUTHOR_ID"]);
            $arAuthor = $dbAuthor->Fetch();
            $ar_res["AUTHOR_PHOTO"] = $arAuthor['PERSONAL_PHOTO'] > 0 ? CIntranetUtils::InitImage($arAuthor['PERSONAL_PHOTO'], 32, 0, BX_RESIZE_IMAGE_EXACT) : array();
            $ar_res["AUTHOR_URL"] = str_replace(array('#ID#', '#USER_ID#'), $ar_res["AUTHOR_ID"], $user_url);
            $ar_res["POST_MESSAGE_HTML"] = $parser->convert(COption::GetOptionString("forum", "FILTER", "Y") == "Y" ? $ar_res["POST_MESSAGE_FILTER"] : $ar_res["POST_MESSAGE"], $allow, "html");
            $arResult["COMMENTS"][] = $ar_res;
        }
    }
    $this->IncludeComponentTemplate();
}
// *****************************************************************************************
// *****************************************************************************************
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


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