class spanishCloud, customizable tag clouds

class spanishCloud, customizable tag clouds

04.01.08 | por Javier [mail] | Categorías: Informática, PHP

This PHP class creates customizable tag clouds, by using either arrays or MySql queries as a source.

Download spanishCloud v2008.01.04

Properties:

$source - MYSQL QUERY or ARRAY, source for generating the cloud
$activateLinks - (true/false) Activate the links
$urlLinks - PRE-URL for hyper-text's links
$style - Style for text's cloud
$rumbleSize - (true/false) random modification for font sizes.
$rumbleQty - Quantity of pixels for rumbleSize modification. It's NOT affected by $this->sizeMultiplier
$sizeMultiplier - Multiplier for zooming font sizes
$minFontSize - Min font size (pixels)
$maxFontSize - Max font size (pixels)
$generatedCloud - Generated cloud

Methods:

generateTagCloud() - Generates the tag cloud. Returns false if $this->source is empty
getCloud() - Returns the tag cloud

Mysql example:

require_once("spanishcloud.class.php");

$dbLink = mysql_connect("localhost","root","");
mysql_select_db("mydatabase", $dbLink);

$myCloud = new spanishCloud;
$myCloud->source = mysql_query("SELECT tagname FROM tagstable;", $dbLink);
$myCloud->activateLinks = true;
$myCloud->urlLinks = "buscar.php?m=tags&t=";
$myCloud->style = "color: white;";
$myCloud->sizeMultiplier = 0.50;
$myCloud->generateTagCloud();
echo $myCloud->getCloud();

Arrays example:

require_once("spanishcloud.class.php");

$myCloud = new spanishCloud;
$myCloud->minFontSize = 10;
$myCloud->source = array('red', 'blue', 'red', 'brown', 'red', 'brown', 'blue', 'blue', 'yellow', 'blue');
$myCloud->rumbleSize = true;
$myCloud->rumbleQty = 10;
$myCloud->generateTagCloud();
echo "There are the tags: " . $myCloud->getCloud();

Default tag cloud example:

require_once("spanishcloud.class.php");

$myCloud = new spanishCloud;
$myCloud->generateTagCloud();
echo $myCloud->getCloud();

Comparte esta entrada con la comunidad:

Comentarios, Pingbacks:

Todavía no hay Comentarios/Pingbacks para esta publicación...

Dejar un comentario:

Tu dirección de Email NO será visible en este sitio
Tu URL será visible

Tags XHTML permitidos: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Saltos de línea se convierten en <br />)
(Dejar “cookies” para nombre, Email y URL)
(Permitir que usuarios te contacten a través de un formulario de mensajes (tu Email no será visible))
This is a captcha-picture. It is used to prevent mass-access by robots.

Please enter the characters from the image above. (case insensitive)

Linkinblog

No tienes derecho a leer este blog, es privado. Además seguro que tienes mejores cosas que hacer.

August 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Misc

XML Feeds

What is RSS?

IBSN 00-07-10-2005
IBSN 00-07-10-2005

Creative Commons License
Esta obra está bajo una licencia de Creative Commons.

powered by b2evolution free blog software