Development

bbPress Plugin - 68-gravatars

Gravatar

While building this site I decided to use Wordpress as the CMS and bbPress as our forums. This way the user registration will remain constant throughout.

Wordpress already has a gravatar plugin but I could not find one for bbPress so I created a simple version that displays a user’s gravatar on the post page.

Installation

  1. Upload `68-gravatar.php` to the `/my-plugins/` directory
  2. Activate the plugin through the ‘Site Management’ menu in bbPress
  3. Place `<img src=”<?php sixtyeight_gravatar(); ?>” />` in your post template.

Parameters

This plugin has the following syntax:

<?php sixtyeight_gravatar({rating{, size{, default{, border}}}}) ?>

All of the parameters are optional. For example, the following will create a gravatar URL that allows all rating levels, is 80×80 pixels, uses no default image, and has no border:

<?php sixtyeight_gravatar(); ?>

If you wish to restrict your gravatars to R rated and below, you’d do this:

<?php sixtyeight_gravatar("R"); ?>

If you want the size of the image changed as well, supply the pixel dimension as the second argument (defaults to 80):

<?php sixtyeight_gravatar("R", 40); ?>

If you want to use your own “Heat Vision and Jack” image as a default graphic (shows up when either no gravatar exists for a given user, or the given user’s gravatar exceeds the specified rating), you’d do this:

<?php sixtyeight_gravatar("R", 40, "http://www.somewhere.com/heatvision.jpg"); ?>

You can also add a 1px border of any color you choose with the fourth parameter:

<?php sixtyeight_gravatar("R", 40, "http://www.somewhere.com/heatvision.jpg", "FF0000"); ?>

If you wish to leave a parameter at its default while supplying other parameters, simply pass an empty string as the argument.

Remember that this only generates the URL, so you have to place the gravatar tag inside the src attribute of an img tag like so:

<img src="<?php sixtyeight_gravatar() ?>" alt="" />

Download

Download 68-gravatar v1.0

Credits

Special thanks to Tom Werner for the wordpress code.

October 25, 2007   No Comments

Initial Features Specs

Today we are going through the process of outlining our initial features specifications for 68kb. For me I always like to sit down and write down what all I want the ending product to accomplish. Of course being a brand new product some of the ideas I have may not be the same ones you have. That is the beauty of documenting the whole process on a blog like this.

Please also keep in mind this is these features may or not be added. This is just the initial plan. If you would like to see a specific feature please post in the comments and they will be considered.

Without further adu here is our first spec list:

  • Unlimited Categories
    I believe it is important to have an unlimited category depth.
  • Clean simple admin interface.
    What good is an interface that you can’t use.
  • Multi-Lingual
    Language files so you can translate into any language.
  • Glossary
    Have the ability to link key terms to the glossary. For better understanding.
  • Search Log
    So you can see what your users are looking for.
  • Statistics
    Related to the above.
  • Definable Templates
    The admin should be able to define the site template and be able to download additional templates.
  • Easily Extendable
    If a feature is not included the script should include a way for developers to extend it and add the feature.

October 24, 2007   No Comments