Hijacking WordPress Internationalisation

As part of a new feature I am developing for the next release of my Welcome Pack plugin for BuddyPress, I needed a really smart way of dynamically adding my own translations for strings at page-load time; creating a stand-alone .mo file to load the strings wasn’t a great solution, for reasons of requiring people to know how to configure file permissions on the server, having to figure out how to write a .mo file (I wish they were as easy as XML, but they aren’t), and — honestly — doing it that way feels like such a hack.

Continue reading

Posted in BuddyPress, Featured | Tagged , | 3 Comments

How to get a list of BuddyPress’ actions.

As part of research for a new version of my Achievements plugin for BuddyPress, I need a list of all the BuddyPress action names.

For non-developers, actions are the hooks that WordPress & BuddyPress launches at specific points during execution, or when specific events occur. This allows plugin developers to hook into these events and do whatever they want.
Continue reading

Posted in BuddyPress, Featured | 9 Comments

Visualisation of mouse activity over two hours

With thanks to the Calm Banana.

Continue reading

Posted in Weird & Wonderful | Tagged | Leave a comment

Wpmu.org look at the Achievements plugin

Sarah Gooding at wpmu.org has taken a look at my Achievements plugin for BuddyPress. I think it’s a great writeup and certainly has inspired me to carry on improving it. Take a look.

Posted in BuddyPress, Plugins | Tagged , | 9 Comments

BuddyPress in 2009 & nitpicks to improve in 2010

2009 has been a very important year for BuddyPress, from its 1.0 release in April, reaching a critical mass of contributing users, helpers and developers on the forums, third-party plugin and theme development, professional use and acceptance of BuddyPress and appearances at many WordCamp events throughout the world. BuddyPress 1.2 is on course to be released early next year – you can test-drive it at http://testbp.org/.

Between my knowledge of BuddyPress, my contributions on the forums and my plugins, I have perhaps five or six plugin ideas or concepts at some stage of development. Some of these may see the light of day at some point and some will not.

As it nears Christmas and a new year full of promise and opportunity, I wanted to share my ideas for future improvements.
Continue reading

Posted in BuddyPress | Tagged | 2 Comments

30 Things About My Invisible Illness

Apparently there’s a bit of a trend amongst medical bloggers as part of Invisible Illness Week to make a list of 30 things to do with their “illness”. So, with some of the answers copied from Kerri’s list (because they are true), here we go:

  1. The illness I live with is: type 1 Diabetes.
  2. I was diagnosed with it in the year: 1997.
  3. But I had symptoms since: I don’t know. I went into hospital on a Saturday with a blood glucose of ~44mmol/l.
  4. The biggest adjustment I’ve had to make is: every little day-to-day, moment-to-moment change.
  5. Most people assume: that they know everything about Diabetes.
  6. The hardest part about mornings are: when they start out of range.
  7. My favorite medical TV show is: I don’t watch TV.
  8. A gadget I couldn’t live without is: my glucose meter.
  9. The hardest part about nights are: having low blood sugars in the middle of them.
  10. Each day I take 2 pills & vitamins: Only insulin, nothing else (touch wood). Continue reading
Posted in Diabetes | Tagged | 3 Comments

Six Little Habits: The Bad Ones.

Over at sixuntilme, Kerri’s listed six of her diabetes “bad habits.” I thought I’d share mine; I can’t do six, but here’s four:

Not changing finger-stabber needle

I’m not quite leaving these until they are rusty, but not far from it! I have recently switch to using the Accu-Chek Multiclix, which has a drum of stabbers in which you rotate around after use. I’m not changing the drum daily – more like twice a week – but I’m working on it.

Autopilot basal rates

Since starting the pump about a year or so ago, it’s changed my life; it’s wonderful. However, there are times when I know I need to do a period of intensive testing so I can assess and make changes to basal rates. In fact, I need to do that right now, but it feels too much like work so I keep putting it off. Maybe later this week!

Selective memory for glucose trends

It has been known that when I visit my diabetes care team, I get very guilty and start making up all sorts of crazy excuses when they point out the very obvious which I’ve somehow missed. Probably linked to point 2 above. I ought to put some time aside every couple of weeks to adjust the basals.

Bolus-Stacking

Same as Kerri. For an explanation for those not in the know, see this post of Kerri’s from 2005.

Posted in Diabetes, Featured | Tagged | Leave a comment

SVN is now public

I made my SVN repository public which I use for my BuddyPress plugins (Welcome Pack and Achievements). It is at http://svn.dangerous-minds.com/djpaul/.

For example, to get the latest trunk (development) version of Achievements  — which requires BuddyPress trunk/1.1 — use http://svn.dangerous-minds.com/djpaul/achievements/trunk/.

Posted in BuddyPress, Plugins | Tagged , | Leave a comment

Improving custom component installation

When implementing a custom component in BuddyPress, you will often have additions for the member theme. Member themes live in their own folder, /wp-content/bp-themes/.

To render a member theme template, your component will call dpa_load_template() which takes an argument of the name of the template to load. The path is hardcoded to the /wp-content/bp-themes/ folder.

The problem with this is that after installation of a custom component, the site administrator will need to move the relevant member theme files (bundled with your component) into /wp-content/bp-themes/. This is an annoyance to site administrator, and it may end up being a frequent support request (“why is X not working?”).  This very first hurdle may even stop people trying out your component.

Something else I’ve seen is that when installing future updates, people may forget that they need to move the updated member theme files into place; this can cause incompatibility issues between versions of your software, something we’ve seen with recent versions of BuddyPress.

For my upcoming “Achievements” plugin (think a cross between forum points and Xbox Live), I decided all that I wanted the site administrator to do would be to download it from the Plugins admin panel – no moving files into the member theme.

So, I present to you my code: (06/01/10 – updated for BP 1.1.3+)

bp_core_load_template( 'yourcomponent_theme_filename' );  // loads /plugins/your_plugin/filename.php

function yourcomponent_screen_filter_template( $located_template, $template_name ) {
	if ( !empty( $located_template ) )
		return $located_template;

	if ( $bp->current_component != $bp->your_component->slug )
		return false;

	if ( false !== strpos( $template_name[0], 'yourcomponent_theme_' ) ) {
		$prefix = strlen( 'yourcomponent_theme_' );
		$template_name = substr( $template_name[0], $prefix, strlen( $template_name[0] ) - $prefix );
		$template_path = WP_PLUGIN_DIR . "/your_plugin/$template_name";

		if ( file_exists( $template_path ) )
			return $template_path;
	}

	return false;
}
add_filter( 'bp_located_template', 'yourcomponent_screen_filter_template', 10, 2 );
Posted in BuddyPress | Tagged , , , | Leave a comment

How appropriate. You fight like a cow.

Hello everyone, welcome to metabiscuits.com.  My name is Paul and this is my first blog which will cover topics around areas such as web design and development, WordPress, PHP and HTML5, as well as projects I am working on.

I’m quite nervous about getting started here, so initially I am going to be aiming to post one blog a week whilst I find my feet.  You are welcome to leave comments on future articles as I post them, or to contact me on twitter (@pgibbs) directly; thanks.

Posted in Site | 3 Comments