CWIS Developer Documentation

- Home
- Main Page
- 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)
| PostMessage ($TopicId, $Author, $Subject, $Body)

## 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
| Forum ($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.

## Member Function Documentation

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

Definition at line 249 of file Forum.php.

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

Forum::Delete | ( |  | ) |

Remove this forum, deleting all assocated topics and messages.

Definition at line 75 of file Forum.php.

References ForumId(), and OK.

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 300 of file Forum.php.

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

Forum::Forum | ( |  | $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 34 of file Forum.php.

References ForumId(), NONEXISTENT, and OK.

Referenced by DeleteMessage().

Here is the caller graph for this function:

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 217 of file Forum.php.

Forum::ForumId | ( |  | ) |

Get the forum's ID.

Returns
  Returns the forum ID

Definition at line 101 of file Forum.php.

Referenced by AddTopic(), Delete(), Forum(), 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 210 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 245 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 183 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 163 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 108 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 121 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 132 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 231 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 153 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 239 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 143 of file Forum.php.

References ModeratorId().

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

Definition at line 267 of file Forum.php.

References MessageCount(), NOSUCHTOPIC, OK, 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 224 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 20 of file Forum.php.

Referenced by Forum().

const Forum::NOSUCHMESSAGE = 3

Definition at line 22 of file Forum.php.

const Forum::NOSUCHTOPIC = 2

Definition at line 21 of file Forum.php.

Referenced by PostMessage().

const Forum::OK = 0

Definition at line 19 of file Forum.php.

Referenced by Delete(), Forum(), and PostMessage().

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

- objects/Forum.php