Check out our latest articles and blog posts

WPEC Bulk Tools Plugin Update

The WPEC Bulk Tools plugin has just been updated to version 0.0.3. The update (inc the 0.0.2 update) provide support for newer versions of Wordpress and the WP eCommerce plugin as well as a new bulk file upload feature to set prices from a CSV file.

The WPEC Bulk Tools plugin can be downloaded free from the official Wordpress plugin directory.

The latest update has come about following a brief email chat with one of the existing users. Thanks to r3altordotcom on twitter.

Tags: , ,
Posted in Uncategorized | No Comments »

Wordpress Dropdown of Child Pages

A friend of our across at About a Ball wanted to know if there was a way of adding code to a Wordpress page template to list child pages in a dropdown list which when selected would take the user to the selected child page. Well… here it is;

<form action="<?php bloginfo('url'); ?>/" method='get'>
<?php 
$parent_id = $post->ID;
$children = wp_dropdown_pages("child_of=$parent_id&echo=0");
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $children);
echo $select;
?>
</form>

Tags:
Posted in Uncategorized | No Comments »

New Plugin - WPEC Bulk Tools

Gingerbread Design are proud to announce their first official community offering - The WPEC Bulk Tools plugin. This Wordpress pluign is designed to deliver bulk tools to e-Commerce sites powered by the WP e-Commerce plugin.

The WPEC Bulk Tools plugin can be downloaded free from the official Wordpress plugin directory and has been tested against the 2.7 and 2.7.1 releases.

The idea from the plugin first came during the build of a client site where the client was very adamant that bulk manipulation of products was something that they would greatly have appreciated from their previous e-Commerce solution… and therefore we were very pleased to assist in the implementation of such a function.

Tags:
Posted in Uncategorized | No Comments »

PHP and MySQL Tag Cloud

This tutorial shows you how to write a simple Tag Cloud using PHP and MySQL and presenting using standard XHTML and CSS.

The basis of using this is that you have a database for your journal entries… most blogging engines follow this approach.

To start with we need to create a couple of new database tables. One will simply hold the list of available tags and the other will hold records which will match journal entries to the tags that are listed against them. For this tutorial I have a table named “tags” which has 2 columns, 1 named id which is an auto_increment column and the other is a string field which holds the tag text. The other table is named “article_tags” which also has two columns. The first field holds the id from the &ldquo;tags&rdquo; table and the second field holds the id value of the journal entry.

To output the tag cloud we essentially count up the number of entries in the article_tag table for each tag. We also have 5 “levels” of tag which are are used to assign a class to the outputted XHTML which will be used to assign a different display property to for each level of popularity of the tags. I have actually been a bit poor in my implementation of the class names for each level of popularity and have given then names such as “largest”. I really should have used names like “tag_level_5″ which would remove the presentation information from the XHTML whilst keeping it semantically correct.

The PHP used has been put into a function which outputs all the tags in an unordered list. This means that if the site is viewed with CSS disabled or via another presentation method for example a screen reader that the page still makes sense. This approach is also useful in terms of how the site is seen by search engines.

// ################################
// TAG CLOUD
// ################################
function tag_cloud(){
  echo "<div id='tag_cloud_div'>
    <h2>tag cloud</h2>
    <ul>\n";
  $tag_query = "SELECT count(article_tags.tag_id),
  tags.tag from article_tags
  left join tags on article_tags.tag_id = tags.id
  group by article_tags.tag_id order by tags.tag";
  $tag_result = mysql_query($tag_query);
  $lowest = 25;
  $highest = 0;
  while ($tag_data = mysql_fetch_row($tag_result)) {
    $tags[$tag_data[1]] = $tag_data[0];
    if ($tag_data[0] < $lowest) {
      $lowest = $tag_data[0];
      }
    if ($tag_data[0] > $highest) {
      $highest = $tag_data[0];
      }
    }
  $step = (($highest - $lowest) / 5);
  $smallest_tag = $lowest;
  $small_tag = $smallest_tag + $step;
  $medium_tag = $small_tag + $step;
  $large_tag = $medium_tag + $step;
  $largest_tag = $medium_tag + $step;
  foreach ($tags as $key => $value){
    if ($value >= $largest_tag) $tag_class = 'largest_tag';
    else if ($value >= $large_tag) $tag_class = 'large_tag';
    else if ($value >= $medium_tag) $tag_class = 'medium_tag';
    else if ($value >= $small_tag) $tag_class = 'small_tag';
    else $tag_class = 'smallest_tag';
    echo "<li class='$tag_class'><a href='/articles/tag/$key'>$key</a></li>\n";
    }
  echo "  </ul>
    </div>\n";
  ?>
  </div>
  <?
}

CSS is then used to style the output so it’s displayed as stream of text where the font size for each tag is dependant on the class which was assigned above (which relates to how popular the tag is).

#tag_cloud_div {
  float:right;
  width:275px;
  padding: 10px;
  border: 1px solid #3F3C20;
  background-color: #DAD306;
  }

#tag_cloud_div li{
  display: inline;
}

#link_list_div {
  float:right;
  width:275px;
  padding: 10px;
  border: 1px solid #3F3C20;
  background-color: #12C6CC;
  margin-bottom: 10px;
  }

#tag_cloud_div h2, #link_list_div h2 {
  margin-bottom:0.3em;
  color: #3F3C20;
  }

#link_list_div li {
  margin-bottom:0.2em;
  }

.smallest_tag{
  font-size: 0.8em;
  line-height: 0em;
  }

.small_tag{
  font-size: 1.0em;
  line-height: 0.4em;
  }

.medium_tag{
  font-size: 1.3em;
  line-height: 0.9em;
  }

.large_tag{
  font-size: 1.8em;
  line-height: 1em;
  }

.largest_tag{
  font-size: 2.2em;
  line-height: 1.3em;
  }

This is by no means the best method of creating a tag cloud but it demonstrates how simple it can be. To enhance this (as I said earlier) I’d prefer to rename the classes used and would also probably look to make the popularity of the tag dependant on other aspects such as time of publication of the journal entries.

Tags: , ,
Posted in Uncategorized | No Comments »

Welcome to Gingerbread

Having learnt how to develop and design websites over the last 3 years, including the many techniques, standards and guidelines I have, along with my partner Badja, finally decided to incorporate our own company. Welcome to the birth of Gingerbread Design.

Gingerbread Design Logo

Gingerbread Design Logo

So what’s next?

Well from here we plan to take on design and development work specialising in, but not limited to, the web arena. With a variety of in-depth skill sets at our disposal (brace yourself for some web jargon) such as (X)HTML, CSS, PHP, SEO and database design and development we plan to bring sites based on simplicity and style to the internet. These sites along with our knowledge of search engines and passion for marketing will bring you, your organisation or company to the forefront of today’s booming market place.

Is that all?

Don’t bet your life on it! In true web fashion we&rsquo;ll be running our blogs; this one for web and design related news, opinions and tutorials and a personal one each for all the rest of our passions and interests&hellip; mini’s, food, etc as well as undertaking some interesting personal projects such as Todget and Chaffr. All I can say is watch this space to see what you could be getting a piece of.

Tags:
Posted in Uncategorized | No Comments »