diff options
Diffstat (limited to 'mod/groups/start.php')
-rw-r--r-- | mod/groups/start.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mod/groups/start.php b/mod/groups/start.php index aeab0649a..c8198371b 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -714,6 +714,7 @@ function discussion_init() { elgg_register_library('elgg:discussion', elgg_get_plugins_path() . 'groups/lib/discussion.php'); elgg_register_page_handler('discussion', 'discussion_page_handler'); + elgg_register_page_handler('forum', 'discussion_forum_page_handler'); elgg_register_entity_url_handler('object', 'groupforumtopic', 'discussion_override_topic_url'); @@ -745,6 +746,20 @@ function discussion_init() { } /** + * Exists for backwards compatibility for Elgg 1.7 + */ +function discussion_forum_page_handler($page) { + switch ($page[0]) { + case 'topic': + header('Status: 301 Moved Permanently'); + forward("/discussion/view/{$page[1]}/{$page[2]}"); + break; + default: + return false; + } +} + +/** * Discussion page handler * * URLs take the form of @@ -792,7 +807,7 @@ function discussion_page_handler($page) { * @return string */ function discussion_override_topic_url($entity) { - return 'discussion/view/' . $entity->guid; + return 'discussion/view/' . $entity->guid . '/' . elgg_get_friendly_title($entity->title); } /** |