Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions forum.module
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,19 @@ function forum_uri($forum) {
);
}

/**
* Implements hook_url_outbound_alter().
*/
function forum_url_outbound_alter(&$path, &$options, $original_path) {
$matches = array();
if ($path !== NULL && preg_match('|^taxonomy/term/([0-9]*)(?!/edit)(/.*)?|', $path, $matches)) {
$term = taxonomy_term_load($matches[1]);
if ($term->vocabulary == config_get('forum.settings', 'forum_nav_vocabulary')) {
$path = 'forum/' . $matches[1];
}
}
}

/**
* Checks whether a node can be used in a forum, based on its content type.
*
Expand Down