Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Ipb Class Reference

Public Member Functions

 Ipb ($path, $version)
 
 setup ($path)
 
 isConnected ()
 
 disconnect ()
 
 getIpbURL ()
 
 search ($assetid)
 
 authenticateUser (&$bridge, $username, $password, $is_email_login)
 
 getAllInfo ($cols=Array(), $id=0)
 
 getMemberGroupInfo ($table_name='members', $cols=Array(), $id=0)
 
 getMembers ($member_id=0, $group_id=0, $cols=Array())
 
 getCustomFields ()
 
 getMemberCustomFieldData ($member_id)
 
 getGroupInfo ($group_id)
 
 getListOfGroups ()
 
 canViewBoard ($username)
 
 getMemberInfo ($member_id)
 
 getMemberInfoByName ($member_name)
 
 getMemberParent ($member_id)
 
 getListOfMembers ($group_id=0)
 
 getRootForumInfo ($forum_id)
 
 getListOfRootForums ()
 
 getForumInfo ($forum_id)
 
 getForumParent ($forum_id)
 
 getListOfForums ($root_forum_id)
 
 getTopicInfo ($topic_id)
 
 getTopicParent ($topic_id)
 
 getListOfTopics ($forum_id)
 
 getPostInfo ($post_id)
 
 getPostParent ($post_id)
 
 getListOfPosts ($topic_id, $forum_id=NULL, $limit=0)
 
 getPollInfo ($poll_id)
 
 getListOfPolls ()
 
 _buildQuery ($columns, $table_name, $table_short_name, $where='', $join='', $order_by='', $limit='')
 
 _getResult ($sql, $key_change=Array(), $one_element=FALSE, $backward=FALSE)
 
 _htmlDecode ($result)
 

Data Fields

 $db
 
 $needed_files
 
 $info = NULL
 
 $version = '2_0_4'
 
 $registry = NULL
 
 $command = 'fetch_row'
 
 $command_free = 'free_result'
 

Protected Member Functions

 _assertValidResult ($db, $message)
 
 _getMemberIdField ()
 
 _getMemberGroupIdField ()
 
 _maintainDataFormat ($data=Array())
 

Detailed Description

Definition at line 30 of file ipb.inc.

Member Function Documentation

_assertValidResult (   $db,
  $message 
)
protected

Asserts a valid DB result

This has to be done in a different way because the DB in question is an IPB DB object, not a Matrix one.

Parameters
DB_Driver$dbThe DB object
string$messageMessage to display if failed
Returns
void

Definition at line 1496 of file ipb.inc.

_buildQuery (   $columns,
  $table_name,
  $table_short_name,
  $where = '',
  $join = '',
  $order_by = '',
  $limit = '' 
)

Return sql query string

Parameters
array$columnsthe list of columns
string$table_namethe name of the table
string$table_short_namethe short name of the table
string$whereWHERE clauss
string$joinJOIN clause
string$order_byORDER BY clause
string$limitLIMIT clause
Returns
boolean private

Definition at line 1353 of file ipb.inc.

_getMemberGroupIdField ( )
protected

Return the member_group_id (used to maintain backwards compatability)

Returns
string private

Definition at line 1529 of file ipb.inc.

_getMemberIdField ( )
protected

Return the member_id (used to maintain backwards compatability)

Returns
string private

Definition at line 1511 of file ipb.inc.

_getResult (   $sql,
  $key_change = Array(),
  $one_element = FALSE,
  $backward = FALSE 
)

Return the db execution result

Parameters
string$sqlthe sql query to execute
array$key_changeThe caller can specify the name of the key by providing the pair of the old and new key
boolean$one_elementIf the result only contains one element, it's TRUE
boolean$backwardIf TRUE, make sure the data in the array is backward compatible
Returns
array private

Definition at line 1394 of file ipb.inc.

_htmlDecode (   $result)

Convert html encoded characters

This function is useful since IPB stores html encoded characters in the database. All the results from database go through this function to make sure they do not contain any html encoded chars

Parameters
string$resultthe string to convert
Returns
string private

