本文整理汇总了PHP中bbp_forum_title函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_forum_title函数的具体用法?PHP bbp_forum_title怎么用?PHP bbp_forum_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_forum_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rpg_settings_page
//.........这里部分代码省略.........
<a href="http://www.rewweb.co.uk/wp-content/uploads/2014/04/private-group-roles1.jpg"><img src="http://www.rewweb.co.uk/wp-content/uploads/2014/04/private-group-roles1.jpg"/> </a>
</form>
</div><!--end sf-wrap-->
</div><!--end wrap-->
<?php
}
?>
<?php
//************************* Management Info *************************//
?>
<?php
if ($active_tab == 'management_information') {
?>
<?php
settings_fields('rpg_group_settings');
?>
<table class="form-table">
<tr valign="top">
</tr>
<?php
$count = count($rpg_groups);
for ($i = 0; $i < $count; ++$i) {
$g = $i + 1;
$name = "group" . $g;
$item = "rpg_groups[" . $name . "]";
?>
<!------------------------- Group --------------------------------------------->
<tr valign="top">
<th><?php
echo $name;
?>
</th>
<td>
Group name :
<?php
echo esc_html($rpg_groups[$name]) . '<br>';
?>
No. users in this group :
<?php
global $wpdb;
$users = $wpdb->get_col("select ID from {$wpdb->users}");
$countu = 0;
foreach ($users as $user) {
$check = get_user_meta($user, 'private_group', true);
if ($check == $name) {
$countu++;
}
}
echo $countu;
?>
<br>Forums in this group :
<?php
global $wpdb;
$forum = bbp_get_forum_post_type();
$forums = $wpdb->get_col("select ID from {$wpdb->posts} where post_type='{$forum}'");
$countu = 0;
echo '<ul><i>';
foreach ($forums as $forum) {
$meta = (array) get_post_meta($forum, '_private_group', false);
foreach ($meta as $meta2) {
if ($meta2 == $name) {
$ftitle = bbp_forum_title($forum);
echo '<li>' . $ftitle . '</li>';
$countu++;
}
}
}
echo '</ul></i>';
echo 'No. forums that have this group set : ' . $countu;
?>
</td></tr>
<?php
}
?>
</table>
</form>
</div><!--end sf-wrap-->
</div><!--end wrap-->
<?php
}
?>
<?php
//**** user management
if ($active_tab == 'user_management') {
$group = 'all';
pg_user_management($group);
}
//end of tab function
}
示例2: bbp_topic_subscription_link
<?php
bbp_topic_subscription_link();
?>
<?php
bbp_topic_favorite_link();
?>
</li>
<?php
}
?>
<li class="topic-info-general clearfix">
<div class="path fl"><a href="<?php
bbp_forum_permalink(bbp_get_forum_id());
?>
"><?php
bbp_forum_title(bbp_get_topic_forum_id(bbp_get_topic_id()));
?>
</a></div>
<div class="date fr">
<time datetime="<?php
echo get_post_time('c', false, bbp_get_topic_id());
?>
">
<?php
printf(_x('%1$s at %2$s', '1: date, 2: time'), get_post_time(bbpresskr()->forum_option('date_format'), false, bbp_get_topic_id()), get_post_time(bbpresskr()->forum_option('time_format'), false, bbp_get_topic_id()));
?>
</time>
</div>
<div class="title"><?php
bbp_topic_title();
?>
示例3: ipt_kb_bbp_forum_title_in_list
function ipt_kb_bbp_forum_title_in_list($forum_id = 0)
{
do_action('bbp_theme_before_forum_title');
?>
<a class="bbp-forum-title" href="<?php
bbp_forum_permalink($forum_id);
?>
"><?php
bbp_forum_title($forum_id);
?>
</a>
<?php
do_action('bbp_theme_after_forum_title');
?>
<?php
}
示例4: widget
/**
* Displays the output, the forum list
*
* @since bbPress (r2653)
*
* @param mixed $args Arguments
* @param array $instance Instance
* @uses apply_filters() Calls 'bbp_forum_widget_title' with the title
* @uses get_option() To get the forums per page option
* @uses current_user_can() To check if the current user can read
* private() To resety name
* @uses bbp_has_forums() The main forum loop
* @uses bbp_forums() To check whether there are more forums available
* in the loop
* @uses bbp_the_forum() Loads up the current forum in the loop
* @uses bbp_forum_permalink() To display the forum permalink
* @uses bbp_forum_title() To display the forum title
*/
public function widget($args, $instance)
{
// Get widget settings
$settings = $this->parse_settings($instance);
// Typical WordPress filter
$settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
// bbPress filter
$settings['title'] = apply_filters('bbp_forum_widget_title', $settings['title'], $instance, $this->id_base);
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_normalize_forum_visibility action and function.
$widget_query = new WP_Query(array('post_type' => bbp_get_forum_post_type(), 'post_parent' => $settings['parent_forum'], 'post_status' => bbp_get_public_status_id(), 'posts_per_page' => get_option('_bbp_forums_per_page', 50), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'orderby' => 'menu_order title', 'order' => 'ASC'));
// Bail if no posts
if (!$widget_query->have_posts()) {
return;
}
echo $args['before_widget'];
if (!empty($settings['title'])) {
echo $args['before_title'] . $settings['title'] . $args['after_title'];
}
?>
<ul>
<?php
while ($widget_query->have_posts()) {
$widget_query->the_post();
?>
<li><a class="bbp-forum-title" href="<?php
bbp_forum_permalink($widget_query->post->ID);
?>
"><?php
bbp_forum_title($widget_query->post->ID);
?>
</a></li>
<?php
}
?>
</ul>
<?php
echo $args['after_widget'];
// Reset the $post global
wp_reset_postdata();
}
示例5: widget
/**
* Displays the output, the forum list
*
* @since bbPress (r2653)
*
* @param mixed $args Arguments
* @param array $instance Instance
* @uses apply_filters() Calls 'bbp_forum_widget_title' with the title
* @uses get_option() To get the forums per page option
* @uses current_user_can() To check if the current user can read
* private() To resety name
* @uses bbp_has_forums() The main forum loop
* @uses bbp_forums() To check whether there are more forums available
* in the loop
* @uses bbp_the_forum() Loads up the current forum in the loop
* @uses bbp_forum_permalink() To display the forum permalink
* @uses bbp_forum_title() To display the forum title
*/
public function widget($args, $instance)
{
extract($args);
$title = apply_filters('bbp_forum_widget_title', $instance['title']);
$parent_forum = !empty($instance['parent_forum']) ? $instance['parent_forum'] : '0';
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_exclude_forums filter and function.
$widget_query = new WP_Query(array('post_parent' => $parent_forum, 'post_type' => bbp_get_forum_post_type(), 'posts_per_page' => get_option('_bbp_forums_per_page', 50), 'orderby' => 'menu_order', 'order' => 'ASC'));
if ($widget_query->have_posts()) {
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<ul>
<?php
while ($widget_query->have_posts()) {
$widget_query->the_post();
?>
<li><a class="bbp-forum-title" href="<?php
bbp_forum_permalink($widget_query->post->ID);
?>
" title="<?php
bbp_forum_title($widget_query->post->ID);
?>
"><?php
bbp_forum_title($widget_query->post->ID);
?>
</a></li>
<?php
}
?>
</ul>
<?php
echo $after_widget;
// Reset the $post global
wp_reset_postdata();
}
}
示例6: bbp_forum_id
<ul id="forums-list-<?php
bbp_forum_id();
?>
" class="bbp-forums">
<li class="bbp-header">
<ul class="forum-titles">
<li class="bbp-forum-info"><?php
if (bbp_is_forum_category()) {
?>
<a class="bbp-forum-title" href="<?php
bbp_forum_permalink(bbp_get_forum_parent_id());
?>
"><?php
bbp_forum_title(bbp_get_forum_parent_id());
?>
</a><?php
} else {
_e('Forum', 'bbpress');
}
?>
</li>
<li class="bbp-forum-topic-count"><?php
_e('Topics', 'bbpress');
?>
/<?php
bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress');
?>
</li>
<li class="bbp-forum-freshness"><?php
示例7: bbp_forum_permalink
?>
<?php
?>
<ul class="td-reply-list-header">
<li class="td-posted-in">Posted in: <a href="<?php
bbp_forum_permalink(bbp_get_forum_id());
?>
"><?php
bbp_forum_title(bbp_get_forum_id());
?>
</a>
</li>
<li class="td-favorite-subscribe">
<?php
bbp_user_favorites_link();
?>
<?php
bbp_user_subscribe_link();
?>
</li>
</ul>
<?php
示例8: do_action
<div class="row column-content-wrapper">
<div id="content" class="span12 article-container tc-gallery-style">
<article class="row-fluid">
<?php do_action( 'bbp_before_main_content' ); ?>
<?php do_action( 'bbp_template_notices' ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( bbp_user_can_view_forum() ) : ?>
<div id="forum-<?php bbp_forum_id(); ?>" class="bbp-forum-content">
<h1 class="entry-title"><?php bbp_forum_title(); ?></h1>
<div class="entry-content">
<?php bbp_get_template_part( 'content', 'single-forum' ); ?>
</div>
</div><!-- #forum-<?php bbp_forum_id(); ?> -->
<?php else : // Forum exists, user no access ?>
<?php bbp_get_template_part( 'feedback', 'no-access' ); ?>
<?php endif; ?>
<?php endwhile; ?>
示例9: display_forums
/**
* Output the forums for a group in the edit screens
*
* As of right now, bbPress only supports 1-to-1 group forum relationships.
* In the future, many-to-many should be allowed.
*
* @since bbPress (r3653)
* @uses bp_get_current_group_id()
* @uses bbp_get_group_forum_ids()
* @uses bbp_has_forums()
* @uses bbp_get_template_part()
*/
public function display_forums($offset = 0)
{
global $wp_query;
// Allow actions immediately before group forum output
do_action('bbp_before_group_forum_display');
// Load up bbPress once
$bbp = bbpress();
/** Query Resets ******************************************************/
// Forum data
$forum_action = bp_action_variable($offset);
$forum_ids = bbp_get_group_forum_ids(bp_get_current_group_id());
$forum_id = array_shift($forum_ids);
// Always load up the group forum
bbp_has_forums(array('p' => $forum_id, 'post_parent' => null));
// Set the global forum ID
$bbp->current_forum_id = $forum_id;
// Assume forum query
bbp_set_query_name('bbp_single_forum');
?>
<div id="bbpress-forums">
<?php
switch ($forum_action) {
/** Single Forum **********************************************/
case false:
case 'page':
// Strip the super stickies from topic query
add_filter('bbp_get_super_stickies', array($this, 'no_super_stickies'), 10, 1);
// Unset the super sticky option on topic form
add_filter('bbp_get_topic_types', array($this, 'unset_super_sticky'), 10, 1);
// Query forums and show them if they exist
if (bbp_forums()) {
// Setup the forum
bbp_the_forum();
?>
<h3><?php
bbp_forum_title();
?>
</h3>
<?php
bbp_get_template_part('content', 'single-forum');
// No forums found
} else {
?>
<div id="message" class="info">
<p><?php
esc_html_e('This group does not currently have a forum.', 'bbpress');
?>
</p>
</div>
<?php
}
break;
/** Single Topic **********************************************/
/** Single Topic **********************************************/
case $this->topic_slug:
// hide the 'to front' admin links
add_filter('bbp_get_topic_stick_link', array($this, 'hide_super_sticky_admin_link'), 10, 2);
// Get the topic
bbp_has_topics(array('name' => bp_action_variable($offset + 1), 'posts_per_page' => 1, 'show_stickies' => false));
// If no topic, 404
if (!bbp_topics()) {
bp_do_404(bbp_get_forum_permalink($forum_id));
?>
<h3><?php
bbp_forum_title();
?>
</h3>
<?php
bbp_get_template_part('feedback', 'no-topics');
return;
}
// Setup the topic
bbp_the_topic();
?>
<h3><?php
bbp_topic_title();
?>
</h3>
<?php
// Topic edit
//.........这里部分代码省略.........
示例10: td_show_forum
function td_show_forum($forum_object)
{
$last_active = bbp_get_forum_last_active_id($forum_object->ID);
$time_since = '';
$last_updated_by_avatar = '';
if (!empty($last_active)) {
$time_since = bbp_get_forum_freshness_link($forum_object->ID);
$last_updated_by_avatar = bbp_get_author_link(array('post_id' => $last_active, 'size' => 40, 'type' => 'avatar'));
//echo $time_since;
}
?>
<div class="clearfix"></div>
<ul class="td-forum-list-table td-forum-content">
<li class="td-forum-category-title<?php
if (empty($forum_object->post_content)) {
echo ' td-forum-title-no-desc';
}
?>
">
<div class="td-forum-index-padd">
<a class="bbp-forum-title" href="<?php
bbp_forum_permalink($forum_object->ID);
?>
"><?php
bbp_forum_title($forum_object->ID);
?>
</a>
<?php
if (!empty($forum_object->post_content)) {
?>
<div class="td-forum-description"><?php
echo $forum_object->post_content;
?>
</div>
<?php
}
?>
</li><li class="td-forum-replies">
<div><?php
echo bbp_get_forum_topic_count($forum_object->ID);
?>
topics</div>
<div><?php
echo bbp_get_forum_reply_count($forum_object->ID);
?>
replies</div>
</li><li class="td-forum-last-comment">
<div>
<?php
echo $last_updated_by_avatar;
?>
</div>
<div class="td-forum-last-comment-content">
<div class="td-forum-author-name">
by <a class="td-forum-last-author" href="<?php
bbp_reply_author_url($last_active);
?>
"><?php
echo bbp_get_topic_author_display_name($last_active);
?>
</a>
</div>
<div class="td-forum-time-comment">
<?php
bbp_forum_freshness_link($forum_object->ID);
?>
</div>
</div>
</li>
</ul>
<div class="clearfix"></div>
<?php
}
示例11: apoc_loop_subforums
/**
* Display nested subforums with a hierarchical structure using their parent category
* @version 2.0
*/
function apoc_loop_subforums()
{
// Exclude private forums
$private = apoc_private_forum_ids();
// Check for subforums
$subs = bbp_forum_get_subforums(array('post__not_in' => $private));
if (empty($subs)) {
return;
}
// Buffer output
ob_start();
// Print a header
?>
<header class="forum-header">
<div class="forum-content"><h2><?php
bbp_forum_title();
?>
</h2></div>
<div class="forum-count">Topics</div>
<div class="forum-freshness">Latest Post</div>
</header>
<ol class="forums category <?php
bbp_forum_status();
?>
"><?php
// Loop over forums
foreach ($subs as $count => $sub) {
// Get forum details
$sub_id = $sub->ID;
$title = $sub->post_title;
$desc = $sub->post_content;
$permalink = bbp_get_forum_permalink($sub_id);
// Get topic counts
$topics = bbp_get_forum_topic_count($sub_id, false);
// Get the most recent reply and its topic
$reply_id = bbp_get_forum_last_reply_id($sub_id);
$topic_id = bbp_is_reply($reply_id) ? bbp_get_reply_topic_id($reply_id) : $reply_id;
$topic_title = bbp_get_topic_title($topic_id);
$link = bbp_get_reply_url($reply_id);
// Get the author avatar
$user_id = bbp_get_reply_author_id($reply_id);
$avatar = apoc_get_avatar(array('user_id' => $user_id, 'link' => true, 'size' => 50));
// Toggle html class
$class = $count % 2 ? 'odd' : 'even';
// Print output
?>
<li id="forum-<?php
echo $sub_id;
?>
" class="forum <?php
echo $class;
?>
">
<div class="forum-content">
<h3 class="forum-title"><a href="<?php
echo $permalink;
?>
" title="Browse <?php
echo $title;
?>
"><?php
echo $title;
?>
</a></h3>
<p class="forum-description"><?php
echo $desc;
?>
</p>
</div>
<div class="forum-count">
<?php
echo $topics;
?>
</div>
<div class="forum-freshness">
<?php
echo $avatar;
?>
<div class="freshest-meta">
<a class="freshest-title" href="<?php
echo $link;
?>
" title="<?php
echo $topic_title;
?>
"><?php
echo $topic_title;
?>
</a>
<span class="freshest-author">By <?php
bbp_author_link(array('post_id' => $reply_id, 'type' => 'name'));
?>
</span>
<span class="freshest-time"><?php
//.........这里部分代码省略.........
示例12: bbp_get_forum_topic_count
?>
<?php
$topics = bbp_get_forum_topic_count('' , true );
$reply_id = bbp_get_forum_last_reply_id( );
$topic_id = bbp_is_reply( $reply_id ) ? bbp_get_reply_topic_id( $reply_id ) : $reply_id;
$topic_title = bbp_get_topic_title( $topic_id );
$link = bbp_get_reply_url( $reply_id );
?>
<table class="forum" id="bbp-forum-<?php bbp_forum_id(); ?>">
<tr class="header">
<th colspan="4"><h3><?php bbp_forum_title(); ?></h3></th>
</tr>
<?php
// Check for subforums
$subs = bbp_forum_get_subforums( );
if ( !empty( $subs ) ) {
?>
<tr>
<th>Board</th>
<th>Topics</th>
<th>Posts</th>
<th>Last Post</th>
</tr>
示例13: g1_bbp_forums_shortcode
/**
* [g1_bbp_forums] shortcode callback function.
*
* @param array $atts
* @param string $content
* @return string
*/
function g1_bbp_forums_shortcode($atts, $content)
{
/* We need a static counter to trace a shortcode without the id attribute */
static $counter = 0;
$counter++;
extract(shortcode_atts(array('id' => '', 'class' => ''), $atts, 'g1_bbp_forums'));
// Compose final HTML id attribute
$final_id = strlen($id) ? $id : 'g1-bbp-forums-' . $counter;
// Compose final HTML class attribute
$final_class = array('g1-bbp-forums');
$final_class = array_merge($final_class, explode(' ', $class));
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_normalize_forum_visibility action and function.
$query = new WP_Query(array('post_type' => bbp_get_forum_post_type(), 'post_parent' => $settings['parent_forum'], 'post_status' => bbp_get_public_status_id(), 'posts_per_page' => get_option('_bbp_forums_per_page', 50), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'orderby' => 'menu_order title', 'order' => 'ASC'));
if (!$query->have_posts()) {
return '';
}
// Start output buffer
ob_start();
?>
<div class="<?php
echo implode(' ', array_map('sanitize_html_class', $final_class));
?>
">
<div class="g1-collection g1-collection--grid g1-collection--one-third g1-collection--simple">
<ul>
<?php
while ($query->have_posts()) {
$query->the_post();
?>
<li class="g1-collection__item">
<article>
<?php
if (has_post_thumbnail()) {
?>
<figure class="entry-featured-media">
<a href="<?php
bbp_forum_permalink($query->post->ID);
?>
">
<?php
the_post_thumbnail('g1_one_third');
?>
</a>
</figure>
<?php
} else {
?>
<?php
echo do_shortcode('[placeholder icon="camera" size="g1_one_third"]');
?>
<?php
}
?>
<div class="g1-nonmedia">
<div class="g1-inner">
<header class="entry-header">
<h3 class="entry-title">
<a href="<?php
bbp_forum_permalink($query->post->ID);
?>
"><?php
bbp_forum_title($query->post->ID);
?>
</a>
</h3>
<p class="entry-meta g1-meta">
<span><?php
_e('Topics', 'bbpress');
?>
: <?php
bbp_forum_topic_count($query->post->ID);
?>
</span>
<span><?php
bbp_show_lead_topic() ? _e('Replies', 'bbpress') : _e('Posts', 'bbpress');
?>
: <?php
bbp_show_lead_topic() ? bbp_forum_reply_count($query->post->ID) : bbp_forum_post_count($query->post->ID);
?>
</span>
</p>
</header>
<div class="entry-summary">
<?php
the_excerpt();
?>
</div>
</div>
</div>
</article>
</li>
//.........这里部分代码省略.........
示例14: display_forums
//.........这里部分代码省略.........
<?php
if (bp_is_group_admin_screen($this->slug)) {
bbp_get_template_part('form', 'forum');
}
}
// No forums found
} else {
?>
<div id="message" class="info">
<p><?php
_e('This group does not currently have any forums.', 'bbpress');
?>
</p>
</div>
<?php
if (bp_is_group_admin_screen($this->slug)) {
bbp_get_template_part('form', 'forum');
}
}
// Single forum
} elseif (bp_action_variable($offset) != $this->slug && bp_action_variable($offset) != $this->topic_slug) {
// Get the forum
$forum_post_type = bbp_get_forum_post_type();
$forum_slug = bp_action_variable($offset);
$forums = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_name = '{$forum_slug}' AND post_type = '{$forum_post_type}'", ARRAY_N);
// Forum exists
if (!empty($forums)) {
$forum_id = $forums[0];
$bbp->current_forum_id = $forum_id;
bbp_set_query_name('bbp_single_forum');
?>
<h3><?php
bbp_forum_title();
?>
</h3>
<?php
bbp_get_template_part('content', 'single-forum');
?>
<?php
} else {
?>
<?php
bbp_get_template_part('feedback', 'no-topics');
?>
<?php
bbp_get_template_part('form', 'topic');
?>
<?php
}
// Single topic
} elseif (bp_action_variable($offset) != $this->slug && bp_action_variable($offset) == $this->topic_slug) {
// Get the topic
$topic_post_type = bbp_get_topic_post_type();
$topic_slug = bp_action_variable($offset + 1);
$topics = $wpdb->get_row("SELECT ID FROM {$wpdb->posts} WHERE post_name = '{$topic_slug}' AND post_type = '{$topic_post_type}'", ARRAY_N);
// Topic exists
if (!empty($topics)) {
$topic_id = $topics[0];
$bbp->current_topic_id = $topic_id;
bbp_set_query_name('bbp_single_topic');
?>
<h3><?php
bbp_topic_title();
?>
</h3>
<?php
bbp_get_template_part('content', 'single-topic');
?>
<?php
} else {
?>
<?php
bbp_get_template_part('feedback', 'no-topics');
?>
<?php
bbp_get_template_part('form', 'topic');
?>
<?php
}
}
?>
</div>
<?php
}
示例15: bbp_forum_permalink
<li class="bboss_search_item bboss_search_item_forum">
<div class="item">
<div class="item-title"><a href="<?php
bbp_forum_permalink(get_the_ID());
?>
"><?php
bbp_forum_title(get_the_ID());
?>
</a></div>
<div class="item-desc"><?php
bbp_forum_content(get_the_ID());
?>
</div>
</div>
</li>