Archive for December, 2005

Page link in wordpress

December 15th, 2005 by Shiva | Comments | Filed in Tips & Tricks

I have been wondering for sometime now, how K2, added an entry in pages, but the content was controlled from the one of the php files in the theme directory.

It turns out that is is very simple (yet elegant … hat’s off to wordpress guys). I used this to integrate FAlbum into K2.

Okay, let’s get on with the tutorial:
*WARNING*: Take a backup of your database before you proceed with the following

Step 1 : Open the wordpress database in phpMyAdmin
Step 2 : Add an entry in the “wp_posts” table, ensuring that the “guid_id” field is empty.

INSERT INTO `wp_posts` VALUES (
123,
1,
‘2005-11-16 15:27:21′,
‘2005-11-16 10:27:21′,
‘Do not edit this page’,
‘Photos’,
0,
”,
’static’,
‘open’,
‘open’,
”,
‘photos’,
”,
”,
‘2005-12-15 02:29:33′,
‘2005-12-14 21:29:33′,
”,
0,
”,
0);

Step 3 : Now create a php template file in your theme’s directory.

This is easily acheived by adding the following at the begining of the new php file

< ?php /*
Template Name: Archives (Do Not Use Manually)
*/ ?>

Step 4 : Add code to display whatever content when the page link is clicked.
Step 5 : Go to Manage>Pages, and edit the page entry for the newly added page.
Step 6 : Change the page template to the newly created template.

Thing to note:
Ensure that the entry for the page link in the database does not have the “guid” field filled. This would cause the page to load the content of the page entry in the final output.

Actually I got a Creative Zen Micro instead

December 14th, 2005 by Shiva | Comments | Filed in Technology

I wanted to get the pod nano initially, but I chose to get the Creative Zen Micro instead for reasons listed below:

Why the Nano is a piece of junk
1. Cracked screens – heard quite a few reports of that and since I live in India and the Nano cost about 2 as much as it is in the US, I didn’t want to risk it

2. Flimsy – the entire player bends with little pressure applied, a little more I’m sure I’d end up with two pieces! (Definitely not suited for 40deg C and extremely dusty conditions that I have to go through everyday to work and back)

3. Battery replacement costs half as much as the player

4. about 25% more cost than the zen micro which has about 20% more space

The Swift is here!

December 13th, 2005 by Shiva | Comments | Filed in Random Thoughts

Yippeeee!!! Last weekend I finally got my long-awaited very won Suzuki Swift ! The delivery of the Swift is by no means swift!

Anyway, I had a ball of a time. Here are some pics! (WARNING: eye-candy)

P1030227 P1030226 P1030225 P1030223 P1030216
Some pics of Bunty and Bubbly too:
P1030188 P1030197 P1030210 P1030232 P1030234 P1030235

Some pictures taken on the wya back to Chennai (a coupla weeks back):
P1030176 P1030175 P1030174 P1030166 P1030162 P1030157

The wonder that is php

December 9th, 2005 by Shiva | Comments | Filed in Development

PHP is an incredibly easy to use scripting language and yesterday I had my first meeting with it.

Yeah, I know I support and fix some issues in wordpress, but that just requires programming knowledge, and not exactly great php exposure. But yesterday, I wrote a small tool to track some timesheet info, in php and the whole thing took about 1.5 hours to complete. Slick UI, storing and retreiving from DB et al!

Simply amazed by the depth and breadth of support for other resources like databases, network protocols etc by the default implementation of php! Truly a programmer’s paradise has to have a webserver running with php support!

technorati tags: , ,