Search Results for 'change buddypress menu'
-
AuthorSearch Results
-
July 5, 2009 at 3:48 pm #48572
In reply to: BuddyPress – 'Create Group' PROBLEM
boonika
ParticipantOK. Here’s what happened:
I created a group called ‘Extraordinary Video Work’. I also invited friends… we had some Wire activities… and so on.
Than I clicked My Account/Groups/Create a Group to create a new, ‘Fonts’ group. Did everything as I did for the first group. I clicked Groups from the main menu and realized that the previous group was transformed into this new group. List of members and Wire posts were the same but name of the group (‘Extraordinary Video Work’ was changed to ‘Fonts’) and description were changed. I tried several times. If You want I can create a profile for you so you ca try it yourself. Just give me your email. Mine is pinkforrest[at]gmail[dot]com.
July 4, 2009 at 4:15 pm #485263125432
InactiveBurt,
I found a bug in the 1.0 alpha 2 and I was curious if the other members have experienced the same issue, and also if you resolved the issue with the 1.0 release.
Problem:
click on Members Directory
click on a letter for a member listing, say ‘M’ and it shows 21 listings. Okay, first 10 members are displayed. If you click on page 2, it goes to a weird submenu that leads to a blank page.
Here is the weird behaviour –
a new page loads with the following url and it’s blank:
http://www.xxyy.info/OurSocial/OurSocial/wp-load.php?upage=2
Resolution:
deactivate the bpc plugin, return to Members Directory
follow same member listing search for category ‘M’
click on page 2
all is fine – works as expected.
The links for pages 2 and 3 show the same links as listed above, but when you click on them, the main page stays the same,
http://www.xxyy.info/OurSocial/members
and only the Member Listing changes
Using:
wpmu 2.7.1 and the new bp 1.0.2
Also, an other question: if we upgrade automatically to bpc 1.0, what about the existing db created tables? Will they be in conflict or will the plugin just create a new table? I ask this because I read the ‘details’ of the upgrade and it says the new plugin creates one new table in the db
Thanks so much for your hard work.
Brian
July 1, 2009 at 3:34 am #48334In reply to: How to use full name, first name + last name
Jeff Sayre
ParticipantFirst off, I do sympathize with your frustration on finding an acceptable set of solutions to your questions. Without writing the code for you, it is difficult to point you in the proper direction. There have been a number of options presented, that while being a compromise to your ultimate, desired solution, could produce satisfactory results.
Isn’t the whole point of Buddypress to turn the WordPress base into something more user-centric?
Yes and no. As I already said two posts above:
WPMU is not designed as a user-centric platform. It is blog-centric. BuddyPress puts the focus on the user.But, BuddyPress is still a layer that rests on top of WPMU, not the other way around. BP relies heavily on certain WPMU functions to handle much of the user registration process. And WPMU requires that the username field be populated (I realize that you know that).
This thread is NOT about the username issue.
I understand that. But what I quoted from your past post was about the username field and that is what I specifically answered in my last post.
This particular thread is entitled “How to use full name, first name + last name“. Burt already provided an answer to this question above via this thread where he shows you how to do exactly this in code.
I’ve understood all along in the various threads that you’ve started on this range of related topics that you want another option, some other way to insert your desired datum into the user_login field, or use newly created fields to allow registering users to enter their firstname and lastname, or that you want a way for users to enter their email for login, or a way to use BP’s xprofile table to display fname and lname in various ways and places, or a way to rearrange fields on the registration form, and that you hate WPMU’s concept of username and want a different option. I get all of this.
Others (including myself) have tried to be as helpful as possible in each of those threads, often rehashing the same answers. I don’t say this to be mean; I say this because we’ve tried to explain in multiple ways and multiple times that what you are after is not possible at this time without hacking the core (in some cases) or writing your own custom plugin(s).
https://buddypress.org/forums/topic.php?id=1746
https://buddypress.org/forums/topic.php?id=1811
https://buddypress.org/forums/topic.php?id=2118
https://buddypress.org/forums/topic.php?id=2119
https://buddypress.org/forums/topic.php?id=2926
How does Buddypress handle first name + last name?
It does and it doesn’t. There are no firstname and lastname fields in BuddyPress unless you create them as Mike Pratt explained above. BuddyPress has its own mandatory registration field that by default is called “Full Name”. Look in the BuddyPress submenu group in WPMU’s backend. Go to “BuddyPress > General Settings > Full Name field name”
Now, there is a function in bp-xprofile-filters.php called xprofile_sync_wp_profile() that will take the datum from the “Full Name” field and split it into a pseudo firstname and lastname and then insert that as meta data into the wp_usermeta table, but it can only do that if a user actually edits their fullname field to include a more than one-word name. So if a user does not edit that field, there will not be any fname/lname wp_usermeta entries for that user.
Buddypress puts a default first x-profile field Name on the registration form; is it possible to replace that with separate first name + last name fields?
You can change the “Full Name” field name to whatever you want but you cannot remove that field from the registration page nor edit it to be something other than a single textbox field–at least not without hacking the core. Look under the “Basic” field grouping in “BuddyPress > Profile Field Setup” to see what I mean.
Or is there already a native solution for first name + last name in WPMU that Buddypress could tap into? (Nicola Greco: ‘… you could replace it with the wp built-in name & last name, or use xprofile fields fot that …”)
In this post above, I explained that if you want to go this route, you’ll need to pull data from two records in wp_usermeta to extract the firstname, lastname combination. If you do not feel comfortable coding this yourself, you could hire a coder to write a simple function to do just that. But be aware, as I explained above, it is possible that not every user will have firstname and lastname meta date.
From your OP:
Default Buddypress is fine for teens/tweens who want to use their anonymous username, but it’s not suitable for a more grown-up business network, for example.
BuddyPress seems perfectly acceptable for business users. There are many professional, adult-based sites that are successfully attracting users to their BP sites. Mike Pratt’s site is a great example, for one.
I’ve been using my full name on this site from day one. It did not bother me that I had to use a single username when registering because I knew I had the option to fill out my full name for display purposes later. It also allowed me to brand BuddyPress.org with my unique name, creating a useful URI in the process.
In fact, the single username approach is what many sites use to allow users to brand themselves. Twitter, youtube, FriendFeed, Delicious, Digg, LinkedIn, and many more all require a unique, single-word username. Of course, some of these then allow you to (or even require) that you use an email for subsequent logins. This is in BP’s future as well.
In the not too distant future, there may be an option to allow users to sign on with their email address via OpenID or another protocol. See the BuddyPress Roadmap and read about the Open Stack.
But for now, your options are limited and if you want to change things you must code your own custom solution or hack the core.
There is not much more we can do, but as I said in my last post, if the username concept bothers you so much, you’ll have to go to the WPMU forums and see what solutions might be in the works–if any.
June 29, 2009 at 2:42 am #48224In reply to: Registration has been disabled and Extended Profile.
Jeff Sayre
ParticipantYou need to log into WPMU’s backend as site admin ( /wp-login.php), and then go to
Site Admin > Options > Allow new registrationsand set the options you want.
Also I am unable to create an extended profile like shown in some of the demos. It only allows me change the “base” and avatar. I can’t put birthday, location, etc.
To add additional profile fields, you need to navigate to the BuddyPress submenu grouping in WPMU’s backend. If BuddyPress is installed and activated, this submenu group is found at the very bottom of the menu column.
So, go to
BuddyPress > Profile Field Setupand set up the additional fields you want.
June 28, 2009 at 5:32 pm #48215In reply to: Redirect to root after Login
Ted Mann
ParticipantIf anyone is looking to hack the adminbar so that when users log in, they stay on the current blog they’re on, just edit the bp-core-adminbar.php file and change the reference to $bp->root_domain, under the “log in and sign up links” section, to $current_blog. Also, I took out the redirect as well. So, my login widget now looks like this:
// **** "Log In" and "Sign Up" links (Visible when not logged in) ********
function bp_adminbar_login_menu() {
global $bp;
if ( !is_user_logged_in() ) {
echo '<li class="bp-login no-arrow"><a href="' . $current_blog . '/wp-login.php">' . __( 'Log In', 'buddypress' ) . '</a></li>';
// Show "Sign Up" link if registrations are allowed
if ( get_site_option( 'registration' ) != 'none' ) {
echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
}
}
}June 12, 2009 at 10:52 pm #47331In reply to: Navigation buttons – Where are they?
Jeff Sayre
Participantcatincoach-
This thread is very outdated. A lot has changed in BuddyPress since this thread last had activity 3 months ago.
If you are simply looking for where you can change the text of the menu buttons “Home”, “Blog”, “Members”, “Groups”, “Blogs”, then it is found in the header.php file of both the home and member themes.
June 11, 2009 at 10:59 am #47219In reply to: Profile Groups fonts not the same
carpconnect
ParticipantOk i have update to new buddypress which i see changes the method used to set size.
Ok i have worked out why they are different, the ‘Me’ and ‘My Tags’ menu text are just text whereas the additional menu text that appears when selecting edit profile are links.
The menu text and links font are not the same, some people may be happy with this but personally i would prefer all text whether it heading or heading/link to be the same if it is in the same location, ie menu bar.
It looks like this something i will have try and change by creating a new style, though would have preferred this to be part of BP.
cheers
June 11, 2009 at 8:30 am #47208In reply to: changing the name of my website
lynton
ParticipantSorry i didnt make it too clear the title of my home page currently reads ” firevine social media marketing network” in the title bar i have decided to change the nature of my site so that title no longer fits, is there any way to change this or would i need to re-install buddypress ?
i have not yet found a way to change it from my admin menu
June 4, 2009 at 10:34 pm #46761In reply to: Search results page – editting and finding
devweb
ParticipantThanks Manoj,
Imagine the standard Buddypress layout. Now go to friends on the left menu. I have changed this page to just have the search feature with ‘members’ selected as the search option.You type in a member, it searches and returns the ‘member listing’ and AJAX powered member search feature.
This is exactly what I want, however, once you search, in the middle bar, default member template, where additional options are listed Eg. My friends, friend requests etc ‘Profile’ ‘Friends’ and the other ‘main’ titles appear with the following URLs:
‘http://address/member//profile
Any ideas howt o get rid of this?
Thanks again
June 2, 2009 at 2:30 am #46526In reply to: Change Member Theme
Jeff Sayre
ParticipantI have read that I should follow the “BuddyPress” option under “Site Admin” menu, in order to change the member theme.
That is outdated information. If you are using BuddyPress 1.0 and have the bpmember folder installed in /wp-content/bp-themes/, then what I described is correct.
Log in to WPMU’s backend as site admin, then go to “BuddyPress > General Settings > Select theme to use for BuddyPress generated pages”. After selecting a member theme, make sure you hit the “Save Settings” button.
June 2, 2009 at 2:14 am #46519In reply to: Change Member Theme
budhajeewa
Participant@ Jeff Sayre :
Yes, but the thing is, I have read that I should follow the “BuddyPress” option under “Site Admin” menu, in order to change the member theme.
I am still unable to change the user theme.
How can I change the member theme ?
June 1, 2009 at 7:00 pm #46469In reply to: Change Member Theme
Jeff Sayre
ParticipantThere is no option called “BuddyPress”, under “Site Admin” menu.
That is correct.
BuddyPress has its own menu grouping found at the very bottom of the menu group column. It is just below the Settings menu grouping.
jfcarter
ParticipantIf you mean the buddybar (grey) at the top of the page, you can change it by going into:
wp-content>plugins>buddypress>bp-core>bp-core-adminbar.php
and
wp-content>plugins>buddypress>bp-core>css>admin-bar.css
If you want to add menus to the login bar, you’re better off setting up a bp-custom.php, this thread will have details on what to do (read thru the whole thread):
May 11, 2009 at 12:19 am #44992In reply to: Buddypress as homepage rather than MU
John James Jacoby
KeymasterFirstly I notice that your Avatar cropper javascript is failing on registration. Also looks like bits of your site are missing, and messing with the BuddyBar (sub-sub menus aren’t appearing on hover.)
Otherwise, it’s working the way you have it setup. If what you’re asking is “why doesn’t my home theme look like testbp.org” it’s because you didn’t change your active home theme in WordPress.

