How to customize a WordPress plugin and upgrade

Sometimes you want to make minor changes to WordPress plugins that no body except your self would want. Then comes the issue of upgrading to new versions of the plugin. git-svn is the perfect tool for this. It has all the cool features of the distributed SCM git and ability to pull from subversion (and push to it as well). Here is how I do it:

  1. Clone the trunk [code language=’shell’ options=’toolbar: false; gutter: false;’]git svn clone http://svn.wp-plugins.org/web-invoice/trunk/[/code]
  2. Make your changes
  3. Commit changes locally [code language=’shell’ options=’toolbar: false; gutter: false;’]git commit -a[/code]
  4. Pull new changes (e.g. new release). Git is very good at merging, you will not have conflicts unless you edit exact same lines in the local version. Still a manual merge shouldn’t be too complicated [code language=’shell’ options=’toolbar: false; gutter: false;’]git svn rebase[/code]

In the example I have taken the svn trunk of Web Invoice WordPress plugin. Hope you find this information useful next time you hack a WordPress plugin.

Hacking drupal: Add search by node creation date and the author

Some of the users using one of my Drupal sites were asking for search by author and creation date. The site had 3000+ nodes and the user’s request seemed reasonable enough. I first started with googling for a Drupal module or a patch that would add the functionality, but none were found.

So when ahead and hacked the node module. I sucessfully managed to add search by author and node creation date to advanced search block. If you are in searching for a patch like I did you can find it at http://drupal.org/node/233476, I’m keeping my fingers crossed to see whether it would make it to the Drupal trunk :).

Adding social bookmarking links to blogger

I recently wanted to add social bookmarking links to all of my blog posts. As you might notice my blog is hosted on blogger, only way I could do that is by editing the template. I thought I would share how to get about editing the template such that you add social bookmarking links which will automatically add the post permalink and the title if possible.

To edit the template, Sign into your blogger.com account and goto Template -> Edit HTML and then select Expand Widget Templates. Search for <data:post.body/>, just after <data:post.body/><div style="clear: both;"> <!-- clear for photos floats --> insert the following code.

[code language='xhtml']

[/sourcecode]
Add the following code before ]]>.
[sourcecode language='css']/** Service links style **/
.service-links {
padding-top: 3px;
}
.service-links ul.links {
margin:0pt; padding:0pt;
}
.service-links ul.links li {
display:inline;
list-style-type:none;
padding: 0pt 0px;
background: none;
}
.service-links ul.links li img {
border: none;
padding: 3px;
}
.service-links ul.links li a {
border: none;
text-decoration: none;
}[/code]

Then save the template. Adding social bookmarking links and submitting your posts to social bookmarking networks would improve the visibility of your blog and help drive traffic to your blog.

Colossus is back to crack Nazi codes

WW2 cipher breaking machine Colossus will be exhibited at new National Museum of Computing, Bletchley Park. If you are in UK, you better not miss this chance to see early days of hacking.

After 6,000 volunteered man days of diligent work Colossus now sits in the original location of Colossus No. 9 in Block H at Bletchley Park. The public can see demonstrations of how Colossus cracked a real intercepted Lorenz message.

The museum will complement Bletchley Park Trust’s story of code breaking up to the Colossus and allow visitors to follow the development of computing from the ultra-secret pioneering efforts of that time, through the mainframes of the 1960s and 1970s, and the rise of personal computing in the 1980s.

Other planned exhibits in the National Museum of Computing include:

  • working Air Traffic Control station previously installed at West Drayton;
  • the bringing back to life of an ICL 2900 – one of the workhorse mainframe.

Source: http://www.ccht.co.uk/