Buddypress Avatar Upload Failed – FIX

So I found an error on a clients server. They were getting the “Upload Failed! Cannot Create Folder” “Is Parent Directory Writeable”. And yes the folder was writeable. It was the /blogs.dir/1/files folder. of course I checked it and saw it had the appropriate 775 permissions. So I searched the forums and then contacted their servers customer support. Turns out the folder AND ALL SUBFOLDERS RECURSIVELY were not ‘owned’ by anyone. (WTF?) This ment that even though 775 permission allowed the owner to write, the server was not the owner….. ...

September 11, 2010 · 1 min · Erik

Hide The WordPress Dashboard and wp-admin COMPLETELY!

WordPress 3 Compatible I have seen several plugins that “hide” the dashboard from subscribers, but none that functions as I want. I don’t want it to allow only the tools, and profile page. I want it to straight kick the user out of the dashboard! So, I wrote my own plugin that does that. If anyone that is not an admin (cannot activate plugins) attempts to access the dashboard via url or link, they are redirected to the front of the site. sorry, access denied.. ...

September 9, 2010 · 1 min · Erik

Add All Pages To Buddypress Admin Bar Dynamically

Want to add all your pages into your buddypress admin bar automatically? It’s easy as pie! Just add wp_list_pages to your buddypress bar with the following code! Create a file called erocks-admin-bar-mod.php in your /plugins/ dir, put in the following code, then activate the BP Nav Bar Mods Plugin on the plugin control panel <?php /* Plugin Name: BP Nav Bar Mods - Add All Pages Plugin URI: http://erikshosting.com Description: Add All Your Pages To The Buddypress Admin Bar Automatically! Author: Erock Version: 1.0 Author URI: http://erikshosting.com */ //Links and Menus Added To The Following Function Are Always Visible On The BP Bar function bp_adminbar_currentsite_menu() { global $bp; ?> <!-- Call All Pages Via A WordPress Shortcode! --> <?php wp_list_pages('title_li='); ?> <?php } // Call The Function Above add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999); ?> Or How About As A Drop Down Menu? <?php /* Plugin Name: BP Nav Bar Mods - Add All Pages Plugin URI: http://erikshosting.com Description: Add All Your Pages To The Buddypress Admin Bar Automatically! Author: Erock Version: 1.0 Author URI: http://erikshosting.com */ //Links and Menus Added To The Following Function Are Always Visible On The BP Bar function bp_adminbar_currentsite_menu() { global $bp; ?> <!-- Call All Pages Via A WordPress Shortcode As A Drop Down! --> <li> <a href="#">Pages</a> <ul> <?php wp_list_pages('title_li='); ?> </ul> </li> <?php } // Call The Function Above add_action('bp_adminbar_menus', 'bp_adminbar_currentsite_menu', 999); ?>

September 6, 2010 · 2 min · Erik

Blogs & Members Directory, Strange Nav Spacing FIX

So I installed the wpmu dev teams blogs directory and their members directory plugins on the wpmu triden theme. I noticed that when I clicked on the link and went to one of the directory pages, the page spacing in the navbar got way big. I figured their was some spacing issue coming from the plugin, but it turns out its a little different than that. Looks like the ‘current_page_item’ was generating an empty href link before the actual link. So their were two links per tag for the members directory page nav link when on that page. same with the blogs directory. Also, when you remove this filter, you stop the plugin from renaming the page, so you can edit the title of the page in the wp editor, and have the on page title actually reflect that, rather than letting the plugin rename the page ‘blogs’ or ‘members’. ...

September 6, 2010 · 1 min · Erik

Remove Buddypress Bar Arrow Images From Menu Links

Now, How About We Remove The Arrow Images From Our Non- Drop Down Menu Items All you have to do is override the tags background css attribute. It’s easy, watch.. <li style=”background:none;”> <!-- Insert your link url or relative url, and your link text below --> <a href=”http://EXAMPLE.COM”>EXAMPLE LINK TEXT</a> </li> & Bam, those drop down arrows are gone from the link.

September 5, 2010 · 1 min · Erik

*FIX* Iframes In Chrome And Safari Ignore Scrolling=no / Scrolling:no;

So I noticed that when embedding an Iframe, Google Chrome (and Safari) failed to respond to scrolling=no. I went to look and see if this syntax was deprecated, but its not. Basically webkit (safari and chrome are based on them) values css styles on the html, body, and others, higher than the actual iframe style itself. what that means is that if their is an ‘overflow’ attribute as anything other than ‘hidden’ in your applicable css, and you place scrolling=no onto an iframe style or place it in the html itself, chrome and safari will show scroll bars. firefox and IE will not. WTF? ...

August 31, 2010 · 1 min · Erik

Building a WordPress Walker – Creating Custom Dynamic Menu Outputs

Code snippet for custom walker near bottom. Narrative near top I was recently working on a clients project where I needed to draw the primary nav of site#1 onto site #2-5, while retaining its ability to be edited via site#1’s wp menu editor panel. So what I did was put a php include onto each site that called a seperate php file that had my iframe code in it. This Iframe framed the primary nav menu of the first site, while the 2nd site called the frame file as an include, and the menu was available to the 2nd site as well… ...

August 24, 2010 · 3 min · Erik

Remove White Box On Frame Loading

I know that if any of you have used iframes you’ll have noticed the white box that floats there so in-your-face, just taunting you with its uglyness as the rest of the page loads. Why not take a screenshot of the page when it has fully loaded, crop the img down to just the contents of the fully loaded frame, and then use it as the background for a div container around the frame. an example would be: ...

August 24, 2010 · 1 min · Erik

How I Can I find My Server Path?

Sometimes it is difficult to locate your server path. Drop this string into a .php file called ‘locate-path’ or something, and then navigate to it in a browser to see your full server path! <p><?php echo $_SERVER['PATH_TRANSLATED'];?></p>

August 23, 2010 · 1 min · Erik

Chrome / Safari Specific Stylesheet CSS Hack and Classes

So, I was working with the login-with-ajax wordpress plugin, When I noticed that it displays differently in chrome. I was blown away that firefox and internet explorer would both show the appropriate css styling and that chrome should some entirely different placing of the div via css. So what I needed was a way to have two different style classes for each browser set.. So I did some research and found that we can use the webkit difference of chrome and safari to firefox and IE. So, if you want a chrome/safari specific css style override just frame it in the below code, and drop it in below the old line# in your stylesheet. ...

August 20, 2010 · 1 min · Erik