Kamis, 08 April 2010

HOW TO MAKE CLOUD ON YOUR BLOG

ADSENSE MAKE MONEY
Step 1 - Get a list tags, and their frequency
SELECT COUNT(tag) AS tagCount, tag
FROM tblblogtags
GROUP BY tag

In my tag cloud I list all my tags, but if you have a lot of tags you may want to limit the min number of occurrences using a HAVING statement. For example HAVING tagCount > 5
Step 2 - Find the Max and Min frequency


Step 3 - Find the difference between max and min, and the distribution

You can define the distribution to be more granular if you like by dividing by a larger number, and using more font sizes below. You will probably need to play with this to get your tag cloud to look good.
Step 4 - Loop over the tags, and output with size











#tags.tag#

Step 5 - add css classes to your stylesheet.smallestTag { font-size: xx-small; }
.smallTag { font-size: small; }
.mediumTag { font-size: medium; }
.largeTag { font-size: large; }
.largestTag { font-size: xx-large; }
There are probably lots of different ways to build a tag cloud, but this is the first method that came to mind.

Tidak ada komentar:

Posting Komentar