Class: topic
Source Location: /lib/topic.inc.php
Class topic
Inherited Properties, Constants, and Methods
Method Summary
| int |
create() |
creates a new topic |
| bool |
edit() |
edits a topic |
| array |
getList() |
lists topics from several forums and get topic-informations |
| array |
getListIDs() |
array with topic IDs of the given Forums |
| string |
id2title() |
Converts topic ID to topic-title |
| array |
info() |
get's topic informations |
| bool |
merge() |
merges several topics |
| bool |
move() |
Moves a topic to a specified destination forum |
| bool |
rate() |
rates a topic |
| mixed |
title2id() |
Converts topic title to topic-IDs |
Methods
int create(
int
$forumID, string
$title, string
$post, [string
$desc = false], [bool
$useEmo = true], [bool
$useSig = true], [bool
$bypassPerms = false], [string
$guestName = false]
)
|
|
creates a new topic
Parameters:
|
int |
$forumID: |
Forum-ID where topic will be created |
|
string |
$title: |
Topic-Title |
|
string |
$post: |
Topic-Post |
|
string |
$desc: |
Topic-Description |
|
bool |
$useEmo: |
set to true to enable emoticons in post |
|
bool |
$useSig: |
set to true to enable signature in post |
|
bool |
$bypassPerms: |
set to true to bypass permissions |
|
string |
$guestName: |
Author's name for Guest |
API Tags:
| Return: | topic ID if topic was created, otherwise false |
| Access: | public |
Information Tags:
bool delete(
int
$topicID
)
|
|
deletes a topic
Parameters:
|
int |
$topicID: |
Topic-ID which has to be deleted |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool edit(
int
$topicID, string
$title, string
$post, [string
$desc = false], [string
$reason = false], [bool
$close = false], [bool
$pin = false], [bool
$approve = true], [bool
$useEmo = true], [bool
$useSig = true], [bool
$bypassPerms = false]
)
|
|
edits a topic
Parameters:
|
int |
$topicID: |
Topic-ID which has to be edited |
|
string |
$title: |
Topic-Title |
|
string |
$post: |
Topic-Post |
|
string |
$desc: |
Topic-Description |
|
string |
$reason: |
reason for editing |
|
bool |
$close: |
Close the topic |
|
bool |
$pin: |
Pin the topic |
|
bool |
$approve: |
Make the topic approved or not |
|
bool |
$useEmo: |
set to true to enable emoticons in post |
|
bool |
$useSig: |
set to true to enable signature in post |
|
bool |
$bypassPerms: |
set to true to bypass permissions |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
| Author: | Cow <khlo@global-centre.com> |
| Author: | Matthias Reuter |
| Author: | Pita <peter@randomnity.com> |
| Since: | 2.0 |
| Sample: | $ipbwi->topic->edit(55,'topic title','topic post');
$ipbwi->topic->edit(55,'topic title','topic post','topic description','Reason',true,true,true,true,false,false,true);
|
array getList(
mixed
$forumIDs, [array
$settings = array()], [bool
$bypassPerms = false]
)
|
|
lists topics from several forums and get topic-informations
Parameters:
|
mixed |
$forumIDs: |
The forum IDs where the topics should be retrieved from (array-list, int or '*' for topics from all forums) |
|
array |
$settings: |
optional query settings. Settings allowed: order, orderby limit and start - string order = ASC or DESC, default ASC
- string orderby = 'tid', 'title', 'posts', 'starter_name', 'starter_id', 'start_date', 'last_post', 'views', 'post_date'. Default: start_date
- int start = Default: 0
- int limit = Default: 15
- bool linked = Get moved & linked topics, too. Default: false
- bool ignoreapproval = Do not get topics which need to be approved. Default: false
- int memberid = Default: false. Deliver Member ID to get topics of this member only
- bool allsubs = Default: false. Retrieve topics from all subforums of delivered Forum-IDs
|
|
bool |
$bypassPerms: |
set to true to bypass permissions |
API Tags:
| Return: | Topic-Informations as multidimensional array |
| Access: | public |
Information Tags:
array getListIDs(
mixed
$forumIDs, [int
$start = false], [int
$limit = false], [bool
$bypassPerms = false]
)
|
|
array with topic IDs of the given Forums
Parameters:
|
mixed |
$forumIDs: |
The forum IDs where the topic IDs should be retrieved from (array-list, int or '*' for topics from all forums) |
|
int |
$start: |
For performance purposes, you are able to set a start parameter to set a section of the attachment list. This is used for forum-attachment-list only. |
|
int |
$limit: |
For performance purposes, you are able to set a limit parameter to set a section of the attachment list. This is used for forum-attachment-list only. |
|
bool |
$bypassPerms: |
set to true, to ignore permissions |
API Tags:
| Return: | Topic-Informations as array |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
string id2title(
int
$id
)
|
|
Converts topic ID to topic-title
Parameters:
API Tags:
| Return: | Topic Title |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
array info(
int
$topicID, [bool
$countView = false], [bool
$replacePostVars = false], [string
$ipbwiLink = false]
)
|
|
get's topic informations
Parameters:
|
int |
$topicID: |
Topic-ID |
|
bool |
$countView: |
set to true to count topic views |
|
bool |
$replacePostVars: |
replace attachment post vars with attachment-code |
|
string |
$ipbwiLink: |
If you want to use IPBWI for attachment-downloading, you are able to define the attachment-link here. The var %id% is required and will be replaced with the attachment-ID. |
API Tags:
| Return: | Topic-Informations as array |
| Access: | public |
Information Tags:
Redefinition of:
- ipbwi::info()
- informations about the current IPBWI and PHP installation
bool merge(
int
$topic1id, int
$topic2id,
$title, string
$desc, [bool
$bypassPerms = false]
)
|
|
merges several topics
Parameters:
|
int |
$topic1id: |
ID('s) of the topic(s) to be merged |
|
int |
$topic2id: |
ID of topic that $topic1id will be merged into |
|
string |
$desc: |
Topic-Description |
|
bool |
$bypassPerms: |
set to true to bypass permissions |
|
|
$title: |
|
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
bool move(
int
$topicID,
$destForumID, [int
$bypassPerms = false], int
$destforumid
)
|
|
Moves a topic to a specified destination forum
Parameters:
|
int |
$topicID: |
Topic ID |
|
int |
$destforumid: |
Destination Forum ID |
|
int |
$bypassPerms: |
set to true to bypass permissions |
|
|
$destForumID: |
|
API Tags:
| Return: | true on success, false on failure |
| Access: | public |
Information Tags:
bool rate(
int
$topicID, int
$rating, [bool
$bypassPerms = false]
)
|
|
rates a topic
Parameters:
|
int |
$topicID: |
ID of the topic which has to be rated |
|
int |
$rating: |
rating for the topic |
|
bool |
$bypassPerms: |
set to true to bypass permissions |
API Tags:
| Return: | true on success, otherwise false |
| Access: | public |
Information Tags:
mixed title2id(
string
$title
)
|
|
Converts topic title to topic-IDs
Parameters:
|
string |
$title: |
Topic Title |
API Tags:
| Return: | int Topic ID, array Topic IDs or false |
| Access: | public |
Information Tags:
| Author: | Matthias Reuter |
| Since: | 2.0 |
| Sample: |
|
|
|