Skip to:
Content

BuddyPress.org

Ticket #5: remove_depreciated_and_global.patch

File remove_depreciated_and_global.patch, 24.7 KB (added by momo360modena, 17 years ago)
  • bp_core.php

     
    153153
    154154function limit_access()
    155155{
    156         global $parent_file;
    157        
    158156        if(!is_site_admin()) {
    159157                if(strpos($_SERVER['SCRIPT_NAME'],'/themes.php')) header("Location: index.php");
    160158                if(strpos($_SERVER['SCRIPT_NAME'],'/plugins.php')) header("Location: index.php");
     
    188186        add_action('admin_head', 'start_dash');
    189187}
    190188
    191 function start_dash($dash_contents)
     189function start_dash($dash_contents = '')
    192190{       
    193191        ob_start();
    194192        add_action('admin_footer', 'end_dash');
     
    251249
    252250function bp_core_get_userid($username)
    253251{
    254         global $wpdb, $wpmuBaseTablePrefix;
     252        global $wpdb;
    255253
    256         $sql = "SELECT ID FROM " . $wpmuBaseTablePrefix . "users
     254        $sql = "SELECT ID FROM " . $wpdb->base_prefix . "users
    257255                        WHERE user_login = '" . $username . "'";
    258256
    259257        if(!$user_id = $wpdb->get_var($sql)) {
     
    279277
    280278function bp_core_get_username($user_id)
    281279{
    282         global $wpdb, $wpmuBaseTablePrefix;
     280        global $wpdb;
    283281
    284         $sql = "SELECT user_login FROM " . $wpmuBaseTablePrefix . "users
     282        $sql = "SELECT user_login FROM " . $wpdb->base_prefix . "users
    285283                        WHERE ID = " . $user_id;
    286284
    287285        if(!$username = $wpdb->get_var($sql)) {
     
    426424// get the page number from the $_GET["p"] variable
    427425function bp_get_page()
    428426{
    429         if (isset($_GET["p"]) ? $page = (int)$_GET["p"] : $page = 1);
    430         return $page;
     427        if ( isset($_GET["p"]) )
     428                return (int) $_GET["p"];
     429        else
     430                return 1;
    431431}
    432432
    433433// generate page links
     
    569569        if (trim($q) != "")
    570570        {
    571571                global $wpdb;
    572                 global $wpmuBaseTablePrefix;
    573572                global $current_user;
    574                 $sql = "select SQL_CALC_FOUND_ROWS id, user_login, display_name, user_nicename from ".$wpmuBaseTablePrefix."users
     573                $sql = "select SQL_CALC_FOUND_ROWS id, user_login, display_name, user_nicename from ".$wpdb->base_prefix."users
    575574                                where (user_nicename like '%".$wpdb->escape($q)."%'
    576575                                or user_email like '%".$wpdb->escape($q)."%'
    577576                                or display_name like '%".$wpdb->escape($q)."%')
  • bp_friends.php

     
    2222
    2323function friends_install()
    2424{
    25         global $wpdb, $table_name;
     25        global $table_name;
    2626
    2727        $sql = "CREATE TABLE ". $table_name ." (
    2828                  id mediumint(9) NOT NULL AUTO_INCREMENT,
     
    4747
    4848function friends_add_menu()
    4949{       
    50         global $wpdb, $table_name, $wpmuBaseTablePrefix, $bp_friends;
    51         $table_name = $wpmuBaseTablePrefix . "bp_friends";
     50        global $wpdb, $table_name, $bp_friends;
     51        $table_name = $wpdb->base_prefix . "bp_friends";
    5252       
    5353        /* Instantiate bp_Friends class to do the real work. */
    5454        $bp_friends = new BP_Friends;
     
    103103         **************************************************************************/
    104104        function bp_friends()
    105105        {
    106                 global $wpdb, $wpmuBaseTablePrefix, $userdata, $table_name;
     106                global $wpdb, $userdata, $table_name;
    107107                 
    108108                $this->wpdb = &$wpdb;
    109109                $this->userdata = &$userdata;
    110                 $this->basePrefix = $wpmuBaseTablePrefix;
     110                $this->basePrefix = $wpdb->base_prefix;
    111111                $this->tableName = $table_name; // need a root prefix, not a wp_X_ prefix.
    112112                $this->imageBase = get_option('siteurl') . '/wp-content/mu-plugins/bp_friends/images/';
    113113               
  • bp_groups.php

     
    1414 Version: 0.1
    1515 Type: Add-On
    1616 **************************************************************************/
     17global $wpdb;
     18$bp_groups_table_name = $wpdb->base_prefix . "bp_groups";
     19$bp_group_members_table_name = $wpdb->base_prefix . "bp_group_members";
    1720
    18 $bp_groups_table_name = $wpmuBaseTablePrefix . "bp_groups";
    19 $bp_group_members_table_name = $wpmuBaseTablePrefix . "bp_group_members";
    20 
    2121include_once('bp_groups/bp_groups.class.php');
    2222
    2323/**************************************************************************
  • bp_groups/bp_groups.class.php

     
    4848                //if (get_site_option("bp_groups_enabled") == "")
    4949                //{
    5050               
    51                         global $wpmuBaseTablePrefix;
    52                         $this->groups_table = $wpmuBaseTablePrefix."bp_groups";
    53                         $this->group_members_table = $wpmuBaseTablePrefix."bp_group_members";
     51                        global $wpdb;
     52                        $this->groups_table = $wpdb->base_prefix."bp_groups";
     53                        $this->group_members_table = $wpdb->base_prefix."bp_group_members";
    5454                       
    5555                        // check the options exist
    5656                        $this->Check_Options();
     
    106106        {
    107107                // get the globals
    108108                global $wpdb;
    109                 global $wpmuBaseTablePrefix;
    110                 global $myjournal_members;
    111109                global $current_user;
    112110
    113111                // get the group details
     
    117115                                        count(m.id) as members
    118116                                        from ".$this->groups_table." n
    119117                                        inner join ".$this->group_members_table." m on m.group_id = n.id and m.status_id = 1
    120                                         inner join ".$wpmuBaseTablePrefix."users b on b.id = m.user_id
     118                                        inner join ".$wpdb->base_prefix."users b on b.id = m.user_id
    121119                                        where n.slug = '".$wpdb->escape($this->slug)."'
    122120                                        group by n.id;";
    123121                }
     
    127125                                        count(m.id) as members
    128126                                        from ".$this->groups_table." n
    129127                                        inner join ".$this->group_members_table." m on m.group_id = n.id and m.status_id = 1
    130                                         inner join ".$wpmuBaseTablePrefix."users b on b.id = m.user_id
     128                                        inner join ".$wpdb->base_prefix."users b on b.id = m.user_id
    131129                                        where n.id = ".$wpdb->escape($this->id)."
    132130                                        group by n.id;";
    133131                }
     
    160158        {
    161159                // get the globals
    162160                global $wpdb;
    163                 global $wpmuBaseTablePrefix;
    164161                $sql = "select name, slug from ".$this->groups_table." where id = ".$wpdb->escape($groupid).";";
    165162                return $wpdb->get_row($sql);
    166163        }
     
    170167        {
    171168                // get the globals
    172169                global $wpdb;
    173                 global $wpmuBaseTablePrefix;
    174170               
    175171                $sql = "select SQL_CALC_FOUND_ROWS id, name, description, slug
    176172                                from ".$this->groups_table."
     
    196192        {
    197193                // get the globals
    198194                global $wpdb;
    199                 global $wpmuBaseTablePrefix;
    200195       
    201196                $groups = $wpdb->get_results("select id, slug, name, description, open
    202197                                                        from ".$this->groups_table."
     
    213208        {
    214209                // get the globals
    215210                global $wpdb;
    216                 global $wpmuBaseTablePrefix;
    217211       
    218212                $groups = $wpdb->get_results("select n.id, n.slug, n.name, n.description, n.open, count(m.id) as members
    219213                                                        from ".$this->groups_table." n
     
    232226        {
    233227                // get the globals
    234228                global $wpdb;
    235                 global $wpmuBaseTablePrefix;
    236229                global $current_user;
    237230               
    238231                if ($all)
     
    447440        function Is_Group_Member($userid = 0)
    448441        {
    449442                global $wpdb;
    450                 global $wpmuBaseTablePrefix;
    451443               
    452444                if ($userid == 0)
    453445                {
     
    473465        function Is_Group_Admin($userid = 0)
    474466        {
    475467                global $wpdb;
    476                 global $wpmuBaseTablePrefix;
    477468               
    478469                if ($userid == 0)
    479470                {
     
    500491        function User_Is_Group_Admin()
    501492        {
    502493                global $wpdb;
    503                 global $wpmuBaseTablePrefix;
    504494                global $current_user;
    505495
    506496                $sql =  "select count(id)
     
    522512        function Has_Group_Admin_Rights()
    523513        {
    524514                global $wpdb;
    525                 global $wpmuBaseTablePrefix;
    526515                global $current_user;
    527516               
    528517                $sql =  "select count(id)
     
    544533        {
    545534                // get the globals
    546535                global $wpdb;
    547                 global $wpmuBaseTablePrefix;
    548536                global $current_user;
    549537               
    550538                $sql = "select SQL_CALC_FOUND_ROWS n.id, n.name, n.slug, n.description, n.private, n.open, n.type, m.group_admin
     
    569557        {
    570558                global $current_user;
    571559                global $wpdb;
    572                 global $wpmuBaseTablePrefix;
    573560               
    574561                $sql =  "select id
    575562                                from  ".$this->group_members_table."
     
    587574       
    588575        // show a form to join this group, if allowed
    589576        function Join_Group_Form($message="")
    590         {
    591                
    592                 global $current_user;
    593                 global $myjournal_members;
    594                
     577        {               
    595578                if ($message == ""){ $message = get_site_option("bp_groups_join_message"); }
    596579               
    597580                if ($this->current_group->open == "1")
     
    603586               
    604587                } else {
    605588               
    606                         print "
    607                         You can only join this group by being invited by a member.
    608                         ";
     589                        print "You can only join this group by being invited by a member.";
    609590               
    610591                }
    611592        }
     
    619600               
    620601                        // get the globals
    621602                        global $wpdb;
    622                         global $current_site;
    623                         global $current_user;
    624                         global $wpmuBaseTablePrefix;
    625603               
    626604                        $featured_group = get_site_option("bp_featured_group");
    627605               
    628606                        if ($featured_group != "" && $featured_group != "0")
    629                         {
    630                
     607                        {               
    631608                                // get the featured group
    632609                                $group = $wpdb->get_row("select id, name, slug, description
    633610                                                                        from ".$this->groups_table."
    634611                                                                        where id = ".$wpdb->escape($featured_group).";");
    635612                                                                       
    636                                 $group->image = $this->Get_Group_Image($group->id, $imagesize);
    637                                
    638                                 return $group;
    639                                                                        
    640                         } else {
    641                        
    642                                 return false;
    643                        
    644                         }
    645                        
     613                                $group->image = $this->Get_Group_Image($group->id, $imagesize);                         
     614                                return $group;                                                                 
     615                        } else {                       
     616                                return false;                   
     617                        }                       
    646618                }
     619                return false;
    647620               
    648621        }
    649622       
     
    651624        function Join_Group()
    652625        {
    653626                global $wpdb;
    654                 global $wpmuBaseTablePrefix;
    655627                global $current_user;
    656628                global $current_user;
    657629               
     
    666638                       
    667639                } else {
    668640               
    669                         $invited = $this->Is_Invited();
     641                        //$invited = $this->Is_Invited();
    670642               
    671643                        // if the group is private and the current user doesn't have an invite
    672644                        if (($this->current_group->private  || !$this->current_group->open) && !invited)
     
    697669        // get an image for a group
    698670        function Get_Group_Image($groupid, $size, $fallback=true, $qs = "")
    699671        {
    700                 global  $current_site;
    701                 global $myjournal_config;
     672                global $current_site;
    702673               
    703674                if ($qs != "")
    704675                {
     
    727698        function Check_Tables()
    728699        {
    729700                require_once(ABSPATH . 'wp-admin/upgrade-functions.php');
    730                 global $wpmuBaseTablePrefix;
    731701                global $wpdb;
    732702               
    733703                if($wpdb->get_var("SHOW TABLES LIKE '".$this->groups_table."'") != $this->groups_table)
     
    838808        {
    839809                // get the globals
    840810                global $wpdb;
    841                 global $wpmuBaseTablePrefix;
    842                 global $bp_groups;
    843811                global $current_user;
    844                 global $current_user;
    845                
     812
    846813                // is this a deleted member
    847814                $deleted_member = $wpdb->get_var("select id from  ".$this->group_members_table." where user_id = ".$wpdb->escape($_GET["invite"])." and group_id = ".$wpdb->escape($_GET["group"])." and status_id = 0;");
    848815               
     
    864831                        // get the members email address
    865832                        $invited_member = get_userdata($_GET["invite"]);
    866833                        $invited_email = $invited_member->user_email;
    867                         $inviter = $current_user->user_email;
    868834                        $group = $this->Group_Details($_GET["group"]);
    869835               
    870836                        $message_headers = "MIME-Version: 1.0\n" . "From: \"".get_site_option("myjournal_system_name")."\" <support@".$_SERVER["SERVER_NAME"].">\n" . "Content-Type: text/plain; charset=\"" . get_option('user_charset') . "\"\n";
     
    885851        {
    886852                // get the globals
    887853                global $wpdb;
    888                 global $wpmuBaseTablePrefix;
    889854                global $current_user;
    890855                if ($wpdb->query("update  ".$this->group_members_table." set status_id = 0 where user_id=".$current_user->user_id." and group_id = ".$wpdb->escape($_GET["leave"]).";") !== false)
    891856                {
     
    900865        {
    901866                // get the globals
    902867                global $wpdb;
    903                 global $wpmuBaseTablePrefix;
    904868                global $current_user;
    905869                if ($wpdb->query("update ".$this->group_members_table." set status_id = 1 where user_id=".$current_user->user_id." and group_id = ".$wpdb->escape($_GET["undoleave"]).";") !== false)
    906870                {
     
    926890        {
    927891                // get the globals
    928892                global $wpdb;
    929                 global $wpmuBaseTablePrefix;
    930                 global $current_user;
     893
    931894                if ($this->User_Is_Group_Admin())
    932895                {
    933896                        if ($wpdb->query("update  ".$this->group_members_table." set status_id = 0 where user_id=".$wpdb->escape($_GET["remove"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    946909        {
    947910                // get the globals
    948911                global $wpdb;
    949                 global $wpmuBaseTablePrefix;
    950                 global $current_user;
     912
    951913                if ($this->User_Is_Group_Admin())
    952914                {
    953915                        if ($wpdb->query("update ".$this->group_members_table." set status_id = 1 where user_id=".$wpdb->escape($_GET["undoremove"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    977939        {
    978940                // get the globals
    979941                global $wpdb;
    980                 global $wpmuBaseTablePrefix;
    981                 global $current_user;
     942
    982943                if ($this->User_Is_Group_Admin())
    983944                {
    984945                        if ($wpdb->query("update  ".$this->group_members_table." set status_id = 0 where user_id=".$wpdb->escape($_GET["cancel"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    1008969        {
    1009970                // get the globals
    1010971                global $wpdb;
    1011                 global $wpmuBaseTablePrefix;
    1012                 global $current_user;
     972
    1013973                if ($this->User_Is_Group_Admin())
    1014974                {
    1015975                        if ($wpdb->query("update  ".$this->group_members_table." set status_id = 2 where user_id=".$wpdb->escape($_GET["reinvite"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    10451005        {
    10461006                // get the globals
    10471007                global $wpdb;
    1048                 global $wpmuBaseTablePrefix;
    1049                 global $current_user;
     1008       
    10501009                if ($this->User_Is_Group_Admin())
    10511010                {
    10521011                        if ($wpdb->query("update  ".$this->group_members_table." set group_admin = 1 where user_id=".$wpdb->escape($_GET["promote"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    10651024        {
    10661025                // get the globals
    10671026                global $wpdb;
    1068                 global $wpmuBaseTablePrefix;
    1069                 global $current_user;
     1027
    10701028                if ($this->User_Is_Group_Admin())
    10711029                {
    10721030                        if ($wpdb->query("update  ".$this->group_members_table." set group_admin = 0 where user_id=".$wpdb->escape($_GET["undopromote"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    10961054        {
    10971055                // get the globals
    10981056                global $wpdb;
    1099                 global $wpmuBaseTablePrefix;
    1100                 global $current_user;
     1057
    11011058                if ($this->User_Is_Group_Admin())
    11021059                {
    11031060                        if ($wpdb->query("update  ".$this->group_members_table." set status_id = 1 where user_id=".$wpdb->escape($_GET["reinstate"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    11161073        {
    11171074                // get the globals
    11181075                global $wpdb;
    1119                 global $wpmuBaseTablePrefix;
    1120                 global $current_user;
    11211076                if ($this->User_Is_Group_Admin())
    11221077                {
    11231078                        if ($wpdb->query("update ".$this->group_members_table." set status_id = 2 where user_id=".$wpdb->escape($_GET["undocancel"])." and group_id = ".$wpdb->escape($_GET["group"]).";") !== false)
     
    11361091        {
    11371092                // get the globals
    11381093                global $wpdb;
    1139                 global $wpmuBaseTablePrefix;
    11401094                global $current_user;
    11411095                global $current_user;
    11421096               
     
    11561110        {
    11571111                // get the globals
    11581112                global $wpdb;
    1159                 global $wpmuBaseTablePrefix;
    11601113                global $current_user;
    11611114               
    11621115                if ($wpdb->query("update ".$this->group_members_table." set status_id = 0 where user_id=".$current_user->user_id." and group_id = ".$wpdb->escape($_GET["decline"]).";") !== false)
     
    11711124        function Edit_Group()
    11721125        {
    11731126                global $wpdb;
    1174                 global $wpmuBaseTablePrefix;
    11751127               
    11761128                $this->message = "";
    11771129               
     
    12001152        function Create_Group()
    12011153        {
    12021154                global $wpdb;
    1203                 global $wpmuBaseTablePrefix;
    12041155                global $current_user;
    12051156                global $current_site;
    12061157                global $current_user;
     
    12741225                                          "uploads" => $uploads)
    12751226                         );
    12761227               
    1277                         global $wpdb;
    1278                         global $wpmuBaseTablePrefix;
    1279                         global $current_site;
    1280                         global $current_user;
    12811228                        $image = new Image();
    12821229                       
    12831230                        $sizes =        array(
     
    12931240                       
    12941241                        if ($errors == "")
    12951242                        {
    1296                                 $value = $option[1];
    1297                                 $image->delete("groups.dir/".$this->current_group->id."_original.jpg");
    1298                                        
     1243                                $image->delete("groups.dir/".$this->current_group->id."_original.jpg");                                 
    12991244                                return true;
    13001245                        } else {
    13011246                                $this->message .= "<p class=\"error\">".get_site_option("bp_error_saving_image")."</p><ul>" . $errors . "</ul>";
    1302                                 $value = null;
    13031247                                return false;
    13041248                        }
    13051249                       
  • bp_messages.php

     
    5050
    5151function messages_add_menu()
    5252{       
    53         global $wpdb, $table_name, $wpmuBaseTablePrefix, $bp_messages;
    54         $table_name = $wpmuBaseTablePrefix . "bp_messages";
     53        global $wpdb, $table_name, $bp_messages;
     54        $table_name = $wpdb->base_prefix . "bp_messages";
    5555       
    5656        /* Instantiate bp_Messages class to do the real work. */
    5757        $bp_messages = new BP_Messages;
     
    114114         **************************************************************************/
    115115        function bp_messages()
    116116        {
    117                 global $wpdb, $wpmuBaseTablePrefix, $userdata, $table_name;
     117                global $wpdb, $userdata, $table_name;
    118118                 
    119119                $this->wpdb = &$wpdb;
    120120                $this->userdata = &$userdata;
    121                 $this->basePrefix = $wpmuBaseTablePrefix;
     121                $this->basePrefix = $wpdb->base_prefix;
    122122                $this->tableName = $table_name; // need a root prefix, not a wp_X_ prefix.
    123123                $this->imageBase = get_option('siteurl') . '/wp-content/mu-plugins/bp_messages/images/';
    124124
  • bp_xprofile.php

     
    1414 Version: 0.1
    1515 Type: Add-On
    1616 **************************************************************************/
    17 
    18 $bp_xprofile_table_name = $wpmuBaseTablePrefix . "bp_xprofile";
     17global $wpdb;
     18$bp_xprofile_table_name = $wpdb->base_prefix . "bp_xprofile";
    1919$image_base = get_option('siteurl') . '/wp-content/mu-plugins/bp_xprofile/images';
    2020$profile_picture_path = trim(get_option('upload_path')) . '/profilepics';
    2121$profile_picture_base = get_option('site_url') . 'files/profilepics';
     
    3333
    3434function xprofile_install()
    3535{
    36         global $wpdb, $bp_xprofile_table_name;
     36        global $bp_xprofile_table_name;
    3737
    3838        $sql = array();
    3939       
     
    8484
    8585function xprofile_add_menu()
    8686{
    87         global $wpdb, $bp_xprofile_table_name, $wpmuBaseTablePrefix, $bp_xprofile, $groups;
     87        global $wpdb, $bp_xprofile_table_name, $groups;
    8888
    89         add_menu_page("Profile", "Profile", 1, basename(__FILE__), "xprofile_picture");
    90         add_submenu_page(basename(__FILE__), "Picture", "Picture", 1, basename(__FILE__), "xprofile_picture");         
     89        add_menu_page(__("Profile"), __("Profile"), 1, basename(__FILE__), "xprofile_picture");
     90        add_submenu_page(basename(__FILE__), __("Picture"), __("Picture"), 1, basename(__FILE__), "xprofile_picture");         
    9191       
    9292        $groups = BP_XProfile_Group::get_all();
    9393
     
    9898        }
    9999       
    100100        /* Add the administration tab under the "Site Admin" tab for site administrators */
    101         add_submenu_page('bp_core.php', "Profiles", "Profiles", 1, "xprofile_settings", "xprofile_admin");
     101        add_submenu_page('bp_core.php', __("Profiles"), __("Profiles"), 1, "xprofile_settings", "xprofile_admin");
    102102
    103103        /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
    104104        if($wpdb->get_var("show tables like '$bp_xprofile_table_name'") != $bp_xprofile_table_name) xprofile_install();
     
    115115
    116116function xprofile_setup()
    117117{
    118         global $image_base, $profile_picture_path, $profile_picture_base;
     118        global $profile_picture_base;
    119119       
    120120        // Check to see if the users profile picture folder exists. If not, make it.
    121121        if(!is_dir(ABSPATH . $profile_picture_path)) {
     
    238238                                                   ($field->is_required && $current_field == ''))
    239239                                                {
    240240                                                        // Validate the field.
    241                                                         $field->message = __($field->name . ' cannot be left blank.');
     241                                                        $field->message = sprintf(__('%s cannot be left blank.'), $field->name);
    242242                                                        $errors[] = $field->message . "<br />";
    243243                                                }
    244244                                                else if(!$field->is_required && $current_field == '')
     
    286286                                $list_html .= '</ul>';
    287287                               
    288288                                $list_html .= '<p class="submit">
    289                                                                 <input type="submit" name="save" id="save" value="Save Changes &raquo;" />
     289                                                                <input type="submit" name="save" id="save" value="'.__('Save Changes &raquo;').'" />
    290290                                                           </p>';
    291291
    292292                                if($errors && isset($_POST['save']))
     
    308308                        }
    309309                        else
    310310                        {
    311                                 $list_html .= '<p>This group is currently empty. Please contact the site admin if this is incorrect.</p>';
     311                                $list_html .= '<p>'.__('This group is currently empty. Please contact the site admin if this is incorrect.').'</p>';
    312312                        }
    313313                       
    314314                ?>
     
    412412                        <div id="profilePicture">
    413413                       
    414414                                <div id="currentPicture">
    415                                         <h2>Current Picture</h2>
     415                                        <h2><?php _e('Current Picture'); ?></h2>
    416416                                        <?php echo $current_thumbnail->html; ?>
    417417                                       
    418418                                        <p style="text-align: center">[ <a href="admin.php?page=bp_xprofile.php&amp;mode=delete_picture&amp;file=<?php echo $current["picture"]; ?>">delete picture</a> ]</p>
    419419                                       
    420420                                        <form action="admin.php?page=bp_xprofile.php" enctype="multipart/form-data" method="post">
    421                                                 <h3>Upload a Picture</h3>
     421                                                <h3><?php _e('Upload a Picture'); ?></h3>
    422422
    423423                                                <input type="file" name="profile_image" id="profile_image" />
    424                                                 <p class="submit" style="text-align: center"><input type="submit" name="submit" value="Upload Picture &raquo;" /></p>
     424                                                <p class="submit" style="text-align: center">
     425                                                        <input type="submit" name="submit" value="<?php _e('Upload Picture &raquo;'); ?>" /></p>
    425426
    426427                                                <input type="hidden" name="action" value="save" />
    427428                                                <input type="hidden" name="max_file_size" value="1000000" />
     
    431432                        </div>
    432433                       
    433434                        <div id="otherPictures">
    434                                 <h2>Previously Uploaded</h2>
     435                                <h2><?php _e('Previously Uploaded'); ?></h2>
    435436                                <?php $pictures = BP_XProfile_Picture::get_all(ABSPATH . $profile_picture_path); ?>
    436437                                <ul>
    437438                                <?php for($i=0; $i<count($pictures); $i++) { ?>
    438439                                        <li>
    439440                                                <a href="admin.php?page=bp_xprofile.php&amp;mode=set_picture&amp;file=<?php echo $pictures[$i]["file"]; ?>">
    440                                                         <img src="<?php echo get_option('site_url') . 'files/profilepics/' . $pictures[$i]["thumbnail"]; ?>" alt="Alternate Pic" style="height: 100px;" /></li>
     441                                                        <img src="<?php echo get_option('site_url') . 'files/profilepics/' . $pictures[$i]["thumbnail"]; ?>" alt="<?php _e('Alternate Pic'); ?>" style="height: 100px;" /></li>
    441442                                                </a>
    442443                                        </li>
    443444                                <?php } ?>
  • bp_xprofile/bp_xprofile.classes.php

     
    2323       
    2424        function bp_xprofile_group($id = null)
    2525        {
    26                 global $wpmuBaseTablePrefix, $bp_xprofile_table_name;
     26                global $wpdb, $bp_xprofile_table_name;
    2727 
    28                 $this->base_prefix = $wpmuBaseTablePrefix;
     28                $this->base_prefix = $wpdb->base_prefix;
    2929                $this->table_name = $bp_xprofile_table_name;
    3030               
    3131                if($id)
     
    263263
    264264        function bp_xprofile_field($id = null, $user_id = null, $get_data = true)
    265265        {
    266                 global $wpmuBaseTablePrefix, $bp_xprofile_table_name;
     266                global $wpdb, $bp_xprofile_table_name;
    267267
    268                 $this->base_prefix = $wpmuBaseTablePrefix;
     268                $this->base_prefix = $wpdb->base_prefix;
    269269                $this->table_name = $bp_xprofile_table_name;
    270270               
    271271                if($id)
     
    431431                        $asterisk = '* ';
    432432                }
    433433               
    434                 $error_class = '';
     434                $message_class = '';
    435435                if($this->message)
    436436                {
    437437                        $this->message = '<p class="' . $this->message_type . '">' . $this->message . '</p>';
     
    783783       
    784784        function bp_xprofile_profiledata($field_id = null, $user_id = null)
    785785        {
    786                 global $wpmuBaseTablePrefix, $bp_xprofile_table_name;
     786                global $wpdb, $bp_xprofile_table_name;
    787787
    788                 $this->base_prefix = $wpmuBaseTablePrefix;
     788                $this->base_prefix = $wpdb->base_prefix;
    789789                $this->table_name = $bp_xprofile_table_name;
    790790               
    791791                if($field_id)
     
    856856
    857857        function save()
    858858        {
    859                 global $wpdb, $userdata;
     859                global $wpdb;
    860860
    861861                if($this->is_valid_field())
    862862                {
  • bp_xprofile/bp_xprofile.setup.php

     
    88
    99function xprofile_install()
    1010{
    11         global $wpdb, $table_name;
     11        global $table_name;
    1212
    1313        $sql = "CREATE TABLE ". $table_name ." (
    1414                  id mediumint(9) NOT NULL AUTO_INCREMENT,
     
    3333
    3434function xprofile_add_menu()
    3535{
    36         global $wpdb, $table_name, $wpmuBaseTablePrefix, $bp_xprofile, $groups;
    37         $table_name = $wpmuBaseTablePrefix . "bp_xprofile";
     36        global $wpdb, $table_name, $groups;
     37        $table_name = $wpdb->base_prefix . "bp_xprofile";
    3838
    3939        include_once('bp_xprofile/bp_xprofile.classes.php');
    4040        include_once('bp_xprofile/bp_xprofile.admin.php');
  • bp_xprofile/bp_xprofile.signup.php

     
    207207
    208208function xprofile_on_activate($blog_id = null, $user_id = null)
    209209{
    210         global $wpdb, $wpmuBaseTablePrefix, $profile_picture_path;
     210        global $wpdb, $profile_picture_path;
    211211       
    212212        $field_ids = get_blog_option($blog_id, 'xprofile_field_ids');
    213213        $field_ids = explode(",", $field_ids);
    214214       
    215         $sql = "SELECT u.ID from " . $wpmuBaseTablePrefix . "users u,
    216                         " . $wpmuBaseTablePrefix . "usermeta um
     215        $sql = "SELECT u.ID from " . $wpdb->base_prefix . "users u,
     216                        " . $wpdb->base_prefix . "usermeta um
    217217                        WHERE u.ID = um.user_id
    218218                        AND um.meta_key = 'primary_blog'
    219219                        AND um.meta_value = " . $blog_id;