echo "border: 1px solid black;";
    echo "text-align: center;";
    echo "}";
    echo "#tagcloud a{";
    echo "      color: #871e32;";
    echo "      text-decoration: none;";
    echo "      text-transform: capitalize;";
    echo "}";
    echo "</style>";
    echo "<body>";
    echo "</body>";
    echo "</html>";
    echo "<div id=\"tagcloud\">";
    /*** create a new tag cloud object ***/
    $tagCloud = new tagCloud($tags);
    echo $tagCloud->displayTagCloud();
    echo "</div>";
    echo "</body>";
    echo "</html>";
}
if ($outputFormat == 'json') {
    $tagCloudJSON = new stdClass();
    $tagCloudJSON->tagCloud = (object) array('maxFontSize' => $maxFontSize, 'maxObjects' => $maxObjects, 'tags' => array());
    shuffle($tags);
    for ($i = 0; $i < count($tags); $i++) {
        $tagCloudJSON->tagCloud->tags[$i]->title = $tags[$i]['tagname'];
        $tagCloudJSON->tagCloud->tags[$i]->url = $tags[$i]['url'];
        $tagCloudJSON->tagCloud->tags[$i]->weight = $tags[$i]['weight'];
    }
    #echo "json";
    $tagCloudJSON = $classJSON->encode($tagCloudJSON);
Beispiel #2
0
				$tok = strtok(" .,");
				tokensAR[] = $tok;
			}
           
            );
            $ordersTokens = array_count_values($tokensAR);
        }
        $tags = array();
        foreach ($ordersTokens as $tag=>$count){
			$tags[] = array('weight'  =>$count, 'tagname' =>$tag, 'url'=>'info.php?op=course_info&id= $serviceId);
		}
*/
$tags = array(array('weight' => 40, 'tagname' => 'lingue', 'url' => 'info.php?op=course_info&id=2'), array('weight' => 12, 'tagname' => 'programmazione', 'url' => 'info.php?op=course_info&id=0'), array('weight' => 10, 'tagname' => 'sicurezza', 'url' => 'info.php?op=course_info&id=1'), array('weight' => 15, 'tagname' => 'reti', 'url' => 'info.php?op=course_info&id=2'), array('weight' => 28, 'tagname' => 'consulenza', 'url' => 'info.php?op=course_info&id=2'), array('weight' => 35, 'tagname' => 'web 2.0', 'url' => 'info.php?op=course_info&id=9'), array('weight' => 20, 'tagname' => 'android', 'url' => 'info.php?op=course_info&id=1'));
/*** create a new tag cloud object ***/
$tagCloud = new tagCloud($tags);
return $tagCloud->displayTagCloud();
class tagCloud
{
    /*** the array of tags ***/
    private $tagsArray;
    public function __construct($tags)
    {
        /*** set a few properties ***/
        $this->tagsArray = $tags;
    }
    /**
     *
     * Display tag cloud
     *
     * @access public
     *