Property | Type | Description | |
---|---|---|---|
$_forum | array | Current forum data | |
$_forum_id | string | Current forum ID |
Property | Type | Description | |
---|---|---|---|
$_cache | Horde_Cache | Cache object | |
$_charset | string | Charset | |
$_db | Horde_Db_Adapter | The database connection object. | |
$_forums_table | string | Scope theads table name | |
$_scope | string | The forums scope. | |
$_threads_table | string | Scope theads table name |
Method | Description | |
---|---|---|
__construct ( $scope, $params ) | Constructor | |
_forumSequence ( integer $forum_id, string $type = 'message', integer | string $diff = '+' ) | Increments or decrements a forum's message count. | |
allowAttachments ( ) : boolean | Checks if attachments are allowed in messages for the current forum. | |
convertFromDriver ( mixed $value ) : mixed | Converts a value from the driver's charset to the default charset. | |
convertToDriver ( mixed $value ) : mixed | Converts a value from the default charset to the driver's charset. | |
countForums ( ) | Returns the number of forums. | |
countMessages ( ) : integer | Returns the number of all messages (threads and replies) in a forum | |
countThreads ( integer $thread_root ) : integer | Returns the number of replies on a thread, or threads in a forum | |
dateFormat ( integer $timestamp ) : string | Formats time according to user preferences. | |
deleteForum ( integer $forum_id ) : boolean | Deletes a forum, any subforums that are present and all messages contained in the forum and subforums. | |
deleteMessage ( integer $message_id ) : string | Deletes a message and all replies. | |
deleteThread ( integer $thread_id ) | Deletes an entire message thread. | |
formatBody ( string $body ) | Formats a message body. | |
formatSize ( integer $filesize ) : string | Formats file size. | |
getAttachmentLink ( $message_id ) | Constructs message attachments link. | |
getBanned ( ) | Get banned users from the current forum | |
getBareForums ( ) : array | Get forums ids and titles | |
getForm ( $vars, $title, $editing = false, $new_forum = false ) | ||
getForum ( integer $forum_id ) : array | Fetches a forum data. | |
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. | |
getMessage ( integer $message_id ) | Fetches a message. | |
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. | |
getThreadActions ( ) | ||
getThreadRoot ( $message_id ) | ||
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. | |
getThreadsUi ( array $threads, array $col_headers, boolean $bodies = false, string $template_file = false ) : string | Returns a table showing the specified message list. | |
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. | |
isHot ( $views, $last_post ) | Returns true if the message is hot. | |
isNew ( $thread_id, $last_post ) | Returns true, has new posts since user last visit | |
isThreadLocked ( $message_id ) : boolean | ||
logView ( $thread_id ) : boolean | Logs a message view. | |
mergeThread ( $thread_from, integer $message_id ) | Merges two threads. | |
moderate ( string $action, array $ids ) | Approves one or more ids. | |
moveThread ( integer $thread_id, integer $forum_id ) | Moves a thread to another forum. | |
newForum ( string $forum_name, $owner ) : integer | Creates a new forum. | |
replyMessage ( mixed $message ) : array | Returns a hash with all information necessary to reply to a message. | |
saveForum ( array $info ) : integer | Saves a forum, either creating one if no forum ID is given or updating an existing one. | |
saveMessage ( array $info ) : mixed | Saves the message. | |
search ( array $filter, string $sort_by = 'message_subject', integer $sort_dir, string $from, string $count ) : array | Searches forums for matching threads or posts. | |
setThreadLock ( $message_id, $lock ) | ||
splitThread ( integer $message_id ) | Splits a thread on message id. | |
updateBan ( string $user, integer $forum_id = null, string $action = 'add' ) | Ban user on a specific forum. | |
updateModerator ( string $moderator, integer $forum_id = null, string $action = 'add' ) | Updates forum moderators. |
Method | Description | |
---|---|---|
_formatForums ( integer $forums ) : array | Traversable | Fetches a list of forums. | |
_formatThreads ( array | Traversable $messages, string $sort_by = 'message_modifystamp', boolean $format = false, integer $thread_root ) | Formats a message body. | |
_getCache ( $key, $thread ) | Get cache value | |
_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. | |
_setCache ( $key, $value, $thread ) | Set cache value |
Method | Description | |
---|---|---|
_getCacheKey ( $key, $thread ) | Append namespace to cache key | |
_lastInForum ( integer $forum_id, integer $message_id, string $message_author = '', integer $message_timestamp ) | Update lastMessage in a Forum | |
_lastInThread ( integer $thread_id, integer $message_id, string $message_author = '', integer $message_timestamp ) | Update lastMessage in Thread | |
_sequence ( integer $thread_id, integer | string $diff = '+' ) | Increments or decrements a thread's message count. | |
_updateCacheState ( $thread ) | Increment namespace |
protected _formatForums ( integer $forums ) : array | Traversable | ||
$forums | integer | Forums to format |
return | array | Traversable | An array of forums. |
protected _formatThreads ( array | Traversable $messages, string $sort_by = 'message_modifystamp', boolean $format = false, integer $thread_root ) | ||
$messages | array | Traversable | Messages to format |
$sort_by | string | List format order |
$format | boolean | Format messages body |
$thread_root | integer | Thread root |
public _forumSequence ( integer $forum_id, string $type = 'message', integer | string $diff = '+' ) | ||
$forum_id | integer | Forum to update |
$type | string | What to increment message, thread or view. |
$diff | integer | string | Incremental or decremental step, either a positive or negative integer, or a plus or minus sign. |
protected _getForums ( integer $root_forum, boolean $formatted = true, string $sort_by = 'forum_name', integer $sort_dir, boolean $add_scope = false, string $from, string $count ) : mixed | ||
$root_forum | integer | The first level forum. |
$formatted | boolean | Whether to return the list formatted or raw. |
$sort_by | string | The column to sort by. |
$sort_dir | integer | Sort direction, 0 = ascending, 1 = descending. |
$add_scope | boolean | Add parent forum if forum for another scopelication. |
$from | string | The forum to start listing at. |
$count | string | The number of forums to return. |
return | mixed | An array of forums or PEAR_Error on failure. |
public allowAttachments ( ) : boolean | ||
return | boolean | Whether attachments allowed or not. |
public convertFromDriver ( mixed $value ) : mixed | ||
$value | mixed | A value to convert. |
return | mixed | The converted value. |
public convertToDriver ( mixed $value ) : mixed | ||
$value | mixed | A value to convert. |
return | mixed | The converted value. |
public countMessages ( ) : integer | ||
return | integer | The number of messages in forum or PEAR_Error on failure. |
public countThreads ( integer $thread_root ) : integer | ||
$thread_root | integer | Thread to count. |
return | integer | The number of messages in thread or PEAR_Error on failure. |
public dateFormat ( integer $timestamp ) : string | ||
$timestamp | integer | Message timestamp. |
return | string | Formatted date. |
public deleteForum ( integer $forum_id ) : boolean | ||
$forum_id | integer | The ID of the forum to delete. |
return | boolean | True on success. |
public deleteMessage ( integer $message_id ) : string | ||
$message_id | integer | The ID of the message to delete. |
return | string | Thread ID on success. |
public deleteThread ( integer $thread_id ) | ||
$thread_id | integer | The ID of the thread to delete. If not specified will delete all the threads for the current forum. |
public formatBody ( string $body ) | ||
$body | string | Text to format. |
public formatSize ( integer $filesize ) : string | ||
$filesize | integer | |
return | string | Formatted filesize. |
public getAttachmentLink ( $message_id ) |
public getBareForums ( ) : array | ||
return | array | An array of forums and form names. |
public getForums ( integer $root_forum, boolean $formatted = true, string $sort_by = 'forum_name', integer $sort_dir, boolean $add_scope = false, string $from, string $count ) : mixed | ||
$root_forum | integer | The first level forum. |
$formatted | boolean | Whether to return the list formatted or raw. |
$sort_by | string | The column to sort by. |
$sort_dir | integer | Sort direction, 0 = ascending, 1 = descending. |
$add_scope | boolean | Add parent forum if forum for another scopelication. |
$from | string | The forum to start listing at. |
$count | string | The number of forums to return. |
return | mixed | An array of forums or PEAR_Error on failure. |
public getMessage ( integer $message_id ) | ||
$message_id | integer | The ID of the message to fetch. |
public getModerateList ( string $sort_by, integer $sort_dir ) | ||
$sort_by | string | The column by which to sort. |
$sort_dir | integer | The direction by which to sort: 0 - ascending 1 - descending |
public 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 ) | ||
$thread_root | integer | Message at which to start the thread. If null get all forum threads |
$all_levels | boolean | Show all child levels or just one level. |
$sort_by | string | The column by which to sort. |
$sort_dir | integer | The direction by which to sort: 0 - ascending 1 - descending |
$message_view | boolean | |
$link_back | string | 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. |
$base_url | string | An alternative URL where edit/delete links point to. Mainly for api usage. Takes "%p" as a placeholder for the parent message ID. |
$from | string | The thread to start listing at. |
$count | string | The number of threads to return. |
$nofollow | boolean | Whether to set the 'rel="nofollow"' attribute on linked URLs in the messages. |
public getThreadsUi ( array $threads, array $col_headers, boolean $bodies = false, string $template_file = false ) : string | ||
$threads | array | A hash with the thread messages as returned by {@link Agora_Driver::getThreads}. |
$col_headers | array | A hash with the column headers. |
$bodies | boolean | Display the message bodies? |
$template_file | string | Template to use. |
return | string | The rendered message table. |
public hasPermission ( integer $perm = Horde_Perms::READ, integer $forum_id = null, string $scope = null ) : boolean | ||
$perm | integer | The permission level needed for access. |
$forum_id | integer | Forum to check permissions for. |
$scope | string | Application scope to use. |
return | boolean | True if the user has the specified permissions. |
public isNew ( $thread_id, $last_post ) |
public mergeThread ( $thread_from, integer $message_id ) | ||
$message_id | integer | The ID of the message to merge to. |
public moveThread ( integer $thread_id, integer $forum_id ) | ||
$thread_id | integer | The ID of the thread to move. |
$forum_id | integer | The ID of the destination forum. |
public replyMessage ( mixed $message ) : array | ||
$message | mixed | The ID of the parent message to reply to, or arry of its data. |
return | array | A hash with all relevant information. |
public saveMessage ( array $info ) : mixed | ||
$info | array | Array containing all the message data to save. |
return | mixed | Message ID on success or PEAR_Error on failure. |
public search ( array $filter, string $sort_by = 'message_subject', integer $sort_dir, string $from, string $count ) : array | ||
$filter | array | 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. |
$sort_by | string | The column by which to sort. |
$sort_dir | integer | The direction by which to sort: 0 - ascending 1 - descending |
$from | string | The thread to start listing at. |
$count | string | The number of threads to return. |
return | array | A search result hash where: 'results' => Array of messages. 'total => Total message number. |
public splitThread ( integer $message_id ) | ||
$message_id | integer | The ID of the message to split at. |
protected Horde_Db_Adapter $_db | ||
return | Horde_Db_Adapter |
protected string $_forums_table | ||
return | string |
protected string $_threads_table | ||
return | string |