Exemplo n.º 1
0
 /**
  * Return a tag cloud
  *
  * @return string
  */
 public function getTagCloud()
 {
     global $_LANGID, $objInit;
     $tpl = new \Cx\Core\Html\Sigma();
     \Cx\Core\Csrf\Controller\Csrf::add_placeholder($tpl);
     $tpl->setErrorHandling(PEAR_ERROR_DIE);
     $template = $this->settings->formatTemplate($this->settings->get("tag_cloud_sidebar_template"));
     $tpl->setTemplate($template);
     $highestFontSize = 20;
     $lowestFontSize = 10;
     try {
         $tags_pop = $this->tags->getAllOrderByPopularity($_LANGID, true);
         $tags = $this->tags->getAll($_LANGID, true);
     } catch (DatabaseError $e) {
         echo $e->plain();
     }
     $tagCloud = new TagCloud();
     $tagCloud->setTags($tags);
     $tagCloud->setTagVals($tags_pop[0]['popularity'], $tags_pop[count($tags_pop) - 1]['popularity']);
     $tagCloud->setFont(20, 10);
     $tagCloud->setUrlFormat("index.php?section=Knowledge" . MODULE_INDEX . "&tid=%id");
     $tpl->setVariable("CLOUD", $tagCloud->getCloud());
     //$tpl->parse("cloud");
     return $tpl->get();
 }
Exemplo n.º 2
0
 function execute(&$controller, &$request, &$user)
 {
     $tags = TagUtils::get_hot_tags(20);
     $cloud = new TagCloud();
     foreach ($tags as $tag) {
         $cloud->add($tag['name'], SCRIPT_PATH . 'tag/' . urlencode($tag['name']), $tag['cnt']);
     }
     $request->setAttribute('tag_cloud', $cloud->htmlAndCSS());
     return VIEW_SUCCESS;
 }
Exemplo n.º 3
0
 function display_tagcloud($limit = null, $tag = null)
 {
     $view = new TagCloud();
     $tagcloud = $this->get_tagcloud($limit, $tag);
     foreach ($tagcloud as $tag => $count) {
         $url = get_script_uri() . '?' . 'cmd=lsx&tag=' . rawurlencode($tag);
         $view->add(htmlspecialchars($tag), $url, $count);
     }
     return $view->html();
 }
Exemplo n.º 4
0
 function execute(&$controller, &$request, &$user)
 {
     $account = $request->getParameter('account');
     $tags = TagUtils::get_tags_by_account($account);
     $cloud = new TagCloud();
     foreach ($tags as $tag) {
         $cloud->add($tag['name'], SCRIPT_PATH . $account . '/tag/' . urlencode($tag['name']), $tag['cnt']);
     }
     $request->setAttribute('tag_cloud', $cloud->htmlAndCSS());
     return VIEW_SUCCESS;
 }
 /**
  * @see EventListener::execute()
  */
 public function execute($eventObj, $className, $eventName)
 {
     if (MODULE_TAGGING == 1 && SEARCH_ENABLE_TAGS == 1) {
         // include files
         require_once WCF_DIR . 'lib/data/tag/TagCloud.class.php';
         // get tags
         $tagCloud = new TagCloud(WCF::getSession()->getVisibleLanguageIDArray());
         $tags = $tagCloud->getTags();
         if (count($tags)) {
             WCF::getTPL()->assign('tags', $tags);
             WCF::getTPL()->append('additionalBoxes1', WCF::getTPL()->fetch('searchFormTagCloud'));
         }
     }
 }
Exemplo n.º 6
0
 function display_tagcloud($limit = null, $tag = null)
 {
     $view = new TagCloud();
     $tagcloud = $this->get_tagcloud($limit, $tag);
     foreach ($tagcloud as $tag => $count) {
         $url = $this->conf['listcmd'] . rawurlencode($tag);
         $view->add(htmlspecialchars($tag), $url, $count);
     }
     return $view->html();
 }
Exemplo n.º 7
0
 public function save()
 {
     $title = isset($_POST['title']) ? $_POST['title'] : '';
     if ($this->live() && !empty($title)) {
         $this->loadModel('tagcloud', 'tagcloud');
         $tagcloud = new TagCloud();
         $term_id = $tagcloud->getTerm($title);
         if (empty($term_id)) {
             $tagcloud->setMembers(array('term' => $title, 'counter' => '1', 'last_search' => date('U')));
             $tagcloud->save();
         } else {
             $tagcloud->load($term_id);
             $count = $tagcloud->getMember('counter') + 1;
             $tagcloud->setMember('counter', $count);
             $tagcloud->setMember('last_search', date('U'));
             $tagcloud->save();
         }
     }
 }
