Building Tag Clouds in Perl and PHP by Bumgardner J.

By Bumgardner J.

Tag clouds are in every single place on the net nowadays. First popularized by way of the net websites Flickr, Technorati, and, those amorphous clumps of phrases now look on a slew of sites as visible proof in their club within the elite corps of "Web 2.0. This PDF analyzes what's and is not a tag cloud, bargains layout counsel for utilizing them successfully, after which is going directly to express how you can gather tags and show them within the tag cloud layout. Scripts are supplied in Perl and PHP.Yes, a few have acknowledged tag clouds are a fad. yet as you will find, tag clouds, while used effectively, have actual benefits. extra importantly, the talents you research in making your individual tag clouds aid you make different attention-grabbing forms of interfaces that might out live the mercurial fads of this 12 months or the subsequent.

Show description

Read or Download Building Tag Clouds in Perl and PHP PDF

Best programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Additional info for Building Tag Clouds in Perl and PHP

Example text

Css" rel="stylesheet" type="text/css">

This code splits the tags up into an array and then walks through the array, incorporating each tag into our data structure and maintaining a tally of all the tags, by calling our addTag() function. us page, which contains the tagged links. 4. Display Tags in PHP There are various ways to display a tag cloud. I've chosen a style that closelyresembles the tag clouds on Flickr. Here is the HTML for a very small tag cloud, so you can see how it is structured:

Each word or tag is associated with the style division class cdiv (which is definedin the CSS style file), and the font size is given explicitly for each tag.

The result is shown in Figure 19. Figure 19. php Note: Figures 19 thru 28 (in the PHP section) exactly duplicate Figures 9 thru 18 (in thePerl section). I did this to keep illustrations inline with the text, so that PHPprogrammers don't have to keep flipping back to the Perl section. As you can see, the words in Figure 19 are far too small. We probably don't wantto see a font size smaller than about te so let's add ten to the count. We'llchange the line that converts tag count to font size from this: $fsize = $cnt; 39 40 to this: $fsize = $cnt+10; This change produces the tag cloud shown in Figure 20.

Download PDF sample

Rated 4.78 of 5 – based on 34 votes