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();
Todavía no hay Comentarios/Pingbacks para esta publicación...
No tienes derecho a leer este blog, es privado. Además seguro que tienes mejores cosas que hacer.
| 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 |

Esta obra está bajo una licencia de Creative Commons.