X-Git-Url: http://git.veekun.com/zzz-spline-forum.git/blobdiff_plain/3be1ed06645727c8d66d23a07ead0d09a24b55c6..3d22d513717cc7d52fc07eeece5cf81fb6ec6ee9:/splinext/forum/__init__.py diff --git a/splinext/forum/__init__.py b/splinext/forum/__init__.py index 6914409..07db391 100644 --- a/splinext/forum/__init__.py +++ b/splinext/forum/__init__.py @@ -15,6 +15,7 @@ def add_routes_hook(map, *args, **kwargs): map.connect('/forums/{forum_id}', controller='forum', action='threads') map.connect('/forums/{forum_id}/threads/{thread_id}', controller='forum', action='posts') + map.connect('/forums/{forum_id}/write', controller='forum', action='write_thread') map.connect('/forums/{forum_id}/threads/{thread_id}/write', controller='forum', action='write') @@ -25,6 +26,16 @@ class ForumPlugin(PluginBase): ) def hooks(self): - return [ + hooks = [ ('routes_mapping', Priority.NORMAL, add_routes_hook), ] + + # frontpage plugin may or may not be installed + try: + from splinext.forum.frontpage_sources import ForumSource + hooks.append( + ('frontpage_updates_forum', Priority.NORMAL, ForumSource)) + except ImportError: + pass + + return hooks