Not sure what’s up with your member theme though. Might be missing some files or have some funky CSS or JS somewhere. Haven’t really looked into it for you.
May 9, 2009 at 3:03 pm #44873Paul Wong-Gibbs
KeymasterLo.
> Why is it when I add a page to my WordPress site, it doesn’t show up in my BuddyPress navigation?
Because that’s just the way the default home theme is written. The items listed on that menu aren’t ‘Pages’ in the WordPress sense, anyway, so it makes little sense for the default, out-the-box BuddyPress theme to do that.
The bit of code you’d need to change (or to add in your custom/duplicate theme) is in header.php. Where you see:
<ul id="nav">Add this underneath:
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>Documentation for that function is at https://codex.wordpress.org/wp_list_pages
May 6, 2009 at 3:26 pm #44617In reply to: first things first
Maythil
ParticipantThanks for a detailed reply, David.
No, I am not using Mac.
Yes, I want the width to be 800px (in fact, less than that, to get rid off the horizontal scroll bar at the bottom of my screen).
I was on a trial-and error spree at a testing site, and was able to found the differences you have mentioned and have reached the same conclusion.
“the difference between profile pages and other pages seems to be that profile pages have two left sidebars with a fixed width of 138px (#optionsbar and #userbar) while the other pages have a single right sidebar (#sidebar) without any width defined (i.e. 100%). Meanwhile, #main is used on all pages and has a min-width of 680px. So unless you change some CSS code… the profile pages will always be at least 956px wide.”
Yes I have tried the max/mini width in the base.css, making both 800px, and it works on the main page and the some other pages as well (that is, under the second horizontal menu). It should work (after all IE6 displays all pages in 800px).
I am not sure how atentive I was to #main. I must try it. I must say your reply has given me some hope and a better idea about things, but I will add that BP still has a bug. On buddypress.org itself you can see that: the header or admin bar is fixed at 800px; it can’t adjust its width with that of the rest of the site. It works well with Firefox if I use: #wp-admin-bar { width: 960px !important; } … but it should work automatically.
I am also testing Elgg; several adjustments are pretty easier there compared to BP, but I perfectly agree with you: “It has some features I need that BP currently lacks… but BP is clearly much superior otherwise”. in addition BP has a very pleasant, elegant look. This is why I want to stick with BP and spend hours on my WPMU site.
Regards.
May 6, 2009 at 7:42 am #44573In reply to: How to change the position of Userbar and Optionbar
Ezd
ParticipantSocialpreneur: Ok thanks.
Would I have to edit the header.php for both the home and bpmember theme? So I would add the same code to both files?
<div id="header">
<h1 id="logo"><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
<ul id="nav">
<li<?php if ( bp_is_page( 'home' ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
<li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php bp_home_blog_url() ?>" title="<?php _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' ) ?></a></li>
<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a></li>
<?php if ( function_exists( 'groups_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
<?php } ?>
<?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
<?php } ?>
<?php do_action( 'bp_nav_items' ); ?>
</ul>
</div>If I wanted to add another menu-link would I have to add something like this to both header.php files? Saying the new page was called ‘pagename’:
<?php if ( function_exists( 'bp_pagename_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_PAGENAME_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_PAGENAME_SLUG ?>" title="<?php _e( 'Pagename', 'buddypress' ) ?>"><?php _e( 'Pagename', 'buddypress' ) ?></a></li>
<?php } ?>Or is this wrong? Just wanna make sure I do it right.
May 4, 2009 at 1:18 pm #44333In reply to: How to: Add a new menu section
Ezd
ParticipantSocialpreneur >
I guess its the header.php file in the bpmember theme that has to be edited and not the header.php in the home theme? Or should the change be added to both header.php files?
They almost look the same so whats the difference between the two?
Also how would the code look, there’s a section where it says:
Bpmember theme’s header.php:
<div id="header">
<h1 id="logo"><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php bp_site_name() ?></a></h1>
<ul id="nav">
<li<?php if ( bp_is_page( 'home' ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>" title="<?php _e( 'Home', 'buddypress' ) ?>"><?php _e( 'Home', 'buddypress' ) ?></a></li>
<li<?php if ( bp_is_page( BP_HOME_BLOG_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php bp_home_blog_url() ?>" title="<?php _e( 'Blog', 'buddypress' ) ?>"><?php _e( 'Blog', 'buddypress' ) ?></a></li>
<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_MEMBERS_SLUG ?>" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a></li>
<?php if ( function_exists( 'groups_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_GROUPS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_GROUPS_SLUG ?>" title="<?php _e( 'Groups', 'buddypress' ) ?>"><?php _e( 'Groups', 'buddypress' ) ?></a></li>
<?php } ?>
<?php if ( function_exists( 'bp_blogs_install' ) ) { ?>
<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) ) {?> class="selected"<?php } ?>><a href="<?php echo get_option('home') ?>/<?php echo BP_BLOGS_SLUG ?>" title="<?php _e( 'Blogs', 'buddypress' ) ?>"><?php _e( 'Blogs', 'buddypress' ) ?></a></li>
<?php } ?>
<?php do_action( 'bp_nav_items' ); ?>
</ul>
</div>Its probably here the extra code would have to be added? I cant seem to get it to work.
April 25, 2009 at 12:41 am #43545In reply to: custom slug via bp-custom makes menu icons disappear
takuya
ParticipantOk, I solved this.
When changing slugs, css needs to be hacked a little to show the icons properly. For example, when you change groups slug to communities in bp-custom like this:
define('BP_GROUPS_SLUG', 'communities');You will need to find the following css entry from base.css locating at bp-themes/buddypress-member/css/.
li a#user-groups, li a#my-groups {background: url(../images/groups_bullet.gif) 88% 52% no-repeat;}Copy above, create a file called custom.css if you haven’t done yet. Modify the css to:
li a#user-communities, li a#my-communities {background: url(../../images/groups_bullet.gif) 88% 52% no-repeat;}And upload custom.css to bp-themes/buddypress-member/css/custom-components/
That’s it!!
April 23, 2009 at 5:27 am #43282In reply to: Limit Blog Creation to Admins
squattingturnip
ParticipantThank you, thank you, thank you.
Your code works like a charm, and you have taught me a great deal about how BuddyPress (and WPMU) works. I really, really appreciate it.
Incidentally, the changes I made are as follows, in case your or anyone else is curious:
global $current_user;
if ( isset( $roles['administrator'] ) || isset( $roles['editor'] ) || isset( $roles['contributor'] ) || is_site_admin() )was added to the “my_can_user_create_a_blog” function. Kind of an odd set of conditions, but, well…whatever. I\’m going to do a little bit of digging around later on, and see if I can condense that down a little (initially I’d planned to have it as a sort of “if user level is great than x” thing, but my cursory examination didn’t turn that up, so this is a decent stopgap for now).
I also added an if statement that draws on the “my_can_user_create_a_blog” function for the “my_blogs_setup_nav” function, so that now everything it does is wrapped thusly:
if (my_can_user_create_a_blog()==true) {
...
}and changed “is_user_logged_in” in the “my_adminbar_blogs_menu” function to call “my_can_user_create_a_blog” instead.
Again, I can’t thank you enough. I only hope some day I can help someone out the way you’ve helped me.
April 23, 2009 at 1:22 am #43265In reply to: Limit Blog Creation to Admins
Burt Adsit
ParticipantWe’ve unhooked the current fns and hooked up our replacement fns. So far they do exactly the same thing as the current fns. We need the ability to decide who gets to see the menu item. I choose to create yet another fn to decide yes or no on blog creation.
function my_can_user_create_a_blog(){
if (is_site_admin())
return true;
else
return false;
}
That goes in bp-custom.php also. Ya, all it does is check if the current user is the site admin. I’m not sure what you mean by only letting ‘Admins’ create blogs. There are blog admins and one site admin. Everyone with a blog gets to have the wp role ‘administrator’. Not sure what you want so i’ve wrapped the logic in a fn so you can change it to whatever you like.
Now we need to alter our new replacement fns to skip the display of the menu items if that returns false.
In our my_blogs_setup_nav() there is a line like this:
bp_core_add_subnav_item( $bp->blogs->slug, ‘create-a-blog’ __(‘Create a Blog’,
‘buddypress’), $blogs_link, ‘bp_blogs_screen_create_a_blog’ );
We need to wrap it like this:
if (my_can_user_create_a_blog()){
‘bp_core_add_subnav_item( $bp->blogs->slug, ‘create-a-blog’Create a Blog’,’buddypress’), $blogs_link, ‘bp_blogs_screen_create_a_blog’ );
}
Also the function my_adminbar_blogs_menu() has code that looks like this:
echo '<li' . $alt . '>';
echo '<a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">'
. __('Create a Blog!', 'buddypress') . '</a>';
echo '</li>';You need to wrap that the same way:
if (my_can_user_create_a_blog()){
..all that stuff..
}
April 18, 2009 at 4:41 pm #42919In reply to: Latest WPMU Rev & latest BP Rev not working
Jeff Sayre
ParticipantOkay, putting aside the subdomain versus subdirectory issue for a second, you state that:
…the bp link in the menu works but where is says “disbale components using below form” nothing shows
It sounds like BuddyPress is not activated. With the 1.0_RC2 changes, BuddyPress is now considered a single WPMU plugin. You must first login to the WPMU backend as site admin and then go to Plugins > Installed and make sure that BuddyPress is activated.
Once it’s activated, a new menu group is created at the bottom of the menu tree called “BuddyPress”. You click on BuddyPress > Component Setup and you should see that all the BP components are enabled by default. It is in this admin screen where you can enable and disable individual components.
If you’ve already activated BuddyPress, then something is clearly wrong. Have you double checked to make sure that you copied all the BP component files and folders (minus the theme folders) into the /wp-content/plugins/ folder? Did you install the BP suite into the /wp-content/mu-plugins/ folder instead?
If the BP install locations and files are in their proper place, then I would recommend deactivating BuddyPress then deleting the entire BP directory and try reinstalling the BP plugin suite again and see what happens.
April 14, 2009 at 4:25 am #42588Burt Adsit
ParticipantHere’s two functions that change the way the admin bar displays user blogs.
// sort array of blog objs by $blog->role according to the order of $blog_roles
// roles not included in $blog_roles array will not be displayed
function filter_blogs_by_role($blogs){
global $bp, $blog_roles;
$blog_roles[] = __( 'Admin', 'buddypress' );
$blog_roles[] = __( 'Editor', 'buddypress' );
$blog_roles[] = __( 'Author', 'buddypress' );
$blog_roles[] = __( 'Contributor', 'buddypress' );
$blog_roles[] = __( 'Subscriber', 'buddypress' );
// get roles
foreach ($blogs as $blog){
$blog->role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->userblog_id );
}
// eliminate roles not in $blog_roles
foreach ($blogs as $key => $value){
if (!in_array($value->role, $blog_roles))
unset($blogs[$key]);
}
// sort by $blog_roles sequence if there are any left
if ($blogs){
usort($blogs, 'compare_roles');
}
return $blogs;
}
// i love php.net. stolen from php.net usort manual, user mkr at binarywerks dot dk's
// contribution for priority list comparision function.
function compare_roles($a, $b){
global $blog_roles;
foreach($blog_roles as $key => $value){
if($a->role==$value){
return 0;
break;
}
if($b->role==$value){
return 1;
break;
}
}
}You can put those two fns in your bp-custom.php file. The fn filter_blogs_by_role() does the work and the fn compare_roles() is just a helper fn.
filter_blogs_by_role() takes the array of blog objects returned by the fn get_blogs_of_user() in the admin bar’s bp_adminbar_blogs_menu() fn. It first gets all the roles for the user’s blogs and then removes all of the roles that are not listed in the $blog_roles array. That way you can eliminate some roles such as ‘Subscriber’ if you want. Next it sorts the blogs by the sequence of roles defined in $blog_roles. However you list them in that array is how they will display in the admin menu.
1) So, put those two fns in bp-custom.php
2) Arrange the roles defined by $blog_roles in the fn filter_blogs_by_role() however you want the roles to appear in the menu
3) Comment out the roles you do *not* want to appear in the menu
4) Put the call to filter_blogs_by_role() on line 133 in bp-core-adminbar.php like this:
if ( !$blogs = wp_cache_get( 'bp_blogs_of_user_' . $bp->loggedin_user->id, 'bp' ) ) {
$blogs = get_blogs_of_user( $bp->loggedin_user->id );
wp_cache_set( 'bp_blogs_of_user_' . $bp->loggedin_user->id, $blogs, 'bp' );
}
$blogs = filter_blogs_by_role($blogs);Just in case the forums trash the code I also stuck it here: http://pastie.org/445729
Jeff Sayre
ParticipantThere were some changes to the header.php file. Off the top of my head, I cannot remember if both the buddypress-home and buddypress-member themes had changes. Or, if only one of them had changes.
Either way, the best thing to do is open your header.php file and compare it to the new header.php file of the respective BuddyPress theme.
If I have the Blog-Menu in my theme – the bp_home_slug doest point to the right page (the home-blog) but to an article in another blog…
It should be BP_HOME_BLOG_SLUG, not BP_HOME_SLUG.
April 8, 2009 at 1:33 pm #42084In reply to: How to change links in wp-admin
Lance Willett
ParticipantHi Tutsie,
This type of change would typically be done with a plugin. Keep in mind that this isn’t a BuddyPress customization as much as it is a WordPress MU one.
I did a quick Google search for “change wordpress admin profile link” and found a few places you could start.
In this WordPress forum topic is some code that would change the behavior of the profile link (albeit for a different reason); this method of changing the admin behavior isn’t recommended, however, since it requires hacking a core file. A plugin would be much better since it doesn’t require changing the core file (and having to stress about updating your WordPress MU code later).
Depending on how much you want to work on this, you could download these two plugins: WP Hide Dashboard and Admin Menu Management, open them up in a text editor, and look at how they change the menus in the WordPress admin area.
Plugins do two things: (1) they provide a new functionality and (2) they hijack the normal WordPress behavior and perform the functionality described in the plugin instead.
Hope that helps…
-
AuthorSearch Results