Ticket #5: remove_depreciated_and_global.patch
File remove_depreciated_and_global.patch, 24.7 KB (added by , 17 years ago) |
---|
-
bp_core.php
153 153 154 154 function limit_access() 155 155 { 156 global $parent_file;157 158 156 if(!is_site_admin()) { 159 157 if(strpos($_SERVER['SCRIPT_NAME'],'/themes.php')) header("Location: index.php"); 160 158 if(strpos($_SERVER['SCRIPT_NAME'],'/plugins.php')) header("Location: index.php"); … … 188 186 add_action('admin_head', 'start_dash'); 189 187 } 190 188 191 function start_dash($dash_contents )189 function start_dash($dash_contents = '') 192 190 { 193 191 ob_start(); 194 192 add_action('admin_footer', 'end_dash'); … … 251 249 252 250 function bp_core_get_userid($username) 253 251 { 254 global $wpdb , $wpmuBaseTablePrefix;252 global $wpdb; 255 253 256 $sql = "SELECT ID FROM " . $wp muBaseTablePrefix . "users254 $sql = "SELECT ID FROM " . $wpdb->base_prefix . "users 257 255 WHERE user_login = '" . $username . "'"; 258 256 259 257 if(!$user_id = $wpdb->get_var($sql)) { … … 279 277 280 278 function bp_core_get_username($user_id) 281 279 { 282 global $wpdb , $wpmuBaseTablePrefix;280 global $wpdb; 283 281 284 $sql = "SELECT user_login FROM " . $wp muBaseTablePrefix . "users282 $sql = "SELECT user_login FROM " . $wpdb->base_prefix . "users 285 283 WHERE ID = " . $user_id; 286 284 287 285 if(!$username = $wpdb->get_var($sql)) { … … 426 424 // get the page number from the $_GET["p"] variable 427 425 function bp_get_page() 428 426 { 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; 431 431 } 432 432 433 433 // generate page links … … 569 569 if (trim($q) != "") 570 570 { 571 571 global $wpdb; 572 global $wpmuBaseTablePrefix;573 572 global $current_user; 574 $sql = "select SQL_CALC_FOUND_ROWS id, user_login, display_name, user_nicename from ".$wp muBaseTablePrefix."users573 $sql = "select SQL_CALC_FOUND_ROWS id, user_login, display_name, user_nicename from ".$wpdb->base_prefix."users 575 574 where (user_nicename like '%".$wpdb->escape($q)."%' 576 575 or user_email like '%".$wpdb->escape($q)."%' 577 576 or display_name like '%".$wpdb->escape($q)."%') -
bp_friends.php
22 22 23 23 function friends_install() 24 24 { 25 global $ wpdb, $table_name;25 global $table_name; 26 26 27 27 $sql = "CREATE TABLE ". $table_name ." ( 28 28 id mediumint(9) NOT NULL AUTO_INCREMENT, … … 47 47 48 48 function friends_add_menu() 49 49 { 50 global $wpdb, $table_name, $ wpmuBaseTablePrefix, $bp_friends;51 $table_name = $wp muBaseTablePrefix . "bp_friends";50 global $wpdb, $table_name, $bp_friends; 51 $table_name = $wpdb->base_prefix . "bp_friends"; 52 52 53 53 /* Instantiate bp_Friends class to do the real work. */ 54 54 $bp_friends = new BP_Friends; … … 103 103 **************************************************************************/ 104 104 function bp_friends() 105 105 { 106 global $wpdb, $ wpmuBaseTablePrefix, $userdata, $table_name;106 global $wpdb, $userdata, $table_name; 107 107 108 108 $this->wpdb = &$wpdb; 109 109 $this->userdata = &$userdata; 110 $this->basePrefix = $wp muBaseTablePrefix;110 $this->basePrefix = $wpdb->base_prefix; 111 111 $this->tableName = $table_name; // need a root prefix, not a wp_X_ prefix. 112 112 $this->imageBase = get_option('siteurl') . '/wp-content/mu-plugins/bp_friends/images/'; 113 113 -
bp_groups.php
14 14 Version: 0.1 15 15 Type: Add-On 16 16 **************************************************************************/ 17 global $wpdb; 18 $bp_groups_table_name = $wpdb->base_prefix . "bp_groups"; 19 $bp_group_members_table_name = $wpdb->base_prefix . "bp_group_members"; 17 20 18 $bp_groups_table_name = $wpmuBaseTablePrefix . "bp_groups";19 $bp_group_members_table_name = $wpmuBaseTablePrefix . "bp_group_members";20 21 21 include_once('bp_groups/bp_groups.class.php'); 22 22 23 23 /************************************************************************** -
bp_groups/bp_groups.class.php
48 48 //if (get_site_option("bp_groups_enabled") == "") 49 49 //{ 50 50 51 global $wp muBaseTablePrefix;52 $this->groups_table = $wp muBaseTablePrefix."bp_groups";53 $this->group_members_table = $wp muBaseTablePrefix."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"; 54 54 55 55 // check the options exist 56 56 $this->Check_Options(); … … 106 106 { 107 107 // get the globals 108 108 global $wpdb; 109 global $wpmuBaseTablePrefix;110 global $myjournal_members;111 109 global $current_user; 112 110 113 111 // get the group details … … 117 115 count(m.id) as members 118 116 from ".$this->groups_table." n 119 117 inner join ".$this->group_members_table." m on m.group_id = n.id and m.status_id = 1 120 inner join ".$wp muBaseTablePrefix."users b on b.id = m.user_id118 inner join ".$wpdb->base_prefix."users b on b.id = m.user_id 121 119 where n.slug = '".$wpdb->escape($this->slug)."' 122 120 group by n.id;"; 123 121 } … … 127 125 count(m.id) as members 128 126 from ".$this->groups_table." n 129 127 inner join ".$this->group_members_table." m on m.group_id = n.id and m.status_id = 1 130 inner join ".$wp muBaseTablePrefix."users b on b.id = m.user_id128 inner join ".$wpdb->base_prefix."users b on b.id = m.user_id 131 129 where n.id = ".$wpdb->escape($this->id)." 132 130 group by n.id;"; 133 131 } … … 160 158 { 161 159 // get the globals 162 160 global $wpdb; 163 global $wpmuBaseTablePrefix;164 161 $sql = "select name, slug from ".$this->groups_table." where id = ".$wpdb->escape($groupid).";"; 165 162 return $wpdb->get_row($sql); 166 163 } … … 170 167 { 171 168 // get the globals 172 169 global $wpdb; 173 global $wpmuBaseTablePrefix;174 170 175 171 $sql = "select SQL_CALC_FOUND_ROWS id, name, description, slug 176 172 from ".$this->groups_table." … … 196 192 { 197 193 // get the globals 198 194 global $wpdb; 199 global $wpmuBaseTablePrefix;200 195 201 196 $groups = $wpdb->get_results("select id, slug, name, description, open 202 197 from ".$this->groups_table." … … 213 208 { 214 209 // get the globals 215 210 global $wpdb; 216 global $wpmuBaseTablePrefix;217 211 218 212 $groups = $wpdb->get_results("select n.id, n.slug, n.name, n.description, n.open, count(m.id) as members 219 213 from ".$this->groups_table." n … … 232 226 { 233 227 // get the globals 234 228 global $wpdb; 235 global $wpmuBaseTablePrefix;236 229 global $current_user; 237 230 238 231 if ($all) … … 447 440 function Is_Group_Member($userid = 0) 448 441 { 449 442 global $wpdb; 450 global $wpmuBaseTablePrefix;451 443 452 444 if ($userid == 0) 453 445 { … … 473 465 function Is_Group_Admin($userid = 0) 474 466 { 475 467 global $wpdb; 476 global $wpmuBaseTablePrefix;477 468 478 469 if ($userid == 0) 479 470 { … … 500 491 function User_Is_Group_Admin() 501 492 { 502 493 global $wpdb; 503 global $wpmuBaseTablePrefix;504 494 global $current_user; 505 495 506 496 $sql = "select count(id) … … 522 512 function Has_Group_Admin_Rights() 523 513 { 524 514 global $wpdb; 525 global $wpmuBaseTablePrefix;526 515 global $current_user; 527 516 528 517 $sql = "select count(id) … … 544 533 { 545 534 // get the globals 546 535 global $wpdb; 547 global $wpmuBaseTablePrefix;548 536 global $current_user; 549 537 550 538 $sql = "select SQL_CALC_FOUND_ROWS n.id, n.name, n.slug, n.description, n.private, n.open, n.type, m.group_admin … … 569 557 { 570 558 global $current_user; 571 559 global $wpdb; 572 global $wpmuBaseTablePrefix;573 560 574 561 $sql = "select id 575 562 from ".$this->group_members_table." … … 587 574 588 575 // show a form to join this group, if allowed 589 576 function Join_Group_Form($message="") 590 { 591 592 global $current_user; 593 global $myjournal_members; 594 577 { 595 578 if ($message == ""){ $message = get_site_option("bp_groups_join_message"); } 596 579 597 580 if ($this->current_group->open == "1") … … 603 586 604 587 } else { 605 588 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."; 609 590 610 591 } 611 592 } … … 619 600 620 601 // get the globals 621 602 global $wpdb; 622 global $current_site;623 global $current_user;624 global $wpmuBaseTablePrefix;625 603 626 604 $featured_group = get_site_option("bp_featured_group"); 627 605 628 606 if ($featured_group != "" && $featured_group != "0") 629 { 630 607 { 631 608 // get the featured group 632 609 $group = $wpdb->get_row("select id, name, slug, description 633 610 from ".$this->groups_table." 634 611 where id = ".$wpdb->escape($featured_group).";"); 635 612 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 } 646 618 } 619 return false; 647 620 648 621 } 649 622 … … 651 624 function Join_Group() 652 625 { 653 626 global $wpdb; 654 global $wpmuBaseTablePrefix;655 627 global $current_user; 656 628 global $current_user; 657 629 … … 666 638 667 639 } else { 668 640 669 $invited = $this->Is_Invited();641 //$invited = $this->Is_Invited(); 670 642 671 643 // if the group is private and the current user doesn't have an invite 672 644 if (($this->current_group->private || !$this->current_group->open) && !invited) … … 697 669 // get an image for a group 698 670 function Get_Group_Image($groupid, $size, $fallback=true, $qs = "") 699 671 { 700 global $current_site; 701 global $myjournal_config; 672 global $current_site; 702 673 703 674 if ($qs != "") 704 675 { … … 727 698 function Check_Tables() 728 699 { 729 700 require_once(ABSPATH . 'wp-admin/upgrade-functions.php'); 730 global $wpmuBaseTablePrefix;731 701 global $wpdb; 732 702 733 703 if($wpdb->get_var("SHOW TABLES LIKE '".$this->groups_table."'") != $this->groups_table) … … 838 808 { 839 809 // get the globals 840 810 global $wpdb; 841 global $wpmuBaseTablePrefix;842 global $bp_groups;843 811 global $current_user; 844 global $current_user; 845 812 846 813 // is this a deleted member 847 814 $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;"); 848 815 … … 864 831 // get the members email address 865 832 $invited_member = get_userdata($_GET["invite"]); 866 833 $invited_email = $invited_member->user_email; 867 $inviter = $current_user->user_email;868 834 $group = $this->Group_Details($_GET["group"]); 869 835 870 836 $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"; … … 885 851 { 886 852 // get the globals 887 853 global $wpdb; 888 global $wpmuBaseTablePrefix;889 854 global $current_user; 890 855 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) 891 856 { … … 900 865 { 901 866 // get the globals 902 867 global $wpdb; 903 global $wpmuBaseTablePrefix;904 868 global $current_user; 905 869 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) 906 870 { … … 926 890 { 927 891 // get the globals 928 892 global $wpdb; 929 global $wpmuBaseTablePrefix; 930 global $current_user; 893 931 894 if ($this->User_Is_Group_Admin()) 932 895 { 933 896 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) … … 946 909 { 947 910 // get the globals 948 911 global $wpdb; 949 global $wpmuBaseTablePrefix; 950 global $current_user; 912 951 913 if ($this->User_Is_Group_Admin()) 952 914 { 953 915 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) … … 977 939 { 978 940 // get the globals 979 941 global $wpdb; 980 global $wpmuBaseTablePrefix; 981 global $current_user; 942 982 943 if ($this->User_Is_Group_Admin()) 983 944 { 984 945 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) … … 1008 969 { 1009 970 // get the globals 1010 971 global $wpdb; 1011 global $wpmuBaseTablePrefix; 1012 global $current_user; 972 1013 973 if ($this->User_Is_Group_Admin()) 1014 974 { 1015 975 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) … … 1045 1005 { 1046 1006 // get the globals 1047 1007 global $wpdb; 1048 global $wpmuBaseTablePrefix; 1049 global $current_user; 1008 1050 1009 if ($this->User_Is_Group_Admin()) 1051 1010 { 1052 1011 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) … … 1065 1024 { 1066 1025 // get the globals 1067 1026 global $wpdb; 1068 global $wpmuBaseTablePrefix; 1069 global $current_user; 1027 1070 1028 if ($this->User_Is_Group_Admin()) 1071 1029 { 1072 1030 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) … … 1096 1054 { 1097 1055 // get the globals 1098 1056 global $wpdb; 1099 global $wpmuBaseTablePrefix; 1100 global $current_user; 1057 1101 1058 if ($this->User_Is_Group_Admin()) 1102 1059 { 1103 1060 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) … … 1116 1073 { 1117 1074 // get the globals 1118 1075 global $wpdb; 1119 global $wpmuBaseTablePrefix;1120 global $current_user;1121 1076 if ($this->User_Is_Group_Admin()) 1122 1077 { 1123 1078 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) … … 1136 1091 { 1137 1092 // get the globals 1138 1093 global $wpdb; 1139 global $wpmuBaseTablePrefix;1140 1094 global $current_user; 1141 1095 global $current_user; 1142 1096 … … 1156 1110 { 1157 1111 // get the globals 1158 1112 global $wpdb; 1159 global $wpmuBaseTablePrefix;1160 1113 global $current_user; 1161 1114 1162 1115 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) … … 1171 1124 function Edit_Group() 1172 1125 { 1173 1126 global $wpdb; 1174 global $wpmuBaseTablePrefix;1175 1127 1176 1128 $this->message = ""; 1177 1129 … … 1200 1152 function Create_Group() 1201 1153 { 1202 1154 global $wpdb; 1203 global $wpmuBaseTablePrefix;1204 1155 global $current_user; 1205 1156 global $current_site; 1206 1157 global $current_user; … … 1274 1225 "uploads" => $uploads) 1275 1226 ); 1276 1227 1277 global $wpdb;1278 global $wpmuBaseTablePrefix;1279 global $current_site;1280 global $current_user;1281 1228 $image = new Image(); 1282 1229 1283 1230 $sizes = array( … … 1293 1240 1294 1241 if ($errors == "") 1295 1242 { 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"); 1299 1244 return true; 1300 1245 } else { 1301 1246 $this->message .= "<p class=\"error\">".get_site_option("bp_error_saving_image")."</p><ul>" . $errors . "</ul>"; 1302 $value = null;1303 1247 return false; 1304 1248 } 1305 1249 -
bp_messages.php
50 50 51 51 function messages_add_menu() 52 52 { 53 global $wpdb, $table_name, $ wpmuBaseTablePrefix, $bp_messages;54 $table_name = $wp muBaseTablePrefix . "bp_messages";53 global $wpdb, $table_name, $bp_messages; 54 $table_name = $wpdb->base_prefix . "bp_messages"; 55 55 56 56 /* Instantiate bp_Messages class to do the real work. */ 57 57 $bp_messages = new BP_Messages; … … 114 114 **************************************************************************/ 115 115 function bp_messages() 116 116 { 117 global $wpdb, $ wpmuBaseTablePrefix, $userdata, $table_name;117 global $wpdb, $userdata, $table_name; 118 118 119 119 $this->wpdb = &$wpdb; 120 120 $this->userdata = &$userdata; 121 $this->basePrefix = $wp muBaseTablePrefix;121 $this->basePrefix = $wpdb->base_prefix; 122 122 $this->tableName = $table_name; // need a root prefix, not a wp_X_ prefix. 123 123 $this->imageBase = get_option('siteurl') . '/wp-content/mu-plugins/bp_messages/images/'; 124 124 -
bp_xprofile.php
14 14 Version: 0.1 15 15 Type: Add-On 16 16 **************************************************************************/ 17 18 $bp_xprofile_table_name = $wp muBaseTablePrefix . "bp_xprofile";17 global $wpdb; 18 $bp_xprofile_table_name = $wpdb->base_prefix . "bp_xprofile"; 19 19 $image_base = get_option('siteurl') . '/wp-content/mu-plugins/bp_xprofile/images'; 20 20 $profile_picture_path = trim(get_option('upload_path')) . '/profilepics'; 21 21 $profile_picture_base = get_option('site_url') . 'files/profilepics'; … … 33 33 34 34 function xprofile_install() 35 35 { 36 global $ wpdb, $bp_xprofile_table_name;36 global $bp_xprofile_table_name; 37 37 38 38 $sql = array(); 39 39 … … 84 84 85 85 function xprofile_add_menu() 86 86 { 87 global $wpdb, $bp_xprofile_table_name, $ wpmuBaseTablePrefix, $bp_xprofile, $groups;87 global $wpdb, $bp_xprofile_table_name, $groups; 88 88 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"); 91 91 92 92 $groups = BP_XProfile_Group::get_all(); 93 93 … … 98 98 } 99 99 100 100 /* 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"); 102 102 103 103 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 104 104 if($wpdb->get_var("show tables like '$bp_xprofile_table_name'") != $bp_xprofile_table_name) xprofile_install(); … … 115 115 116 116 function xprofile_setup() 117 117 { 118 global $ image_base, $profile_picture_path, $profile_picture_base;118 global $profile_picture_base; 119 119 120 120 // Check to see if the users profile picture folder exists. If not, make it. 121 121 if(!is_dir(ABSPATH . $profile_picture_path)) { … … 238 238 ($field->is_required && $current_field == '')) 239 239 { 240 240 // Validate the field. 241 $field->message = __($field->name . ' cannot be left blank.');241 $field->message = sprintf(__('%s cannot be left blank.'), $field->name); 242 242 $errors[] = $field->message . "<br />"; 243 243 } 244 244 else if(!$field->is_required && $current_field == '') … … 286 286 $list_html .= '</ul>'; 287 287 288 288 $list_html .= '<p class="submit"> 289 <input type="submit" name="save" id="save" value=" Save Changes »" />289 <input type="submit" name="save" id="save" value="'.__('Save Changes »').'" /> 290 290 </p>'; 291 291 292 292 if($errors && isset($_POST['save'])) … … 308 308 } 309 309 else 310 310 { 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>'; 312 312 } 313 313 314 314 ?> … … 412 412 <div id="profilePicture"> 413 413 414 414 <div id="currentPicture"> 415 <h2> Current Picture</h2>415 <h2><?php _e('Current Picture'); ?></h2> 416 416 <?php echo $current_thumbnail->html; ?> 417 417 418 418 <p style="text-align: center">[ <a href="admin.php?page=bp_xprofile.php&mode=delete_picture&file=<?php echo $current["picture"]; ?>">delete picture</a> ]</p> 419 419 420 420 <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> 422 422 423 423 <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 »" /></p> 424 <p class="submit" style="text-align: center"> 425 <input type="submit" name="submit" value="<?php _e('Upload Picture »'); ?>" /></p> 425 426 426 427 <input type="hidden" name="action" value="save" /> 427 428 <input type="hidden" name="max_file_size" value="1000000" /> … … 431 432 </div> 432 433 433 434 <div id="otherPictures"> 434 <h2> Previously Uploaded</h2>435 <h2><?php _e('Previously Uploaded'); ?></h2> 435 436 <?php $pictures = BP_XProfile_Picture::get_all(ABSPATH . $profile_picture_path); ?> 436 437 <ul> 437 438 <?php for($i=0; $i<count($pictures); $i++) { ?> 438 439 <li> 439 440 <a href="admin.php?page=bp_xprofile.php&mode=set_picture&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> 441 442 </a> 442 443 </li> 443 444 <?php } ?> -
bp_xprofile/bp_xprofile.classes.php
23 23 24 24 function bp_xprofile_group($id = null) 25 25 { 26 global $wp muBaseTablePrefix, $bp_xprofile_table_name;26 global $wpdb, $bp_xprofile_table_name; 27 27 28 $this->base_prefix = $wp muBaseTablePrefix;28 $this->base_prefix = $wpdb->base_prefix; 29 29 $this->table_name = $bp_xprofile_table_name; 30 30 31 31 if($id) … … 263 263 264 264 function bp_xprofile_field($id = null, $user_id = null, $get_data = true) 265 265 { 266 global $wp muBaseTablePrefix, $bp_xprofile_table_name;266 global $wpdb, $bp_xprofile_table_name; 267 267 268 $this->base_prefix = $wp muBaseTablePrefix;268 $this->base_prefix = $wpdb->base_prefix; 269 269 $this->table_name = $bp_xprofile_table_name; 270 270 271 271 if($id) … … 431 431 $asterisk = '* '; 432 432 } 433 433 434 $ error_class = '';434 $message_class = ''; 435 435 if($this->message) 436 436 { 437 437 $this->message = '<p class="' . $this->message_type . '">' . $this->message . '</p>'; … … 783 783 784 784 function bp_xprofile_profiledata($field_id = null, $user_id = null) 785 785 { 786 global $wp muBaseTablePrefix, $bp_xprofile_table_name;786 global $wpdb, $bp_xprofile_table_name; 787 787 788 $this->base_prefix = $wp muBaseTablePrefix;788 $this->base_prefix = $wpdb->base_prefix; 789 789 $this->table_name = $bp_xprofile_table_name; 790 790 791 791 if($field_id) … … 856 856 857 857 function save() 858 858 { 859 global $wpdb , $userdata;859 global $wpdb; 860 860 861 861 if($this->is_valid_field()) 862 862 { -
bp_xprofile/bp_xprofile.setup.php
8 8 9 9 function xprofile_install() 10 10 { 11 global $ wpdb, $table_name;11 global $table_name; 12 12 13 13 $sql = "CREATE TABLE ". $table_name ." ( 14 14 id mediumint(9) NOT NULL AUTO_INCREMENT, … … 33 33 34 34 function xprofile_add_menu() 35 35 { 36 global $wpdb, $table_name, $ wpmuBaseTablePrefix, $bp_xprofile, $groups;37 $table_name = $wp muBaseTablePrefix . "bp_xprofile";36 global $wpdb, $table_name, $groups; 37 $table_name = $wpdb->base_prefix . "bp_xprofile"; 38 38 39 39 include_once('bp_xprofile/bp_xprofile.classes.php'); 40 40 include_once('bp_xprofile/bp_xprofile.admin.php'); -
bp_xprofile/bp_xprofile.signup.php
207 207 208 208 function xprofile_on_activate($blog_id = null, $user_id = null) 209 209 { 210 global $wpdb, $ wpmuBaseTablePrefix, $profile_picture_path;210 global $wpdb, $profile_picture_path; 211 211 212 212 $field_ids = get_blog_option($blog_id, 'xprofile_field_ids'); 213 213 $field_ids = explode(",", $field_ids); 214 214 215 $sql = "SELECT u.ID from " . $wp muBaseTablePrefix . "users u,216 " . $wp muBaseTablePrefix . "usermeta um215 $sql = "SELECT u.ID from " . $wpdb->base_prefix . "users u, 216 " . $wpdb->base_prefix . "usermeta um 217 217 WHERE u.ID = um.user_id 218 218 AND um.meta_key = 'primary_blog' 219 219 AND um.meta_value = " . $blog_id;