function bb_load_template($files, $globals = false, $action_arg = null)
{
    global $bb, $bbdb, $bb_current_user, $page, $bb_cache, $posts, $bb_post, $post_id, $topics, $topic, $topic_id, $forums, $forum, $forum_id, $tags, $tag, $tag_name, $user, $user_id, $view, $del_class, $bb_alt;
    if ($globals) {
        foreach ($globals as $global => $v) {
            if (!is_numeric($global)) {
                ${$global} = $v;
            } else {
                global ${$v};
            }
        }
    }
    $files = (array) $files;
    $template = false;
    $default_template = false;
    $file_used = false;
    $default_file_used = false;
    foreach ($files as $file) {
        do_action('bb_' . $file, $action_arg);
        if (false !== ($template = bb_get_template($file, false))) {
            $file_used = $file;
            break;
        }
        if (!$default_template) {
            if (false !== ($default_template = bb_get_default_template($file))) {
                $default_file_used = $file;
            }
        }
    }
    if (!$template && $default_template) {
        $template = $default_template;
        $file_used = $default_file_used;
    }
    $template = apply_filters('bb_template', $template, $file_used);
    include $template;
    do_action('bb_after_' . $file_used, $action_arg);
}
Exemplo n.º 2
0
/**
 * Loads the theme's translated strings.
 *
 * If the current locale exists as a .mo file in the theme's root directory, it
 * will be included in the translated strings by the $domain.
 *
 * The .mo files must be named based on the locale exactly.
 *
 * @since 0.7.2
 *
 * @param string $domain Unique identifier for retrieving translated strings
 */
function bb_load_theme_textdomain($domain, $path = false)
{
    $locale = bb_get_locale();
    $mofile = empty($path) ? bb_get_template($locale . '.mo') : "{$path}/{$locale}.mo";
    load_textdomain($domain, $mofile);
}