Months ago, I was impressed by the tag clouds featured by many web sites including blogs. I wondered whether I could have that ‘plugin’ in my blog as well.
Today, I realized that it is easy to create a tag cloud function with PHP and PostgreSQL. Currently, I have the following table:
Then, I created a PHP function based on this table so that tags (journal entry types) are displayed with fonts bigger or smaller depending on the number of entries each got as expressed in percentage. I used the scale of 10 to evaluate each of the tag’s percentage. The tag that got 80 percent up receives a font size of 10points. The tag that got 60 to 79 percent receives font size of 9 points, and so on.
Of course, I can’t apply this learning of mine for my own blog at WordPress.com. I’m not allowed to tinker with the CSS file nor the PHP scripts. It’s all right; what’s more important is that I already know the ropes of tag clouds and I’ve applied them right in my journal system hosted in my own machine.
Powered by ScribeFire.