Version 75 (modified by anonymous, 8 years ago) (diff)


Discussion Forum Plugin

Notice: This plugin is unmaintained and available for adoption.


The DiscussionPlugin adds discussion forums to Trac. An arbitrary number of forums can be added, organized 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 Trac administration interface 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.


If you want to support plugin's development, you can donate some small amount via PayPal. If you specify particular feature, you want to support, in the note field, the donation will be used on that feature.

Any donation will be gratefully welcomed.

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:discussionplugin download zipped sources], check out using Subversion, or browse the source with Trac.


If you need spam filtering feature working, the SpamFilterPlugin installation is required. In other cases, disable a DiscussionSpamFilter component. On older Trac versions, the DiscussionPlugin depends on a WebAdminPlugin since many configuration options are available only on appropriate WebAdminPlugin's pages. Since Trac 0.10, the WebAdminPlugin is internal part of the Trac.

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.12-stable 0.6, 0.7

Main difference between 0.5 and 0.6 version is that 0.6 uses Genshi templates and 0.5 ClearSilver ones.


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:

title = Discussion
default_topic_display = classic
default_message_display = tree
forum_sort = lasttopic
forum_sort_direction = asc
topic_sort = lastreply
topic_sort_direction = asc
topics_per_page = 30
messages_per_page = 50
smtp_always_cc = 

Option title changes title of main navigation bar button, default_topic_display changes between two possible displays of topic list - the classic and the compact view. default_message_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. topics_per_page and messages_per_page options controlls number of items displayed in topic and message lists at each page of pagination. You can type list of e-mail addresses into smtp_always_cc option to send all discussion plugin e-mail notification to them. 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:

tracdiscussion.admin.DiscussionWebAdmin = enabled
tracdiscussion.api.DiscussionApi = enabled
tracdiscussion.core.DiscussionCore = enabled
tracdiscussion.init.DiscussionInit = enabled
tracdiscussion.notification.DiscussionNotifyEmail = enabled = enabled
tracdiscussion.spamfilter.DiscussionSpamFilter = enabled # Optional, disable if you don't have SpamFilterPlugin.
tracdiscussion.timeline.DiscussionTimeline = enabled = 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.


Discussion plugin defines five permissions. With DISCUSSION_VIEW permission you can view all topics and you can post replies to them with DISCUSSION_APPEND permission. Attachments can be added to the topics with DISCUSSION_ATTACH 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 web administration interface 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_ATTACH
# trac-admin <path_to_environment> permission add <user> DISCUSSION_MODERATE
# trac-admin <path_to_environment> permission add <user> DISCUSSION_ADMIN


There are few wiki macros available:

[forum:<forum_id> <text>]

Displays a link to forum with id <id> and text <text>. Second argument is optional.

[topic:<topic_id> <text>]

Displays a link to topic with id <id> and text <text>. Second argument is optional.

[message:<message_id> <text>]

Displays a link to reply with id <id> and text <text>. Second argument is optional.

[last-forum:<forum_group_id> <text>]

Displays a link to the last forum created in forum group with id <id> and text <text>. Second argument is optional.

[last-topic:<forum_id> <text>]

Displays a link to the last topic created in forum with id <id> and text <text>. Second argument is optional.


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.

[[RecentTopics(<forum_id>,<number_of_topics>)]] or [[RecentTopics(<number_of_topics>)]]

Displays list of recently changed topics in a forum <forum_id> or in all forums, if <forum_id> is not specified, grouped by the day of their last change. Second argument <number_of_topics> limits the number of recently changed topics displayed.


Discuss this on the [forum:5 Trac Development forum]. 
Useful threads are [topic:23 this one] and [topic:96 this one].


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:


There are also two custom macros doing the same and they simplifies the syntax a bit:


Planned Features

  • Better permission system (maybe using 0.11 permissions policies).
  • email2trac support.


  • Branches 0.9 and 0.10 of the plugin are considered as deprecated and not developed anymore. User-contributed backporting patches are welcomed though.
  • Branch 0.11 of the plugin is tested mainly with Trac 0.12 now. If you encounter some problem on Trac 0.11, just create a ticket about it. Separate branch 0.12 will be created only in case of significant differences between Trac 0.11 and 0.12 relevant to the plugin.


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


Are you using this plugin?
  • Yes, it's usefull. (sgrayban, cboos, okaori, wadeb, s0undt3ch, ttressieres, imme, dh1jc, talameelombu, Tharban, athomas, jtuchscherer, xvirus, osimons, Sincklation, manni, izzy, ericalens, KevinGabbert, mwehr, renzo, marcvs, eskil, rjollos, koolhand, edo, colski, dfleming, lucasrangit, miezuit, lhr870630, hasienda, arnisandy, lucid, AdrianFritz, akliewer99, AmigaAbattoir, laijinman, ntmlod)
  • No, it's useless. (falkb)
  • No, I don't need it. (dfaerch, harmy, prz)
  • I think it will help

  • You don't have permission to vote. You may need to login.

Change Log

16775 by rjollos on 2017-08-26 03:49:19
TracDiscussion 1.2: Update copyright info
16671 by rjollos on 2017-06-19 05:05:51
TracDiscussion 1.2dev: Fix incorrect username in input fields

format_author should not be used in input fields.

16670 by rjollos on 2017-06-19 04:17:31
TracDiscussion 1.2dev: Strip trailing whitespace
16669 by rjollos on 2017-06-19 04:16:30
TracDiscussion 1.2dev: Fix error adding forum with no groups defined
16503 by rjollos on 2017-04-15 08:52:25
1.2dev: Fix parsing list from request argument
16492 by rjollos on 2017-04-15 08:15:08
1.2dev: Refactor and use Trac 1.2 API

Refs #7990.

16465 by rjollos on 2017-04-04 07:27:59
Fix indentation


Author: Blackhex
Contributors: athomas lucid

Attachments (3)

Download all attachments as: .zip