function advanced_forum_path_to_style in Advanced Forum 5
Same name and namespace in other branches
- 6.2 includes/style.inc \advanced_forum_path_to_style()
- 6 advanced_forum.module \advanced_forum_path_to_style()
- 7.2 includes/style.inc \advanced_forum_path_to_style()
Returns the full path to the advanced forum style, including the style name
2 calls to advanced_forum_path_to_style()
- advanced_forum_path_to_images in ./
advanced_forum.module - Returns the path to the advanced forum image directory
- _advanced_forum_add_files in ./
advanced_forum.module - Adds extra files needed when we have a post that is to be treated as a forum post. Mostly CSS but could be JS and others in the future.
File
- ./
advanced_forum.module, line 1130 - Enables the look and feel of other popular forum software.
Code
function advanced_forum_path_to_style() {
static $style_path;
if (!$style_path) {
// Retrieve the style name
$style = advanced_forum_get_current_style();
// Check first if there is a subtheme. This function is defined in Zen
// and potentially may exist in other themes with subthemes.
init_theme();
if (function_exists("path_to_subtheme")) {
$path_to_subtheme = path_to_subtheme();
$style_path = $path_to_subtheme . '/' . $style;
}
// If we had no luck finding the style in a subtheme, find the style path
// the normal way.
if (empty($path_to_subtheme) || empty($style_path) || !file_exists($style_path)) {
$style_path = path_to_theme() . '/' . $style;
}
}
return $style_path;
}