$_forum
$_forum : array
Current forum data
Agora_Driver:: provides the functions to access both threads and individual messages.
Copyright 2003-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
replyMessage(mixed $message) : array
Returns a hash with all information necessary to reply to a message.
mixed | $message | The ID of the parent message to reply to, or arry of its data. |
A hash with all relevant information.
_forumSequence(integer $forum_id, string $type = 'message', integer|string $diff = '+')
Increments or decrements a forum's message count.
integer | $forum_id | Forum to update |
string | $type | What to increment message, thread or view. |
integer|string | $diff | Incremental or decremental step, either a positive or negative integer, or a plus or minus sign. |
getThreads(integer $thread_root, boolean $all_levels = false, string $sort_by = 'message_timestamp', integer $sort_dir, boolean $message_view = false, string $link_back = '', string $base_url = null, string $from = null, string $count = null, boolean $nofollow = false)
Returns a list of threads.
integer | $thread_root | Message at which to start the thread. If null get all forum threads |
boolean | $all_levels | Show all child levels or just one level. |
string | $sort_by | The column by which to sort. |
integer | $sort_dir | The direction by which to sort: 0 - ascending 1 - descending |
boolean | $message_view | |
string | $link_back | A url to pass to the reply script which will be returned to after an insertion of a post. Useful in cases when this thread view is used in blocks to return to the original page rather than to Agora. |
string | $base_url | An alternative URL where edit/delete links point to. Mainly for api usage. Takes "%p" as a placeholder for the parent message ID. |
string | $from | The thread to start listing at. |
string | $count | The number of threads to return. |
boolean | $nofollow | Whether to set the 'rel="nofollow"' attribute on linked URLs in the messages. |
getModerateList(string $sort_by, integer $sort_dir)
Fetches a list of messages awaiting moderation. Selects all messages, irrespective of the thread root, which have the 'moderate' flag set in the attributes.
string | $sort_by | The column by which to sort. |
integer | $sort_dir | The direction by which to sort: 0 - ascending 1 - descending |
getThreadsUi(array $threads, array $col_headers, boolean $bodies = false, string $template_file = false) : string
Returns a table showing the specified message list.
array | $threads | A hash with the thread messages as returned by {@link Agora_Driver::getThreads}. |
array | $col_headers | A hash with the column headers. |
boolean | $bodies | Display the message bodies? |
string | $template_file | Template to use. |
The rendered message table.
getForums(integer $root_forum, boolean $formatted = true, string $sort_by = 'forum_name', integer $sort_dir, boolean $add_scope = false, string $from, string $count) : mixed
Fetches a list of forums.
integer | $root_forum | The first level forum. |
boolean | $formatted | Whether to return the list formatted or raw. |
string | $sort_by | The column to sort by. |
integer | $sort_dir | Sort direction, 0 = ascending, 1 = descending. |
boolean | $add_scope | Add parent forum if forum for another scopelication. |
string | $from | The forum to start listing at. |
string | $count | The number of forums to return. |
An array of forums or PEAR_Error on failure.
saveForum(array $info) : integer
Saves a forum, either creating one if no forum ID is given or updating an existing one.
array | $info | The forum information to save consisting of: forum_id forum_author forum_parent_id forum_name forum_moderated forum_description forum_attachments |
The forum ID on success.
search(array $filter, string $sort_by = 'message_subject', integer $sort_dir, string $from, string $count) : array
Searches forums for matching threads or posts.
array | $filter | Hash of filter criteria: 'forums' => Array of forum IDs to search. If not present, searches all forums. 'keywords' => Array of keywords to search for. If not present, finds all posts/threads. 'allkeywords' => Boolean specifying whether to find all keywords; otherwise, wants any keyword. False if not supplied. 'message_author' => Name of author to find posts by. If not present, any author. 'searchsubjects' => Boolean specifying whether to search subjects. True if not supplied. 'searchcontents' => Boolean specifying whether to search post contents. False if not supplied. |
string | $sort_by | The column by which to sort. |
integer | $sort_dir | The direction by which to sort: 0 - ascending 1 - descending |
string | $from | The thread to start listing at. |
string | $count | The number of threads to return. |
A search result hash where: 'results' => Array of messages. 'total => Total message number.
hasPermission(integer $perm = \Horde_Perms::READ, integer $forum_id = null, string $scope = null) : boolean
Finds out if the user has the specified rights to the messages forum.
integer | $perm | The permission level needed for access. |
integer | $forum_id | Forum to check permissions for. |
string | $scope | Application scope to use. |
True if the user has the specified permissions.
_formatThreads(array|\Traversable $messages, string $sort_by = 'message_modifystamp', boolean $format = false, integer $thread_root)
Formats a message body.
array|\Traversable | $messages | Messages to format |
string | $sort_by | List format order |
boolean | $format | Format messages body |
integer | $thread_root | Thread root |
_getForums(integer $root_forum, boolean $formatted = true, string $sort_by = 'forum_name', integer $sort_dir, boolean $add_scope = false, string $from, string $count) : mixed
Fetches a list of forums.
integer | $root_forum | The first level forum. |
boolean | $formatted | Whether to return the list formatted or raw. |
string | $sort_by | The column to sort by. |
integer | $sort_dir | Sort direction, 0 = ascending, 1 = descending. |
boolean | $add_scope | Add parent forum if forum for another scopelication. |
string | $from | The forum to start listing at. |
string | $count | The number of forums to return. |
An array of forums or PEAR_Error on failure.
_lastInForum(integer $forum_id, integer $message_id, string $message_author = '', integer $message_timestamp)
Update lastMessage in a Forum
integer | $forum_id | Forum to update |
integer | $message_id | Last message id |
string | $message_author | Last message author |
integer | $message_timestamp | Last message timestamp |
_lastInThread(integer $thread_id, integer $message_id, string $message_author = '', integer $message_timestamp)
Update lastMessage in Thread
integer | $thread_id | Thread to update |
integer | $message_id | Last message id |
string | $message_author | Last message author |
integer | $message_timestamp | Last message timestamp |