Archive for the ‘Tips and IT’ Category

How to create custom tag cloud in WordPress
Posted by: Nuwan Sameera Hettiarachchi on: July 23rd, 2010
In: Tips and IT,WordPress Comments (2)

Previous article was about some new features in wordpress 3.0. But today I like to write small Hack in WordPress template. You know, there is a grate feature Tag cloud which is displays a list of tags has been assigned to posts. WordPress Tags can be generated by wp_tag_cloud() API function by passing relevant arguments. Using this method you can show list of tags somewhere in you template (ex: sidebar).

Since Version 2.8, the taxonomy parameter was added so that any taxonomy could be used to generate the tag clouds. As well as WordPress contain existing widget so that easily add tag cloud to the sidebar or somewhere in template.

The clouds are available for Categories or any other Custom Taxonomies to present in you web site. But you can control only available parameters for appearance tag cloud.

But if you want to present the post count for a specific tag, we cannot generate using wp_tag_cloud() function. So we can use simply following Hack to generate any type of output in your tag cloud.

   $args = array('taxonomy'  => 'post_tags' );
   $tags = get_terms( $args['taxonomy'], array_merge( $args, array( 'orderby' => 'count', 'order' => 'DESC' ) ) ); // Always query top tags
 
   if (!empty( $tags )) {
	foreach ($tags as $tag){
          $link = get_term_link( intval($tag->term_id), $args['taxonomy'] );						
           $list .= '<li><strong class="tag_link"><a href="'.$link.'">'.$tag->name.'</a> ('.$tag->count.')</strong></li>';
	}
   }
echo $list;

The get_terms() function will fetch the all tags data as an array for specific taxonomy. Above example I used default post_tags as taxonomy. But get_terms() function doesn’t contain the tags link, so I used get_term_link() inside of the Foreach loop. Well, finally print the output as follows,

A grate Firefox plugin to Notify new mails at Gmail
Posted by: Nuwan Sameera Hettiarachchi on: August 8th, 2009
In: Tips and IT,Web Comments (1)

gmail_logo_stylizedGmail is the grate web application which is a free webmail, POP3, and IMAP service provided by Google among the other free webmail application such as Yahoo! Mail, Hotmail, and AOL. And most of Freelancers are using Gmail for day to day activities with projects and private usage.

I am not going to talk about Gmail and other applications. But I am also using Gmail. And I was a problem to notifying a new mails which come Gmail inbox. Sometime I am late to check the new important mails. Meantime I go to check new mails very often. But it was very time consuming task when I work projects. And I was finding a solution to avoid this problem. Finally I found a Firefox plugin named Gmail Notifier. It is very useful plugin if you are wasting time on Gmail.

It Supports:

  • Mozilla 1.4+ (all platforms)
  • Firefox 1.0+ (all platforms)
  • Seamonkey 1.0+ (all platforms)
  • Flock 0.7+ (all platforms)

Features:

  • Monitor multiple Gmail accounts from within your Mozilla-based browser.
  • Statusbar item available for all browsers, and Firefox users get a toolbar item as well.
  • Supports Gmail Hosted accounts. Simply use username@hosteddomain.tld as the username in the notifier.

perferance

In addition can play a nice notify sound track when new mail receive. I think this is very good plugin for you and get a experiance with Gmail Notifier plugin.

How to disable annoying keys in your Laptop using KeyTweak
Posted by: Nuwan Sameera Hettiarachchi on: June 14th, 2009
In: Technology,Tips and IT,Windows Comments (0)

102752_keysLast week, my key board of laptop was broken. The problem is Ctrl key keeping hold. So it was difficult to work with laptop. I installed KeyTweak software which is good among with other softwares. KeyTweak is a simple utility that allows users of Windows NT/2000/XP/Vista/Win 7 to remap their keyboard inputs. My need was to disable to annoying Ctrl key in my laptop.

If you want to disable any key in ur key board just select a key form the Key Selection Area, then click the Disable key button on the Keyboard Controls Area, by applying changes you did. Likewise you can control your keyboard keys.

key-twak

And other features :

  • Simple interface
  • Ability to Teach remapping by pressing the keys to be remapped
  • Easy-to-read lists of all current and pending re-mappings
  • Implementation of Specialty Keys support for certain keyboards
  • Remove all re-mappings with a single button
  • Enable/disable annoying keys
  • Displays what exactly is written to the “Scancode Map” registry value and how to
    interpret its binary data
  • User warnings help ensure Ctrl-Alt-Delete sequence is maintained
Selecting columns text using Firefox
Posted by: Nuwan Sameera Hettiarachchi on: December 8th, 2008
In: Tips and IT Comments (0)

FirefoxToday I got a very difficult problem when selecting content of a table to copy and paste. I wanted to get contents (Data) which include each and every columns separately copy and paste to a Notepad. But you know when u highlight particular table will be highlight entire table as follow. I think you may have faced this situation.

highlighting-table

So we cannot get a column content only. Fortunately I am using firefox 3.0.4 supported to do it. This is the way to select a column of a table.

Just click Ctrl and keeping hold, highlight a table moving mouse on a column which you need to get data. Then you can paste into a Notepad or excel sheet.

column-highlidht

In addition you can select any row at a table.

top-10-css-table-designs-css-events

And I check this ability within Opera, IE7 and Safari, but they don’t come with this option. Be work with Open source Firefox great Browser.

MySQL 5.0.51a Installation for Windows Vista
Posted by: Nuwan Sameera Hettiarachchi on: December 8th, 2008
In: Tips and IT Comments (0)

mysqlSince last week end I stared to learn Ruby and Rails. And I tried to work with RoR and MySQL as database. But RoR is not easy to support installation at Windows vista. To me this was a very big thing to configure RoR and MySQL.

Unfortunately RoR and MySQL will connect only 5.0.51a.
So I had to install mysql 5.0.51a.

Again I got a problem when installing MySQL 5.0.51a at vista. Error is “side-by-side configuration is incorrect“.

error
The problem is occur when you go to configure MySQL (Mysql Server Instance Config Wizard). There is a problem with the MySQLInstanceConfig.exe in Mysql 5.0.51a version.

This is the procedure which I did to overcome form this problem.

  • First install MySql 5.0.51a at vista
  • The best practice is disable the UAC currect account in Windows Control Panel->User Accounts.
  • As next step is just download and install Resource Hacker and run it.
  • Go through Resource Hacke and just open the file menu chooser. And browse to MySQL installation’s directory which locate bin. (C:\Program Files\MySQL\MySQL Server 5.0\bin) Now you can select MySQLInstanceConfig.exe
  • Navigate to 24 –> 1 –> 1033 in the tree that appears in the Resource Hacke view.
  • Find  <requestedExecutionLevel level=”asAdministrator” uiAccess=”false”>
  • Change to <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”>
  • click”Compile script” button and leave Resource Hacker and save the result by overwriting the initial MySQLInstanceConfig.exe at your installation.

This is the normal way to fix this bug and should be work MySQLInstanceConfig.exe in correctly.