Skip to content

Archive for November, 2009

comment

sunset front

2009 November 15
 
by dnorman

2009-11-15 sunset front

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.

theatrical

2009 November 15
 

2009-11-15 theatrical

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

pinned

2009 November 14
 

2009-11-14 pinned

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

yellowlight

2009 November 14
 

2009-11-14 yellowlight

Modifying the BuddyPress AdminBar

2009 November 13
 
by dnorman

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:

BuddyPress-adminbar-modified

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…)

the other side of the sun

2009 November 13
 

2009-11-13 - the other side of the sun

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.

touch down

2009 November 12
 

2009-11-12 touch down

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.

garden

2009 November 11
 

Had a family birthday gathering at the olive garden. nothing that food and alcohol couldnt numb…

Had a family birthday gathering at the olive garden. nothing that food and alcohol couldn’t numb…

Lawrence Lessig’s EDUCAUSE Keynote

2009 November 10
 
by dnorman

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:

Lessig-certificate-of-entitlement

sciences

2009 November 10
 
by dnorman

2009-11-10 - sciences

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