phpDocumentor PluginSonots
[ class tree: PluginSonots ] [ index: PluginSonots ] [ all elements ]

Class: TagCloud

Source Location: /sonots/tag.class.php

Class TagCloud

Class Overview

Generate An HTML Tag Cloud

Example

  1.  $tags array(
  2.      array('tag' => 'blog''count' => 20),
  3.      array('tag' => 'ajax''count' => 10),
  4.      array('tag' => 'mysql''count'  => 5),
  5.      array('tag' => 'hatena''count'  => 12),
  6.      array('tag' => 'bookmark''count'  => 30),
  7.      array('tag' => 'rss''count' => 1),
  8.      array('tag' => 'atom''count' => 2),
  9.      array('tag' => 'misc''count' => 10),
  10.      array('tag' => 'javascript''count' => 11),
  11.      array('tag' => 'xml''count' => 6),
  12.      array('tag' => 'perl''count' => 32),
  13.  );
  14.  $cloud new TagCloud();
  15.  foreach ($tags as $t{
  16.      $cloud->add($t['tag']"http://<your.domain>/{$t['tag']}/"$t['count']);
  17.  }
  18.  print "<html><body>";
  19.  print $cloud->htmlAndCSS(20);
  20.  print "</body></html>";

Located in /sonots/tag.class.php [line 1002]



		
				Author(s):
		
		
		
Information Tags:
Version:  $Id: v 1.0 2008-06-05 07:23:17Z sonots $
License:  GPL v2

Properties

Methods

[ Top ]
Property Summary
array   $counts   Counts of tags
array   $urls   Urls of tags

[ Top ]
Method Summary
TagCloud   TagCloud()  
void   add()   Add a tag
string   css()   Generate embedded CSS HTML
string   html()   Generate tagcloud HTML
string   htmlAndCSS()   Generate tagcloud HTML and embedded CSS HTML concurrently

[ Top ]
Properties
array   $counts [line 1014]

Counts of tags

Associative array of integers whose key is a tag and value is its count (number of items associated with the tag)


[ Top ]
array   $urls [line 1025]

Urls of tags

Associative array of strings whose key is a tag and value is its link to be displayed in tagcloud


[ Top ]
Methods
Constructor TagCloud  [line 1027]

  TagCloud TagCloud( )



[ Top ]
add  [line 1042]

  void add( $tag $tag, $url $url, $count $count  )

Add a tag

Parameters:
$tag   $tag:  tag
$url   $url:  associated url to be displayed in tagcloud
$count   $count:  number of items associated with tag.

API Tags:
Access:  public


[ Top ]
css  [line 1055]

  string css( )

Generate embedded CSS HTML

You may create a .css file instead of using this function everytime


API Tags:
Return:  CSS


[ Top ]
html  [line 1073]

  string html( [$limit $limit = null]  )

Generate tagcloud HTML

Parameters:
$limit   $limit:  number of limits to be displayed

API Tags:
Return:  HTML
Access:  public


[ Top ]
htmlAndCSS  [line 1120]

  string htmlAndCSS( [$limit $limit = null]  )

Generate tagcloud HTML and embedded CSS HTML concurrently

Parameters:
$limit   $limit:  number of limits to be displayed in tagcloud

API Tags:
Return:  HTML
Access:  public


[ Top ]

Documentation generated on Sat, 16 Aug 2008 15:27:38 -0400 by phpDocumentor 1.3.2