nazly.me

Weblog of Nazly Ahmed

Nazly Ahmed

Nazly Ahmed

Web Developer. PHP Addict. Wordpress Hacker. FOSS Enthusiast. (Micro)Blogger. Photo Hobbyist. Cricket Fanatic. Husband. Dad.

Twenty Twelve

My blog is like 8 years old and in the recent past I have been updating WordPress more often than writing blog posts. Twitter is where most of the updates go. There are few posts left under Drafts which I have failed to complete.

Today, my blog gets a new theme, the all new Twenty Twelve released by WordPress which is a fully Responsive theme which should work across all types of screens including Smart Phones & Tabs.

There are so many hits I’m getting to the older posts I have written related to technology. There are posts which I still refer when I encounter an issue. Unless I get my act together and start documenting what I face now, I won’t have anything to refer in the future.

As always hoping to keep it alive!

Posted 1 year ago

WordPress for Android

Nothing much to say, but inspired by Himal‘s blogging from phone business, I just installed the official WordPress application for Android which is really cool.

Hopefully this will improve the rate of my blogging. Really hopeful..

Posted from WordPress for Android

Posted 3 years ago

Optimizing the MySQL tables of a WordPress Website

If you are running a WordPress Website or a Blog where the content is updated and/or deleted frequently, you will need to optimize the MySQL tables more often than not so that you don’t run into database issues and down times. This also helps to maintain the average response time of MySQL queries.

Read More >>

Posted 3 years ago

I keep coming back and this time for real..

At the beginning of this year I made a promise that my blog posts will flow and I will update regularly. But unfortunately for several reasons I haven’t posted anything in my blog since January. Juggling my life between work and family is one of the main reasons. My wife gave birth to a baby boy in January. Since then I have been fascinated by watching him grow. Each day has been a new experience and facing new challenges was exciting. I would have loved to keep posting stuff on my blog but my addiction to Twitter was the easy way out since I could do a blog post in 140 characters and in quick time. Yet there were stuff I want to share on my blog but since my blogging engine is something I wrote from scratch in PHP in 2005 it lacked all the new features a blog should have. So actually I was kinda stuck with the basic requirements to keep my blogging hopes alive.

Couple of months back I made the decision to switch to WordPress. Since then I have been stealing time and migrating my blog to WordPress. It was not easy but since WordPress has a tons of features to import it was just like a walk in the park. But that was just for posts. Importing comments was bit tough but I was able to write few custom PHP scripts and MySQL queries to make the transition smooth. Then I had to categorize and tag posts which I did manually. URLs have changed. But I made sure that I do 301 redirects to all the previous URLs to make sure that I don’t lose my search engine rankings and traffic that has been flowing in. All in all it was fun. I took my own time, and finally its up.

Now I make another promise. My blog posts will continue. Its your support that has kept this blog alive.

Posted 4 years ago

lkgeeks.org – A blog aggregator for Sri Lankan FOSS/geek Blogs

http://www.nazly.net/imgs/lkgeeks.jpg

Early this month I put up lkgeeks.org a Blog Aggregator for Sri Lankan FOSS/geek Blogs. This site is not intended to compete with other Sri Lankan Blog Aggregators but its goal is to let everyone read Blog posts only from the Blogs of FOSS/geek Bloggers. I'm a fan of Kottu, but it consists of Blogs from various categories and its too crowded. Its difficult to filter out Blogs that sounds more technical. So that kinda influenced me to start this site.

If you fall into the category of a SriLankan FOSS/geek Blogger send me the URL of your blog to nazly dot ahmed at gmail dot com. There is a review process and once its approved it will be added to lkgeeks.org.

Posted 6 years ago

AJAX version of my BLOG

AJAX has been the most popular buzz word among the Web Developers. I have been using AJAX for a while now and wanted to AJAX enable my BLOG. And I have done it. You can check the AJAX version of my BLOG. The AJAX version is not the default one you will get once you login to www.nazly.net. But you will be able to access it through the above link which I'm planning to add at the bottom of the page to switch between versions once I test it out completely.

There are few ways that I have implemented AJAX in my Web Applications. Rasmus' 30 second AJAX Tutorial is one of the neat and basic ways. Sajax and libAjax are couple of tool kits I have tried out. On my blog I have used Prototype which is a Javascript Framework that can be used to implement AJAX in our applications quite easily.

Posted 8 years ago

CAPTCHA on my blog

I have added the CAPTCHA on my blog when posting comments to avoid SPAM comments. CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart" which is used in Web based applications to only allow human beings to submit data. Though I was aware of CAPTCHA it was Christian Wenz's tutorial session on "Web Application Security Bootcamp" during the ApacheCon Asia 2006 that influenced me to add this feature on my blog. So when you are posting comments you just need to enter the verification code you see in the image.

Posted 8 years ago

Two years of blogging..

It has been exactly two years since I started to blog here. I first started to blog @ Codewalkers.com but the blogs there had to be taken off for some reason. Then I started my own blog and prefered coding the blog system on my own as a hobby project. I slowly added features to it and made sure to keep it very easy to use from my end. I also made sure to keep the look and feel very simple as well.

It has been two years of fun blogging about things that interests me. Will try to keep my blog live as much as I can. Hopefully you all had a good time reading my posts and gained something out of it. Looking forward to your comments and suggestions to keep my blog up and running.

Posted 8 years ago

Flickr photos on my blog

As you would have noticed I have added a section called 'Recent Photos' on the right column of my blog. That shows the recent 5 photos that I have uploaded to my Flickr Photos. To grab my recent photos I'm using phpFlickr, the API kit for Flickr API.

PHPFlickr is so easy to use and has some very basic examples on how to play around with it. PHPFlickr requires PEAR HTTP_Request package. If caching is needed the PEAR DB package is required as well. I'm using caching in my case.

You will need to get an API key from Flickr before using the Flickr API. You can get it from here.

Here goes the code.

Display my recent photos

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once("phpFlickr.php");
#Replace <api_key> with your API Key 
$f = new phpFlickr("<api_key>");
 
#Enable phpFlickr Cache
$f -> enableCache("db", "mysql://user:pass@localhost/db", 1800);
 
#Find my NSID
$nsid = $f->people_findByUsername("nazly");
 
// Get the friendly URL of the my photos
$photos_url = $f->urls_getUserPhotos($nsid);
 
// Get the my recent 5 photos
$photos = $f->people_getPublicPhotos($nsid, NULL, 5);
 
// Display Thumbnail pics
foreach ($photos['photo'] as $photo) {
        echo "<a href=\"".$photos_url.$photo["id"]."\">";
        echo "<img border=\"0\" alt=\"".$photo["title"]."\" ".
        	"src=\"".$f->buildPhotoURL($photo, "Thumbnail")."\" />";
        echo "</a>";
        echo "<br /><br />\n";
}
?>

Display my photos that belongs to specific tag(s)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require_once("phpFlickr.php");
#Replace <api_key> with your API Key 
$f = new phpFlickr("<api_key>");
 
#Enable phpFlickr Cache
$f -> enableCache("db", "mysql://user:pass@localhost/db", 1800);
 
#Find my NSID
$nsid = $f->people_findByUsername("nazly");
 
// Get the friendly URL of the my photos
$photos_url = $f->urls_getUserPhotos($nsid);
 
// Search for photos
$photos = $f->photos_search(array("tags" => "ubuntu",
					"user_id" => $nsid));
// Display Thumbnail pics
$i=0;
foreach($photos['photo'] as $photo){
	echo "<a href=\"".$photos_url.$photo["id"]."\" target=\"blank\">";
        echo "<img border=\"0\" alt=\"".$photo["title"]."\" ".
        	"src=\"".$f->buildPhotoURL($photo, "Thumbnail")."\" />";
        echo "</a>&nbsp;\n";
        $i++;
        // If it reaches the fifth photo, insert a line break
        if ($i % 5 == 0){
            echo "<br />\n";
        }
}
?>
Posted 8 years ago

Lazy to blog..

Atlast made up my mind to make a post here. Was involved in couple of experiments (no scientific stuff, basic coding) and was feeling really lazy to make up my mind to post it on my blog. The experiment continues so I don't wanna blow it up in the middle. Couple weeks after the new year again here we are having some days off from work coz of the Public holidays. Its important to take these days off coz when we hit next Monday it will be no stopping. It has been raining heavily around Colombo and heard that its raining really heavily in the most parts of the island. So stuck with my computer at home even on a holiday as I didn't even worry about having a bath or changing cloths considering the climate. Nobody at home complained. So no worries [Wink]

Posted 8 years ago

1 of 212