Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 16946 программистов и 1772 робота. Сейчас ищут 1265 программистов ...

Introduction

Вернуться к: HTML_TagCloud

Edited By

Shoma Suzuki

Introduction

Introduction – Introduction to HTML_TagCloud.

This package can be used to generate tag coulds in HTML and CSS. A tag cloud is an visual representation of list of so-called "tags" or keywords, that do have a different font size depending on how often they occur on the page/blog.

More information on tag clouds is available in Wikipedia.

This package does not only visualize frequency, but also timeline infomation. The newer the tag is, the deeper its color will be; older tags will have a lighter color.

Simple usage example

Basic example

<?php
require_once 'HTML/TagCloud.php';

$tags = new HTML_TagCloud();
// add Elements
$tags->addElement('PHP'       ,'http://www.php.net'  39strtotime('-1 day'));
$tags->addElement('XML'       ,'http://www.xml.org'  21strtotime('-2 week'));
$tags->addElement('Perl'      ,'http://www.xml.org'  15strtotime('-1 month'));
$tags->addElement('PEAR'      ,'http://pear.php.net' 32time());
$tags->addElement('MySQL'     ,'http://www.mysql.com'10strtotime('-2 day'));
$tags->addElement('PostgreSQL','http://pgsql.com'    ,  6strtotime('-3 week'));
// output HTML and CSS
print $tags->buildALL();
?>

The above example code creates a tag cloud containing five items. The tag used most often is "PHP"; it will appear in the largest font. The tag used latest is"PEAR", it is in the deepest color. Tags are sorted by alphabetically, and escaped in HTML.



Вернуться к: HTML_TagCloud

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware