Opened 16 years ago
Closed 16 years ago
#174 closed enhancement (fixed)
Add Login Link In Buddypress Bar
Reported by: | trent | Owned by: | apeatling |
---|---|---|---|
Milestone: | Priority: | minor | |
Severity: | Version: | ||
Component: | Keywords: | login, admin bar | |
Cc: | deadpan110@… |
Description
It would be nice to add a link to login in the buddypress bar when you are viewing a site not logged in.
Attachments (2)
Change History (11)
@
16 years ago
I should have tested while logged out and not allowing registrations... last patch had a spelling error... should have been checking the site option 'registration' and not 'registrations'.
#4
@
16 years ago
- Cc deadpan110@… added
'Sign Up' link will only show when 'registration' != 'none'
'Log In' link shows when a user is not logged in (and the admin bar is set to display when not logged in)
Patch needs 'blogadmin_icon.gif' and 'invite_bullet.gif' copied from:
/trunk/buddypress-theme/buddypress-member/images
into:
/trunk/bp-core/images
so that the modified css shows the 'Log In' and 'Sign Up' icons
#5
@
16 years ago
The bp-admin-bar-login-signup-v2.patch vastly improves the customisation possibilities within the admin bar.
Each individual menu is called by the following:
add_action('bp-adminbar-logo','bp_adminbar_logo'); add_action('bp-adminbar-menus','bp_adminbar_login_menu',2); add_action('bp-adminbar-menus','bp_adminbar_account_menu',4); add_action('bp-adminbar-menus','bp_adminbar_blogs_menu',6); add_action('bp-adminbar-menus','bp_adminbar_notifications_menu',8); add_action('bp-adminbar-menus','bp_adminbar_authors_menu',12); add_action('bp-adminbar-menus','bp_adminbar_random_menu',100);
- NOTE the use of priorities :)
To add your own menu item between 'Notifications' and 'Authors', do the following within your own plugins:
function my_bp_menu_item() { echo '<li><a href="/some/link">My Menu</a></li>'; } add_action('bp-adminbar-menus','my_bp_menu_item');
To replace the BuddyPress logo within your own plugins:
function my_bp_adminbar_logo() { echo '<a href="' . get_blog_option( 1, 'siteurl' ) . '"><img id="admin-bar-logo" src="' . site_url() . '/path/to/my/admin_bar_logo.gif" alt="My Site Name" /></a>'; } remove_action('bp-adminbar-logo','bp_adminbar_logo'); add_action('bp-adminbar-logo','my_bp_adminbar_logo');
Using combinations of add_action and remove_action for your menu items within your own plugins will enable you to add / remove / reorder your admin bar menus.
- This patch was created using svn diff from the trunk (revision 557) and will probably not work on top of the 1st patch I submitted.
#8
@
16 years ago
Patch applied into trunk as of Rev 627, when I get time - I may add a detailed 'hacking the BuddyPress admin bar howto' into the wiki to make it easier for people to understand some of the finer tips and tricks that are now possible.
Thanks Andy for adding this... and should we now mark this as fixed?
I think it would be nice and easy to add a login link and although not everyone would like a sign up link, I have added one to my custom admin-bar (as well as login).
Although my sign up link is hard coded, a check to see if the current site_id is allowing sign ups could decide if the link would show.
to view my custom admin bar, visit http://test.ind-web.com/ (The site is still being worked on - so excuse the mess and half finished stuffs)
Also in that example, you can see the bar shows when not logged in for ONLY that theme as my BuddyPress option is set to NOT show the bar for non logged in users.
Custom bar was created by copying bp-core/bp-core-adminbar.php into mu-plugins and renaming the file and its functions.
I then added and renamed the bp_core_add_css function from bp-core/bp-core-cssjs.php.
Finally, I used the following to replace the original bar and insert my own:
*NOTE: Name your own admin bar php alphabetically higher than 'bp' so it runs AFTER the original actions have been added.