Exemplo n.º 8
0
if (!Enable_Tags) {
    header("Location: {$my_pligg_base}/404error.php");
    die;
}
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Cloud');
$navwhere['link1'] = getmyurl('tagcloud', '');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Cloud'));
$main_smarty = do_sidebar($main_smarty);
// put the names of the tabs in an array for the tag cloud tpl file
$range_names = array($main_smarty->get_config_vars('PLIGG_Visual_Tags_All'), $main_smarty->get_config_vars('PLIGG_Visual_Tags_48_Hours'), $main_smarty->get_config_vars('PLIGG_Visual_Tags_This_Week'), $main_smarty->get_config_vars('PLIGG_Visual_Tags_This_Month'), $main_smarty->get_config_vars('PLIGG_Visual_Tags_This_Year'));
// give each name a value
$range_values = array(0, 172800, 604800, 2592000, 31536000);
// show the tag cloud
$cloud = new TagCloud();
$cloud->smarty_variable = $main_smarty;
// pass smarty to the function so we can set some variables
$cloud->range_values = $range_values;
if (isset($_GET['categoryID']) && is_numeric($_GET['categoryID'])) {
    $cloud->filterCategory = $_GET['categoryID'];
}
$cloud->show();
$main_smarty = $cloud->smarty_variable;
// get the updated smarty back from the function
// give smarty data for the links to filter by time
if (!($current_range = check_integer('range')) || $current_range < 1 || $current_range >= count($range_values)) {
    $current_range = 0;
}
// misc smarty
$main_smarty->assign('current_range', $current_range);
Exemplo n.º 9
0
<?php