Definition at line 1436 of file ipb.inc.

_maintainDataFormat (   $data = Array())
protected

Maintain data format (used to maintain backwards compatability)

Parameters
array$dataThe array to maintain
Returns
string private

Definition at line 1549 of file ipb.inc.

authenticateUser ( $bridge,
  $username,
  $password,
  $is_email_login 
)

Authenticate the user based on the username and the password

Parameters
object$bridgeThe current bridge
string$usernamethe user name to verify
string$passwordthe password to verify
boolean$is_email_loginit's TRUE if email is used for loggin
Returns
boolean public

Definition at line 284 of file ipb.inc.

canViewBoard (   $username)

Returns TRUE if the user's group has the access to view the IPB board

Parameters
int$usernamethe name of the ipb user
Returns
array public

Definition at line 790 of file ipb.inc.

disconnect ( )

Close IPB's database connection

Returns
boolean public

Definition at line 203 of file ipb.inc.

getAllInfo (   $cols = Array(),
  $id = 0 
)

Returns the summary of members and groups in multi dimen array

The returned array can take two different forms. If cols is not specified, the associative array have the id of members/groups as a key. For example, Also, this function return all the information of members and groups at once.

Array(
  'id'  => Array(
            'name'      => value,
            'mgroup     => value,
            ...
            ),
);

If the list of wanted columns is passed, no key is specified in the returned array

Array(
  0 => Array(
        'id'    => value,
        'name'  => value,
        'mgroup => value,
        ...
      ),
  ...
);
Parameters
array$colsthe list of wanted columns
int$idoptionally the id of member/group can be specified
Returns
array public

Definition at line 379 of file ipb.inc.

getCustomFields ( )

Returns the list of all custom fields for the members if there are any

Returns
array public

Definition at line 702 of file ipb.inc.

getForumInfo (   $forum_id)

Returns the details of Ipb Forum

Parameters
int$forum_idthe id of the ipb forum
Returns
array public

Definition at line 997 of file ipb.inc.

getForumParent (   $forum_id)

Returns the root forum which this forum belongs to

Parameters
int$forum_idthe id of the ipb forum
Returns
array public

Definition at line 1028 of file ipb.inc.

getGroupInfo (   $group_id)

Returns the details of the Ipb User Group

Parameters
int$group_idthe id of the ipb user group
Returns
array public

Definition at line 745 of file ipb.inc.

getIpbURL ( )

Returns IPB website URL

Returns
string public

Definition at line 225 of file ipb.inc.

getListOfForums (   $root_forum_id)

Returns all the forum under this root forum

Parameters
int$root_forum_idthe id of the ipb forum
Returns
array public

Definition at line 1050 of file ipb.inc.

getListOfGroups ( )

Returns the list of all Ipb User Groups

Returns
array public

Definition at line 764 of file ipb.inc.

getListOfMembers (   $group_id = 0)

Returns the list of all members in this Ipb User Group

Parameters
int$group_idthe id of the ipb user group
Returns
array public

Definition at line 905 of file ipb.inc.

getListOfPolls ( )

Returns the list of all polls

Returns
array public

Definition at line 1327 of file ipb.inc.

getListOfPosts (   $topic_id,
  $forum_id = NULL,
  $limit = 0 
)

Returns the list of all posts under this topic

Parameters
int$topic_idthe id of the ipb topic
int$forum_idthe id of the ipb forum
int$limitoptional limit clause
Returns
array public

Definition at line 1250 of file ipb.inc.

getListOfRootForums ( )

Returns the list of all Ipb Root Forums

Returns
array public

Definition at line 973 of file ipb.inc.

getListOfTopics (   $forum_id)

Returns the list of all the topic under this forum

Parameters
int$forum_idthe id of the ipb forum
Returns
array public

Definition at line 1143 of file ipb.inc.

getMemberCustomFieldData (   $member_id)

Returns the list of all custom fields for the members if there are any

Parameters
int$member_idthe id of the user
Returns
array public

Definition at line 720 of file ipb.inc.

