diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-05-29 12:58:19 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-05-29 12:58:19 +0000 |
commit | cf3bfe006bd9fa5aedac03fe88cb3229df4dab3e (patch) | |
tree | 5769cf88de75821c517852d9ca9fd080efd849cf /modules | |
parent | 9b8733bca632bfbb36bfdead4004ab714da384d8 (diff) | |
download | brdo-cf3bfe006bd9fa5aedac03fe88cb3229df4dab3e.tar.gz brdo-cf3bfe006bd9fa5aedac03fe88cb3229df4dab3e.tar.bz2 |
- Patch #18260 by Morbus: fixed taxonomy links.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/forum.module | 9 | ||||
-rw-r--r-- | modules/forum/forum.module | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/modules/forum.module b/modules/forum.module index 922df1eb0..4ec9da74a 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -638,8 +638,13 @@ function _forum_parent_select($tid, $title, $child_type) { function forum_link_alter(&$node, &$links) { foreach ($links AS $module => $link) { if (strstr($module, 'taxonomy_term')) { - // Link back to the forum and not the taxonomy term page - $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + // Link back to the forum and not the taxonomy term page. We'll only + // do this if the taxonomy term in question belongs to forums. + $tid = str_replace('taxonomy/term/', '', $link['#href']); + $term = taxonomy_get_term($tid); + if ($term->vid == _forum_get_vid()) { + $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + } } } } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 922df1eb0..4ec9da74a 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -638,8 +638,13 @@ function _forum_parent_select($tid, $title, $child_type) { function forum_link_alter(&$node, &$links) { foreach ($links AS $module => $link) { if (strstr($module, 'taxonomy_term')) { - // Link back to the forum and not the taxonomy term page - $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + // Link back to the forum and not the taxonomy term page. We'll only + // do this if the taxonomy term in question belongs to forums. + $tid = str_replace('taxonomy/term/', '', $link['#href']); + $term = taxonomy_get_term($tid); + if ($term->vid == _forum_get_vid()) { + $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + } } } } |