Archive for November, 2009

a strong chinook built up over the city for the last day or so, and this standing front held its position right overhead for most of the day.

we went to see Where the WIld Things Are today, and got there a little early.

the aftermath of a game of “pin the tail on the donkey” at one of Evan’s friends’ birthday party.

On UCalgaryBlogs, I’d modified the adminbar to include a link to the current site’s dashboard if a person was logged in, making it easy to get to the members-only side of WordPress without having to go through My Blogs and finding the right blog, then mousing over the pop-out “Dashboard” link. Most people never found that, and it’s not very intuitive.
So, I hacked in a hard-coded link to Dashboard in bp-core-adminbar.php. This worked, but meant I had to remember to re-hack the file after running a BuddyPress update. I forgot to do that right after I ran the last upgrade, and got emails from users asking WTF?
I decided to figure out the best way to add in the Dashboard link without hacking the actual plugin files. Turns out, it’s drop-dead simple. Yay, WordPress.
In your /wp-content/plugins/ directory, create a file called bp-custom.php (if it’s not there already), and drop this code into it:
<?php
// custom functions for tweaking BuddyPress
function custom_adminbar_dashboard_button() {
// adds a "Dashboard" link to the BuddyPress admin bar if a user is logged in.
if (is_user_logged_in()) {
echo '<li><a href="/wp-admin/">Dashboard</a></li>';
}
}
add_action('bp_adminbar_menus', 'custom_adminbar_dashboard_button', 1);
?>
When in place, your BuddyPress adminbar will look something like this:
Yes, I know I should do something to properly detect user levels and privileges, rather than just providing the Dashboard link all willie-nillie to anyone that’s logged in, but the link itself just provides access to whatever Dashboard features the user is allowed to see, so there’s no security risk. Better to just say that a user can see the Dashboard for any site they’re logged into, and let WordPress deal with restricting access properly.
I should also deal with the possibility of WPMU being configured as a subdirectory vs. subdomain (the /wp-admin/ link will bork if you’re using subdirectories – better to use the real code to sniff out the base url of the current site…)

caught the sunset on the ride home last night, sunrise this morning. gotta love the colours, but the days are starting to feel pretty short already.

the sun hit the horizon as I was riding home. I also got a bonus in this shot – I didn’t even notice the flocks of birds flying overhead when I took it.

Had a family birthday gathering at the olive garden. nothing that food and alcohol couldn’t numb…
If you haven’t watched Lessig’s fantastic, passionate keynote yet, watch it.
(link to the video, in case it gets stripped from the RSS)
It’s worth it, if for no other reason than to get your own Certificate of Entitlement, signed by Lawrence Lessig:

Biological Sciences, Science Theatres, and Social Sciences. And the moon.
