CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Forum Class Reference

A converastion forum which includes topics and messages. More...

## Public Member Functions
| AddTopic ($Author, $TopicName, $Subject, $Body)
| Add topic to forum. More...
| PostMessage ($TopicId, $Author, $Subject, $Body)
| Post new message to topic. More...

## Static Public Member Functions
static | DeleteMessage ($MessageId)
| Delete a message from a forum, updating the message counts for the associated forum and topic. More...

## Public Attributes
const | OK = 0
const | NONEXISTENT = 1
const | NOSUCHTOPIC = 2
const | NOSUCHMESSAGE = 3

## Setup/Initialization/Destruction
| __construct ($ForumId=NULL)
| Object Constructor. More...
| Delete ()
| Remove this forum, deleting all assocated topics and messages. More...

## Accessors
| ForumId ()
| Get the forum's ID. More...
| LastMessageDate ()
| Get the date of the most recent post to the forum. More...
| LastMessagePoster ()
| Get the CWIS username of the user with the most recent post. More...
| LastMessagePosterEmail ()
| Get the e-mail address of the user with the most recent post. More...
| ModeratorName ()
| Get the CWIS username of the forum's moderator. More...
| ModeratorEmail ()
| Get the e-mail address of the forum's moderator. More...
| GetTopicList ()
| Get the list of the topics in this forum. More...
| GetLastMessage ()
| Get the last message posted in the forum. More...
| ForumName ($NewValue=DB_NOVALUE)
| Get or modify the forum's name. More...
| ForumDescription ($NewValue=DB_NOVALUE)
| Get or modify the forum description. More...
| TopicCount ($NewValue=DB_NOVALUE)
| Get or set the forum's topic count. More...
| MessageCount ($NewValue=DB_NOVALUE)
| Get or set the forum's message count. More...
| ModeratorId ($NewValue=DB_NOVALUE)
| Get or set the forum's moderator. More...
| GetErrorStatus ()
| Retrieve error codes associated with the creation of the forum. More...

## Detailed Description

A converastion forum which includes topics and messages.

Definition at line 14 of file Forum.php.

## Constructor & Destructor Documentation

Forum::__construct | ( |  | $ForumId = `NULL` | ) |

Object Constructor.

After constructing the object, be sure to call GetErrorStatus() and verify that it returns Forum::OK.

Parameters

  int | $ForumId | ID of the forum to retrieve from the database, or -1 to create a new forum.

See also
  GetErrorStatus()

Definition at line 35 of file Forum.php.

References ForumId().

## Member Function Documentation

Forum::AddTopic | ( |  | $Author,
|  |  | $TopicName,
|  |  | $Subject,
|  |  | $Body
| ) |  |

Add topic to forum.

Parameters

  string | $Author | User adding new topic.
  string | $TopicName | Name of new topic.
  string | $Subject | Subject for new topic.
  string | $Body | Text body for new topic.

Returns
  int ID of new topic.

Definition at line 278 of file Forum.php.

References ForumId(), PostMessage(), and TopicCount().

Forum::Delete | ( |  | ) |

Remove this forum, deleting all assocated topics and messages.

Definition at line 76 of file Forum.php.

References ForumId().

static Forum::DeleteMessage | ( |  | $MessageId | ) |
| static

Delete a message from a forum, updating the message counts for the associated forum and topic.

Parameters

  int | $MessageId | ID of the message to delete

Returns
  Forum::OK on success, or an appropriate error code on failure.

Definition at line 336 of file Forum.php.

References ForumId(), Message\OK, and Topic\OK.

Forum::ForumDescription | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or modify the forum description.

Parameters

  string | $NewValue | New forum description. This parameter is optional.

Returns
  Returns the current forum description.

Definition at line 223 of file Forum.php.

Forum::ForumId | ( |  | ) |

Get the forum's ID.

Returns
  Returns the forum ID

Definition at line 102 of file Forum.php.

Referenced by __construct(), AddTopic(), Delete(), DeleteMessage(), GetLastMessage(), and GetTopicList().

Here is the caller graph for this function:

