• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_groups函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bp_groups函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_groups函数的具体用法?PHP bp_groups怎么用?PHP bp_groups使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bp_groups函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: widget

	function widget($args, $instance) {
		global $bp;

	    extract( $args );

		echo $before_widget;
		echo $before_title
		   . $widget_name
		   . $after_title; ?>

		<?php if ( bp_has_groups( 'type=popular&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] ) ) : ?>
			<div class="item-options" id="groups-list-options">
				<span class="ajax-loader" id="ajax-loader-groups"></span>
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
				<a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?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() ?>"><?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 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( $instance['max_groups'] ); ?>" />

		<?php else: ?>

			<div class="widget-error">
				<?php _e('There are no groups to display.', 'buddypress') ?>
			</div>

		<?php endif; ?>

		<?php echo $after_widget; ?>
	<?php
	}
开发者ID:n-sane,项目名称:zaroka,代码行数:47,代码来源:bp-groups-widgets.php


示例2: getGroups

 function getGroups($force = false)
 {
     //need a user id for this
     if (empty($this->ID)) {
         return false;
     }
     //check cache
     if (isset($this->groups) && !$force) {
         return $this->groups;
     }
     //remove the bp-site-groups filter
     remove_filter('groups_get_groups', 'bpsg_groups_get_groups');
     //get corresponding class ids for buddypress groups this user is a member of
     $groups = array();
     if (bp_has_groups(array('user_id' => $this->ID))) {
         while (bp_groups()) {
             bp_the_group();
             $group_id = bp_get_group_id();
             $groups[] = groups_get_group(array('group_id' => $group_id));
         }
     }
     //add the bp-site-groups filter back
     add_filter('groups_get_groups', 'bpsg_groups_get_groups');
     $this->groups = $groups;
     return $this->groups;
 }
开发者ID:danielcoats,项目名称:schoolpress,代码行数:26,代码来源:class.SPStudent.php


示例3: training_wpo_buddypress_group_header

    function training_wpo_buddypress_group_header()
    {
        global $groups_template;
        ?>
	<div id="item-header" class="pb-group pb-item-header" role="complementary">
		<div class="container">
				<?php 
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                ?>
				<?php 
                bp_get_template_part('groups/single/group-header');
                ?>
			<?php 
            }
        }
        ?>
		</div>
	</div><!-- #item-header -->


<?php 
    }
开发者ID:morganloehr,项目名称:chris-verna,代码行数:24,代码来源:function.php


示例4: _e

				<div id="whats-new-post-in-box">

					<?php 
    _e('Post in', 'buddypress');
    ?>
:

					<select id="whats-new-post-in" name="whats-new-post-in">
						<option selected="selected" value="0"><?php 
    _e('My Profile', 'buddypress');
    ?>
</option>

						<?php 
    if (bp_has_groups('user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0')) {
        while (bp_groups()) {
            bp_the_group();
            ?>

								<option value="<?php 
            bp_group_id();
            ?>
"><?php 
            bp_group_name();
            ?>
</option>

							<?php 
        }
    }
    ?>
开发者ID:kosir,项目名称:thatcamp-org,代码行数:31,代码来源:post-form.php


示例5: profiles_header_widget

/**
 *  members sidebar header widget
 *
 * @package Custom Community
 * @since 1.8.3
 */
function profiles_header_widget($args)
{
    extract($args);
    $options = get_option("profiles_header_position");
    if (!is_array($options)) {
        $options = array('profiles_header_position' => 'horizontal');
    }
    if ($options[profiles_header_position] != 'horizontal') {
        locate_template(array('members/single/member-header-sidebar.php'), true, false);
    } else {
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                locate_template(array('members/single/member-header.php'), true, false);
            }
        }
    }
}
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:24,代码来源:widgets.php


示例6: invite_anyone_screen_one_content


//.........这里部分代码省略.........
        ?>
				<label for="invite-anyone-custom-message"><?php 
        _e('Message:', 'invite-anyone');
        ?>
