Esempio n. 1
0
// Set up new font sizes
$baseFontSize = 36;
$fontSizeRange = 24;
// Create an instance of HTML_TagCloud with non-default font sizes
$tags = new HTML_TagCloud($baseFontSize, $fontSizeRange);
// Prepare some items, without specifying the timestamp (this way they will get
//  the actual timestamp)
$name = 'a';
foreach (range(0, 15) as $i) {
    $arr[$i]['name'] = $name;
    $arr[$i]['url'] = '#';
    $arr[$i]['count'] = $i;
    $name++;
}
// Submit the prepared items to the TagCloud
$tags->addElements($arr);
$tags->addElement('H', '#', 16);
$tags->addElement('P', '#', 18);
// Get the CSS part only
$css = $tags->buildCSS();
// Get the HTML part only
$taghtml = $tags->buildHTML();
// Now return a HTML page and display the CSS-part and the HTML-part in
//  separated positions
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>My first Tag Cloud</title>
<style type="text/css">