The MU forums have moved to WordPress.org

Minor issue with the Admin Bar plugin (31 posts)

  1. drmike
    Member
    Posted 17 years ago #

    Greets:

    I just noticed that the MU Admin Bar plugin displays a link to the Plug-in page.

    I know at least for my install, we don't have user accessable plugins so I would remove this line:

    array(__('Plugins'), 'activate_plugins', 'plugins.php', ''),

    Or maybe replace it with something else like your Stats page or some such.

    Hope this helps,
    -drmike

  2. kahless
    Member
    Posted 17 years ago #

    Thanks. Is there a way to check if Plugins are on and only display it then. There must be I'll check the code for when the Plugin link is displayed in the Admin area and do something similar. Would that work for you?

  3. kahless
    Member
    Posted 17 years ago #

    1.1.2 is now on wpmudev.org and it adds a check to see if Plugins should be displayed.

  4. kahless
    Member
    Posted 17 years ago #

    1.1.3 is now up and fixes an error in the check for whether to display the Plugins menu. It is now working as one would expect on all my installs.

  5. drmike
    Member
    Posted 17 years ago #

    Cool, thanks. :)

    I had the idea last night to also put in a link to the Stats page. I'm going to add that in to mine.

  6. drmike
    Member
    Posted 17 years ago #

    And I found the array with the Random Greetings. Let's see if we can come up with a few more:

    'We\'ve been expecting you'
    'Hello'
    'Does your mother know you\'re wearing that shirt'

    Anyone else got any?

  7. kahless
    Member
    Posted 17 years ago #

    Mike would you try my latest update out? I changed it so that it always displays and if you are not logged in then it displays a random greeting and the Login option. I'm trying to find a good way for users to login to their sites. Not sure if I want to direct them all to domain.tld or allow them to go to blog.domain.tld and have the option to login. If the later then you could do the bar thing like I have or add Login to the sidebar of all themes. Not sure which is better. Probably adding to the sidebar. I'll stop rambling now.

    I'll add the greetings.

  8. kahless
    Member
    Posted 17 years ago #

    How about

    'Hey'
    'Hi'
    'Hiya'
    'Ciao'
    'Aloha'
    'Greetings'
    'Salutations'

  9. drmike
    Member
    Posted 17 years ago #

    Not sure exactly what you want me to be looking at but I installed v1.1.3 and it works fine.

    I have a login on the front page but I'm sure it's present on all of the blogs anyway. I need to go back and do it like how they have it at WP.com. (ie form if not logged in, list of blogs if they are and the form disappears)

  10. MazZziKa
    Member
    Posted 17 years ago #

    feature sugg. :
    if user is logout .. viewing a bar like blogger.com bar

  11. mickemus
    Member
    Posted 17 years ago #

    drmike... I understand that you have quite a few themes for daria.be... are they all enabled to work with the Admin Bar? ...is it possible to hack the plugin so one don't have to modify them all... currently I have 30 plus themes (awaiting the updated pack of about 70 themes with widget support) and I dread the thought of manually fixing this.

    Cheers!

  12. drmike
    Member
    Posted 17 years ago #

    All of them have the admin bar. I have added it in there with each theme manually.

    I have a small checklist of things that I go thru when i add in a theme:

    - Add "Hosted by" Link in footer.php
    - Add a "Get your own blog" Link in the Meta section of the sidebar.php
    - Add in the admin bar to either header.php or to each page if needed depending on how the theme was written.
    - Remove the 'Blog Archives' bit from the title.
    - Check for Widget support. Add in if necessary
    - Check to see if it works.
    - Throw up a Demo blog
    - Make sure Stats work for the Demo blog and the three initial links are there. (I'm having an issue with both on my setup)
    - Insert the demo content that I swiped, um borrowed from themes.wordpress.net
    - Post about the addition and link to the Demo blog.

    Hope this helps,
    -drmike

  13. mickemus
    Member
    Posted 17 years ago #

    Hahaha... we'll I did think that I was a tad bit overambitious with my request!!! :D

    How about a hack in the file that calls the selected theme? Could one not add the code for the admin bar there?? I'm guessing that it would create a duplicate header... how about in template-loader.php just before

    include(TEMPLATEPATH . "/index.php");

    May not be the most beautiful way but it makes sense to me (not that I make sense to everyone though)???

  14. kahless
    Member
    Posted 17 years ago #

    MazZziKa,

    I could certainly add the search, but the rest is some javascript and I've never tried to write that from scratch. I usually borrow things and tweak them.

    What I mentioned above is a modification where the bar is always there and if you are logged out then it shows the login link and a greeting. I don't know if that is pleasing on all themes. I've since hacked the code that showed up on here in one of the threads about header login form to put the login in the sidebar. If you are logged in it will give the list of blogs you admin by name with a link and a link to the admin area of each blog. So on some themes there are three ways to login: mu admin bar, nav bar of theme, sidebar login form. This is overkill and I am trying to decide which is best. Input is welcome.

  15. suleiman
    Member
    Posted 17 years ago #

    what code is it that you use to get this working? I've been trying to insert <?php if(function_exists(''wp_admin_bar'')) wp_admin_bar(); in my header.php file in my theme folder after the body tag and without any success. I get this error:

    Parse error: syntax error, unexpected T_STRING in /home/suleiman/public_html/wp-content/themes/fresh-bananas(tp)/header.php on line 32

  16. suleiman
    Member
    Posted 17 years ago #

    nevermind, i fixed this by removing the "if..." portion of the code.

  17. bmonster99
    Member
    Posted 17 years ago #

    I was getting the T_STRING error too. I used this code instead:

    <?php if ( function_exists('wp_admin_bar' ) ) wp_admin_bar(); ?>

    and it is working fine now. There were just a couple of extra single quotes.

  18. drmike
    Member
    Posted 17 years ago #

    *chuckle* Of course my users now have access to some plugins so I guess it's moot now but thanks for the fix. :)

    I did have a user point out another issue though. If one views a Page while logged in and clicks on the Edit link within the Admin bar, it leads them to the Write Post page instead of the Write Page page for editing. I haven't had a chance to look at the code myself but it is on my todo list for today or this weekend.

    IIRC, I'm using v1.1.3 and r725 of WPMU code.

  19. drmike
    Member
    Posted 17 years ago #

    /drmike bangs his head against the table.

    I can't fix this.

    *grumble*

    edit: Never mind. Fixed and included some CSS changes that I absolutely *NO* idea where they came from.

    :whistle:

    /drmike looks around.

    You can use the CSS changes if you want or just replace the old CSS back in. And you can grab the background image from here.

    I'll see about a drop down menu of blogs for the user later on.

  20. suleiman
    Member
    Posted 17 years ago #

    for some bizzarre reason when I tried to use this plugin the page doesn't load dr.mike. Any ideas what could be causing this?

  21. kahless
    Member
    Posted 17 years ago #

    suleiman,

    I am going to upload a new version to wpmudev.org that has Mike's changes. It is working on three installs for me. Mike is it OK for me to put the background image in the package? I'll acknowledge your code as well in the file.

  22. drmike
    Member
    Posted 17 years ago #

    suleiman, are you getting any sort of error? IS there any output? Any page source? Anythign in the error_log in wpmu's root?

    Background image? What background image? I don't see any background image. And I definitely didn't swipe it from anywhere. Oh no, not me.

    :whistle:

    It's fine. I'm still planning on doing some drop downs but it's going to be a bit before I get to them. I don't think I can do them with the arrays so I might have to hard code all of the links in there.

    Do note that I made the update for determining the post/page issue. That should be in that version.

  23. suleiman
    Member
    Posted 17 years ago #

    dr.mike i did ultimately get it working. My only issue now with the admin bar is getting it to appear when the users aren't logged in, or at the very least show up when they're on someone else's blog. One thing I like about being logged in as Site Admin is being able to navigate from blog to blog since the admin bar appears on each site.

  24. drmike
    Member
    Posted 17 years ago #

    Yes, I saw that in the other thread. Could you please do me a favor and send in that email to my support address? The issue that you raise is a valid one and I would like to hack something together. I know that WP.com at least provides a Link this Site quick jump in this situation.

  25. kahless
    Member
    Posted 17 years ago #

    Strange when I am logged in the bar appears on every blog I visit, and has for as long as I've been using the post rc4 builds. There was some commented code at the bottom that only loaded the CSS if the user was logged in, but the latest version has that all uncommented.

  26. drmike
    Member
    Posted 17 years ago #

    Are you signed in as the Site Admin? :)

    It doesn't show when I sign in as one of my test accounts.

  27. kahless
    Member
    Posted 17 years ago #

    I thought it worked when I was in as a regular user as well. Can't test now as the server is not responding again. Something is funky with this Xserve.

  28. drmike
    Member
    Posted 17 years ago #

    The mac backup servers? I have two of them. Never thought I would pretty much fill 14 TBs on each one. :)

  29. suleiman
    Member
    Posted 17 years ago #

    dr mike if you provide me with your support address i would be more than happy to e-mail you.

  30. drmike
    Member
    Posted 17 years ago #

    support ( at ) daria ( dot ) be

About this Topic