PHP: Hypertext Preprocessor
Posted by Pavan Chander | Filed under Web
Man, I have totally re ‘thunk’ my view on PHP.
In the past the only times I have come into contact with PHP is when I was editing a blog and delving into the code, and let me tell you from looking at the ugly mess of braces and semi-colons - I was happy I didn’t know what I was doing!
But then Ian recently helped me convert the 540 website into a PHP version. As we were on Vent at the time, I got to listen in on his thought process…and it seemed easy. And sure enough, when I looked at the code and saw all the includes it really did make a lot of sense.
And now after having worked with the files myself and done a lot of redesigning the website, I can definitely say that PHP is a must for any web developer. The main reason I am liking the PHP integration is because I can now keep one header/footer file and just have PHP call it and include it in each page, thereby making my life a lot easier when it comes time for site wide changes. The same principle can be applies to navigational aides, sidebars, basically anything that is used repetitively on the site.
In order to further my knowledge I’ve been working on a script that will recursively browse a directory and display its contents. This script will be the foundation for my picture gallery.
Tags: css, html, php, site news
Posted by Pavan Chander | Filed under Web
If you’re looking for the ultimate status updater, Twitter is the service.
You can update your status from the web, IM, or even on the go using SMS. And if you’re a Facebook user, it will update your Facebook status with the Twitter Plugin.
I had thought of adding a meta field to each post with a status key, but in the spirit of Web 2.0 having a realtime rss list of my status’ feels more appropriate.
Edit: I have no idea why, but there seems to be either a huge lag on Twitter.com’s rss feed updates..or there is an issue with their time stamps. Oh well, if you want my absolute live/realtime status, you can always check my Twitter page out.
Shutter and Lightbox
Posted by Pavan Chander | Filed under Web
The last 4 hours of my life were spent integrating Shutter into the NextGEN gallery, and comparing the different features between Shutter, Lightbox, and Thickbox
Pain in the ass I tell you, not the actual plugin or coding part. But the constant need to clear the cache, edit posts, and refresh like crazy..drove me crazy. And then to top it off each browser has its own quirks which have to get sorted out.
In the end I now have my images being served with Shutter, found it to be the fastest loader and it also had a nice feature to downsize large images on the fly to fit the users browser.
[singlepic=95,118,149,,]
Yay.
One downside is that because I’m not using the Thickbox plugin, NextGEN won’t take advantage of the JQuery navigation.
Auto changing copyright year
Posted by Pavan Chander | Filed under Asides, Web
While working with the PHP, I managed to play with a function to auto change the copyright period.
So the site will automatically adjust the copyright on Jan 1 to say
Pavan Chander © 2007 - 2008
<?php
$my_date = the_date('Y', '', '', FALSE);
if (2007 != $my_date)
{ print ("- $my_date");}
?>
Tags: php
All this damn PHP is going to kill me
Posted by Pavan Chander | Filed under Web
Its ridiculous, I end up spending hours on such simple things involving PHP and it turns out to be a simple error my part. For example I’ve spent the last 3 hours trying to figure out how to place the Archives link on the right hand side instead of following the other pages on the navigation bar. It involved looking through all the PHP to write the HTML tags properly, and then over and above that, playing with the CSS to get it position properly.
The CSS is where I spent the bulk of my time actually, so It’s not entirely PHP’s fault.
Phew this site is starting to actually come together, added the following:
- Last.FM scrobble info
- Technology page directory structure
- “tag” support instead of categories
and of course:
- Placing the Archives link on the right hand side
There’s still lots left to do though.