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
- To update from previous versions, run this SQL command to add the new user fields:
Good start
Has a forum thread been raised to report issues and ideas?
well done!
Keep up the good work!
Thanks
@WebDevPT: Thanks
@bettor: It has now:) Thanks for the suggestion.
Thanks
this is a very good job
i'll test it shortly
;)
tested today = i love it
hope you shortly include the 'extrastuff.js' stuff!!
Nice updates :)
Keep up the good work :)
column «t.is_sticky» must appears in a GROUP BY clause in POSTGRES
Thanks for your forum module.
I am trying to run this extension with Postgres 8.4.
I did the conversion.
However, I have the following error:
column «t.is_sticky» must appears in a GROUP BY clause.
I tried to fix it using pgadmin only, as follows:
SELECT forum_id AS c, COUNT(*) AS s FROM thread t WHERE (t.forum_id=2) GROUP BY forum_id, is_sticky, t.created, t.subject ORDER BY is_sticky DESC, created DESC, subject
And in pgadmin, it worked.
I did the module generation of the 4 tables you use, very careful (only copying the differences in rules and relations - just adding them, leaving yours).
May be the error is accepted in Mysql but not in Postgres.
Question:
In what part of your module can I include the rest of group by fields?
All of the following fields: GROUP BY forum_id, is_sticky, t.created, t.subject
Maybe you have a better idea how to fix this error.
Please your help is needed.
Best Regards,
Douglas
Postgress
@Douglas: I have no experience whatsoever with Postgres, so as much as I would like to, I can not help you. It is obviously a difference in SQL dialect between MySQL and Postgres. However, in order for anyone to look into the problem, they're going to need more information. A tracelog would be most helpful I think. Either way, please move this to the forums.
Forum finally
Thanks! forum is what I really missed in extensions. I will try to use it soon:)
How do I get to work fine with Cruge Module?
I've installed the Forum Extension, but I work with CRUGE
module for control acces instead user module.
The problem is that every request appear a error:
Propertie "CrugeWebUser"."isAdmin" is undefined.
Any suggestion to fix the problem ???
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.