Changeset 28
- Timestamp:
- 04/14/2008 05:55:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp_xprofile.php
r19 r28 85 85 function xprofile_add_menu() 86 86 { 87 global $wpdb, $bp_xprofile_table_name, $bp_xprofile, $groups; 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"); 91 92 $groups = BP_XProfile_Group::get_all(); 93 94 for($i=0; $i<count($groups); $i++) { 95 if($groups[$i]->fields) { 96 add_submenu_page(basename(__FILE__), $groups[$i]->name, $groups[$i]->name, 1, "xprofile_" . $groups[$i]->name, "xprofile_edit"); 97 } 98 } 99 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"); 102 87 global $wpdb, $bp_xprofile_table_name, $bp_xprofile, $groups, $userdata; 88 89 if($wpdb->blogid == $userdata->primary_blog) 90 { 91 add_menu_page(__("Profile"), __("Profile"), 1, basename(__FILE__), "xprofile_picture"); 92 add_submenu_page(basename(__FILE__), __("Picture"), __("Picture"), 1, basename(__FILE__), "xprofile_picture"); 93 add_options_page(__("Profile"), __("Profile"), 1, basename(__FILE__), "xprofile_add_settings"); 94 95 $groups = BP_XProfile_Group::get_all(); 96 97 for($i=0; $i<count($groups); $i++) { 98 if($groups[$i]->fields) { 99 add_submenu_page(basename(__FILE__), $groups[$i]->name, $groups[$i]->name, 1, "xprofile_" . $groups[$i]->name, "xprofile_edit"); 100 } 101 } 102 103 /* Add the administration tab under the "Site Admin" tab for site administrators */ 104 add_submenu_page('wpmu-admin.php', __("Profiles"), __("Profiles"), 1, "xprofile_settings", "xprofile_admin"); 105 } 106 103 107 /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */ 104 108 if($wpdb->get_var("show tables like '%" . $bp_xprofile_table_name . "%'") == false) xprofile_install(); … … 126 130 add_action("admin_print_scripts", "xprofile_add_css"); 127 131 add_action("admin_print_scripts", "xprofile_add_js"); 132 128 133 } 129 134 add_action('admin_menu','xprofile_setup'); … … 141 146 query_posts('showposts=1'); 142 147 if (have_posts()) : while (have_posts()) : the_post(); endwhile; endif; 143 global $is_author, $userdata, $authordata; 148 global $is_author, $userdata, $authordata; 144 149 } 145 150 add_action('wp_head', 'xprofile_invoke_authordata'); … … 447 452 448 453 449 454 /************************************************************************** 455 xprofile_add_settings() 456 457 Renders the profile tab under settings for each member. 458 **************************************************************************/ 459 460 function xprofile_add_settings() 461 { 450 462 ?> 463 <div class="wrap"> 464 <h2><?php _e('Profile Settings'); ?></h2> 465 <p>Member profile settings will appear here.</p> 466 </div> 467 <?php 468 } 469 470 471 ?>
Note: See TracChangeset
for help on using the changeset viewer.