Welcome to my blog !

A blog devoted to all things geeky, including PHP, Web Development, Photography, Design, Gadgets and Gizmos.

January 19 2009

George W Bush and his hollidays

Yes another George Bush post… I promise no more after this (for a while). I know I ranted about George Bush the other day but I also had to point out a couple of articles I saw recently.

CBS News mentioned that Bush didn’t really spend that much time at work while he was president. Out of the last 8 years, he spent 487 days relaxing at camp david and 490 days relaxing at home in Texas. That’s right, out of the last 8 years George Bush spent 977 days (or 2.67 YEARS) at camp david or at home at the ranch. That’s not counting the time he spent traveling or on holliday at other locations.

So in addition to being the “worst president in American history”, he was also the president who had the most hollidays and spent the least amount of time actually working in the white house.

In addition, Harper’s Magazine, published some facts and figure blurbs about Bush’s time in office. Some that stuck out for me…

Minimum number of Bush appointees who have regulated industries they used to represent as lobbyists: 98
Percentage of the amendments in the Bill of Rights that are violated by the USA PATRIOT Act, according to the ACLU: 50
Minimum number of laws that Bush signing statements have exempted his administration from following: 1,069
Number of U.S. cities and towns that have passed resolutions calling for the impeachment of President Bush: 92
Percentage change since 2001 in U.S. government spending on paper shredding: +466
Percentage of EPA scientists who say they have experienced political interference with their work since 2002: 60

July 18 2008

Templating Drupal 6

Drupal Logo

I’m finding Drupal 6 easier to template after a small initial learning curve. There are a couple of gotchas however. For example:

With Drupal 6 you can copy .tpl.php files from core Drupal modules into your theme directory and you can customise that .tpl.php. For example if you wish to customise the Drupal search, copy the search templates from the core search module in drupal (/modules/search/search-block-form.tplp and search-theme-form.tpl.php) to your theme directory.

Here is where gotcha 1 got me. Drupal 6 has a theme registry, which needs to be cleared before it starts using the search templates in your theme folder. So either clear the cache (/admin/settings/performance page and ‘clear cached data’) OR add -

<?php drupal_rebuild_theme_registry(); ?> to your page.tpl.php

I probably spent 20 minutes in error wondering why chages weren’t happening with my theme updates, then realised I needed to clear the theme registry.
There are actually instructions in the search-block-form.tpl.php as to how you can modify the $search_form variable. Its basically a multidimensional array with $search["search_theme_form"] $search["hidden"] $search["submit"]

To do something simple like replacing the submit button with an image submit I just did:

$search["submit"] = ‘<button><img src=”‘.$base_path.’themes/themename/images/search-btn.png” alt=”" /></button>’;

and voila, an image submit button…  To replace the generic form title (change it from ‘Search this site’ to ‘Search’) you could use this:

$search["search_theme_form"] = str_replace(” this site”, “”, $search["search_theme_form"]);

Some core module sections cannot be modified so easily just yet, for example the login block requires some PHP in the template.php file in the theme, however huge chunks of the core modules can now be easily re-shaped.

July 01 2008

New music, Jonathan Coulton

I only recently discovered Jonathan Coulton, hes the guy who wrote the theme song to Code Monkeys (a pretty decent cartoon).

He does some interesting covers (Baby got back is on his myspace page), I think I’ll listen to some more.

June 23 2008

Canon 450D Arrives!

My new Canon 450D camera finally arrived.  I’ve spent about an hour playig with it, taking some snaps around the house and the local park.  So far VERY impressed, the image quality is great. 12 Megapixels w00t.

Canon 450D

and speaking of photography, this article is pretty sweet.  How to avoid camera shake..