Discussion Forum Plugin
Description
The DiscussionPlugin adds discussion forums to Trac. An arbitrary number of forums can be added, organised to forum groups. Users can create topics in forums and reply to them which together creates discussion threads. Threaded or flat view to topics and its replies is supported. Each forum has a list of moderators who can delete topics, replies, etc. Plugin is administrated directly or via WebAdminPlugin with appropriate rights. Appending new forums and topics either as new replies shows up in timeline. Searching capability in topics and replies is supported too.
Live Example
To get an idea how the forums look, see BlackTrac discussion.
Bugs/Feature Requests
Existing bugs and feature requests for DiscussionPlugin are here.
If you have any issues, create a new ticket but read BugReporting page first, please.
Download and Source
You can download zipped sources, check out using Subversion, or browse the source with Trac.
Dependencies
DiscussionPlugin depends on WebAdminPlugin since many configuration options are available only on appropriate WebAdminPlugin's pages. The SpamFilterPlugin is also required.
Plugin Versions
As many other plugins in this site even this plugin names its branches according to Trac versions. Here is a simple table explaining this convention for DiscussionPlugin:
| Plugin Branch | Trac Branch | Plugin Version |
| 0.9 | 0.9-stable | 0.5 |
| 0.10 | 0.10-stable | 0.5 |
| 0.11 | 0.11-stable | 0.6 |
Main difference between 0.5 and 0.6 version is that 0.6 uses Genshi templates and 0.5 ClearSilver ones.
Installation
For general information about Trac plugins installation see TracPlugins. Plugin is configurable from trac.ini file, see TracIni for more on this topic. The following variables controls DiscussionPlugin's behavior:
[discussion] title = Discussion default_display = tree forum_sort = id forum_sort_direction = asc topic_sort = id topic_sort_direction = asc
Option title changes title of main navigation bar button, default_display defines default display mode for message list. Possible values are tree, flat, flat-asc and flat-desc. flat is synonym for flat-desc. forum_sort is column by which will be sorted forum lists. Possible values are: id, group, name, subject, time, moderators, description, topics, replies, lasttopic and lastreply. Topic lists may be sorted with topic_sort option. It has values id, forum, subject, time, author, body, replies and lastreply. Options forum_sort_direction and topic_sort_direction are directions of that sorting. They may be asc and desc. Previous example shows default values for these options.
If you run Trac in environment which needs to enable plugins explicitly put in trac.ini these lines:
[components] # Enable this component for 0.11 branch and 0.10 branch from revision r3518. tracdiscussion.api.DiscussionApi = enabled tracdiscussion.admin.DiscussionWebAdmin = enabled tracdiscussion.core.DiscussionCore = enabled tracdiscussion.init.DiscussionInit = enabled tracdiscussion.search.DiscussionSearch = enabled tracdiscussion.timeline.DiscussionTimeline = enabled tracdiscussion.wiki.DiscussionWiki = enabled tracdiscussion.notification.DiscussionNotifyEmail = enabled
The next step is to upgrade your environment:
# trac-admin <path_to_environment> upgrade
For now sqlite version 3 or PostgreSQL is required as SQL backend for running this plugin.
Permissions
Discussion plugin defines four permissions. With DISCUSSION_VIEW permission you can view all topics and you can post replies to them with DISCUSSION_APPEND permission. DISCUSSION_MODERATE permission gives you rights to delete replies or topics where are you defined as moderator. DISCUSSION_ADMIN permission gives you administrator rights to create, modify or delete forum groups, forums and topics. You can add these permissions by typing following commands from commandline or you can use WebAdminPlugin to do it for you.
# trac-admin <path_to_environment> permission add <user> DISCUSSION_VIEW # trac-admin <path_to_environment> permission add <user> DISCUSSION_APPEND # trac-admin <path_to_environment> permission add <user> DISCUSSION_MODERATE # trac-admin <path_to_environment> permission add <user> DISCUSSION_ADMIN
Macros
There are few wiki macros available:
[forum:<forum_id> <text>]
Displays link to forum with id <id> and text <text>. Second argument is optional.
[topic:<topic_id> <text>]
Displays link to topic with id <id> and text <text>. Second argument is optional.
[message:<message_id> <text>]
Displays link to reply with id <id> and text <text>. Second argument is optional.
[[ViewTopic(<topic_subject>)]]
Displays content of topic with subject <topic_subject>. If no subject given displays content of topic with same subject as name of current wiki page. Currently there is a limitation of post length using this macro because of using GET method of HTML form.
Example
Discuss this on the [forum:5 Trac Development forum]. Useful threads are [topic:23 this one] and [topic:96 this one].
Attachments
Foreign files can also be attached to topics and then linked in replies. For this purpose you can use general Trac attachment link syntax with disscussion domain and topic resource:
[attachment:discussion:topic/<topic_id>:<filename>] [raw-attachment:discussion:topic/<topic_id>:<filename>] [[Image(discussion:topic/<topic_id>:<filename>)]]
There are also two custom macros doing the same and they simplifies the syntax a bit:
[topic-attachment:<topic_id>:<filename>] [raw-topic-attachment:<topic_id>:<filename>]
Planned Features
- Better permission system (maybe using 0.11 permissions policies).
- email2trac support.
Notes
- Branch 0.9 of plugin is considered as deprecated and not developed anymore.
- Please test if all links and forms redirects page to proper location after request processing in 0.11 branch. If they don't or any error occurs, create a ticket describing error or behavior you expect.
Support
If you have any troubles with plugin's installation or configuration and your problem is generally Trac related, you can ask on #trac channel at Freenode IRC network to get the quickiest answer. If the problem is purely DiscussionPlugin related, you can create a topic at BlackTrac discussion - DiscussionPlugin forum
Feedback
Change Log
[8310] by Blackhex on 07/29/10 13:13:40
- Fixing bug ##7412.
[8112] by Blackhex on 06/12/10 01:41:06
- Possible regression #7238 fix.
[7899] by Blackhex on 04/29/10 15:07:57
- Fixing missing RSS templates (bug #6877).
- Custom icon for timeline events added (#6744).
- Wiki links to discussion attachments added (#6990).
- Author names are now formated with format_author() (#6587, #6468, #6307).
- Added indices for time columns of discussion tables (#5645).
[7282] by Blackhex on 12/19/09 13:21:44
- Fixing bug #6350.
[6310] by Blackhex on 07/29/09 13:32:55
- RSS feed formats for forums and topics. (#1364).
[6309] by Blackhex on 07/28/09 14:48:53
- Spam filter support (#2706).
[6308] by Blackhex on 07/28/09 13:25:27
- E-mail notification, subscription and ivitation finished (#725, #1424, #3167).
- Tables ordering by columns fixed.
- Possibly bug #4648 fixed.
- IForumChangeListener interface added.
[6261] by Blackhex on 07/22/09 15:44:54
- E-mail notification reimplemented as a component (#725).
- Partially implemented posibility to subscribe or invite user to topics or forums (#3167 #3010 #1424).
- Enabled revision diplay for setuptools (#4662).

