phpDocumentor topic
[ class tree: topic ] [ index: topic ] [ all elements ]

Class: topic

Source Location: /lib/topic.inc.php

Class topic

Class Overview

Located in /lib/topic.inc.php [line 11]

ipbwi
   |
   --topic
Author(s):
  • Matthias Reuter ($LastChangedBy: matthias $)
Information Tags:
Version:  $LastChangedDate: 2009-03-02 22:08:15 +0000 (Mo, 02 Mrz 2009) $
Copyright:  2007-2008 IPBWI development team
Link:  http://ipbwi.com/examples/topic.php
Since:  2.0
License:  GNU General Public License

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From ipbwi

ipbwi::$DB
ipbwi::$ips

Inherited From ipbwi

ipbwi::addSystemMessage()
adds a system message
ipbwi::date()
Returns textual/timestamp offsetted date by board and by member offset and DST setting.
ipbwi::getBoardVar()
gets the requested board-var
ipbwi::getLibLang()
gets the language-var from actual requested native language-bit
ipbwi::info()
informations about the current IPBWI and PHP installation
ipbwi::makeSafe()
filtering html-strings, e.g. for db-queries
ipbwi::printSystemMessages()
prints system messages
ipbwi::properXHTML()
filtering HTML strings
ipbwi::setLang()
Set's current SDK language
ipbwi::updateSession()
Update Member Session Informations

Inherited From ipbwi

ipbwi::DEV_TEAM
ipbwi::PROJECT_LEADER
ipbwi::TITLE
ipbwi::VERSION
ipbwi::WEBSITE

[ Top ]
Method Summary
int   create()   creates a new topic
bool   delete()   deletes a 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

[ Top ]
Methods
create  [line 44]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->create(55,'topic title','topic post');
  2.  $ipbwi->topic->create(55,'topic title','topic post','topic description',false,false,true,true);

[ Top ]
delete  [line 253]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->delete(55);

[ Top ]
edit  [line 139]

  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:  
  1.  $ipbwi->topic->edit(55,'topic title','topic post');
  2.  $ipbwi->topic->edit(55,'topic title','topic post','topic description','Reason',true,true,true,true,false,false,true);

[ Top ]
getList  [line 398]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->getList(55);
  2.  $ipbwi->topic->getList(55,array('memberid' => 66));
  3.  $ipbwi->topic->getList(array(55,22,77,99));
  4.  $ipbwi->topic->getList('*');
  5.  $ipbwi->topic->getList(55,array('order' => 'DESC''orderby' => 'pid''start' => 10'limit' => 20'linked' => true'ignoreapproval' => true));

[ Top ]
getListIDs  [line 336]

  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:  
  1.  $ipbwi->topic->getListIDs(55);
  2.  $ipbwi->topic->getListIDs(array(55,77,99));
  3.  $ipbwi->topic->getListIDs('*',10,20,true);

[ Top ]
id2title  [line 756]

  string id2title( int $id  )

Converts topic ID to topic-title

Parameters:
int   $id:  Topic ID

API Tags:
Return:  Topic Title
Access:  public

Information Tags:
Author:  Matthias Reuter
Since:  2.0
Sample:  
  1.  $ipbwi->topic->title2id('topic title');

[ Top ]
info  [line 284]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->info(55);
  2.  $ipbwi->topic->info(55,true,true,download.php?id=%id%);

Redefinition of:
ipbwi::info()
informations about the current IPBWI and PHP installation

[ Top ]
merge  [line 589]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->rate(55,77,'merged topic title''merged topic description');
  2.  $ipbwi->topic->rate(55,77,'merged topic title''merged topic description'true);

[ Top ]
move  [line 780]

  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:
Author:  Andrew Beveridge <andrewthecoder@googlemail.com>
Author:  Matthias Reuter
Since:  2.0
Sample:  
  1.  $ipbwi->topic->move(55,33);
  2.  $ipbwi->topic->move(55,33,true);

[ Top ]
rate  [line 529]

  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:
Author:  Cow <khlo@global-centre.com>
Author:  Matthias Reuter
Author:  Pita <peter@randomnity.com>
Since:  2.0
Sample:  
  1.  $ipbwi->topic->rate(55,4);
  2.  $ipbwi->topic->rate(55,5,true);

[ Top ]
title2id  [line 734]

  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:  
  1.  $ipbwi->topic->title2id('topic title');

[ Top ]

Documentation generated on Mon, 02 Mar 2009 23:51:19 +0100 by phpDocumentor 1.4.0