Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 426 through 450 (of 630 total)
  • @pcwriter

    Participant

    @jenyus

    Here comes some shameless self-promotion! Try the beta-version of my plugin: Add-All-Nav-Links-To-BP-Adminbar. You can add all your main navigation items to the bp-adminbar, hide your theme’s main nav, then customize your new adminbar just about any way you like, including repositioning the whole thing anywhere on your pages. Here’s a screenshot of the backend admin panel: http://i33.tinypic.com/2nvea8j.jpg

    You can download from my site here:
    http://nowrecovery.com/downloads/add-all-nav-links-to-bp-adminbar2.1beta.zip

    The current release is available here:
    https://buddypress.org/community/groups/add-all-nav-links-to-bp-adminbar/

    If you try it, please let me know what you think in the plugin’s forum :-)

    @pcwriter

    Participant

    @hnla @r-a-y

    Oops… forum enabled (forgot about that) ;-)

    @pcwriter

    Participant

    Version 2.0 is out!

    All user configuration options are now available through an admin panel under “Settings” > “BP-WP-Navbar”.

    Enjoy :-)

    @pcwriter

    Participant

    @hnla

    You’re absolutely right! I do tend to give answers rather than what I myself ask for: help to learn how to do it… preferably with a working example :-)
    Still working on the admin panel for my plugin, and I’m starting to get the hang of things (I think…).

    @pcwriter

    Participant

    Go to “My Account” > “Messages” > “Notices” and click “Deactivate” next to the message you want to deactivate. :-)

    @pcwriter

    Participant

    @circlereader

    Yup, that plugin will allow you to have all nav links show in the adminbar. Then, simply hide the navbar and reposition the adminbar using the css rules provided in bp-wp-navbar.css. Voilà: instant single navbar with all the Buddypress goodness!

    Enjoy :-)

    @pcwriter

    Participant

    That’s kind of what I had understood too while I was trying to figure out the concept of “theme locations”, but I had hoped I was wrong… like I have often been before.
    I’ll see if I can dig up some other folks to also take a look. Personally, I’m treading unknown waters and I’m pretty lost in all this new stuff.

    Thanks again very much for all the help you’ve given me these past several days. Without it, I doubt this plugin would have been born, and my knowledge of how to do so would have been sadly lacking. ;-)

    @pcwriter

    Participant

    Not quite… tables are created but the data is NOT saved. That’s where I’m stuck.
    Thanks again for the time you put in and… take your time, there’s no rush.
    I have to go pick up my bicycle from the shop and then I’m off to the amusement park to lose control for a while!

    @pcwriter

    Participant

    @hnla Hiya teach!

    Progress report here on the next update for BP-WP-Navbar: an Option Configuration Admin Panel :-)

    I’ve managed to get my head around creating an admin panel under Settings in the WP backend with the basic hide/show function labels/radio buttons.
    Code here: http://pastebin.com/F29UtJFh

    Tables are created in the database but I can’t figure out what I need to change in the main file (bp-wp-navbar.php) to save the option values to the database so they take effect.

    So far, so good… but I’m stuck. Would you happen to have any clues or guidance on this bit?

    @pcwriter

    Participant

    @hnla

    I’m just very grateful that someone knowledgeable is investing the time and effort to help out a motivated noob :-)

    Thanks!

    @pcwriter

    Participant

    @hnla

    I may have found some clues here:
    http://adambrown.info/p/wp_hooks/hook/wp_get_nav_menus?version=3.0&file=wp-includes/nav-menu.php

    And from here:
    http://svn.automattic.com/wordpress/tags/3.0/wp-includes/nav-menu.php
    … there are these nifty tidbits:

    function wp_get_nav_menus( $args = array() ) {
    $defaults = array( ‘hide_empty’ => false, ‘orderby’ => ‘none’ );
    $args = wp_parse_args( $args, $defaults );
    return apply_filters( ‘wp_get_nav_menus’, get_terms( ‘nav_menu’, $args), $args );
    }

    function get_registered_nav_menus() {
    global $_wp_registered_nav_menus;
    if ( isset( $_wp_registered_nav_menus ) )
    return $_wp_registered_nav_menus;
    return array();
    }

    Looks like these functions should call whatever nav menus are set in the backend in 3.0 but, as I’m still VERY wet behind the ears when it comes to understanding what functions can actually do… :-(

    @pcwriter

    Participant

    Here’s an option:
    https://buddypress.org/community/groups/custom-profile-filters-for-buddypress/

    It turns any profile field into a clickable search term that brings up directory of all profiles matching that term. Could be useful… depends on how you want to use it.

    @pcwriter

    Participant

    @hnla

    Here’s an interesting question from a user which would render the plugin more user-friendly in a WP3.0 environment:

    “How do you change the label of the $adminbarPages 1 & 2 to default to the name of the custom menus? In other words, I don’t want to hardcode the labels into the navbar. Instead, I’d like it to display the Custom Menu names.”

    Something like this maybe (I’ve omitted the “>” and “?” simply so the code would show here…)

    $adminbarPages1 = ‘ php echo wp_nav_menu( array(‘menu’ => ‘MENU-SLUG-HERE-I-THINK’ )); ‘;

    @pcwriter

    Participant

    @hnla

    Oops, my bad! Updated loader and readme. Thanks for that catch.
    remove_action does sound like a better approach. If you could provide an example of how to code such a function, the class would appreciate the exercise :-)

    @pcwriter

    Participant

    @hnla Well now, great progress!

    I remember writing at some point that it’s often the most obvious that escapes me… Turns out I hadn’t “actually” selected any files to upload to subversion… I was just going through the motions and clicking buttons (doh!). The first version of the plugin is up and I just updated it with a whole bunch of cool new stuff. Code here: http://pastebin.com/Qquwe9pH

    Thanks to your examples, I created 3 new custom configuration options: in addition to hide/show the main nav, users can now choose to hide/show the site name/logo, the Login/Signup links, and the Visit Random dropdown. I’ve also completely revamped the readme with a detailed FAQ, and added a fully commented stylesheet with the rules I use for my site to help get folks started on customizing their new admin/navbar.

    Thanks a whole bunch for your invaluable help and instruction on this project! I can now say I’ve popped my plugin cherry! :-)

    Now we just have to wait for subversion to update………

    @pcwriter

    Participant

    Brilliant!

    I noticed though that $wpListPagesLabel appears twice in the globals, but $pageLinkDropdown isn’t there. So I switched it.

    Got to get to work right now but, when I get back home, I’ll try to do the same for the BP pages “Community” dropdown label. Then run the code through its paces on my install.

    This is lots of fun… thanks for playing!

    BTW, nothing I’ve uploaded to subversion (I use TortoiseSVN) appears in trunk, and my (EDIT: our) plugin is nowhere to be found in the repo. I guess its a sign… not ready for release yet :-)

    @pcwriter

    Participant

    For those who want to play with the plugin – including its far out new features! (and a freesh new readme) – you can download from here:
    http://nowrecovery.com/downloads/bp-wp-navbar0.1.1.zip

    EDIT: Ooh… just uploaded to subversion… should appear soon in the repo… fingers crossed… ;-)

    @pcwriter

    Participant

    @hnla

    Oops, I had removed the page IDs from the plugin file, but the file I uploaded to pastebin was the one that has my page ID exclusions.

    Nice touch with the pageLinkDropdown idea! I take your hint and I’ll see if, following your example, I can figure out how to add that option to wp_nav_menus. ;-)

    I fully agree that the user should be able to control values and parameters. Next challenge then is to learn how to create (and code) an admin area to give users that control. Here’s the start of my study program: https://codex.wordpress.org/Creating_Options_Pages and https://codex.wordpress.org/Adding_Administration_Menus

    Oh goody… more fun! :-)

    @pcwriter

    Participant

    @hnla

    Wow, you really took this little project to heart, didn’t you? Thanks for investing so much time on it! :-)

    1. Didn’t realize the ul elements could cause problems but it works just fine without them (tested successfully on bp-default and child theme).

    2. By wrapping wp_list_pages in ul elements, all pages aggregate under a top-level “Pages” nav item, with actual WP pages as subnav items and child pages as sub-subnavs as example below:

    “Pages”
    – Page 1 – – Page 1 child 1 – – Page 1 grandchild 1
    – – – – – – – – – – – – – – – – – – – – – Page 1 grandchild 2
    – – – – – – – – Page 1 child 2
    – Page 2

    By removing the “Pages” li element and wrapping the call to wp_list_pages in li elements, WP pages appear as top level, with child pages as subnavs. Creating a new page adds it to the nav as a top-level item, unless excluded (either entering the page ID manually in the code, or with “Exclude Pages” plugin). I prefer it this way, but the modified code could be included as an option in the plugin for those who prefer having all pages listed under a common heading, with instructions on where to change the heading label.

    3. I get no errors with the new WP3.0 checks in place. I couldn’t figure out how to do that, but I see it was a rather simple if !function_exists call. Huh…

    4. I left the top link name “Pages” in the wp_nav_menu calls for now. I have not tested this code on WP3.0 so don’t know if the menus will behave as in 2.9.2

    I ran the code with modifications, both yours and mine, and it works brilliantly. Collaboration is a wonderful thing :-)

    Here’s my revision: http://pastebin.com/4U85PWrt

    No word yet from WP about my plugin submission… still waiting. Got to get to work now, thanks again!

    @pcwriter

    Participant

    @hnla

    Thanks. I sometimes do tend to shoot first and ask questions later :-)

    @pcwriter

    Participant

    And we’re off to a running start…

    I just submitted the plugin to the WP repository. Now we’ll have to wait……………

    But if anyone wants to give it a whirl in the meantime, you can grab it from my site here:
    Updated version now available… yippee! Continue reading this thread to learn about the changes
    http://nowrecovery.com/downloads/bp-wp-navbar0.1.1.zip

    Be sure to read the readme!

    @pcwriter

    Participant

    If I understood the instructions correctly here: https://codex.buddypress.org/how-to-guides/checking-buddypress-is-active/

    This, in loader.php, should check if BP is active: http://pastebin.com/dFt1h3pf

    EDIT: I’ve added the loader.php file to the plugin and, eureka!, it still works.

    @pcwriter

    Participant

    @hnla

    Yes, I added the first bit ( ‘register_nav_menus’ ) before the pages function in my plugin file, but the second part ( ‘if(has_nav_menu’ ) throws up errors. So I’ll include that part of the code in the readme with instructions on where to paste it if running WP3.0.

    @r-a-y Your infinite wisdom will again come in handy: should the plugin check whether BP is active and, if so, what would you say is the best way to proceed?

    @pcwriter

    Participant

    @hnla @r-a-y

    I just packaged the code as a simple plugin and tested it on my install. It works perfectly.

    One question you may help me with though: as this code calls BP pages, is it necessary to check whether BP is active?

    As far as I can tell, if BP isn’t active, it’ll simply create dropdowns of WP pages. But I’ve been wrong before ;-)

    @pcwriter

    Participant

    Bingo! I guess my brain was still foggy after my nap.

    @hnla said add the global to the function scope… I had added it before the function (doh!)

    @r-a-y I forgot to add the ->blog_id bit

    With the help of both of you, it works perfectly now! BP Community and WP page dropdowns now DO NOT appear on sub-blogs. (Those few WP pages that mysteriously appear in the adminbar in the backend can be excluded simply by adding their page IDs in the code.)

    Thanks a bunch guys!

Viewing 25 replies - 426 through 450 (of 630 total)
Skip to toolbar