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


PHP CForumMessage::GetMessagePage方法代码示例

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


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

示例1: intVal

			"bDescPageNumbering" => false,
			"nPageSize" => $arParams["MESSAGES_PER_PAGE"],
			"bShowAll" => false,
			"sNameTemplate" => $arParams["NAME_TEMPLATE"]);
		$MID = intVal($_REQUEST["MID"]);
		unset($_GET["MID"]); unset($GLOBALS["MID"]);
		if (isset($arResult['RESULT']) && intval($arResult['RESULT']) > 0)
			$MID = $arResult['RESULT'];
		if (intVal($MID) > 0)
		{
			$page_number = CForumMessage::GetMessagePage(
				$MID,
				$arParams["MESSAGES_PER_PAGE"],
				$USER->GetUserGroupArray(),
				$arResult["FORUM_TOPIC_ID"],
				array(
					"ORDER_DIRECTION" => ($arParams["PREORDER"] == "N" ? "DESC" : "ASC"),
					"PERMISSION_EXTERNAL" => $arResult["USER"]["PERMISSION"],
					"FILTER" => array("!PARAM1" => "IB")
				)
			);
			if ($page_number > 0)
				$arFields["iNumPage"] = intVal($page_number);
		}

		$arFilter = array("FORUM_ID"=>$arParams["FORUM_ID"], "TOPIC_ID"=>$arResult["FORUM_TOPIC_ID"], "!PARAM1" => "IB");
		if ($arResult["USER"]["RIGHTS"]["MODERATE"] != "Y")
			$arFilter["APPROVED"] = "Y";
		$db_res = CForumMessage::GetListEx($arOrder, $arFilter, false, 0, $arFields);
		$db_res->NavStart($arParams["MESSAGES_PER_PAGE"], false, ($arFields["iNumPage"] > 0 ? $arFields["iNumPage"] : false));
		$arResult["NAV_RESULT"] = $db_res;
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:component.php

示例2: CAdminException

    if (isset($arNote['title'])) {
        $arResult['OK_MESSAGE'] = $arNote['title'];
    } else {
        $e = new CAdminException($arNote);
        $arResult["OK_MESSAGE"] = $e->GetString();
    }
}
/********************************************************************
				Data
********************************************************************/
/************** Message list ***************************************/
$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = $arResult["TOPIC"]["ABS_LAST_MESSAGE_ID"];
// Number current page
$iNumPage = 0;
if ($arParams["MID"] > 0) {
    $iNumPage = CForumMessage::GetMessagePage($arParams["MID"], $arParams["MESSAGES_PER_PAGE"], $USER->GetUserGroupArray(), $arParams["TID"], array("PERMISSION_EXTERNAL" => $arParams["PERMISSION"]));
}
$arFilter = array("TOPIC_ID" => $arParams["TID"]);
if ($arParams["MODE"] != "GROUP") {
    $arFilter["FORUM_ID"] = $arParams["FID"];
}
if ($arResult["USER"]["RIGHTS"]["MODERATE"] != "Y") {
    $arFilter["APPROVED"] = "Y";
}
if ($USER->IsAuthorized()) {
    $arFilter["POINTS_TO_AUTHOR_ID"] = $USER->GetID();
}
// Pagen
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
$db_res = CForumMessage::GetListEx(array("ID" => "ASC"), $arFilter, false, false, array("bDescPageNumbering" => false, "nPageSize" => $arParams["MESSAGES_PER_PAGE"], "bShowAll" => $arParams["PAGE_NAVIGATION_SHOW_ALL"] == "Y", "iNumPage" => $iNumPage > 0 ? $iNumPage : false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));
$db_res->NavStart($arParams["MESSAGES_PER_PAGE"], false, $iNumPage > 0 ? $iNumPage : false);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例3: intVal

    $pager_number = $GLOBALS["NavNum"] + 1;
    $arResult["UNREAD_MID"] = intVal(ForumGetFirstUnreadMessage($arParams["FORUM_ID"], $arResult["FORUM_TOPIC_ID"]));
    $MID = intVal($_REQUEST["MID"]);
    unset($_GET["MID"]);
    unset($GLOBALS["MID"]);
    if (isset($arResult['RESULT']) && intval($arResult['RESULT']) > 0) {
        $MID = $arResult['RESULT'];
        if ($arResult["UNREAD_MID"] == $MID) {
            $arResult["UNREAD_MID"]++;
        }
    } elseif ($arResult["UNREAD_MID"] > 0 && ($MID > 0 && $MID > $arResult["UNREAD_MID"] || $MID <= 0)) {
        $MID = $arResult["UNREAD_MID"];
    }
    ForumSetReadTopic($arParams["FORUM_ID"], $arResult["FORUM_TOPIC_ID"]);
    if (intVal($MID) > 0) {
        $pageNo = CForumMessage::GetMessagePage($MID, $arParams["MESSAGES_PER_PAGE"], $GLOBALS["USER"]->GetUserGroupArray(), $arResult["FORUM_TOPIC_ID"], array("ORDER_DIRECTION" => $arParams["PREORDER"] == "N" ? "DESC" : "ASC", "PERMISSION_EXTERNAL" => $arResult["USER"]["PERMISSION"], "FILTER" => array("!PARAM1" => $arParams['ENTITY_TYPE'])));
        $bShowAll = $pageNo > 1;
        $arResult['MID'] = $MID;
    } else {
        $pageNo = $_GET["PAGEN_" . $pager_number];
        if (isset($arResult['RESULT']) && intval($arResult['RESULT']) > 0) {
            $pageNo = $arResult['RESULT'];
        }
    }
    if ($pageNo > 200) {
        $pageNo = 0;
    }
}
$ar_cache_id = array($arParams["FORUM_ID"], $arParams["ENTITY_XML_ID"], $arResult["FORUM_TOPIC_ID"], $arResult["USER"]["RIGHTS"], $arResult["USER"]["PERMISSION"], $arResult["PANELS"], $arParams['SHOW_RATING'], $arParams["MESSAGES_PER_PAGE"], $arParams["DATE_TIME_FORMAT"], $arParams["PREORDER"], $pageNo);
$cache_id = "forum_comment_" . serialize($ar_cache_id);
ob_start();
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例4: __deprecated_Add