</label>
					<textarea name="invite_anyone_custom_message" id="invite-anyone-custom-message" disabled="disabled"><?php 
        echo invite_anyone_invitation_message($returned_message);
        ?>
</textarea>

				<input type="hidden" name="invite_anyone_custom_message" value="<?php 
        echo invite_anyone_invitation_message();
        ?>
" />
			<?php 
    }
    ?>

		</li>

		<?php 
    if (invite_anyone_are_groups_running()) {
        ?>
			<?php 
        if ($iaoptions['can_send_group_invites_email'] == 'yes' && bp_has_groups("per_page=10000&type=alphabetical&user_id=" . bp_loggedin_user_id())) {
            ?>
			<li>
				<p><?php 
            _e('(optional) Select some groups. Invitees will receive invitations to these groups when they join the site.', 'invite-anyone');
            ?>
</p>
				<ul id="invite-anyone-group-list">
					<?php 
            while (bp_groups()) {
                bp_the_group();
                ?>
						<?php 
                // Enforce per-group invitation settings
                if (!bp_groups_user_can_send_invites(bp_get_group_id()) || 'anyone' !== invite_anyone_group_invite_access_test(bp_get_group_id())) {
                    continue;
                }
                ?>
						<li>
						<input type="checkbox" name="invite_anyone_groups[]" id="invite_anyone_groups-<?php 
                bp_group_id();
                ?>
" value="<?php 
                bp_group_id();
                ?>
" <?php 
                if ($from_group == bp_get_group_id() || array_search(bp_get_group_id(), $returned_groups)) {
                    ?>
checked<?php 
                }
                ?>
 />

						<label for="invite_anyone_groups-<?php 
                bp_group_id();
                ?>
" class="invite-anyone-group-name"><?php 
                bp_group_avatar_mini();
                ?>
 <span><?php 
                bp_group_name();
                ?>
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:67,代码来源:by-email.php


示例7: widget

    /**
     * Extends our frontend output method.
     *
     * @param array $args     Array of arguments for the widget.
     * @param array $instance Widget instance data.
     */
    public function widget($args, $instance)
    {
        /**
         * Filters the user ID to use with the widget instance.
         *
         * @since 1.5.0
         *
         * @param string $value Empty user ID.
         */
        $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');
        }
        /**
         * Filters the title of the Groups widget.
         *
         * @since 1.8.0
         * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $instance The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        /**
         * Filters the separator of the group widget links.
         *
         * @since 2.4.0
         *
         * @param string $separator Separator string. Default '|'.
         */
        $separator = apply_filters('bp_groups_widget_separator', '|');
        echo $before_widget;
        $title = !empty($instance['link_title']) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title;
        echo $before_title . $title . $after_title;
        $max_groups = !empty($instance['max_groups']) ? (int) $instance['max_groups'] : 5;
        $group_args = array('user_id' => $user_id, 'type' => $instance['group_default'], 'per_page' => $max_groups, 'max' => $max_groups);
        ?>

		<?php 
        if (bp_has_groups($group_args)) {
            ?>
			<div class="item-options" id="groups-list-options">
				<a href="<?php 
            bp_groups_directory_permalink();
            ?>
" id="newest-groups"<?php 
            if ($instance['group_default'] == 'newest') {
                ?>
 class="selected"<?php 
            }
            ?>
><?php 
            _e("Newest", 'buddypress');
            ?>
</a>
				<span class="bp-separator" role="separator"><?php 
            echo esc_html($separator);
            ?>
</span>
				<a href="<?php 
            bp_groups_directory_permalink();
            ?>
" id="recently-active-groups"<?php 
            if ($instance['group_default'] == 'active') {
                ?>
 class="selected"<?php 
            }
            ?>
><?php 
            _e("Active", 'buddypress');
            ?>
</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>
//.........这里部分代码省略.........
开发者ID:boonebgorges,项目名称:BuddyPress-1,代码行数:101,代码来源:bp-groups-widgets.php


示例8: 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 
    }
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:93,代码来源:bp-groups-widgets.php


示例9: create_field

 function create_field($field)
 {
     // defaults?
     $field = array_merge($this->defaults, $field);
     // Change Field into a select
     $field['type'] = 'select';
     $field['choices'] = array();
     // set the user ID if you want to return only groups that this user is a member of.
     $user_id = $field['groups'] == 1 ? FALSE : get_current_user_id();
     $args = array('per_page' => 999, 'user_id' => $user_id);
     if (bp_has_groups($args)) {
         while (bp_groups()) {
             bp_the_group();
             $field['choices'][bp_get_group_id()] = bp_get_group_name();
         }
     }
     // create field
     do_action('acf/create_field', $field);
 }
开发者ID:rabidgadfly,项目名称:acf-field-buddypress-groups,代码行数:19,代码来源:acf-buddypress_groups-v4.php


示例10: display

    function display($page = 1)
    {
        global $bp, $groups_template;
        $parent_template = $groups_template;
        $hide_button = false;
        if (isset($_REQUEST['grpage'])) {
            $page = (int) $_REQUEST['grpage'];
        } else {
            if (!is_numeric($page)) {
                $page = 1;
            } else {
                $page = (int) $page;
            }
        }
        /** Respect BuddyPress group creation restriction */
        if (function_exists('bp_user_can_create_groups')) {
            $hide_button = !bp_user_can_create_groups();
        }
        bp_has_groups_hierarchy(array('type' => 'alphabetical', 'parent_id' => $bp->groups->current_group->id, 'page' => $page));
        ?>
		<div class="group">

			<?php 
        if (($bp->is_item_admin || $bp->groups->current_group->can_create_subitems) && !$hide_button) {
            ?>
			<div class="generic-button group-button">
				<a title="<?php 
            printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy'));
            ?>
" href="<?php 
            echo $bp->root_domain . '/' . bp_get_groups_root_slug() . '/' . 'create' . '/?parent_id=' . $bp->groups->current_group->id;
            ?>
"><?php 
            printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy'));
            ?>
</a>
			</div><br /><br />
			<?php 
        }
        ?>

		<?php 
        if ($groups_template && count($groups_template->groups) > 0) {
            ?>

			<div id="pag-top" class="pagination">
				<div class="pag-count" id="group-dir-count-top">
					<?php 
            bp_groups_pagination_count();
            ?>
				</div>
		
				<div class="pagination-links" id="group-dir-pag-top">
					<?php 
            bp_groups_pagination_links();
            ?>
				</div>
			</div>
	
			<ul id="groups-list" class="item-list">
				<?php 
            while (bp_groups()) {
                bp_the_group();
                ?>
				<?php 
                $subgroup = $groups_template->group;
                ?>
				<?php 
                if ($subgroup->status == 'hidden' && !(groups_is_user_member($bp->loggedin_user->id, $subgroup->id) || groups_is_user_admin($bp->loggedin_user->id, $bp->groups->current_group->id))) {
                    continue;
                }
                ?>
				<li id="tree-childof_<?php 
                bp_group_id();
                ?>
">
					<div class="item-avatar">
						<a href="<?php 
                bp_group_permalink();
                ?>
"><?php 
                bp_group_avatar('type=thumb&width=50&height=50');
                ?>
</a>
					</div>
		
					<div class="item">
						<div class="item-title"><a href="<?php 
                bp_group_permalink();
                ?>
"><?php 
                bp_group_name();
                ?>
</a></div>
						<div class="item-meta"><span class="activity"><?php 
                printf(__('active %s', 'buddypress'), bp_get_group_last_active());
                ?>
</span></div>
						<div class="item-desc"><?php 
                bp_group_description_excerpt();
//.........这里部分代码省略.........
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:extension.php


示例11: get_list_for_usergroups_widget

 /**
  *
  * @global type $wpdp
  * @global type $bp
  * @param type $num
  * @param type $featured
  * @return type
  * @version 1.2.2
  * v1.2.1, 17/9/2013, stergatu fix the http://wordpress.org/support/topic/widget-functionality bug
  * v1, 1/5/2013
  * @author stergatu
  * @since 0.5
  */
 public static function get_list_for_usergroups_widget($num, $featured = 0)
 {
     global $wpdb, $bp;
     if (bp_has_groups('user_id=' . get_current_user_id())) {
         while (bp_groups()) {
             bp_the_group();
             $group_array[] = bp_get_group_id();
         }
     }
     $sql = "SELECT * FROM " . BP_GROUP_DOCUMENTS_TABLE . " WHERE group_id in (" . implode(',', array_map('absint', $group_array)) . " ) ";
     if ($featured && BP_GROUP_DOCUMENTS_FEATURED) {
         $sql .= "AND featured = 1 ";
     }
     $sql .= "ORDER BY created_ts DESC LIMIT %d";
     $result = $wpdb->get_results($wpdb->prepare($sql, $num), ARRAY_A);
     return $result;
 }
开发者ID:lilarock3rs,项目名称:bp-group-documents,代码行数:30,代码来源:classes.php


示例12: render_field

 function render_field($field)
 {
     /*
      *  Review the data of $field.
      *  This will show what data is available
      */
     // echo '<pre>';
     // 	print_r( $field );
     // echo '</pre>';
     /*
      *  Create a simple text input using the 'font_size' setting.
      */
     /*
     ?>
     <input type="text" name="<?php echo esc_attr($field['name']) ?>" value="<?php echo esc_attr($field['value']) ?>" style="font-size:<?php echo $field['font_size'] ?>px;" />
     <?php
     */
     // defaults?
     $field = array_merge($this->defaults, $field);
     // Change Field into a select
     $field['type'] = 'select';
     $field['choices'] = array();
     // set the user ID if you want to return only groups that this user is a member of.
     $user_id = $field['groups'] == 1 ? FALSE : get_current_user_id();
     $args = array('per_page' => 999, 'user_id' => $user_id);
     if (bp_has_groups($args)) {
         while (bp_groups()) {
             bp_the_group();
             $field['choices'][bp_get_group_id()] = bp_get_group_name();
         }
     }
     // create field
     do_action('acf/render_field/type=select', $field);
 }
开发者ID:rabidgadfly,项目名称:acf-field-buddypress-groups,代码行数:34,代码来源:acf-buddypress_groups-v5.php


示例13: generate_html

 protected function generate_html($template_type = '')
 {
     $group_ids = array();
     foreach ($this->search_results['items'] as $item_id => $item_html) {
         $group_ids[] = $item_id;
     }
     //now we have all the posts
     //lets do a groups loop
     $args = array('include' => $group_ids, 'per_page' => count($group_ids));
     if (is_user_logged_in()) {
         $args['show_hidden'] = true;
     }
     if (bp_has_groups($args)) {
         while (bp_groups()) {
             bp_the_group();
             $result = array('id' => bp_get_group_id(), 'type' => $this->type, 'title' => bp_get_group_name(), 'html' => buddyboss_global_search_buffer_template_part('loop/group', $template_type, false));
             $this->search_results['items'][bp_get_group_id()] = $result;
         }
         //var_dump( $this->search_results['items'] );
     }
 }
开发者ID:tvolmari,项目名称:hammydowns,代码行数:21,代码来源:class.BBoss_Global_Search_Groups.php


示例14: invite_anyone_screen_one_content


//.........这里部分代码省略.........
    } else {
        ?>
				<label for="invite-anyone-custom-message"><?php 
        _e('Message:', 'bp-invite-anyone');
        ?>
</label>
					<textarea name="invite_anyone_custom_message" id="invite-anyone-custom-message" disabled="disabled"><?php 
        echo invite_anyone_invitation_message($returned_message);
        ?>
</textarea>
				
				<input type="hidden" name="invite_anyone_custom_message" value="<?php 
        echo invite_anyone_invitation_message();
        ?>
" />
			<?php 
    }
    ?>
				<p><?php 
    _e('The message will also contain a custom footer containing links to accept the invitation or opt out of further email invitations from this site.', 'bp-invite-anyone');
    ?>
</p>

		</li>

		<?php 
    if (invite_anyone_are_groups_running()) {
        ?>
			<?php 
        if ($iaoptions['can_send_group_invites_email'] == 'yes' && bp_has_groups("per_page=10000&type=alphabetical&user_id=" . bp_loggedin_user_id())) {
            ?>
			<li>
				<p><?php 
            _e('(optional) Select some groups. Invitees will receive invitations to these groups when they join the site.', 'bp-invite-anyone');
            ?>
</p>
				<ul id="invite-anyone-group-list">
					<?php 
            while (bp_groups()) {
                bp_the_group();
                ?>
						<li>
						<input type="checkbox" name="invite_anyone_groups[]" id="invite_anyone_groups-<?php 
                bp_group_id();
                ?>
" value="<?php 
                bp_group_id();
                ?>
" <?php 
                if ($from_group == bp_get_group_id() || array_search(bp_get_group_id(), $returned_groups)) {
                    ?>
checked<?php 
                }
                ?>
 />
						
						<label for="invite_anyone_groups-<?php 
                bp_group_id();
                ?>
" class="invite-anyone-group-name"><?php 
                bp_group_avatar_mini();
                ?>
 <span><?php 
                bp_group_name();
                ?>
</span></label>

						</li>
					<?php 
            }
            ?>

				</ul>
       
			</li>
			<?php 
        }
        ?>

		<?php 
    }
    ?>

		<?php 
    do_action('invite_anyone_addl_fields');
    ?>

	</ol>

	<div class="submit">
		<input type="submit" name="invite-anyone-submit" id="invite-anyone-submit" value="<?php 
    _e('Send Invites', 'buddypress');
    ?>
 " />
	</div>


	</form>
	<?php 
}
开发者ID:hnla,项目名称:invite-anyone,代码行数:101,代码来源:by-email.php


示例15: bp_groupblog_update_defaults

function bp_groupblog_update_defaults()
{
    // retrieve the old landing page slug so we know which pages to delete
    $oldoptions = get_site_option('bp_groupblog_blog_defaults_options');
    // create an array to hold the chosen options
    $newoptions = array();
    $newoptions['theme'] = $_POST['theme'];
    // groupblog validation settings
    $newoptions['allowdashes'] = !empty($_POST['bp_groupblog_allowdashes']) ? 1 : 0;
    $newoptions['allowunderscores'] = !empty($_POST['bp_groupblog_allowunderscores']) ? 1 : 0;
    $newoptions['allownumeric'] = !empty($_POST['bp_groupblog_allownumeric']) ? 1 : 0;
    $newoptions['minlength'] = isset($_POST['bp_groupblog_minlength']) && is_numeric($_POST['bp_groupblog_minlength']) == true ? $_POST['bp_groupblog_minlength'] : 4;
    // groupblog default settings
    $newoptions['default_cat_name'] = isset($_POST['default_cat_name']) ? $_POST['default_cat_name'] : '';
    $newoptions['default_link_cat'] = isset($_POST['default_link_cat']) ? $_POST['default_link_cat'] : '';
    if (!empty($_POST['delete_first_post'])) {
        $newoptions['delete_first_post'] = 1;
    } else {
        $newoptions['delete_first_post'] = 0;
    }
    if (!empty($_POST['delete_first_comment'])) {
        $newoptions['delete_first_comment'] = 1;
    } else {
        $newoptions['delete_first_comment'] = 0;
    }
    if (!empty($_POST['delete_blogroll_links'])) {
        $newoptions['delete_blogroll_links'] = 1;
    } else {
        $newoptions['delete_blogroll_links'] = 0;
    }
    // groupblog layout settings
    if (!empty($_POST['group_admin_layout'])) {
        $newoptions['group_admin_layout'] = 1;
    } else {
        $newoptions['group_admin_layout'] = 0;
    }
    // redirect group home to blog home
    if (!empty($_POST['deep_group_integration'])) {
        $newoptions['deep_group_integration'] = 1;
    } else {
        $newoptions['deep_group_integration'] = 0;
    }
    // groupblog redirect option
    $newoptions['redirectblog'] = isset($_POST['bp_groupblog_redirect_blog']) ? $_POST['bp_groupblog_redirect_blog'] : '';
    $newoptions['pagetitle'] = isset($_POST['bp_groupblog_page_title']) ? $_POST['bp_groupblog_page_title'] : __('Blog', 'bp-groupblog');
    $newoptions['pageslug'] = isset($_POST['bp_groupblog_page_title']) ? sanitize_title($_POST['bp_groupblog_page_title']) : '';
    $newoptions['page_template_layout'] = isset($_POST['page_template_layout']) ? $_POST['page_template_layout'] : 'magazine';
    $newoptions['rerun'] = 0;
    if ($newoptions['redirectblog'] == 2) {
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                if ($blog_id = get_groupblog_blog_id(bp_get_group_id())) {
                    switch_to_blog($blog_id);
                    $change_front = new WP_Query('pagename=' . $newoptions['pageslug']);
                    if ($change_front->have_posts()) {
                        while ($change_front->have_posts()) {
                            $change_front->the_post();
                            $blog_page_id = get_the_ID();
                        }
                    }
                    if ($newoptions['deep_group_integration'] == 1) {
                        $page_or_posts = 'page';
                        update_option('page_on_front', $blog_page_id);
                    } else {
                        $page_or_posts = 'posts';
                    }
                    update_option('show_on_front', $page_or_posts);
                }
            }
        }
        update_site_option('bp_groupblog_blog_defaults_options', $newoptions);
        $get_out = false;
        if ($newoptions['redirectblog'] != 2) {
            $get_out = true;
        }
        if ($oldoptions['pageslug'] == $newoptions['pageslug'] && $oldoptions['redirectblog'] == 2) {
            $get_out = true;
        }
        if ($get_out && $oldoptions['rerun'] == 0) {
            return false;
        }
        echo '<div id="message" class="updated fade">';
        echo '<p><strong>The following blogs were updated</strong></p>';
        $exists_in = array();
        $updated_blogs = array();
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                if ($blog_id = get_groupblog_blog_id(bp_get_group_id())) {
                    switch_to_blog($blog_id);
                    $create = new WP_Query('pagename=' . $newoptions['pageslug']);
                    if ($create->have_posts()) {
                        $get_lost = 1;
                        while ($create->have_posts()) {
                            $create->the_post();
                            if (!get_post_meta(get_the_ID(), 'created_by_groupblog_dont_change')) {
                                $exists_in[] = get_bloginfo('name');
                                $page_found = 1;
                                $newoptions['rerun'] = 1;
//.........这里部分代码省略.........
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:bp-groupblog-admin.php


示例16: StudyPressUserWP

             $user = new StudyPressUserWP();
             if (function_exists('bp_is_active') && bp_is_active('groups')) {
                 $result['content'] .= "<h3>" . $tr->__("Comment:") . "</h3>";
                 $result['content'] .= "<textarea name='comment' rows='2' cols='100'></textarea>";
                 if ($type === "lesson") {
                     $result['content'] .= "<h3>" . $tr->__("Share in:") . "</h3>";
                 } else {
                     $result['content'] .= "<h3>" . $tr->__("Share :") . "</h3>";
                     $result['content'] .= "<label><input type='radio' value='result' name='t' checked='checked'> " . $tr->__("Result") . "</label>";
                     $result['content'] .= "&nbsp;<label><input type='radio' value='quiz' name='t'> " . $tr->__("Quiz") . "</label>";
                     $result['content'] .= "<h3>" . $tr->__("Share In :") . "</h3>";
                 }
                 $result['content'] .= "<label><input type='checkbox' value='0'> " . $tr->__("Personal profile") . "</label><div class='separator'></div>";
                 $args = array('user_id' => $user->id());
                 if (bp_has_groups($args)) {
                     while (bp_groups($args)) {
                         bp_the_group();
                         $groupId = bp_get_group_id();
                         $groupName = bp_get_group_name();
                         $result['content'] .= "<label><input type='checkbox' value='{$groupId}'> {$groupName}</label><br/>";
                     }
                 } else {
                     $result['content'] .= "no groups";
                 }
                 $result['content'] .= "<button type='button' class='button'>" . $tr->__("Validate") . "</button>";
                 $result['result'] = "true";
                 echo json_encode($result);
             }
         }
     }
 }
开发者ID:Cossumo,项目名称:studypress,代码行数:31,代码来源:share.controller.php


示例17: on_bp_gtm_admin_groups

    function on_bp_gtm_admin_groups($bp_gtm)
    {
        global $bp;
        ?>
        <table id="bp-gtm-admin-table" class="widefat link-group">
            <thead>
                <tr class="header">
                    <td colspan="2"><?php 
        _e('Which groups should have GTM System turned on?', 'bp_gtm');
        ?>
</td>
                    <td class="own_roles"><?php 
        _e('Own roles?', 'bp_gtm');
        ?>
</td>
                </tr>
            </thead>
            <tbody id="the-list">
                <tr>
                    <td><input type="checkbox" class="bp_gtm_allgroups" name="bp_gtm_allgroups" <?php 
        echo 'all' == $bp_gtm['groups'] ? 'checked="checked" ' : '';
        ?>
 value="all" /></td>
                    <td><?php 
        _e('All groups', 'bp_gtm');
        ?>
</td>
                    <td class="own_roles">&nbsp;</td>
                </tr>
                <?php 
        $arg['type'] = 'alphabetical';
        $arg['per_page'] = '1000';
        if (bp_has_groups($arg)) {
            while (bp_groups()) {
                bp_the_group();
                $description = preg_replace(array('<<p>>', '<</p>>', '<<br />>', '<<br>>'), '', bp_get_group_description_excerpt());
                echo '<tr>
                                <td><input name="bp_gtm_groups[' . bp_get_group_id() . ']" class="bp_gtm_groups" type="checkbox" ' . ('all' == $bp_gtm['groups'] || $bp_gtm['groups'][bp_get_group_id()] == 'on' ? 'checked="checked" ' : '') . 'value="on" /></td>
                                <td><a href="' . bp_get_group_permalink() . $bp->gtm->slug . '/" target="_blank">' . bp_get_group_name() . '</a> &rarr; ' . $description . '</td>
                                <td class="own_roles"><input name="bp_gtm_groups_own_roles[' . bp_get_group_id() . ']" class="bp_gtm_groups_own_roles" type="checkbox" ' . ((!empty($bp_gtm['groups_own_roles']) || !empty($bp_gtm['groups_own_roles'][bp_get_group_id()])) && 'all' == $bp_gtm['groups_own_roles'] || !empty($bp_gtm['groups_own_roles'][bp_get_group_id()]) && $bp_gtm['groups_own_roles'][bp_get_group_id()] == bp_get_group_id() ? 'checked="checked" ' : '') . 'value="' . bp_get_group_id() . '" /></td>
                            </tr>';
            }
        }
        ?>
            </tbody>
            <tfoot>
                <tr class="header">
                    <td><input type="checkbox" class="bp_gtm_allgroups" name="bp_gtm_allgroups" <?php 
        echo 'all' == $bp_gtm['groups'] ? 'checked="checked" ' : '';
        ?>
 value="all" /></td>
                    <td><?php 
        _e('All groups', 'bp_gtm');
        ?>
</td>
                    <td>&nbsp;</td>
                </tr>
            </tfoot>
        </table>
        <?php 
    }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:61,代码来源:bp-gtm-admin.php


示例18: 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 
//.........这里部分代码省略.........
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:bp-group-hierarchy-widgets.php

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_groups_auto_join函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_group_type函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap