/* PHP & MySQL Journal */
Posted in: plugins | Comments Off
5 Jul 2009Today I’ve released my first Wordpress plugin, Country Filter. The Country Filter plugin allows you to control the visibility of Wordpress elements depending on the users country of origin. You can hide or show certain elements of a page or some sections of a post from users browsing from a particular country. For example you could have a ‘donate’ button that displays only if the user is browsing from France, India or UK.
Plugin download and installation instructions can be found here.
Posted in: php | ( 5 ) Comments
21 Jun 2009With a plethora of wordpress plugins available for every conceivable purpose, there is a huge amount of data that is stored on a typical wordpress installation. We could easily use that data across domains or display them using widgets on the desktop. Take for example the WP-UserOnline plugin that displays how many users are currently online on your blog. We could easily write a proxy to grab that information from the plugin and use it in a Yahoo Widget or in a AIR application on the desktop, so you can see the number of users online without having to visit your site. Or you could use the information on some other site.
Posted in: browser | ( 1 ) Comment
17 Jun 2009Rarely do I get excited about new software developments. The last I remember was when WolframAlpha was realeased. Now it is Opera Unite. I’ve forever been a Opera fan, and always loved the extra bit of functionality thoughtfully added to the product by the opera team. But Unite really takes the step forward.
Posted in: php | ( 4 ) Comments
15 Jun 2009In this post we will see how to create a custom stream filter. Streams, first introduced in PHP 4.3, provide an abstration layer for file access. A number of different resources besides files – like network connections, compression protocols etc. can be regarded as “streams” of data which can be serially read and written to.
Posted in: software | ( 1 ) Comment
11 Jun 2009Having to scrap a project after working on it for more than a year is not really an interesting way to up your morale. But it is one the most common things to occur in software development.
To take a real world example; A development company I know has been developing a shopping cart for the last 14 months ( beats me why anyone has to develop a shopping cart when so many free and excellent are already available ). But it is still nowhere near production ready. There is always something left to be added or cleaned. During the development period more than half a dozen programmers have worked on the project and left, producing a convoluted piece of software, which every new member dreads to touch in fear of breaking something somewhere. Salvaging the project is getting harder by the day.
Posted in: refactoring | ( 5 ) Comments
5 Jun 2009Temporary variables are a integral part of any code. But a splattering of the same all over can make your code hard to understand or modify. Replace temp with query is a refactoring method where you replace temp variable expressions with methods. This method is often also required before you use the Extract Method refactoring.
Posted in: browser, tools | ( 2 ) Comments
19 May 2009A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. The toolbar is shown below. You can install the same from here.
Now you can create a toolbar for your own blog or site. The source for the toolbar can be downloaded from below after which you can edit the code to suit your site; to help you there is a nice reference for XUL elements here. The idea for the post was inspired by david.
Today will be the launch of WolframAlpha, the new knowledge engine everyone is waiting for. WolframAlpha will truly revolutionize information search in that the information returned will be computed for your particular purpose from a gargantuan knowledge base. It rightly shows the power of intelligent computing. Even though I’m a developer myself and regularly keep myself abreast in the software field, I couldn’t have imagined the amount of advances made in natural language processing, heuristics and knowledge representation.
Posted in: browser, php, tip | ( 3 ) Comments
14 May 2009A couple of days back I created a Firefox toolbar for my blog as an experiment in learning XUL. Once installed on my blog I wanted Firefox to recognize it as an addon and install it rather than displaying a ’save/open’ dialog. For that I needed to add the following directive to the servers .htaccess file.
Posted in: libraries, pear, php | ( 6 ) Comments
11 May 2009Searching and replacing content in files is a common task all of us do regularly. Most programmers will implement it using Perl a shell script or through a editor. Perl offers itself as an excellent tool for the required purpose; we PHP programmers are not quite so lucky in that matter. Search/replace is easier from a shell prompt or an editor, but what if you have to do the same programatically in php. File_SearchReplace is a pear package that helps you search/replace in files through a nice object oriented interface.