<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][7316] trunk/bp-groups/bp-groups-classes.php: Explicit PHP5 visibility and static declarations for bp-groups-classes.php</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/7316">7316</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2013-07-26 18:13:51 +0000 (Fri, 26 Jul 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Explicit PHP5 visibility and static declarations for bp-groups-classes.php
See <a href="http://buddypress.trac.wordpress.org/ticket/5108">#5108</a>, <a href="http://buddypress.trac.wordpress.org/ticket/3886">#3886</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpgroupsbpgroupsclassesphp">trunk/bp-groups/bp-groups-classes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpgroupsbpgroupsclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-classes.php (7315 => 7316)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-classes.php 2013-07-26 17:55:16 UTC (rev 7315)
+++ trunk/bp-groups/bp-groups-classes.php 2013-07-26 18:13:51 UTC (rev 7316)
</span><span class="lines">@@ -11,18 +11,18 @@
</span><span class="cx"> if ( !defined( 'ABSPATH' ) ) exit;
</span><span class="cx">
</span><span class="cx"> class BP_Groups_Group {
</span><del>- var $id;
- var $creator_id;
- var $name;
- var $slug;
- var $description;
- var $status;
- var $enable_forum;
- var $date_created;
</del><ins>+ public $id;
+ public $creator_id;
+ public $name;
+ public $slug;
+ public $description;
+ public $status;
+ public $enable_forum;
+ public $date_created;
</ins><span class="cx">
</span><del>- var $admins;
- var $mods;
- var $total_member_count;
</del><ins>+ public $admins;
+ public $mods;
+ public $total_member_count;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Is the current user a member of this group?
</span><span class="lines">@@ -48,14 +48,14 @@
</span><span class="cx"> */
</span><span class="cx"> public $user_has_access;
</span><span class="cx">
</span><del>- function __construct( $id = null ) {
</del><ins>+ public function __construct( $id = null ) {
</ins><span class="cx"> if ( !empty( $id ) ) {
</span><span class="cx"> $this->id = $id;
</span><span class="cx"> $this->populate();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function populate() {
</del><ins>+ public function populate() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) {
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function save() {
</del><ins>+ public function save() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $this->creator_id = apply_filters( 'groups_group_creator_id_before_save', $this->creator_id, $this->id );
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete() {
</del><ins>+ public function delete() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> // Delete groupmeta for the group
</span><span class="lines">@@ -212,12 +212,12 @@
</span><span class="cx"> return BP_Groups_Group::group_exists( $slug );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_invites( $user_id, $group_id ) {
</del><ins>+ public static function get_invites( $user_id, $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx"> return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d and is_confirmed = 0 AND inviter_id = %d", $group_id, $user_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
</del><ins>+ public static function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx"> /**
</span><span class="cx"> * @todo Deprecate in favor of get()
</span><span class="cx"> */
</span><del>- function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
</del><ins>+ public static function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $filter = esc_sql( like_escape( $filter ) );
</span><span class="lines">@@ -268,19 +268,19 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function check_slug( $slug ) {
</del><ins>+ public static function check_slug( $slug ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE slug = %s", $slug ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_slug( $group_id ) {
</del><ins>+ public static function get_slug( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM {$bp->groups->table_name} WHERE id = %d", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function has_members( $group_id ) {
</del><ins>+ public static function has_members( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $members = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
</span><span class="lines">@@ -291,13 +291,13 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function has_membership_requests( $group_id ) {
</del><ins>+ public static function has_membership_requests( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_membership_requests( $group_id, $limit = null, $page = null ) {
</del><ins>+ public static function get_membership_requests( $group_id, $limit = null, $page = null ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( !empty( $limit ) && !empty( $page ) ) {
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx"> return array( 'requests' => $paged_requests, 'total' => $total_requests );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get( $args = array() ) {
</del><ins>+ public static function get( $args = array() ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> // Backward compatibility with old method of passing arguments
</span><span class="lines">@@ -620,7 +620,7 @@
</span><span class="cx"> * @param string $orderby
</span><span class="cx"> * @return string $order_by_term
</span><span class="cx"> */
</span><del>- protected function convert_orderby_to_order_by_term( $orderby ) {
</del><ins>+ protected static function convert_orderby_to_order_by_term( $orderby ) {
</ins><span class="cx"> $order_by_term = '';
</span><span class="cx">
</span><span class="cx"> switch ( $orderby ) {
</span><span class="lines">@@ -649,7 +649,7 @@
</span><span class="cx"> return $order_by_term;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
</del><ins>+ public static function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
</ins><span class="cx"> global $wpdb, $bp, $bbdb;
</span><span class="cx">
</span><span class="cx"> if ( empty( $bbdb ) )
</span><span class="lines">@@ -691,7 +691,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
</del><ins>+ public static function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {
</ins><span class="cx"> global $wpdb, $bp, $bbdb;
</span><span class="cx">
</span><span class="cx"> if ( empty( $bbdb ) )
</span><span class="lines">@@ -733,7 +733,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
</del><ins>+ public static function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> // Multibyte compliance
</span><span class="lines">@@ -776,7 +776,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
</del><ins>+ public static function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $pag_sql = $hidden_sql = $search_sql = $exclude_sql = '';
</span><span class="lines">@@ -816,7 +816,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
</del><ins>+ public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> if ( empty( $group_ids ) )
</span><span class="lines">@@ -851,13 +851,13 @@
</span><span class="cx"> return $paged_groups;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete_all_invites( $group_id ) {
</del><ins>+ public static function delete_all_invites( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d AND invite_sent = 1", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_total_group_count() {
</del><ins>+ public static function get_total_group_count() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $hidden_sql = '';
</span><span class="lines">@@ -867,7 +867,7 @@
</span><span class="cx"> return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_global_forum_topic_count( $type ) {
</del><ins>+ public static function get_global_forum_topic_count( $type ) {
</ins><span class="cx"> global $bbdb, $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( 'unreplied' == $type )
</span><span class="lines">@@ -883,7 +883,7 @@
</span><span class="cx"> return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_total_member_count( $group_id ) {
</del><ins>+ public static function get_total_member_count( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
</span><span class="lines">@@ -898,7 +898,7 @@
</span><span class="cx"> * @param string $status 'public', 'private', 'hidden', 'all' Which group types to count
</span><span class="cx"> * @return int The topic count
</span><span class="cx"> */
</span><del>- function get_global_topic_count( $status = 'public', $search_terms = false ) {
</del><ins>+ public static function get_global_topic_count( $status = 'public', $search_terms = false ) {
</ins><span class="cx"> global $bbdb, $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> switch ( $status ) {
</span><span class="lines">@@ -944,7 +944,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @return array
</span><span class="cx"> */
</span><del>- function get_group_type_ids() {
</del><ins>+ public static function get_group_type_ids() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $ids = array();
</span><span class="lines">@@ -1194,7 +1194,7 @@
</span><span class="cx"> var $invite_sent;
</span><span class="cx"> var $user;
</span><span class="cx">
</span><del>- function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
</del><ins>+ public function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
</ins><span class="cx">
</span><span class="cx"> // User and group are not empty, and ID is
</span><span class="cx"> if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) {
</span><span class="lines">@@ -1216,7 +1216,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function populate() {
</del><ins>+ public function populate() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( $this->user_id && $this->group_id && !$this->id )
</span><span class="lines">@@ -1245,7 +1245,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function save() {
</del><ins>+ public function save() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $this->user_id = apply_filters( 'groups_member_user_id_before_save', $this->user_id, $this->id );
</span><span class="lines">@@ -1289,7 +1289,7 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function promote( $status = 'mod' ) {
</del><ins>+ public function promote( $status = 'mod' ) {
</ins><span class="cx"> if ( 'mod' == $status ) {
</span><span class="cx"> $this->is_admin = 0;
</span><span class="cx"> $this->is_mod = 1;
</span><span class="lines">@@ -1305,7 +1305,7 @@
</span><span class="cx"> return $this->save();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function demote() {
</del><ins>+ public function demote() {
</ins><span class="cx"> $this->is_mod = 0;
</span><span class="cx"> $this->is_admin = 0;
</span><span class="cx"> $this->user_title = false;
</span><span class="lines">@@ -1313,7 +1313,7 @@
</span><span class="cx"> return $this->save();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function ban() {
</del><ins>+ public function ban() {
</ins><span class="cx"> if ( !empty( $this->is_admin ) )
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -1323,7 +1323,7 @@
</span><span class="cx"> return $this->save();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function unban() {
</del><ins>+ public function unban() {
</ins><span class="cx"> if ( !empty( $this->is_admin ) )
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -1332,18 +1332,18 @@
</span><span class="cx"> return $this->save();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function accept_invite() {
</del><ins>+ public function accept_invite() {
</ins><span class="cx"> $this->inviter_id = 0;
</span><span class="cx"> $this->is_confirmed = 1;
</span><span class="cx"> $this->date_modified = bp_core_current_time();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function accept_request() {
</del><ins>+ public function accept_request() {
</ins><span class="cx"> $this->is_confirmed = 1;
</span><span class="cx"> $this->date_modified = bp_core_current_time();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function remove() {
</del><ins>+ public function remove() {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $sql = $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $this->user_id, $this->group_id );
</span><span class="lines">@@ -1384,7 +1384,7 @@
</span><span class="cx"> return groups_update_groupmeta( $group_id, 'total_member_count', (int) BP_Groups_Group::get_total_member_count( $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete( $user_id, $group_id ) {
</del><ins>+ public static function delete( $user_id, $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $remove = $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) );
</span><span class="lines">@@ -1398,7 +1398,7 @@
</span><span class="cx"> return $remove;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_group_ids( $user_id, $limit = false, $page = false ) {
</del><ins>+ public static function get_group_ids( $user_id, $limit = false, $page = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $pag_sql = '';
</span><span class="lines">@@ -1419,7 +1419,7 @@
</span><span class="cx"> return array( 'groups' => $groups, 'total' => (int) $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
</del><ins>+ public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $pag_sql = $hidden_sql = $filter_sql = '';
</span><span class="lines">@@ -1441,7 +1441,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
</del><ins>+ public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $pag_sql = $hidden_sql = $filter_sql = '';
</span><span class="lines">@@ -1463,7 +1463,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
</del><ins>+ public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> $pag_sql = $hidden_sql = $filter_sql = '';
</span><span class="lines">@@ -1517,7 +1517,7 @@
</span><span class="cx"> return array( 'groups' => $paged_groups, 'total' => $total_groups );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
</del><ins>+ public static function check_has_invite( $user_id, $group_id, $type = 'sent' ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -1531,7 +1531,7 @@
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( $sql, $user_id, $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete_invite( $user_id, $group_id ) {
</del><ins>+ public static function delete_invite( $user_id, $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -1540,7 +1540,7 @@
</span><span class="cx"> return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0 AND invite_sent = 1", $user_id, $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete_request( $user_id, $group_id ) {
</del><ins>+ public static function delete_request( $user_id, $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -1594,7 +1594,7 @@
</span><span class="cx"> * @param int $group_id
</span><span class="cx"> * @since BuddyPress (1.2.6)
</span><span class="cx"> */
</span><del>- function check_is_creator( $user_id, $group_id ) {
</del><ins>+ public static function check_is_creator( $user_id, $group_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -1603,7 +1603,7 @@
</span><span class="cx"> return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name} WHERE creator_id = %d AND id = %d", $user_id, $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function check_for_membership_request( $user_id, $group_id ) {
</del><ins>+ public static function check_for_membership_request( $user_id, $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> if ( empty( $user_id ) )
</span><span class="lines">@@ -1612,7 +1612,7 @@
</span><span class="cx"> return $wpdb->query( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0 AND inviter_id = 0", $user_id, $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_random_groups( $user_id = 0, $total_groups = 5 ) {
</del><ins>+ public static function get_random_groups( $user_id = 0, $total_groups = 5 ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> // If the user is logged in and viewing their random groups, we can show hidden and private groups
</span><span class="lines">@@ -1623,31 +1623,31 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_group_member_ids( $group_id ) {
</del><ins>+ public static function get_group_member_ids( $group_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_group_administrator_ids( $group_id ) {
</del><ins>+ public static function get_group_administrator_ids( $group_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_group_moderator_ids( $group_id ) {
</del><ins>+ public static function get_group_moderator_ids( $group_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_mod = 1 AND is_banned = 0", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_all_membership_request_user_ids( $group_id ) {
</del><ins>+ public static function get_all_membership_request_user_ids( $group_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> return $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 0 AND inviter_id = 0", $group_id ) );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
</del><ins>+ public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> _deprecated_function( __METHOD__, '1.8', 'BP_Group_Member_Query' );
</span><span class="lines">@@ -1707,7 +1707,7 @@
</span><span class="cx"> return array( 'members' => $members, 'count' => $total_member_count );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- function delete_all( $group_id ) {
</del><ins>+ public static function delete_all( $group_id ) {
</ins><span class="cx"> global $wpdb, $bp;
</span><span class="cx">
</span><span class="cx"> return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE group_id = %d", $group_id ) );
</span><span class="lines">@@ -1722,7 +1722,7 @@
</span><span class="cx"> * @since BuddyPress (1.0)
</span><span class="cx"> * @uses BP_Groups_Member
</span><span class="cx"> */
</span><del>- function delete_all_for_user( $user_id ) {
</del><ins>+ public static function delete_all_for_user( $user_id ) {
</ins><span class="cx"> global $bp, $wpdb;
</span><span class="cx">
</span><span class="cx"> // Get all the group ids for the current user's groups and update counts
</span></span></pre>
</div>
</div>
</body>
</html>