本文整理汇总了PHP中bp_get_group_date_created函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_get_group_date_created函数的具体用法?PHP bp_get_group_date_created怎么用?PHP bp_get_group_date_created使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_get_group_date_created函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
$user_id = apply_filters('bp_group_widget_user_id', '0');
extract($args);
if (empty($instance['group_default'])) {
$instance['group_default'] = 'popular';
}
if (empty($instance['title'])) {
$instance['title'] = __('Groups', 'buddypress');
}
echo $before_widget;
$title = !empty($instance['link_title']) ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug()) . '">' . $instance['title'] . '</a>' : $instance['title'];
echo $before_title . $title . $after_title;
?>
<?php
if (bp_has_groups('user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] . '&per_page=' . $instance['max_groups'])) {
?>
<div class="item-options" id="groups-list-options">
<a href="<?php
echo site_url(bp_get_groups_root_slug());
?>
" id="newest-groups"<?php
if ($instance['group_default'] == 'newest') {
?>
class="selected"<?php
}
?>
><?php
_e("Newest", 'buddypress');
?>
</a> |
<a href="<?php
echo site_url(bp_get_groups_root_slug());
?>
" id="recently-active-groups"<?php
if ($instance['group_default'] == 'active') {
?>
class="selected"<?php
}
?>
><?php
_e("Active", 'buddypress');
?>
</a> |
<a href="<?php
echo site_url(bp_get_groups_root_slug());
?>
" id="popular-groups" <?php
if ($instance['group_default'] == 'popular') {
?>
class="selected"<?php
}
?>
><?php
_e("Popular", 'buddypress');
?>
</a>
</div>
<ul id="groups-list" class="item-list">
<?php
while (bp_groups()) {
bp_the_group();
?>
<li>
<div class="item-avatar">
<a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_avatar_thumb();
?>
</a>
</div>
<div class="item">
<div class="item-title"><a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_name();
?>
</a></div>
<div class="item-meta">
<span class="activity">
<?php
if ('newest' == $instance['group_default']) {
printf(__('created %s', 'buddypress'), bp_get_group_date_created());
}
if ('active' == $instance['group_default']) {
printf(__('active %s', 'buddypress'), bp_get_group_last_active());
} else {
if ('popular' == $instance['group_default']) {
//.........这里部分代码省略.........
示例2: bp_group_date_created
/**
* Output the created date of the current group in the loop.
*
* @since 1.0.0
* @since 2.7.0 Added $args as a parameter.
*
* @param object|bool $group Optional. Group object. Default: current group in loop.
* @param array|string $args {@see bp_get_group_date_created()}.
*/
function bp_group_date_created($group = false, $args = array())
{
echo bp_get_group_date_created($group, $args);
}
示例3: bp_group_date_created
function bp_group_date_created($group = false)
{
echo bp_get_group_date_created($group);
}
示例4: widget
//.........这里部分代码省略.........
</a>
<span class="bp-separator" role="separator"><?php
echo esc_html($separator);
?>
</span>
<a href="<?php
bp_groups_directory_permalink();
?>
" id="popular-groups" <?php
if ($instance['group_default'] == 'popular') {
?>
class="selected"<?php
}
?>
><?php
_e("Popular", 'buddypress');
?>
</a>
</div>
<ul id="groups-list" class="item-list">
<?php
while (bp_groups()) {
bp_the_group();
?>
<li <?php
bp_group_class();
?>
>
<div class="item-avatar">
<a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_avatar_thumb();
?>
</a>
</div>
<div class="item">
<div class="item-title"><a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_name();
?>
</a></div>
<div class="item-meta">
<span class="activity">
<?php
if ('newest' == $instance['group_default']) {
printf(__('created %s', 'buddypress'), bp_get_group_date_created());
} elseif ('active' == $instance['group_default']) {
printf(__('active %s', 'buddypress'), bp_get_group_last_active());
} elseif ('popular' == $instance['group_default']) {
bp_group_member_count();
}
?>
</span>
</div>
</div>
</li>
<?php
}
?>
</ul>
<?php
wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups');
?>
<input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php
echo esc_attr($max_groups);
?>
" />
<?php
} else {
?>
<div class="widget-error">
<?php
_e('There are no groups to display.', 'buddypress');
?>
</div>
<?php
}
?>
<?php
echo $after_widget;
?>
<?php
}
示例5: bp_group_date_created
function bp_group_date_created()
{
echo bp_get_group_date_created();
}
示例6: groups_ajax_widget_groups_list
/**
* AJAX callback for the Groups List widget.
*
* @since 1.0.0
*/
function groups_ajax_widget_groups_list()
{
check_ajax_referer('groups_widget_groups_list');
switch ($_POST['filter']) {
case 'newest-groups':
$type = 'newest';
break;
case 'recently-active-groups':
$type = 'active';
break;
case 'popular-groups':
$type = 'popular';
break;
}
$per_page = isset($_POST['max_groups']) ? intval($_POST['max_groups']) : 5;
$groups_args = array('user_id' => 0, 'type' => $type, 'per_page' => $per_page, 'max' => $per_page);
if (bp_has_groups($groups_args)) {
?>
<?php
echo "0[[SPLIT]]";
?>
<?php
while (bp_groups()) {
bp_the_group();
?>
<li <?php
bp_group_class();
?>
>
<div class="item-avatar">
<a href="<?php
bp_group_permalink();
?>
"><?php
bp_group_avatar_thumb();
?>
</a>
</div>
<div class="item">
<div class="item-title"><a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_name();
?>
</a></div>
<div class="item-meta">
<span class="activity">
<?php
if ('newest-groups' == $_POST['filter']) {
printf(__('created %s', 'buddypress'), bp_get_group_date_created());
} elseif ('recently-active-groups' == $_POST['filter']) {
printf(__('active %s', 'buddypress'), bp_get_group_last_active());
} elseif ('popular-groups' == $_POST['filter']) {
bp_group_member_count();
}
?>
</span>
</div>
</div>
</li>
<?php
}
?>
<?php
wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups');
?>
<input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php
echo esc_attr($_POST['max_groups']);
?>
" />
<?php
} else {
?>
<?php
echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress');
?>
<?php
}
}
示例7: bp_group_permalink
<div class="item">
<div class="item-title"><a href="<?php
bp_group_permalink();
?>
" title="<?php
bp_group_name();
?>
"><?php
bp_group_name();
?>
</a></div>
<div class="item-meta">
<span class="activity">
<?php
if ('newest' == $group_default) {
printf(esc_html__('created %s', 'training'), bp_get_group_date_created());
}
if ('active' == $group_default) {
printf(esc_html__('active %s', 'training'), bp_get_group_last_active());
} elseif ('popular' == $group_default) {
bp_group_member_count();
}
?>
</span>
<p></p>
</div>
</div>
</li>
<?php
}
示例8: widget
function widget($args, $instance)
{
global $bp;
extract($args);
$parent_id = isset($bp->groups->current_group->id) ? $bp->groups->current_group->id : 0;
echo $before_widget;
echo $before_title;
if ($parent_id == 0) {
echo $instance['title'];
} else {
echo $instance['sub_title'];
}
echo $after_title;
?>
<?php
if (!class_exists('BP_Groups_Group')) {
_e('You must enable Groups component to use this widget.', 'bp-group-hierarchy');
return;
}
?>
<?php
if (bp_has_groups_hierarchy('type=' . $instance['sort_type'] . '&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] . '&parent_id=' . $parent_id)) {
?>
<ul id="toplevel-groups-list" class="item-list">
<?php
while (bp_groups()) {
bp_the_group();
?>
<li>
<div class="item-avatar">
<a href="<?php
bp_group_permalink();
?>
"><?php
bp_group_avatar_thumb();
?>
</a>
</div>
<div class="item">
<div class="item-title"><a href="<?php
bp_group_permalink();
?>
" title="<?php
echo strip_tags(bp_get_group_description_excerpt());
?>
"><?php
bp_group_name();
?>
</a></div>
<div class="item-meta"><span class="activity">
<?php
switch ($instance['sort_type']) {
case 'newest':
printf(__('created %s', 'buddypress'), bp_get_group_date_created());
break;
case 'alphabetical':
case 'active':
printf(__('active %s', 'buddypress'), bp_get_group_last_active());
break;
case 'popular':
bp_group_member_count();
break;
case 'prolific':
printf(_n('%d member group', '%d member groups', bp_group_hierarchy_has_subgroups(), 'bp-group-hierarchy'), bp_group_hierarchy_has_subgroups());
}
?>
</span></div>
<?php
if ($instance['show_desc']) {
?>
<div class="item-desc"><?php
bp_group_description_excerpt();
?>
</div>
<?php
}
?>
</div>
</li>
<?php
}
?>
</ul>
<?php
wp_nonce_field('groups_widget_groups_list', '_wpnonce-groups');
?>
<input type="hidden" name="toplevel_groups_widget_max" id="toplevel_groups_widget_max" value="<?php
echo esc_attr($instance['max_groups']);
?>
" />
<?php
} else {
?>
<div class="widget-error">
<?php
//.........这里部分代码省略.........
示例9: bp_group_date_created
function bp_group_date_created($deprecated = false)
{
echo bp_get_group_date_created();
}
示例10: groups_ajax_widget_groups_list
function groups_ajax_widget_groups_list() {
global $bp;
check_ajax_referer('groups_widget_groups_list');
switch ( $_POST['filter'] ) {
case 'newest-groups':
$type = 'newest';
break;
case 'recently-active-groups':
$type = 'active';
break;
case 'popular-groups':
$type = 'popular';
break;
}
if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
<?php echo "0[[SPLIT]]"; ?>
<ul id="groups-list" class="item-list">
<?php while ( bp_groups() ) : bp_the_group(); ?>
<li>
<div class="item-avatar">
<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
</div>
<div class="item">
<div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
<div class="item-meta">
<span class="activity">
<?php
if ( 'newest-groups' == $_POST['filter'] ) {
printf( __( 'created %s ago', 'buddypress' ), bp_get_group_date_created() );
} else if ( 'recently-active-groups' == $_POST['filter'] ) {
printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() );
} else if ( 'popular-groups' == $_POST['filter'] ) {
bp_group_member_count();
}
?>
</span>
</div>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
<input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $_POST['max_groups'] ); ?>" />
<?php else: ?>
<?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?>
<?php endif;
}