Login   Register  
PHP Classes
elePHPant
Icontem

File: showcloud.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Dmitry Sheiko  >  Multi-User Tag Cloud  >  showcloud.php  >  Download  
File: showcloud.php
Role: Example script
Content type: text/plain
Description: tag cloud generator
Class: Multi-User Tag Cloud
Manage clouds of tags added by multiple users
Author: By
Last change:
Date: 2007-01-26 03:58
Size: 1,847 bytes
 

Contents

Class file image Download
<?PHP
/*
* Tag Cloud Showing Script
*
* @package Tag Cloud
* @author $Author: sheiko $  
* @version $Id: showcloud.php, v 1.0 sheiko Exp $ 
* @since v.1.0 
* @copyright (c) Dmitry Sheiko http://www.cmsdevelopment.com 
*/  
include("config.inc.php");
include(
"tagcloud.lib.php");

header("Content-type: text/html; charset=".DEFAULT_CHARSET);
if(!isset(
$dbconnect)) die("Config.inc.php is corrupted");

$tc = new TagCloud();
$tc->DBConnect($dbconnect);
$tc->Controller();



$Headers '<html>
    <title>Tag Cloud</title>
    <script language="JavaScript" type="text/javascript" src="tagcloud.js"></script>
    <style>
        .tc_body { }
        .tc_body A { color: black; }
        .tc_content { padding: 0px 5px 0px 5px; }
        .tc_buttom { 
            border-top: 1px white solid;
            border-left: 1px white solid;
            border-right: 1px #AAAAAA solid;
            border-bottom: 1px #AAAAAA solid;
            background-color: #EEEEEE;
            padding: 2px 4px 2px 4px;
            margin: 2px;
        }
        .tc_buttom A {
            color: black;
            font-weight: bold;
            font-size: 12px;
            font-family: Arial, Tahoma;
            text-decoration: none;
        }
        
    </style>
<body>'
;

$Output '<div style="width: 200px;">
<div class="tc_buttom"><a href="http://www.phpclasses.org/browse/package/3672.html">Tag Cloud</a></div>
<div class="tc_body" id="TagCloud">
'
;
    
$data $tc->getClouds();
    foreach (
$data as $fetch) {
           
$Output .= '<a href="#" onClick="getList(\''.$fetch["tag"].'\', 0); return false;" title="'.$fetch["tag"].lang(" tag is found ").$fetch["index"].' '.lang("time(s)").'" style="font-size:'.$fetch["size"].';">'.$fetch["tag"].'</a> '."\n";
   }    
$Output .= '</div>
</div>'
;
if(isset(
$_GET["js"])) {
    
$lines split("\n"preg_replace("/\r/s",""$Output));
    foreach (
$lines as $line) {
        print 
"document.writeln('".preg_replace("/\'/""\'"$line)."');\n";
    }
} else print 
$Headers $Output '</body></html>';
?>