![]() |
|
sfSimpleForumPlugin - 0.6.0Lightweight embedded forum plugin. |
|
Some of the plugins offer one-click modules to easily add complete features to your symfony applications
![]() |
DescriptionA simple embedded forum for Symfony applications. Categories |
| Name | |
|---|---|
|
|
moc.tcejorp-ynofmys <<ta>> ottoninaz.siocnarf |

| Version | License | API | Released |
|---|---|---|---|
| 0.6.6beta | MIT license | 0.6.6beta | 28/02/2008 |
| 0.6.5beta | MIT license | 0.6.5beta | 08/11/2007 |
| 0.6.4beta | MIT license | 0.6.4beta | 10/10/2007 |
| 0.6.3beta | MIT license | 0.6.3beta | 03/10/2007 |
| 0.6.2beta | MIT license | 0.6.2beta | 25/09/2007 |
| 0.6.1beta | MIT license | 0.6.1beta | 07/09/2007 |
| 0.6.0alpha | MIT license | 0.6.0alpha | 03/07/2007 |
| Version | License | API | Released |
|---|---|---|---|
| 0.6.7beta | MIT license | 0.6.7beta | 23/09/2008 |
| 0.6.6beta | MIT license | 0.6.6beta | 28/02/2008 |
| 0.6.5beta | MIT license | 0.6.5beta | 08/11/2007 |
| 0.6.4beta | MIT license | 0.6.4beta | 10/10/2007 |
| 0.6.3beta | MIT license | 0.6.3beta | 03/10/2007 |
| 0.6.2beta | MIT license | 0.6.2beta | 25/09/2007 |
| 0.6.1beta | MIT license | 0.6.1beta | 07/09/2007 |
| 0.6.0alpha | MIT license | 0.6.0alpha | 03/07/2007 |
Copyright (c) 2007 François Zaninotto
Copyright (c) 2007 Nick Winfield
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Go to the ticketing system to view opened tickets or report a bug.
php symfony plugin:install sfSimpleForumPlugin --release=0.6.0
php symfony plugin-install http://plugins.symfony-project.org/sfSimpleForumPlugin
Go to the repository: http://svn.symfony-project.com/plugins/sfSimpleForumPlugin
This plugin allows you to embed a forum within your symfony application with the following features:
Topics are grouped into forums, forums are grouped into categories
Topics are flat (= not threaded)
Breadcrumb navigation
Pagination
Lists of latest messages are available for all forums, one forum, one user
RSS feeds (requires sfFeed2Plugin)
Identified users can participate in any topic and submit new messages
User management is controlled through sfGuardPlugin
Basic moderation
Uses output escaping to prevent XSS attacks
i18n ready
It is not aimed at replacing full-featured forum packages, but offers a lightweight alternative for when you build a website that has to contain a forum section. It is voluntarily simple, and contains many optimizations so that is remains fast even with a lot of messages and concurrent users. It is very easy to configure and adapt, so it should fulfill most basic forum requirements.
Please note that this plugin is in active development. If you want to help and improve it, please contact François Zaninotto.



The prerequisites for using the sfSimpleForum plugin are:
As the plugin doesn't contain a user management module, the project where you install it must have a table managing authors, or users (whatever the name), and the related Propel class must have a __toString() method. Both these conditions are satisfied by the sfGuardPlugin, so installing this plugin is a good choice.
If you want to use RSS feeds, you must install the sfFeed2Plugin.
To install the plugin for a symfony project, the usual process is to use the symfony command line:
$ php symfony plugin-install http://plugins.symfony-project.com/sfSimpleForumPlugin
Alternatively, if you don't have PEAR installed, you can download the latest package attached to this plugin's wiki page and extract it under your project's plugins/ directory. You will also have to copy the contents of the myproject/plugins/sfSimpleForumPlugin/web/ directory into a myproject/web/sfSimpleForumPlugin/ directory.
Rebuild the model, generate the SQL code for the new tables and insert it into your database:
$ php symfony propel-build-all
Clear the cache to enable the autoloading to find the new classes:
$ php symfony cc
You can load the included fixtures to start using the forum with test data.
$ php symfony propel-load-data frontend plugins\sfSimpleForumPlugin\data\fixtures
Enable the new sfSimpleForum module in your application, via the settings.yml file.
// in myproject/apps/frontend/config/settings.yml
all:
.settings:
enabled_modules: [sfSimpleForum](default,)
Start using the plugin by browsing to the frontend module's default page:
http://myproject/frontend_dev.php/sfSimpleForum
The templates of the sfSimpleForum module define some slots that you cna use inside your layout:
auto_discovery_link_tag: For the auto discovery links, to be placed in the <head> section
forum_navigation: For the forum breadcrumb and actions
An example layout to display all the information of the template is given below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<?php include_http_metas() ?>
<?php include_metas() ?>
<?php include_title() ?>
<?php include_slot('auto_discovery_link_tag') ?>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div class="sfSimpleForum">
<?php include_slot('forum_navigation') ?>
</div>
<?php echo $sf_data->getRaw('sf_content') ?>
</body>
</html>
Some of the features of the plugin can be altered by configuration. To do so, add some of the following lines to your application's app.yml:
all:
sfSimpleForumPlugin:
forum_name: My symfony forum
display_categories: true
use_feeds: true # requires sfFeed2Plugin
allowed_tags: <b><i><strong><em><img><a><p><br> # other tags are stripped from user contributions
breadcrumb_separator: ' » ' # separator for breadcrumb trail
max_per_page: 10 # maximum threads or messages per page
pages_displayed: 5 # maximum pages displayed by the pager navigation
feed_max: 10 # maximum messages served by feed
show_author_details: false # display number of messages of post authors
The plugin doesn't come with any routing rule. However, you can add some of your own to make the URLs look nicer. An example of set of rules could be as follows:
forum_home:
url: /forum
param: { module: sfSimpleForum, action: forumList }
forum_latest_messages:
url: /forum/latest
param: { module: sfSimpleForum, action: latestPosts }
forum_latest_messages_feed:
url: /forum/latest/feed
param: { module: sfSimpleForum, action: latestPostsFeed }
forum_forum:
url: /forum/:forum_name
param: { module: sfSimpleForum, action: forum }
forum_latest_messages_for_forum:
url: /forum/:forum_name/latest
param: { module: sfSimpleForum, action: latestPosts }
forum_latest_messages_for_forum_feed:
url: /forum/:forum_name/latest/feed
param: { module: sfSimpleForum, action: latestPostsFeed }
forum_thread:
url: /forum/thread/:id/:stripped_title
param: { module: sfSimpleForum, action: topic }
forum_thread_feed:
url: /forum/thread/:id/:stripped_title/feed
param: { module: sfSimpleForum, action: topicFeed }
forum_latest_messages_by_user:
url: /forum/user/:username
param: { module: sfSimpleForum, action: latestUserPosts }
forum_latest_messages_by_user_feed:
url: /forum/user/:username/rss
param: { module: sfSimpleForum, action: latestUserPostsFeed }
The sfSimpleForum module comes with a default stylesheet. You can choose to use your own stylesheet instead of the default one. To do so, you must create an empty sfSimpleForum module inside your application with just one config/view.yml file in it, with the followin content:
all:
stylesheets: [myCustomStylesheet](-/sfSimpleForumPlugin/css/default.css,)

