function forum_description($args = null)
{
    if (is_numeric($args)) {
        $args = array('id' => $args);
    } elseif ($args && is_string($args) && false === strpos($args, '=')) {
        $args = array('before' => $args);
    }
    $defaults = array('id' => 0, 'before' => ' – ', 'after' => '');
    $args = wp_parse_args($args, $defaults);
    if ($desc = apply_filters('forum_description', get_forum_description($args['id']), $args['id'], $args)) {
        echo $args['before'] . $desc . $args['after'];
    }
}
function bb_forum_form($forum_id = 0)
{
    $forum_id = (int) $forum_id;
    if ($forum_id && !($forum = bb_get_forum($forum_id))) {
        return;
    }
    $forum_name = '';
    $forum_slug = '';
    $forum_description = '';
    $forum_position = '';
    if ($forum_id) {
        $forum_name = get_forum_name($forum_id);
        $forum_slug = apply_filters('editable_slug', $forum->forum_slug);
        $forum_description = get_forum_description($forum_id);
        $forum_position = get_forum_position($forum_id);
        $legend = __('Edit Forum');
        $submit = __('Save Changes');
        $action = 'update';
    } else {
        $legend = __('Add Forum');
        $submit = __('Add Forum');
        $action = 'add';
    }
    $forum_options = array('forum_name' => array('title' => __('Name'), 'value' => $forum_name), 'forum_slug' => array('title' => __('Slug'), 'value' => $forum_slug), 'forum_desc' => array('title' => __('Description'), 'value' => $forum_description, 'class' => 'long'), 'forum_parent' => array('title' => __('Parent'), 'type' => 'select', 'options' => bb_get_forum_dropdown(array('cut_branch' => $forum_id, 'id' => 'forum_parent', 'none' => true, 'selected' => $forum_id ? get_forum_parent($forum_id) : 0, 'disable_categories' => 0, 'options_only' => true))), 'forum_order' => array('title' => __('Position'), 'value' => $forum_position, 'class' => 'short'), 'forum_is_category' => array('title' => __('Category'), 'type' => 'checkbox', 'options' => array(1 => array('label' => __('Make this forum a category'), 'value' => bb_get_forum_is_category($forum_id))), 'note' => __('Categories are forums where new topics cannot be created. Categories usually contain a group of sub-forums.')));
    if (!$forum_id) {
        unset($forum_options['forum_slug']);
        unset($forum_options['forum_order']);
    }
    ?>
<form class="settings" method="post" id="<?php 
    echo $action;
    ?>
-forum" action="<?php 
    bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN);
    ?>
" class="add:forum-list: forum-form">
	<fieldset>
		<legend><?php 
    echo $legend;
    ?>
</legend>
<?php 
    foreach ($forum_options as $option => $args) {
        bb_option_form_element($option, $args);
    }
    ?>
		<fieldset class="submit">
<?php 
    if ($forum_id) {
        ?>
			<input type="hidden" name="forum_id" value="<?php 
        echo $forum_id;
        ?>
" />
<?php 
    }
    ?>
			<?php 
    bb_nonce_field('order-forums', 'order-nonce');
    ?>
			<?php 
    bb_nonce_field($action . '-forum');
    ?>
			<input type="hidden" name="action" value="<?php 
    echo $action;
    ?>
" />
			<input class="submit" type="submit" name="submit" value="<?php 
    echo $submit;
    ?>
" />
		</fieldset>
	</fieldset>
</form>
<?php 
}
예제 #3
0
파일: forum.php 프로젝트: billerby/Surdeg
					<div class="info">
						<a href="<?php 
echo bb_get_forum_posts_rss_link();
?>
"><img src="<?php 
echo bb_get_active_theme_uri();
?>
image/feed.png" width="16" height="16" alt="Feed"/></a>
					</div>
					<h2><?php 
_e('Page Information', 'guangzhou');
?>
</h2>
					<?php 
if (get_forum_description()) {
    echo '<p>' . get_forum_description() . '</p>';
}
?>
					
					<p><?php 
printf(__('Subscribe through your <a href="%s">feed reader</a>.', 'guangzhou'), bb_get_forum_posts_rss_link());
?>
</p>
				</li>
				<?php 
do_action('gz_place_sidebar');
?>
				
				<li>
					<h2><?php 
_e('Search');