|
static | br2space ($text) |
|
static | killEdit ($description) |
|
static | appendEdit ($description) |
|
static | parseEdit ($description, $anonymous=false) |
|
static | getContentAsHtml ($description, $anonymous=false) |
|
static | getEditComment ($description, $anonymous=false) |
|
static | getEditInfo ($description) |
|
static | removeQuotes ($description) |
|
static | killFormat ($text) |
|
static | getConstraints ($topic_id) |
|
static | getParentTopicId ($topic_id) |
|
static | getChildTopicIds ($topic_id) |
|
static | getPostingPage ($topic_id, $constraint=null) |
|
static | getLastUnread ($parent_id) |
|
static | getLatestPosting ($parent_id) |
|
static | getPathToPosting ($topic_id) |
|
static | getFlatPathToPosting ($topic_id) |
|
static | parseEntries ($postings) |
|
static | getEntries ($parent_id, $with_childs=false, $add='', $sort_order='DESC', $start=0, $limit=ForumEntry::POSTINGS_PER_PAGE) |
|
static | getLastPostings ($postings) |
|
static | getList ($type, $parent_id) |
|
static | getLatestSince ($parent_id, $start_date, $end_date) |
|
static | getSearchResults ($parent_id, $_searchfor, $options) |
|
static | getEntry ($topic_id) |
|
static | countEntries ($parent_id) |
|
static | countPostings ($course_id) |
|
static | countUserEntries ($user_id, $seminar_id=null) |
|
static | insert ($data, $parent_id) |
|
static | update ($topic_id, $name, $content) |
|
static | delete ($topic_id) |
|
static | move ($topic_id, $destination) |
|
static | close ($topic_id) |
|
static | open ($topic_id) |
|
static | sticky ($topic_id) |
|
static | unsticky ($topic_id) |
|
static | checkRootEntry ($seminar_id) |
|
static | getTopTenSeminars () |
|
static | countAllEntries () |
|
static | migrateUser ($user_from, $user_to) |
|
static | getDump ($seminar_id, $parent_id=null) |
|
static | isClosed ($topic_id) |
|
static | exportUserData (StoredUserData $storage) |
|
◆ appendEdit()
static appendEdit |
( |
|
$description | ) |
|
|
static |
add the edit-html to a posting
- Parameters
-
string | $description | the posting-content |
- Returns
- string the content with the edit-mark
◆ br2space()
is used for posting-preview. replaces all newlines with spaces
- Parameters
-
string | $text | the text to work on |
- Returns
- string
◆ checkRootEntry()
static checkRootEntry |
( |
|
$seminar_id | ) |
|
|
static |
check, if the default root-node for this seminar exists and make sure the default category exists as well
- Parameters
-
- Returns
- void
◆ close()
static close |
( |
|
$topic_id | ) |
|
|
static |
close the passed topic
- Parameters
-
string | $topic_id | the topic to close |
- Returns
- void
◆ countAllEntries()
static countAllEntries |
( |
| ) |
|
|
static |
count all entries that exists in the whole installation and return it.
- Returns
- int
◆ countEntries()
static countEntries |
( |
|
$parent_id | ) |
|
|
static |
Count the number of child-elements that the passed entry has and return it.
- Parameters
-
- Returns
- int the number of child entries for the passed entry
◆ countPostings()
static countPostings |
( |
|
$course_id | ) |
|
|
static |
Count the number of postings in a given course and return it.
- Parameters
-
string | $course_id | the id of the given course |
- Returns
- int the number of postings in the course
◆ countUserEntries()
static countUserEntries |
( |
|
$user_id, |
|
|
|
$seminar_id = null |
|
) |
| |
|
static |
Count all entries the passed user has ever written and return the result
type $entries
- Parameters
-
- Returns
- int number of entries user has ever written
◆ delete()
static delete |
( |
|
$topic_id | ) |
|
|
static |
delete an entry and all his descendants from the mptt-table
- Parameters
-
string | $topic_id | the id of the entry to delete |
- Returns
- void
◆ exportUserData()
Export available data of a given user into a storage object (an instance of the StoredUserData class) for that user.
- Parameters
-
Implements PrivacyObject.
◆ getChildTopicIds()
static getChildTopicIds |
( |
|
$topic_id | ) |
|
|
static |
get the topic_ids of all childs of the passed topic including itself
- Parameters
-
string | $topic_id | the topic_id to find the childs for |
- Returns
- array a list if topic_ids
◆ getConstraints()
static getConstraints |
( |
|
$topic_id | ) |
|
|
static |
returns the entry for the passed topic_id
- Parameters
-
- Returns
- array | bool array('lft' => ..., 'rgt' => ..., seminar_id => ...)
- Exceptions
-
◆ getContentAsHtml()
static getContentAsHtml |
( |
|
$description, |
|
|
|
$anonymous = false |
|
) |
| |
|
static |
Get content with appended edit comment as HTML.
- Parameters
-
string | $description | Database entry of forum entry's body. |
bool | $anonymous | True, if only root is allowed to see authors. |
- Returns
- string Content and edit comment as HTML.
◆ getDump()
static getDump |
( |
|
$seminar_id, |
|
|
|
$parent_id = null |
|
) |
| |
|
static |
returns the complete seminar or only the passed sub-tree as a html-string
- Parameters
-
- Returns
- string
◆ getEditComment()
static getEditComment |
( |
|
$description, |
|
|
|
$anonymous = false |
|
) |
| |
|
static |
Get author and time of an edited forum entry as a string.
- Parameters
-
string | $description | Database entry of forum entry's body. |
bool | $anonymous | True, if only root is allowed to see authors. |
- Returns
- string Author and time or empty string if not edited.
◆ getEditInfo()
static getEditInfo |
( |
|
$description | ) |
|
|
static |
Get author and time of an edited forum entry.
- Parameters
-
string | $description | Database entry of forum entry's body. |
- Returns
- array|bool Associative array containing author and time. boolean False if edit tag was not found.
◆ getEntries()
Get all entries for the passed parent_id. Returns an array of the following structure: Array ( 'list' => Array ( 'author' => 'topic_id' => 'name' => formatReady() 'name_raw' => 'content' => formatReady() 'content_raw' => 'content_short' => 'chdate' => 'mkdate' => 'user_id' => 'raw_title' => 'raw_description' => 'fav' => 'depth' => 'sticky' => 'closed' => 'seminar_id' => ) 'count' => )
- Parameters
-
string | $parent_id | id of parent-element to get entries for. |
boolean | $with_childs | if true, the whole subtree is fetched |
string | $add | for additional constraints in the WHERE-part of the query |
string | $sort_order | can be ASC or DESC |
int | $start | can be used for pagination, is used for the LIMIT-part of the query |
int | $limit | number of entries to fetch, defaults to ForumEntry::POSTINGS_PER_PAGE |
- Returns
- array
- Exceptions
-
Exception | if the retrieval failed, an Exception is thrown |
◆ getEntry()
static getEntry |
( |
|
$topic_id | ) |
|
|
static |
returns the entry for the passed topic_id
- Parameters
-
- Returns
- array | false hash-array with the entries fields
◆ getFlatPathToPosting()
static getFlatPathToPosting |
( |
|
$topic_id | ) |
|
|
static |
returns a hashmap where key is topic_id and value a posting-title from the entries which lead to the passed topic.
WARNING: This function ommits postings with an empty title. For a full list please use ForumEntry::getPathToPosting()!
- Parameters
-
string | $topic_id | the topic to get the path for |
- Returns
- array
◆ getLastPostings()
static getLastPostings |
( |
|
$postings | ) |
|
|
static |
Takes a posting-array like the one generated by ForumEntry::getList() and adds the child-posting with the freshest creation-date to it.
- Parameters
-
- Returns
- array
◆ getLastUnread()
static getLastUnread |
( |
|
$parent_id | ) |
|
|
static |
return the id for the oldest unread child-posting for the passed topic.
- Parameters
-
- Returns
- string id of oldest unread posting
◆ getLatestPosting()
static getLatestPosting |
( |
|
$parent_id | ) |
|
|
static |
retrieve the the latest posting under $parent_id or false if the postings itself is the latest
- Parameters
-
string | $parent_id | the node to lookup the childs in |
- Returns
- array | bool the data for the latest postings or false
◆ getLatestSince()
static getLatestSince |
( |
|
$parent_id, |
|
|
|
$start_date, |
|
|
|
$end_date |
|
) |
| |
|
static |
Get the latest forum entries for the passed entries childs
- Parameters
-
string | $parent_id | |
int | $start_date | timestamp |
int | $end_date | timestamp |
- Returns
- array list of postings
◆ getList()
static getList |
( |
|
$type, |
|
|
|
$parent_id |
|
) |
| |
|
static |
get a list of postings of a special type
- Parameters
-
string | $type | one of 'area', 'list', 'postings', 'latest', 'favorites', 'dump', 'flat' |
string | $parent_id | the are to fetch from |
- Returns
- array array('list' => ..., 'count' => ...);
◆ getParentTopicId()
static getParentTopicId |
( |
|
$topic_id | ) |
|
|
static |
return the topic_id of the parent element, false if there is none (ie the passed topic_id is already the upper-most node in the tree)
- Parameters
-
string | $topic_id | the topic_id for which the parent shall be found |
- Returns
- string the topic_id of the parent element or false
◆ getPathToPosting()
static getPathToPosting |
( |
|
$topic_id | ) |
|
|
static |
returns a hashmap with arrays containing id and name with the entries which lead to the passed topic
- Parameters
-
string | $topic_id | the topic to get the path for |
- Returns
- array
◆ getPostingPage()
static getPostingPage |
( |
|
$topic_id, |
|
|
|
$constraint = null |
|
) |
| |
|
static |
get the page the passed posting is on
- Parameters
-
- Returns
- int
◆ getSearchResults()
static getSearchResults |
( |
|
$parent_id, |
|
|
|
$_searchfor, |
|
|
|
$options |
|
) |
| |
|
static |
returns a list of postings for the passed search-term
- Parameters
-
string | $parent_id | the area to search in (can be a whole seminar) |
string | $_searchfor | the term to search for |
array | $options | filter-options: search_title, search_content, search_author |
- Returns
- array array('list' => ..., 'count' => ...);
◆ getTopTenSeminars()
static getTopTenSeminars |
( |
| ) |
|
|
static |
returns the ten most active seminars
- Returns
- array
◆ insert()
static insert |
( |
|
$data, |
|
|
|
$parent_id |
|
) |
| |
|
static |
insert a node into the table
- Parameters
-
array | $data | an array containing the following fields: topic_id the id of the new topic seminar_id the id of the seminar to add the topic to user_id the id of the user who created the topic name the title of the entry content the content of the entry author the author's name as a plaintext string author_host ip-address of creator |
string | $parent_id | the node to add the topic to |
- Returns
- void
◆ isClosed()
static isClosed |
( |
|
$topic_id | ) |
|
|
static |
◆ killEdit()
static killEdit |
( |
|
$description | ) |
|
|
static |
remove the edit-html from a posting
- Parameters
-
string | $description | the posting-content |
- Returns
- string the content stripped by the edit-mark
◆ killFormat()
static killFormat |
( |
|
$text | ) |
|
|
static |
calls Stud.IP's kill_format
- Parameters
-
string | $text | the text to parse |
- Returns
- string the text without format-tags
◆ migrateUser()
static migrateUser |
( |
|
$user_from, |
|
|
|
$user_to |
|
) |
| |
|
static |
updates the user-entries and replaces the old user-id by the new one
- Parameters
-
string | $user_from | |
string | $user_to | |
◆ move()
static move |
( |
|
$topic_id, |
|
|
|
$destination |
|
) |
| |
|
static |
move the passed topic to the passed area
- Parameters
-
string | $topic_id | the topic to move |
string | $destination | the area_id where the topic is moved to |
- Returns
- void
◆ open()
open the passed topic
- Parameters
-
string | $topic_id | the topic to open |
- Returns
- void
◆ parseEdit()
static parseEdit |
( |
|
$description, |
|
|
|
$anonymous = false |
|
) |
| |
|
static |
convert the edit-html to raw text
- Parameters
-
string | $description | the posting-content |
- Returns
- string the content with the raw text version of the edit-mark
◆ parseEntries()
static parseEntries |
( |
|
$postings | ) |
|
|
static |
fill the passed postings with additional data
- Parameters
-
- Returns
- array
◆ removeQuotes()
static removeQuotes |
( |
|
$description | ) |
|
|
static |
Remove all quote blocks AND the quoted text from a forum post.
- Parameters
-
String | $description | The string to remove the quote blocks from |
- Returns
- String the posting without the [quote]-blocks (not just tags!)
◆ sticky()
static sticky |
( |
|
$topic_id | ) |
|
|
static |
make the passed topic sticky
- Parameters
-
string | $topic_id | the topic to make sticky |
- Returns
- void
◆ unsticky()
static unsticky |
( |
|
$topic_id | ) |
|
|
static |
make the passed topic unsticky
- Parameters
-
string | $topic_id | the topic to make unsticky |
- Returns
- void
◆ update()
static update |
( |
|
$topic_id, |
|
|
|
$name, |
|
|
|
$content |
|
) |
| |
|
static |
update the passed topic
- Parameters
-
string | $topic_id | the id of the topic to update |
string | $name | the new name |
string | $content | the new content |
- Returns
- void
◆ FEED_POSTINGS
const FEED_POSTINGS = 100 |
◆ POSTINGS_PER_PAGE
const POSTINGS_PER_PAGE = 10 |
◆ THREAD_PREVIEW_LENGTH
const THREAD_PREVIEW_LENGTH = 100 |
◆ WITH_CHILDS
◆ WITHOUT_CHILDS
const WITHOUT_CHILDS = false |
The documentation for this class was generated from the following file: