yii-forum An easy to install, mostly self-contained forum module

  1. Requirements
  2. Usage
  3. Options
  4. Embedded extensions
  5. Versions
  6. Resources

This module will add a forum to pretty much any site, with minimal efforts.

Requirements

Any Yii 1.1.* should work. (Developed with 1.1.12)

Usage

  • Extract file to application's protected/modules directory
  • Create database tables according to yii-forum/data/schema.mysql.sql
  • Optionally import sample data from yii-forum/data/sampledata.mysql.sql
  • Edit your configuration to register the module:
...
'modules'=>array(
    'forum'=>array(
        'class'=>'application.modules.yii-forum.YiiForumModule',
    ),
),
...
  • On user login, you will need to set a isAdmin state indicating if a user has administrator access. On an out-of-the-box Yii appliction, you could edit the components/UserIdentity.php file, and after successful authentication, add:
...
    $this->setState('isAdmin', ($this->name == 'admin'));
...

Now you should be able to browse to the forum at http://<your base url>/forum

Options

The following configuration options can be used:

userUrl: The url to generate for links to user profiles. i.e. 'Yii::app()->createUrl("customer/view", array("id"=>$id))' $id will be replaced with the site's user id.

forumTableClass, forumListviewClass, forumDetailClass: The CSS class applied to the Forum tables. When not set, Yii's default CGridView style will be applied. When set to "MyBB", an included style modeled after the the default MyBB theme will be used instead. When set to anything else, you will have to create our own styles.

dateFormatShort, dateFormatLong, timeFormatShort, timeFormatLong: Date and time format used to display date and time. See PHP's date function for more information.

dateReplaceWords: When set to true (default) today's date will be replaced with "Today", and yesterday's date will be replaced with "Yesterday"

threadsPerPage: The number of threads per page shown. Default is 20.

Embedded extensions

Versions

  • v0.1 (Oct. 10, 2012): Initial release
  • v0.2 (Oct. 11, 2012): Added userUrl option
  • v0.3 (Oct. 15, 2012): Added user page, added user signature
    • To update from previous versions, run this SQL command to add the new user fields:
      [sql]
      ALTER TABLE forumuser
      ADD COLUMN signature TEXT NULL,
      ADD COLUMN firstseen INT(10) UNSIGNED NOT NULL,
      ADD COLUMN lastseen INT(10) UNSIGNED NOT NULL
      

Resources

8 2
34 followers
7 116 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags: forum, module
Developed by: Caliban
Created on: Oct 11, 2012
Last updated: 11 years ago

Downloads

show all

Related Extensions