Toggling ASC/DESC sorting using Animated table sort plugin for jQuery

Just few mins ago, from a tweet of Tareq Hasan, I came to learn about Animated Table Sort plugin for jQuery. Seeing the demo I was stunned and decided to implement on a project I was working right then!

After implementing, I see it can sort in one way. Either ascending or descending. If we set the parameter to

sortDesc: true

it sorts the table in descending order, otherwise ascending order. But, I wanted in both way. I mean, after clicking on the header, it should toggle between order. Suppose, on first click, it sorted ascending order. However, the second click should sort in descending order.
Continue reading →

Recaptcha with AJAX application, get new challenge using JavaScript

Currently, I am working on a commercial project (for me) that will be dedicated to the soul of Michael Jackson. I have used some AJAX based interface where I have used reCaptcha challenges to fight spamming. The form where I have used reCaptcha, will be submitted through AJAX calls. As the page won’t reload, the same captcha challenge exists even the user makes a mistake during filling the form.  I wanted to show a new challenge each time he/she makes a mistake. I thought, I will be in trouble in this part! However, I have seen it is extremely easy to get a new challenge. Continue reading →

Show RSS Feed within a WordPress Post – In Post RSS Feed plugin

This idea, showing a relevant RSS Feed at the end of the post, came to my mind day before yesterday. That time, I had to install the wp-exec plugin that can handle PHP codes inside the post. Using that, I have included an RSS Feed at the end of the post to show live contents from external site.

However, that is not suitable for all. All wordpress users don’t know PHP. Moreover, it is not simply process. if you make a syntax error, you take a lots of trouble. So, I thought, I will make it simple. And yes, the initial version is done. I have plan to release an low-cost premium version with many customizable features that I have in my mind.

How it works?

After you install the plugin, you configure it from WP-Admin -> Settings -> In Post RSS link and set the number of items to show and show/hide Feed Title that is given by you as you see in the screenshot below:

Continue reading →

Facebook Like button for PunBB forum

Facebook likeFacebook like button is a component of its social plugins. It is a great tool of driving traffic to your site. Mashable has a report of increasing referral traffics by 50% by using this Like button.

Considering it as a good tool to drive traffic, I have developed a tiny extension for PunBB bulletin board. When you install this extension, you will find a Like button at the top of Topic View (viewtopic.php). It will also show number of persons liked the topic. Continue reading →

Header Image Rotator for Twenty Ten theme of WordPress 3.0

WordPress 3.0 is still in RC1. I have already upgraded this blog to this version. I can’t but  simply love the new theme ‘Twenty Ten’ which is default in WordPress 3.0. It is super simple theme.

In this theme, there is option to use custom header image. From the admin panel you can select the header image. However, all of the default banners looked interesting to me and I have also uploaded some of my own shots. I wanted to show them all.

Keeping that in mind, I made this simple plugin, Twenty Ten Image Rotator. Having this plugin installed, you can show all images on the header. Single banner each selected randomly on each page load.

I believe if you love Twenty Ten theme, you will love this plugin too :).

Download from WordPress Plugin Repo

WordPress Category Widgets plugin – display different widgets for different categories

Today, I have developed another plugin for WordPress which I named ‘Category Widgets’ plugin and as usual nothing more peaceful rather than sharing with the community.

Using this plugin, you can display a text widget for any specific category and/or its sub-categories. For example, you want to show different sidebar banners based on different category. It is easy using this plugin. Just create a new widget and select the category.

I have found another plugin for almost the same purpose. That plugin lacks of capability of displaying in the subcategories. That mean it does not work for the sub-categories of the selected category. In this plugin, I have made that feature and also optionally you can disable that feature too.

Requirements:

  1. WordPress 2.8+

Download:

Continue reading →

Solution for “M2M authentication error – password invalid (code: 823)” error in OpenX

If you receive the error “M2M authentication error – password invalid (code: 823)” in your installation of OpenX, you can solve it quite easily.

Suppose, your OpenX is installed at: www.yourdomain.com/adserver/

then call the following link:

www.yourdomain.com/adserver/regenerate-platformhash.php

Once your platform hash is re-generated, you should not see the error message again.

Passing filename arguments to PHP from shell and space issue…

Today, while working with a project to import thousands of articles from text files to wordpress,  I had faced a trouble while I am executing a shell script to iterate through all text files and call a PHP script with sending the filename as argument. The PHP script would then process the file as our requirement. The shell script looked like:

for i in `find . -type f -name '*.txt'`;

do

php import_posts.php $i

done

Here, $i would be the filename and it is passed to PHP script for processing. But the problem is that, when the filename (including directory name) consists any whitespace in its name, the script would broken. For example, some files path looked like
/home/user/articles/Internet Business/Web Hosting/how_to_start_your_company.txt

Here, notice the space after Internet and Web. The shell script was breaking just after Internet. It was sending /home/user/articles/Internet as argument to PHP script and obviously PHP script was failed to find this file.

After searching a lot, finally I found a solution.

It was really simple. I am quoting from his blog:

If none of your files or folders have spaces in their names, then this isn’t a problem, but that is increasingly unlikely nowadays.  If your songs do have spaces in their filenames, then the solution is to change how the shell splits that output.  This is controlled by the variable $IFS, which is set to spaces, tabs, and newlines by default.  We’d like it set to just newlines, so we do:

So, here is the solution. I just put the following line at the top of my shell script.

export IFS=$'\n'

After that everything is fine. The script is running exactly how I intended it to run.

Thanks for Anthony for his solution.

PunBB Topic Ownership Change extension

Just now I have developed a small extension for PunBB that will let admins and moderators to change the ownership of any topic. As usual, I made it for Projanmo Forum but it is always pleasing to share with the community :).

It is very simple plugin. Just upload and activate the extension. Then if you view any topic with, at least, moderation privilege, you will see a link ‘Change Topic Owner’. When you click on it, you will be asked to enter new User’s ID (check the image below). Once you enter and hit Ok, you will be redirected to a new page where either the ownership will be changed or corresponding error message will be shown.

Note: This will not affect users’ post count.

Download
or,
Download

Attended Tech Seminar “Web & Software Industry Opportunities – Beyond 2010”

Last evening, I have attended a seminar titled “Tech Seminar : Web & Software Industry Opportunities – Beyond 2010” arranged by Blueliner Bangladesh,  hosted by CSE Department, BRAC University.

The seminar covered 4 sessions. Those were:

Continue reading →