Ejemplo n.º 1
0
    ?>
</table>
<p class="rss-link"><a href="<?php 
    bb_forum_posts_rss_link();
    ?>
" class="rss-link"><?php 
    _e('<abbr title="Really Simple Syndication">RSS</abbr> feed for this forum');
    ?>
</a></p>
<?php 
    forum_pages(array('before' => '<div class="nav">', 'after' => '</div>'));
}
?>

<?php 
if (bb_forums($forum_id)) {
    ?>
<h2><?php 
    _e('Subforums');
    ?>
</h2>
<table id="forumlist">

<tr>
	<th><?php 
    _e('Main Theme');
    ?>
</th>
	<th><?php 
    _e('Topics');
    ?>
Ejemplo n.º 2
0
                ?>
</a></td>
</tr>
<?php 
            }
        }
        // $topics
        ?>
</table>
<?php 
    }
    // $topics or $super_stickies
    ?>

<?php 
    if (bb_forums()) {
        ?>
<h2><?php 
        _e('Forums');
        ?>
</h2>
<table id="forumlist">

<tr>
	<th style="width:260px;"><?php 
        _e('Categories');
        ?>
</th>
	<th><?php 
        _e('Topics');
        ?>
function bb_get_forum_dropdown($args = '')
{
    $defaults = array('callback' => false, 'callback_args' => false, 'id' => 'forum_id', 'none' => false, 'selected' => false, 'tab' => false, 'hierarchical' => 1, 'depth' => 0, 'child_of' => 0, 'disable_categories' => 1, 'options_only' => false);
    if ($args && is_string($args) && false === strpos($args, '=')) {
        $args = array('callback' => $args);
    }
    if (1 < func_num_args()) {
        $args['callback_args'] = func_get_arg(1);
    }
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    if (!bb_forums($args)) {
        return;
    }
    global $forum_id, $forum;
    $old_global = $forum;
    $name = esc_attr($id);
    $id = str_replace('_', '-', $name);
    $tab = (int) $tab;
    if ($none && 1 == $none) {
        $none = __('- None -');
    }
    $r = '';
    if (!$options_only) {
        if ($tab) {
            $tab = ' tabindex="' . $tab . '"';
        } else {
            $tab = '';
        }
        $r .= '<select name="' . $name . '" id="' . $id . '"' . $tab . '">' . "\n";
    }
    if ($none) {
        $r .= "\n" . '<option value="0">' . $none . '</option>' . "\n";
    }
    $no_option_selected = true;
    $options = array();
    while ($depth = bb_forum()) {
        global $forum;
        // Globals + References = Pain
        $pad_left = str_repeat('&nbsp;&nbsp;&nbsp;', $depth - 1);
        if ($disable_categories && isset($forum->forum_is_category) && $forum->forum_is_category) {
            $options[] = array('value' => 0, 'display' => $pad_left . $forum->forum_name, 'disabled' => true, 'selected' => false);
            continue;
        }
        $_selected = false;
        if (!$selected && $forum_id == $forum->forum_id || $selected == $forum->forum_id) {
            $_selected = true;
            $no_option_selected = false;
        }
        $options[] = array('value' => $forum->forum_id, 'display' => $pad_left . $forum->forum_name, 'disabled' => false, 'selected' => $_selected);
    }
    if (1 === count($options) && !$none) {
        foreach ($options as $option_index => $option_value) {
            if ($option_value['disabled']) {
                return;
            }
            return '<input type="hidden" name="' . $name . '" id="' . $id . '" value="' . esc_attr($option_value['value']) . '" /><span>' . esc_html($option_value['display']) . '</span>';
        }
    }
    foreach ($options as $option_index => $option_value) {
        if (!$none && !$selected && $no_option_selected && !$option_value['disabled']) {
            $option_value['selected'] = true;
            $no_option_selected = false;
        }
        $option_disabled = $option_value['disabled'] ? ' disabled="disabled"' : '';
        $option_selected = $option_value['selected'] ? ' selected="selected"' : '';
        $r .= "\n" . '<option value="' . esc_attr($option_value['value']) . '"' . $option_disabled . $option_selected . '>' . esc_html($option_value['display']) . '</option>' . "\n";
    }
    $forum = $old_global;
    if (!$options_only) {
        $r .= '</select>' . "\n";
    }
    return $r;
}
Ejemplo n.º 4
0
</a>
		<input class="submit delete" type="submit" name="submit" value="<?php 
        _e('Delete Forum');
        ?>
" />
	</fieldset>
</form>

<?php 
        break;
    default:
        ?>


<?php 
        if (bb_forums('type=list&walker=BB_Walker_ForumAdminlistitems')) {
            ?>
<ul id="forum-list" class="list:forum list-block holder">
	<li class="thead list-block"><?php 
            _e('Forum');
            ?>
</li>
<?php 
            while (bb_forum()) {
                bb_forum_row();
            }
            ?>
</ul>
<?php 
        }
        // bb_forums()