At one point, I used Woopra to monitor my traffic. At the time, I also used Gravatar for avatars. Woopra has this awesome ability to show the gravatars of the person visiting, based on their email. Except it wasn’t working with my theme.
Normally I’d just slap this in my footer.php theme file to make gravatars show up in my Woopra console, but I happen to be using a Theme Parent (ThemeHybrid – which I’m also using here) and I don’t want to have to hack my theme any more than I have. The glorious thing is that Justin, in his wisdom, made a function I could plug into. So I made a new function (my_woopra_footer) which lets me extract the user’s email and ID name, parse it through, and spit back the right data. It’s weird, and I don’t suggest you use it unless you’re using Hybrid’s theme.
/* Woopra */ function my_woopra_footer() { global $user_ID, $user_email, $user_identity; echo "\n"; ?>? <?!-- Woopra Code Start -->? <?script type="text/javascript">? var woopra_visitor = new Array(); <?php if (is_user_logged_in()) { echo "\n\t\twoopra_visitor['name'] = '$user_identity';"; echo "\n\t\twoopra_visitor['email'] = '$user_email';"; echo "\n\t\twoopra_visitor['avatar'] = 'http://www.gravatar.com/avatar/" . md5(strtolower($user_email)) . "&size=60&default=http%3A%2F%2Fstatic.woopra.com%2Fimages%2Favatar.png';"; } echo "\n"; ?> var _wh = ((document.location.protocol=="https:") ? "https://sec1.woopra.com" : "http://static.woopra.com"); document.write(unescape("%3Cscript src='" + _wh + "/js/woopra.js' type='text/javascript'%3E%3C/script%3E")); <?/script>? <??php } add_action( 'wp_footer', 'my_woopra_footer' );
As a sidebar, I still think Woopra is an amazing tool. It just had all sorts of weird issues on my sites and I backed off, trading it for Google Analytics. Yeah, I know.