Bitrix Site Manager

CForumMessage::GetMessagePage

int
GetMessagePage(
 int ID,
 int mess_per_page,
 array arUserGroups
);

The method GetMessagePage returns a page containing a specified message of a user who is a member of the specified groups. The page returned is set up for pagewise navigation given the maximum number of messages per page.

Parameters

ParameterDescription
ID The message ID.
mess_per_page Number of messages per page. Usually equals to the variable $FORUM_MESSAGES_PER_PAGE defined in the Forum module. This variable is initialized within the Forum module settings.
arUserGroups Array of groups whose member this user is. Array of groups of the current user is returned by $USER->GetUserGroupArray().

Return Values

Number of page on which the message will be shown. If the message can not be found, the method returns false.

See Also

  • CDBResult::NavStart

    Example


    
    <?
    if ($MID>0)
      $db_Message->NavStart($FORUM_MESSAGES_PER_PAGE, 
                            true, 
                            CForumMessage::GetMessagePage($MID, 
                                                          $FORUM_MESSAGES_PER_PAGE,
                                                          $USER->GetUserGroupArray()));
    else
      $db_Message->NavStart($FORUM_MESSAGES_PER_PAGE);
    ?>