//.........这里部分代码省略.........
         if ($componentName !== null) {
             ForumClearComponentCache($componentName);
         }
         // NOTIFICATION
         $arTask["ACCOMPLICES"] = $arTask["AUDITORS"] = array();
         $rsMembers = CTaskMembers::GetList(array(), array("TASK_ID" => $arTask["ID"]));
         while ($arMember = $rsMembers->Fetch()) {
             if ($arMember["TYPE"] == "A") {
                 $arTask["ACCOMPLICES"][] = $arMember["USER_ID"];
             } elseif ($arMember["TYPE"] == "U") {
                 $arTask["AUDITORS"][] = $arMember["USER_ID"];
             }
         }
         $arEmailUserIDs = array($arTask["RESPONSIBLE_ID"], $arTask["CREATED_BY"]);
         $arEmailUserIDs = array_unique(array_merge($arEmailUserIDs, $arTask["ACCOMPLICES"], $arTask["AUDITORS"]));
         $currentUserPos = array_search($givenUserId, $arEmailUserIDs);
         if ($currentUserPos !== false) {
             unset($arEmailUserIDs[$currentUserPos]);
         }
         $parser = new CTextParser();
         $parser->imageWidth = $imageWidth;
         $parser->imageHeight = $imageHeight;
         $parser->smiles = $arSmiles;
         $parser->allow = array("HTML" => $arForum["ALLOW_HTML"], "ANCHOR" => $arForum["ALLOW_ANCHOR"], "BIU" => $arForum["ALLOW_BIU"], "IMG" => "N", "VIDEO" => "N", "LIST" => $arForum["ALLOW_LIST"], "QUOTE" => $arForum["ALLOW_QUOTE"], "CODE" => $arForum["ALLOW_CODE"], "FONT" => $arForum["ALLOW_FONT"], "SMILES" => "N", "UPLOAD" => $arForum["ALLOW_UPLOAD"], "NL2BR" => $arForum["ALLOW_NL2BR"], "TABLE" => "Y");
         $arAllow = NULL;
         $MESSAGE = HTMLToTxt($parser->convertText($commentText, $arAllow));
         // remove [ url] for socialnetwork log
         $MESSAGE = preg_replace("/(\\s\\[\\s(http:\\/\\/|https:\\/\\/|ftp:\\/\\/))(.*?)(\\s\\])/is", "", $MESSAGE);
         $parser->allow = array("HTML" => 'Y', "ANCHOR" => 'Y', "BIU" => 'Y', "IMG" => "Y", "VIDEO" => "Y", "LIST" => 'N', "QUOTE" => 'Y', "CODE" => 'Y', "FONT" => 'Y', "SMILES" => "N", "UPLOAD" => 'N', "NL2BR" => 'N', "TABLE" => "Y");
         $message_notify = $parser->convertText($commentText);
         $arRecipientsIDs = CTaskNotifications::GetRecipientsIDs($arTask);
         // Instant Messages
         if (IsModuleInstalled("im") && CModule::IncludeModule("im") && sizeof($arRecipientsIDs)) {
             $pageNumber = CForumMessage::GetMessagePage($MID, $messagesPerPage, $arUserGroupArray);
             // There are different links for extranet users
             $isExtranetEnabled = false;
             if (CModule::IncludeModule("extranet")) {
                 $isExtranetEnabled = true;
             }
             if ($isExtranetEnabled) {
                 $arSites = array();
                 $dbSite = CSite::GetList($by = "sort", $order = "desc", array("ACTIVE" => "Y"));
                 while ($arSite = $dbSite->Fetch()) {
                     if (strlen(trim($arSite["DIR"])) > 0) {
                         $arSites[$arSite['ID']]['DIR'] = $arSite['DIR'];
                     } else {
                         $arSites[$arSite['ID']]['DIR'] = '/';
                     }
                     if (strlen(trim($arSite["SERVER_NAME"])) > 0) {
                         $arSites[$arSite['ID']]['SERVER_NAME'] = $arSite["SERVER_NAME"];
                     } else {
                         $arSites[$arSite['ID']]['SERVER_NAME'] = COption::GetOptionString("main", "server_name", $_SERVER["HTTP_HOST"]);
                     }
                     $arSites[$arSite['ID']]['urlPrefix'] = $arSites[$arSite['ID']]['SERVER_NAME'] . $arSites[$arSite['ID']]['DIR'];
                     // remove last '/'
                     if (strlen($arSites[$arSite['ID']]['urlPrefix']) > 0 && substr($arSites[$arSite['ID']]['urlPrefix'], -1) === '/') {
                         $arSites[$arSite['ID']]['urlPrefix'] = substr($arSites[$arSite['ID']]['urlPrefix'], 0, -1);
                     }
                 }
                 $extranet_site_id = CExtranet::GetExtranetSiteID();
                 $intranet_site_id = CSite::GetDefSite();
                 $arIntranetUsers = CExtranet::GetIntranetUsers();
             } else {
                 if ($arTask["GROUP_ID"]) {
                     $pathTemplateWoExtranet = str_replace("#group_id#", $arTask["GROUP_ID"], COption::GetOptionString("tasks", "paths_task_group_entry", "/workgroups/group/#group_id#/tasks/task/view/#task_id#/", $arFields["SITE_ID"]));
                 } else {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:67,代码来源:taskcomments.php

示例5: array

// LAST MESSAGE
$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = 0;
if ($arResult["USER"]["RIGHTS"]["EDIT"] != "Y" && $USER->IsAuthorized() && COption::GetOptionString("forum", "USER_EDIT_OWN_POST", "N") != "Y"):
	if ($arResult["FORUM"]["MODERATION"] == "Y"):
		$db_res = CForumMessage::GetList(array("ID" => "DESC"), array("TOPIC_ID" => $arParams["TID"], "APPROVED" => "N",
			">ID" => $arResult["TOPIC"]["LAST_MESSAGE_ID"]), false, 1);
		if ($db_res && $res = $db_res->Fetch()):
			$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = intVal($res["ID"]);
		endif;
	endif;
	if ($arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] <= 0):
		$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = $arResult["TOPIC"]["LAST_MESSAGE_ID"];
	endif;
endif;
// NUMBER CURRENT PAGE
$iNumPage = ($arParams["MID"] > 0 ? CForumMessage::GetMessagePage($arParams["MID"], $arParams["MESSAGES_PER_PAGE"], $arUserGroups, $arParams["TID"]) : 0);
// Create filter and additional fields for message select
$arFilter = array("TOPIC_ID" => $arParams["TID"]);
if ($arResult["USER"]["RIGHTS"]["MODERATE"] != "Y") {$arFilter["APPROVED"] = "Y";}
if ($USER->IsAuthorized()) {$arFilter["POINTS_TO_AUTHOR_ID"] = $USER->GetID();}
/*******************************************************************/
CPageOption::SetOptionString("main", "nav_page_in_session", "N");
$db_res = CForumMessage::GetListEx(array("ID"=>"ASC"), $arFilter, false, false,
	array(
		"bDescPageNumbering" => false,
		"nPageSize" => $arParams["MESSAGES_PER_PAGE"],
		"bShowAll" => ($arParams["PAGE_NAVIGATION_SHOW_ALL"] == "Y"),
		"iNumPage" => ($iNumPage > 0 ? $iNumPage : false),
		"sNameTemplate" => $arParams["NAME_TEMPLATE"]));
$db_res->NavStart($arParams["MESSAGES_PER_PAGE"], false, ($iNumPage > 0 ? $iNumPage : false));
$db_res->nPageWindow = $arParams["PAGE_NAVIGATION_WINDOW"];
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php

示例6: array

    $arTopic["iLAST_TOPIC_MESSAGE"] = $tmp;
    $arFilter = array("TOPIC_ID" => $TID);
    if ($PermissionUser < "Q") {
        $arFilter["APPROVED"] = "Y";
    }
    if ($USER->IsAuthorized()) {
        $arFilter["POINTS_TO_AUTHOR_ID"] = $USER->GetID();
    }
    $db_Message = CForumMessage::GetListEx(array("ID" => "ASC"), $arFilter);
    global $HTTP_GET_VARS;
    unset($_GET["MID"]);
    unset($HTTP_GET_VARS["MID"]);
    unset($_GET["ACTION"]);
    unset($HTTP_GET_VARS["ACTION"]);
    if ($MID > 0) {
        $db_Message->NavStart($GLOBALS["FORUM_MESSAGES_PER_PAGE"], false, CForumMessage::GetMessagePage($MID, $GLOBALS["FORUM_MESSAGES_PER_PAGE"], $USER->GetUserGroupArray()));
    } else {
        $db_Message->NavStart($GLOBALS["FORUM_MESSAGES_PER_PAGE"], false);
    }
    $UserInfo = array();
    $arCurrUser = array();
    $arCurrUser["Rank"] = CForumUser::GetUserRank(IntVal($USER->GetParam("USER_ID")));
    $arCurrUser["bCanUserDeleteMessages"] = CForumTopic::CanUserDeleteTopicMessage($TID, $USER->GetUserGroupArray(), $USER->GetID());
    $arCurrUser["Perms"] = ForumCurrUserPermissions($FID);
    $parser = new textParser(LANGUAGE_ID);
    $arAllow = array("HTML" => $arForum["ALLOW_HTML"], "ANCHOR" => $arForum["ALLOW_ANCHOR"], "BIU" => $arForum["ALLOW_BIU"], "IMG" => $arForum["ALLOW_IMG"], "LIST" => $arForum["ALLOW_LIST"], "QUOTE" => $arForum["ALLOW_QUOTE"], "CODE" => $arForum["ALLOW_CODE"], "FONT" => $arForum["ALLOW_FONT"], "SMILES" => $arForum["ALLOW_SMILES"], "UPLOAD" => $arForum["ALLOW_UPLOAD"], "NL2BR" => $arForum["ALLOW_NL2BR"]);
    ?>
	<table width="100%" border="0">
		<tr>
			<td align="left"><?php 
    echo $db_Message->NavPrint(GetMessage("FR_MESS"));
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: strtoupper

    $ORDER_DIRECTION = strtoupper($arResult['FORUM']['ORDER_DIRECTION']);
} elseif ($arParams['PREORDER'] === 'N') {
    $ORDER_DIRECTION = 'DESC';
}
if (!in_array($ORDER_DIRECTION, array('ASC', 'DESC'), true)) {
    $ORDER_DIRECTION = 'ASC';
}
$arResult['ORDER_DIRECTION'] = $ORDER_DIRECTION;
$pageNo = 0;
if ($arResult["FORUM_TOPIC_ID"] > 0) {
    $page_number = $GLOBALS["NavNum"] + 1;
    $MID = intVal($_REQUEST["MID"]);
    unset($_GET["MID"]);
    unset($GLOBALS["MID"]);
    if (intVal($MID) > 0) {
        $pageNo = CForumMessage::GetMessagePage($MID, $arParams["MESSAGES_PER_PAGE"], $GLOBALS["USER"]->GetUserGroupArray(), $arResult["FORUM_TOPIC_ID"], array("ORDER_DIRECTION" => $ORDER_DIRECTION, "PERMISSION_EXTERNAL" => $arResult["USER"]["PERMISSION"], "FILTER" => array("!PARAM1" => "IB")));
    } else {
        $pageNo = $_GET["PAGEN_" . $page_number];
        if (isset($arResult['RESULT']) && intval($arResult['RESULT']) > 0) {
            $pageNo = $arResult['RESULT'];
        }
    }
    if ($pageNo > 200) {
        $pageNo = 0;
    }
    $arMessages = array();
    $ar_cache_id = array($arParams["FORUM_ID"], $arParams["TASK_ID"], $arResult["FORUM_TOPIC_ID"], $arParams["MESSAGES_PER_PAGE"], $arParams["DATE_TIME_FORMAT"], $ORDER_DIRECTION, $pageNo, $arResult['FORUM']['LAST_POST_DATE'] . $arResult['FORUM']['ABS_LAST_POST_DATE'], $arResult['TASK']['COMMENTS_COUNT']);
    if ($_GET["IFRAME"] == "Y") {
        $ar_cache_id[] = "IFRAME";
    }
    $cache_id = "forum_message_" . sha1(serialize($ar_cache_id));
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


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