The MU forums have moved to WordPress.org

Top bar (52 posts)

  1. kahless
    Member
    Posted 17 years ago #

    In the else try putting

    # Login and logout link.
    echo '<div id="wp-admin-bar-not-logged"><ul>';
    echo "\n\t<li class=\"signup\"><a href=\"http://domain.tld\">Main Blog</a></li>";
    echo "\n\t<li class=\"signup\"><a href=\"http://domain.tld/wp-signup.php\">Get a Blog</a></li>";
    echo "\n\t<li class=\"next\"><a href=\"http://domain.tld/next.php\">Next Blog</a></li>"; /* uncomment if you are using dr mike's random blog plugin */
    /* echo "\n\t<li>"; wp_loginout(); echo "</li>"; */
    echo "\n</ul></div>";

    Delete the text-align: center; from the the #wp-admin-bar-not-logged element and add

    #wp-admin-bar-not-logged .signup { float: left;}
    #wp-admin-bar-not-logged .next { float: right;}

    somewhere in the CSS.

  2. suleiman
    Member
    Posted 17 years ago #

    perfect. I have been waiting for this hack for ages, and now that it's on there, it's gorgeos and great at the same time.

    Thanks kahless!

  3. suleiman
    Member
    Posted 17 years ago #

    I was wondering, some of us have bbpress installed on our wpmu pages. Is it possible to get the plugin to be in the header of the bbpress site too?

    I understand this is a plugin for WordPress, but does that mean it's more work than worth it?

    I suppose an alternative could be to get the bbpress forum site to wrap inside the wordpress mainpage. I'm still figuring that one out of course...

  4. kahless
    Member
    Posted 17 years ago #

    No idea. I don't have bbPress. So I can't test this at all.

  5. suleiman
    Member
    Posted 17 years ago #

    Okay well I'll try and tackle that nutter on my own later.

    I'm having a new problem with the CSS in the admin bar however.

    When you are viewing the admin bar without being logged in then the links appear correctly on the left and right of the screen.

    But once logged in, despite the fact that identical code is used to "float" the links to the right, the "Next Blog" link appears a row below the dashboard links of the admin bar.

    Any ideas? Literally the only difference between the logged in and not logged in styling is that I'm not using the "float: left" for the dashboard links, where I am for my links on the not logged in state.

  6. kahless
    Member
    Posted 17 years ago #

    Well, I'd try making the CSS the same first. I'm happy to have everything left aligned on mine, but I'll try some stuff.

  7. suleiman
    Member
    Posted 17 years ago #

    yepp if I leave everything left aligned it works fine, just can't get the next blog text to show up on the right hand side.

    Ah well, I suppose this is really just a moot issue. The features in this plugin are jam-packed and I for one genuinely thank you for its release.

    Great work kahless!

  8. kahless
    Member
    Posted 17 years ago #

    Try this


    echo "\n</ul></div>";
    # Login and logout link.
    echo '<div id="wp-admin-bar-right"><ul>';
    echo "\n\t<li><a href=\"$url/next.php\">Next Blog</a></li>"; /* uncomment if you are using dr mike's random blog plugin */
    echo "\n\t<li>"; wp_loginout(); echo "</li>";
    echo "\n</ul></div>";
    } else {
    # Login and logout link.
    echo '<div id="wp-admin-bar"><ul>';
    echo "\n\t<li><a href=\"http://domain.tld\">Main Blog</a></li>";
    echo "\n\t<li><a href=\"http://domain.tld/wp-signup.php\">Get a Blog</a></li>";
    echo "\n</ul></div>";
    echo '<div id="wp-admin-bar-right"><ul>';
    echo "\n\t<li><a href=\"http://domain.tld/next.php\">Next Blog</a></li>"; /* uncomment if you are using dr mike's random blog plugin */
    /* echo "\n\t<li>"; wp_loginout(); echo "</li>"; */
    echo "\n</ul></div>";
    }
    }

    function wp_admin_bar_style () {
    global $user_level;

    //if ( isset($user_level) ) { // only add style if user logged in.
    ob_start();

    ?>
    <style type="text/css">
    /* <![CDATA[ */

    #wp-admin-bar {
    position: relative;
    z-index: 66;
    height: 28px; /* changed by dr mike */
    margin: 0;
    padding: 2px;
    background: #f9f9f9;
    border: 1px solid #666;
    border-right: none;
    border-bottom:1px solid #3285ae; /* added by dr mike */
    font:12px "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana; /* added by dr mike */
    color: #fff; /* changed by dr mike */
    clear: both;
    text-align: left;
    float: left;
    background:url('/wp-includes/images/adminbar.png') #14568a no-repeat 40% 0; /* added by dr mike */
    }

    #wp-admin-bar-right {
    position: relative;
    z-index: 66;
    height: 28px; /* changed by dr mike */
    margin: 0;
    padding: 2px;
    background: #f9f9f9;
    border: 1px solid #666;
    border-left: none;
    border-bottom:1px solid #3285ae; /* added by dr mike */
    font:12px "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana; /* added by dr mike */
    color: #fff; /* changed by dr mike */
    clear: both;
    float: right;
    background:url('/wp-includes/images/adminbar.png') #14568a no-repeat 100% 0; /* added by dr mike */
    }

    body {
    padding-top: 0px; /* this may cause problems */
    }

    #wp-admin-bar { /* part of hack to make the bar show at the top of all templates */
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    }

    #wp-admin-bar-right { /* part of hack to make the bar show at the top of all templates */
    position: fixed;
    top: 0;
    right: 0;
    width: 20%;
    }

    #wp-admin-bar ul, #wp-admin-bar-right ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    }

    #wp-admin-bar ul li, #wp-admin-bar-right ul li {
    list-style-type: none;
    display: inline;
    margin: 0 10px;
    padding: 0;
    font:12px "Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana; /* added by dr mike */
    color: #fff; /* changed by dr mike */
    }

    #wp-admin-bar ul li.login, #wp-admin-bar-right ul li.login { margin-right: 30px; }
    #wp-admin-bar strong, #wp-admin-bar-right strong { font-weight: bold; }
    #wp-admin-bar a, #wp-admin-bar-right a { color: #fff; }
    #wp-admin-bar a:hover, #wp-admin-bar-right a:hover { color: #488cff; }

    /* ]]> */
    </style>
    <?php

    $css = ob_get_contents();
    ob_end_clean();
    print($css);
    //}
    }

    Note this should replace everything after the } before the login/out area displayed for logged in users and before the first add_action. It is behaving as you want on my install. I think I got the centering right with this method.

  9. kahless
    Member
    Posted 17 years ago #

    If you give it the OK. I'll update the version on wpmudev.org.

  10. kahless
    Member
    Posted 17 years ago #

    There are a couple of things I need to clean up but once those are done it works like a champ. It recognizes the user's role and only shows the links they are to have. It puts the bar on every blog and for visitors they see Main Blog, Get a Blog on the left and Random Blog on the right. Logged in users get all the admin functions that they are entiled to on the left and Random Blog and Logout on the right of their blog, and the visitor links on any blog they are not a user on. I think this solves most of the basic functionality people wanted in top bar. The only bad thing is that you have to edit every theme to allow 28px at the top for the bar. For most themes this would be a padding-top: 28px; to the body element but there are some where the padding needs to be added to a different element. I just ran through my 70 themes and it took a couple hours.

  11. mrjcleaver
    Member
    Posted 17 years ago #

    Great work Kahless. Do you use the http://wpmudevorg.wordpress.com/project/Theme-Pack ? If you've done the padding work already can you just update the Theme-Pack? The community can help if we work together from a common baseline.

    Am I right in thinking that WPMUDEV does not allow one user to update another users' package? If not maybe you could make another package?

  12. kahless
    Member
    Posted 17 years ago #

    MU Admin Bar is on wpmudev, I need to update what is there with the latest code.

    I did start with the theme pack. Unfortunately, I added a lot of site specific elements. Mainly in the footer. What I am in the process of doing is taking this code out and using a footer plugin to add code into the footer. Once I get this done I'd be happy to add it as a new project or to send it to the owner of the current project. I think drmike and andrea_r have also done a lot of theme work. I don't know if any of us has used the footer plugin approach. I like it because a site admin edits one file and changes all footers.

  13. andrea_r
    Moderator
    Posted 17 years ago #

    Personally, I think you should do it as a new project as not everyone is going to use the admin bar. Also, I think andrewbillets is the person in "charge" of the theme pack (and probably crazy-busy at the moment. :) ) even tho drmike and I did do a ton on work on some themes.

  14. mrjcleaver
    Member
    Posted 17 years ago #

    Yes, to clarify, I was asking whether it is possible for kahless to update the Theme-Pack

  15. drmike
    Member
    Posted 17 years ago #

    I don't think he can. I think the theme pack is "owned" by Andrew. I don't think he can upload a newer zip to that project else I would have just updated teh admin bar project myself.

    I know I would hate to see two seperate projects up there covering the same items.

  16. suleiman
    Member
    Posted 17 years ago #

    i'm just wondering, how difficult would it be to insert a a sitewide or blog-specific search into the admin bar?

  17. drmike
    Member
    Posted 17 years ago #

    Not really sized for one but I'm sure it can be done.

  18. suleiman
    Member
    Posted 17 years ago #

    well on my own site there was plenty space i the center, besides it's just a text field right?

    but my concerns have more to do with whether the function for "search all blogs" is even in WPMU yet, because i thought it wasn't yet.

  19. suleiman
    Member
    Posted 17 years ago #

    just to let anyone reading this thread know, the new version of the admin bar is out and it fixed all my problems (i.e., ie was tamed).

  20. helmi
    Member
    Posted 17 years ago #

    so the new version is the one that we can all download from WPMUDEV? or is it just your private version? Would you then want to share it or keep it private?

  21. kahless
    Member
    Posted 17 years ago #

    ????

    I am maintaining it and what is there is the most recent version. Everyone probably has their own private version to better match their site, but the base code is probably what was on wpmudev.org. I can certainly say that what is on my site looks very different than what I upload to wpmudev.org.

  22. helmi
    Member
    Posted 17 years ago #

    @kahless: sorry i think that was kinda misunderstood. I just asked because suleiman was announcing the new version and i thought he may not have access to update the project at WPMUDEV.

    so sorry if you got me wrong. Thanks for your work!

About this Topic