/*
 	define ("PathRoot","C:/wamp/www/evalactisem");
	// *** Define the path to the SVG class dir. ***
define("SVG_CLASS_BASE", PathRoot."/library/svg/");
   	define ("jsPathRoot",PathRoot."/library/js/");

require_once ("library/php/TagCloud.php");
require_once ("library/svg/Svg.php");
require_once ('library/delicious/library/php-delicious.inc.php');
*/
require 'param/ParamPage.php';
$tg = new TagCloud();
//$tg->SauveBookmarkNetwork("xxxx","xxx")
header("Content-type: image/svg+xml");
$tg->GetSvg($login);
Exemplo n.º 10
0
                 $cells .= wf_TableCell($monthName);
                 $monthData = isset($reportTmp[$monthNumber]) ? $reportTmp[$monthNumber] : 0;
                 $cells .= wf_TableCell($monthData);
                 $cells .= wf_TableCell(web_bar($monthData, $totalCount), '', '', 'sorttable_customkey="' . $monthData . '"');
                 $rows .= wf_TableRow($cells, 'row3');
             }
             $result .= wf_TableBody($rows, '100%', '0', 'sortable');
             $result .= wf_tag('b') . __('Total') . ':' . wf_tag('b', true) . ' ' . $totalCount;
         }
         show_window(__('Tags'), $result);
     }
 }
 /*
  * Controller & view section
  */
 $tagCloud = new TagCloud();
 //show cloud or grid tag view
 if (!wf_CheckGet(array('gridview'))) {
     if (wf_CheckGet(array('report'))) {
         $tagCloud->renderReport();
     } else {
         //default tag cloud
         $tagCloud->renderTagCloud();
     }
 } else {
     //grid view
     $tagCloud->renderTagGrid();
 }
 //show selected tag users
 if (isset($_GET['tagid'])) {
     $tagid = vf($_GET['tagid'], 3);
Exemplo n.º 11
0
 /**
  * Display tagcloud
  *
  * @access public
  * @param integer $limit Number to show
  * @param string $relate_tag Show only related tags of this
  * @param string $basehref base href
  * @return string HTML
  */
 function display_tagcloud($limit = null, $relate_tag = null)
 {
     $view = new TagCloud();
     $tagcloud = $this->get_tagcloud($limit, $relate_tag);
     foreach ($tagcloud as $tag => $count) {
         $url = $this->get_tag_uri($tag);
         $view->add(htmlspecialchars($tag), $url, $count);
     }
     return $view->html();
 }
 /**
  * @see Page::readData();
  */
 public function readData()
 {
     parent::readData();
     if ($this->tagObj) {
         // get tagged objects
         if ($this->taggableID == 0) {
             // get objects for overview
             $this->taggedObjects = TagEngine::getInstance()->getGroupedTaggedObjectsByTagID($this->tagObj->getID());
         } else {
             $this->taggedObjects = $this->taggable->getObjectsByTagID($this->tagObj->getID(), $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);
         }
     }
     // get tags
     $tagCloud = new TagCloud(WCF::getSession()->getVisibleLanguageIDArray());
     $this->tags = $tagCloud->getTags($this->tagObj !== null ? 50 : 500);
 }
Exemplo n.º 13
0
        break;
    case 'SavePalette':
        $resultat = SavePalette(stripslashes($_POST['color']));
        break;
    case 'GetPalette':
        $resultat = GetPalette();
        break;
    case 'IemlCycle':
        if ($_GET['debug']) {
            $resultat = IemlCycle($_GET['key']);
        } else {
            $resultat = IemlCycle($_POST['key']);
        }
        break;
    case 'TagCloud':
        $tg = new TagCloud();
        $tg->GetSvg();
        break;
}
echo $resultat;
function GetTreeTrad($flux, $trad, $descp, $type, $primary, $bdd, $couche)
{
    global $objSite;
    $sem = new Sem($objSite, $objSite->infos["XML_Param"], "");
    $arrBdd = explode(";", $bdd);
    $arrFlux = explode(";", $flux);
    if ($type == "Signl_Trad") {
        $arrTrad = explode(";", $trad);
        $arrDescp = explode(";", $descp);
        $arrCouche = explode(";", $couche);
        //vérifie le partage de traduction
Exemplo n.º 14
0
 private function parseWebsite()
 {
     $document = new Document($this->html);
     $this->document["doctype"] = $document->getDoctype();
     $this->document["isPrintable"] = $document->isPrintable();
     $this->document["appleIcon"] = $document->issetAppleIcon();
     $this->document["deprecatedTags"] = $document->getDeprecatedTags();
     $this->document["langID"] = $document->getLanguageID();
     //$this -> document["langID"] = $this->lang;
     $this->document["cssCount"] = $document->getCssFilesCount();
     $this->document["jsCount"] = $document->getJsFilesCount();
     $favicon = new Favicon($this->html, $this->domain);
     $this->favicon = $favicon->getFavicon();
     $content = new Content($this->html);
     $this->content["flash"] = $content->issetFlash();
     $this->content["iframe"] = $content->issetIframe();
     $this->content["headings"] = $content->getHeadings();
     $this->content["issetHeadings"] = !Helper::isEmptyArray($this->content["headings"]);
     $this->content["nestedTables"] = $content->issetNestedTables();
     $this->content["inlinceCss"] = $content->issetInlineCss();
     $this->content["email"] = $content->issetEmail();
     $image = new Image($this->html);
     $this->image["totalCount"] = $image->getTotal();
     $this->image["totalAlt"] = $image->getAltCount();
     $links = new Links($this->html, $this->domain);
     $this->links["links"] = $links->getLinks();
     $this->links["internal"] = $links->getInternalCount();
     $this->links["externalNofollow"] = $links->getExternalNofollowCount();
     $this->links["externalDofollow"] = $links->getExternalDofollowCount();
     $this->links["files"] = $links->getFilesCount();
     $this->links["issetUnderscore"] = $links->issetUnderscore();
     $this->links["friendly"] = $links->isAllLinksAreFriendly();
     $metatags = new MetaTags($this->html);
     $this->metatags["title"] = $metatags->getTitle();
     $this->metatags["description"] = $metatags->getDescription();
     $this->metatags["keywords"] = $metatags->getKeywords();
     $this->metatags["charset"] = $metatags->getCharset();
     $this->metatags["viewport"] = $metatags->getViewPort() !== null ? 1 : 0;
     $this->metatags["dublincore"] = $metatags->getDublinCore();
     $this->metatags["ogproperties"] = $metatags->getOgMetaProperties();
     $seoanalyse = new SeoAnalyse($this->html);
     $this->seoanalyse['htmlratio'] = $seoanalyse->getHtmlRatio();
     $validation = new Validation($this->domain);
     $this->validation["w3c"] = $validation->w3cHTML();
     $tagcloud = new TagCloud($this->html, $this->lang);
     $analyser = $this->CI->config->item('analyser');
     $this->tagcloud = $tagcloud->generate($analyser["tagCloud"]);
     $matrix = new SearchMatrix();
     $matrix->addWords(array_slice(array_keys($this->tagcloud), 0, $analyser["consistencyCount"]));
     $matrix->addSearchInString("title", $this->metatags["title"]);
     $matrix->addSearchInString("description", $this->metatags["description"]);
     $matrix->addSearchInString("keywords", $this->metatags["keywords"]);
     $matrix->addSearchInArrayRecursive("headings", $this->content["headings"]);
     $this->matrix = $matrix->generate();
     $optimization = new Optimization($this->domain);
     $analytics = new AnalyticsFinder($this->html);
     $this->misc['sitemap'] = $optimization->getSitemap();
     $this->misc['robotstxt'] = $optimization->hasRobotsTxt();
     $this->misc['gzip'] = $optimization->hasGzipSupport();
     $this->misc['analytics'] = $analytics->findAll();
     $this->score = $this->getScore();
     $p = new PageSpeedInsights($this->domain, $this->CI->config->item('googleApiKey'));
     $p->setLocale($this->CI->config->item('langshort'));
     $results = $p->getResults();
     $this->pagespeed = $results;
     // Social grader
     $s = new Socialgrader($this->html, $this->domain);
     $this->grader = $s->grader();
 }
    /**
     * Prints tag cloud for attribute <code>attribute</code> to <code>$wgOut</code>
     *
     * @param $attribute String: attribute
     */
    private function printTagCloud($attribute)
    {
        global $wgOut;
        try {
            $tagCloud = new TagCloud($attribute);
            // Context menu
            $wgOut->addHTML('<ul id="fptc_contextMenu" class="contextMenu">
					<li class="browse">
						<a href="#browse">' . wfMsg('fptc-context-menu-browse') . '</a>
					</li>
					<li class="fptc_suggestions separator">
						' . wfMsg('fptc-context-menu-similar-tags') . '
					</li>
				</ul>');
            // Print tags
            foreach ($tagCloud->getTags() as $tag) {
                $this->printTag($tag, $attribute);
            }
            $wgOut->addHTML('<div style="clear:both"></div>');
        } catch (InvalidAttributeException $e) {
            if ($attribute) {
                // Attribute not found -> show error
                $wgOut->addHTML('<span style="color:red; font-weight:bold;">' . wfMsg('fptc-invalid-attribute') . '</span>');
            }
        }
    }
Exemplo n.º 16
0
<?php

include "TagCloud.php";
$cloud = new TagCloud();
$cloud->setOption('transliterate', false);
$cloud->addTag(array('tag' => 'PHP', 'level' => 5));
$cloud->addTag(array('tag' => 'Mysql', 'level' => 4));
$cloud->addTag(array('tag' => 'Reflux', 'level' => 3));
$cloud->addTag(array('tag' => 'Gulp', 'level' => 3));
$cloud->addTag(array('tag' => 'Javascript', 'level' => 5));
$cloud->addTag(array('tag' => 'Composer', 'level' => 4));
$cloud->addTag(array('tag' => 'Jenkins', 'level' => 2));
$cloud->addTag(array('tag' => 'HTML5', 'level' => 5));
$cloud->addTag(array('tag' => 'RAML', 'level' => 4));
$cloud->addTag(array('tag' => 'Python', 'level' => 2));
$cloud->addTag(array('tag' => 'Compass', 'level' => 4));
$cloud->addTag(array('tag' => 'Memcache', 'level' => 3));
$cloud->addTag(array('tag' => 'CouchDB', 'level' => 2));
$cloud->addTag(array('tag' => 'Apache', 'level' => 4));
$cloud->addTag(array('tag' => 'Flash Media Server', 'level' => 4));
$cloud->addTag(array('tag' => 'Saas', 'level' => 4));
$cloud->addTag(array('tag' => 'JSON Schema', 'level' => 2));
$cloud->addTag(array('tag' => 'API REST', 'level' => 5));
$cloud->addTag(array('tag' => 'App cache', 'level' => 4));
$cloud->addTag(array('tag' => 'Nagios', 'level' => 1));
$cloud->addTag(array('tag' => 'NPM', 'level' => 3));
$cloud->addTag(array('tag' => 'ReactJS', 'level' => 3));
$cloud->addTag(array('tag' => 'IndexedDB', 'level' => 4));
$cloud->addTag(array('tag' => 'Nginx', 'level' => 2));
$cloud->addTag(array('tag' => 'CSS', 'level' => 5));
$cloud->addTag(array('tag' => 'Express', 'level' => 3));
Exemplo n.º 17
0
 /**
  * Reads the tags of this board.
  */
 protected function readTags()
 {
     // include files
     require_once WCF_DIR . 'lib/data/tag/TagCloud.class.php';
     // get tags
     $tagCloud = new TagCloud(WCF::getSession()->getVisibleLanguageIDArray());
     $this->tags = $tagCloud->getTags();
 }