PHP Classes
elePHPant
Icontem

cal_TagCloud: Display a tag cloud from an array of tags

Recommend this page to a friend!
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2006-12-13 (9 years ago) RSS 2.0 feedNot enough user ratingsTotal: 926 This week: 1All time: 3,718 This week: 1,047Up
Version License PHP version Categories
cal_tagcloud 1.2GNU General Publi...5.0PHP 5, Content management
Description Author

This class can be used to generate a tag cloud from an array of tags.

It takes an array with a list of tags and generate the cloud considering the number of times each tag appears in the list.

The class outputs a piece of HTML with links with the tag names pointing to pages with more detail about each tag.

The presentation of each tag is defined using CSS styles. The name of the CSS style of a tag is defined by a configurable prefix followed by the score of the tag.

The maximum number of tags to show in the cloud and the format of the tag link URL are also configurable details.

Picture of Cal Evans
Name: Cal Evans <contact>
Classes: 1 package by
Country: United States United States

Details
Cal Evans <cal@calevans.com>
My Homepage: http://www.calevans.com
Project Homepage: http://www.calevans.com/view.php/page/tagcloud
(c) 2006 Cal Evans, All Rights Reserved
Licensed under the GPL 2.0

---

1: Create a directory cal somewhere in your include_path.
2: Place TagCloud.php in it.
3: In your code use:
require 'cal/TagCloud.php';
$cloudMaker = new cal_TagCloud($yourArrayOfTags); 
// Set options here.
$cloudMaker->buildCloud();
echo $cloudMaker->cloudOutput;

In the above example, $yourArrayOfTags is a single dimensional 
array of tags. The more a tag is in the array, the higher it's 
weight and score. See tagCloydTest.php for a working example.

You can see a working example on the project homage:
http://www.calevans.com/tagCloud/


Email me if you have questions.

=C=
  Files folder image Files  
File Role Description
Accessible without login Plain text file README.TXT Doc. Basic instructions
Plain text file TagCloud.php Class The main class
Plain text file testTagCloud.php Example Self contained test file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:926
This week:1
All time:3,718
This week:1,047Up