Exemple #1
0
        $cloud_html = '';
        $cloud_tags = array();
        foreach ($tags as $tag => $count) {
            $size = $small + ($count - $minimum_count) * ($big - $small) / $spread;
            //set up colour array for font colours.
            $colour_array = array('yellow', 'brown', 'green', 'blue', 'pink', 'red', 'orange', '#0099FF');
            //spew out some html malarky!
            $cloud_tags[] = '<a style="color:' . $colour_array[mt_rand(0, 5)] . '; font-size: ' . floor($size) . 'px' . '" class="tag_cloud" href="index.php?page=torrents&amp;search=' . urlencode($tag) . '&amp;catagory=0' . '" title="\'' . htmlentities($tag) . '\' returned a count of ' . $count . '">' . htmlentities(stripslashes($tag)) . '</a>';
        }
        $cloud_html = join("\n", $cloud_tags) . "\n";
        return $cloud_html;
    }
    ?>
<style type="text/css">
.tag_cloud
{padding: 3px; text-decoration: none;
font-family: verdana; }
.tag_cloud:link { color: #0099FF; text-decoration:none;}
.tag_cloud:visited { color: #00CCFF; }
.tag_cloud:hover { color: #0000FF; background: #00CCFF; }
.tag_cloud:active { color: #0000FF; background: #FFFFFF; }
</style>


<div id="wrapper" style="width:99%;border:0;">
<?php 
    //print out the tag cloud
    print "<center><b>";
    print cloud();
    print "</b></center>";
}
Exemple #2
0
    //list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, "browse.php?" . $addparam);
    $pager = pager($torrentsperpage, $count, "browse.php?" . $addparam);
    $query = "SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.type,  torrents.comments,torrents.numfiles,torrents.filename,torrents.owner,IF(torrents.nfo <> '', 1, 0) as nfoav," . "categories.name AS cat_name, categories.image AS cat_pic, users.username FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id {$where} {$orderby} {$pager['limit']}";
    $res = mysql_query($query) or die(mysql_error());
} else {
    unset($res);
}
if (isset($cleansearchstr)) {
    $title = "{$lang['browse_search']}\"{$searchstr}\"";
} else {
    $title = '';
}
$HTMLOUT .= "<div id='wrapper' style='width:90%;border:1px solid black;background-color:pink;'>";
//print out the tag cloud
require_once "include/searchcloud_functions.php";
$HTMLOUT .= cloud() . "</div><br /><br />";
$HTMLOUT .= "<form method='get' action='browse.php'>\r\n    <table class='bottom'>\r\n    <tr>\r\n    <td class='bottom'>\r\n      <table class='bottom'>\r\n      <tr>";
$i = 0;
foreach ($cats as $cat) {
    $catsperrow = 7;
    $HTMLOUT .= $i && $i % $catsperrow == 0 ? "</tr><tr>" : "";
    $HTMLOUT .= "<td class='bottom' style='padding-bottom: 2px;padding-left: 7px;align:left;'>\r\n      <input name='c" . $cat['id'] . "' type=\"checkbox\" " . (in_array($cat['id'], $wherecatina) ? "checked='checked' " : "") . "value='1' /><a class='catlink' href='browse.php?cat={$cat['id']}'>" . htmlspecialchars($cat['name']) . "</a></td>\n";
    $i++;
}
$alllink = "<div align='left'>(<a href='browse.php?all=1'><b>{$lang['browse_show_all']}</b></a>)</div>";
$ncats = count($cats);
$nrows = ceil($ncats / $catsperrow);
$lastrowcols = $ncats % $catsperrow;
if ($lastrowcols != 0) {
    if ($catsperrow - $lastrowcols != 1) {
        $HTMLOUT .= "<td class='bottom' rowspan='" . ($catsperrow - $lastrowcols - 1) . "'>&nbsp;</td>";
    $pager = pager($torrentsperpage, $count, "browse.php?" . $addparam);
    $query = "SELECT id, search_text, category, leechers, seeders, bump, release_group, subs, name, times_completed, size, added, poster, descr, type, free, freetorrent, silver, comments, numfiles, filename, anonymous, sticky, nuked, vip, nukereason, newgenre, description, owner, username, youtube, checked_by, IF(nfo <> '', 1, 0) as nfoav," . "IF(num_ratings < {$INSTALLER09['minvotes']}, NULL, ROUND(rating_sum / num_ratings, 1)) AS rating " . "FROM torrents {$where} {$orderby} {$pager['limit']}";
    $res = sql_query($query) or sqlerr(__FILE__, __LINE__);
} else {
    unset($query);
}
if (isset($cleansearchstr)) {
    $title = "{$lang['browse_search']} {$searchstr}";
} else {
    $title = '';
}
$HTMLOUT .= "<div class='article' align='center'>";
if ($CURUSER['opt1'] & user_options::VIEWSCLOUD) {
    $HTMLOUT .= "<div id='wrapper' style='width:80%;border:1px solid black;background-color:pink;'>";
    //print out the tag cloud
    $HTMLOUT .= cloud() . "\n    </div>";
}
$HTMLOUT .= "<br /><br />\n    <form method='get' action='browse.php'>\n    <table class='bottom'>\n    <tr>\n    <td class='bottom'>\n    <table class='bottom'>\n    <tr>";
$i = 0;
foreach ($cats as $cat) {
    $HTMLOUT .= $i && $i % $INSTALLER09['catsperrow'] == 0 ? "</tr><tr>" : "";
    $HTMLOUT .= "<td class='bottom' style=\"padding-bottom: 2px;padding-left: 7px\">\n      <input name='c" . (int) $cat['id'] . "' class=\"styled\" type=\"checkbox\" " . (in_array($cat['id'], $wherecatina) ? "checked='checked' " : "") . "value='1' /><a class='catlink' href='browse.php?cat=" . (int) $cat['id'] . "'> " . ($CURUSER['opt2'] & user_options_2::BROWSE_ICONS ? "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($cat['image']) . "' alt='" . htmlsafechars($cat['name']) . "' title='" . htmlsafechars($cat['name']) . "' />" : "" . htmlsafechars($cat['name']) . "") . "</a></td>\n";
    $i++;
}
$alllink = "<div align='left'>&nbsp;</div>";
$ncats = count($cats);
$nrows = ceil($ncats / $INSTALLER09['catsperrow']);
$lastrowcols = $ncats % $INSTALLER09['catsperrow'];
if ($lastrowcols != 0) {
    if ($INSTALLER09['catsperrow'] - $lastrowcols != 1) {
        $HTMLOUT .= "<td class='bottom' rowspan='" . ($INSTALLER09['catsperrow'] - $lastrowcols - 1) . "'>&nbsp;</td>";
Exemple #4
0
<?
	return cloud($argv, $argc);

	function cloud($argv, $argc) {
		global $fold, $site;

		$package_name = $argv[1];
		$package_main_file = $fold['repository'] . $package_name . $site['extensions'];

		if (empty($package_name)) {
			throw new Exception("Укажите название пакета", 3164);
		}
		if (!is_file($package_main_file)) {
			throw new Exception("Пакет \"$package_main_file\" не обнаружен в репозитории", 3165);
		}
		// if (!is_readable($package_name)) {
		// 	throw new Exception("Указанный пакет не доступен для чтения", 3166);
		// }
		echo '<div class="last-answer"></div><script>new_cloud("' . $package_name . '"); $(".last-answer").last().text("Запущен процесс #" + window.focus);</script>';
		// если доступна для чтения картинка /img/32x32/white/$package_name.png то подгружаем в миниатюру окна (poudle) эту картинку, иначе дефолтную для файлов 
	}