Forum::ForumName | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or modify the forum's name.

Parameters

  string | $NewValue | New forum name. This parameter is optional.

Returns
  Returns the current forum name.

Definition at line 213 of file Forum.php.

Forum::GetErrorStatus | ( |  | ) |

Retrieve error codes associated with the creation of the forum.

Returns
  Returns Forum::OK if everything worked, something else otherwise.

Definition at line 263 of file Forum.php.

Forum::GetLastMessage | ( |  | ) |

Get the last message posted in the forum.

Returns
  Returns a Message object of the last posted message or NULL if there isn't one.

Definition at line 186 of file Forum.php.

References ForumId(), and Message\PARENTTYPE_TOPIC.

Referenced by LastMessageDate(), LastMessagePoster(), and LastMessagePosterEmail().

Here is the caller graph for this function:

Forum::GetTopicList | ( |  | ) |

Get the list of the topics in this forum.

Returns
  Returns an array of topic IDs for this forum's conversations.

Definition at line 166 of file Forum.php.

References ForumId().

Forum::LastMessageDate | ( |  | ) |

Get the date of the most recent post to the forum.

Returns
  Returns the date of the most recent post or "None" for empty forums

Definition at line 111 of file Forum.php.

References GetLastMessage().

Forum::LastMessagePoster | ( |  | ) |

Get the CWIS username of the user with the most recent post.

Returns
  Returns the CWIS username of the user with the most recent post.

Definition at line 124 of file Forum.php.

References GetLastMessage().

Forum::LastMessagePosterEmail | ( |  | ) |

Get the e-mail address of the user with the most recent post.

Returns
  Returns the e-mail address of the user with the most recent post.

Definition at line 135 of file Forum.php.

References GetLastMessage().

Forum::MessageCount | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the forum's message count.

Parameters

  int | $NewValue | New forum message count. This parameter is optional.

Returns
  Returns the current message count.

Definition at line 243 of file Forum.php.

Referenced by PostMessage().

Here is the caller graph for this function:

Forum::ModeratorEmail | ( |  | ) |

Get the e-mail address of the forum's moderator.

Returns
  Returns the e-mail address of the forum's modreator

Definition at line 156 of file Forum.php.

References ModeratorId().

Forum::ModeratorId | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the forum's moderator.

Parameters

  int | $NewValue | New forum moderator's user ID. This parameter is optional.

Returns
  Returns the CWIS user ID of the forum's moderator.

Definition at line 254 of file Forum.php.

Referenced by ModeratorEmail(), and ModeratorName().

Here is the caller graph for this function:

Forum::ModeratorName | ( |  | ) |

Get the CWIS username of the forum's moderator.

Returns
  Returns the CWIS username of the forum's moderator

Definition at line 146 of file Forum.php.

References ModeratorId().

Forum::PostMessage | ( |  | $TopicId,
|  |  | $Author,
|  |  | $Subject,
|  |  | $Body
| ) |  |

Post new message to topic.

Parameters

  int | $TopicId | ID of topic.
  string | $Author | User adding new message.
  string | $Subject | Subject for new message.
  string | $Body | Text body for new message.

Definition at line 303 of file Forum.php.

References MessageCount(), Topic\OK, and Message\PARENTTYPE_TOPIC.

Referenced by AddTopic().

Here is the caller graph for this function:

Forum::TopicCount | ( |  | $NewValue = `DB_NOVALUE` | ) |

Get or set the forum's topic count.

Parameters

  int | $NewValue | New forum topic count. This parameter is optional.

Returns
  Returns the forum's current topic count.

Definition at line 233 of file Forum.php.

Referenced by AddTopic().

Here is the caller graph for this function:

## Member Data Documentation

const Forum::NONEXISTENT = 1

Definition at line 21 of file Forum.php.

const Forum::NOSUCHMESSAGE = 3

Definition at line 23 of file Forum.php.

const Forum::NOSUCHTOPIC = 2

Definition at line 22 of file Forum.php.

const Forum::OK = 0

Definition at line 20 of file Forum.php.

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

- objects/Forum.php