getMemberGroupInfo (   $table_name = 'members',
  $cols = Array(),
  $id = 0 
)

Returns the summary of members/groups in multi dimen array

The returned array can take two different forms. If cols is not specified, the associative array have the id of members/groups as a key. For example,

Array(
  'id'  => Array(
            'name'      => value,
            'mgroup     => value,
            ...
            ),
);

If the list of wanted columns is passed, no key is specified in the returned array

Array(
  0 => Array(
        'id'    => value,
        'name'  => value,
        'mgroup => value,
        ...
      ),
  ...
);
Parameters
string$table_namethe name of the table
array$colsthe list of wanted columns
int$idoptionally the id of member/group can be specified
Returns
boolean public

Definition at line 476 of file ipb.inc.

getMemberInfo (   $member_id)

Returns the details of Ipb User

Parameters
int$member_idthe id of the ipb user
Returns
array public

Definition at line 815 of file ipb.inc.

getMemberInfoByName (   $member_name)

Returns the details of Ipb User by Name

Parameters
int$member_namethe name of the ipb user
Returns
array public

Definition at line 844 of file ipb.inc.

getMemberParent (   $member_id)

Returns all the groups which this user belongs to

Parameters
int$member_idthe id of the ipb user
Returns
array public

Definition at line 870 of file ipb.inc.

getMembers (   $member_id = 0,
  $group_id = 0,
  $cols = Array() 
)

Returns all the members or a group of members according to the given arguments

Parameters
int$member_idmatrix ipb_user_id which maps to IPB member id
int$group_idmatrix ipb_group_id which matps to IPB group id
array$colsthe list of fields
Returns
array public

Definition at line 621 of file ipb.inc.

getPollInfo (   $poll_id)

Returns the details of this poll

Parameters
int$poll_idthe id of the ipb poll
Returns
array public

Definition at line 1295 of file ipb.inc.

getPostInfo (   $post_id)

Returns the details of this Ipb Post

Parameters
int$post_idthe id of the ipb post
Returns
array public

Definition at line 1173 of file ipb.inc.

getPostParent (   $post_id)

Returns the topic which this topic belongs to

Parameters
int$post_idthe id of the ipb post
Returns
array public

Definition at line 1214 of file ipb.inc.

getRootForumInfo (   $forum_id)

Returns the details of Ipb Root Forum

Parameters
int$forum_idthe id of the ipb root forum
Returns
array public

Definition at line 948 of file ipb.inc.

getTopicInfo (   $topic_id)

Returns the details of this Ipb Topic

Parameters
int$topic_idthe id of the ipb topic
Returns
array public

Definition at line 1078 of file ipb.inc.

getTopicParent (   $topic_id)

Returns the forum which this topic belongs to

Parameters
int$topic_idthe id of the ipb topic
Returns
array public

Definition at line 1112 of file ipb.inc.

Ipb (   $path,
  $version 
)

Constructor

Parameters
string$pathabsolute path to Invision Power Board installation

Definition at line 63 of file ipb.inc.

isConnected ( )

Return TRUE if IPB is connected

Returns
boolean public

Definition at line 186 of file ipb.inc.

search (   $assetid)

Search the database for the given shadow assetid Since IPB can have same primary key for member and group, ipb_bridge adds an unique prefix for different asset type. For example, member has 'm_' as a prefix and 'g_' for a group.

Parameters
int$assetidthe id of the shadow asset to search
Returns
mixed array|boolean public

Definition at line 246 of file ipb.inc.

setup (   $path)

Set up the database connection

This function includes all necessary files from IPB, then establishes db connection to their database

Parameters
string$paththe absolute path to Invision Power Board installation
string$versionthe version of the Invision Power Board installation
Returns
boolean public

Definition at line 88 of file ipb.inc.

Field Documentation

$needed_files
Initial value:
= Array(
'/conf_global.php',
'/ips_kernel/class_db_mysql.php',
'/ips_kernel/class_converge.php',
)

Definition at line 45 of file ipb.inc.


The documentation for this class was generated from the following file: