hello community I share a personal mods, to contribute to the forum, if only everyone would share a mod forum would be filled
sorry for my english
add or at your convenience
in the cloud made ??a js file and put swfobject.js
in the cloud made ??a flash file and put tagcloud.swf
enjoy
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5537"]searchcloud.rar[/url]
sorry for my english
CREATE TABLE IF NOT EXISTS `searchcloud` (
`id` int(10) unsigned NOT NULL auto_increment,
`searchedfor` varchar(50) NOT NULL,
`howmuch` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `howmuch_searchedfor` (`howmuch`,`searchedfor`),
KEY `searchedfor` (`searchedfor`)
) ENGINE=MyISAM;
index.phpadd or at your convenience
require_once("cloud/searchcloud_block.php");
create a searchcloud_block.php with the code below, then creates a folder to place it in cloud
<?php
function tag_info()
{
$arr = array();
$result = mysql_query("SELECT * FROM searchcloud ORDER BY howmuch DESC LIMIT 30");
while($row = mysql_fetch_array($result))
{
$arr[$row['searchedfor']] = $row['howmuch'];
}
return $arr;
}
function cloud()
{
$cloud_html = "";
$tags = tag_info();
foreach ($tags as $tag => $count)
{
$cloud_html .= "<a href='torrents-search.php?search=".urlencode($tag)."' style='11'>".htmlentities(stripslashes($tag))."</a>";
}
return $cloud_html;
}
begin_frame("keywords");
?>
<div id="searchcloud">
<div align="center">
<script type="text/javascript" src="cloud/js/swfobject.js"></script>
<div id="flashcontent"></div>
<script type="text/javascript">
var so = new SWFObject("cloud/flash/tagcloud.swf", "tagcloud", "100%", "375", "7", "#c0c0c0");
so.addVariable("tcolor", "0x204987");
so.addParam("wmode", "transparent");
so.addVariable("tcolor2", "0xff6d06");
so.addVariable("hicolor", "0xff6d06");
so.addVariable("mode", "");
so.addVariable("distr", "true");
so.addVariable("tspeed", "80");
so.addVariable("tagcloud", "<tags><?php echo cloud(); ?></tags>");
so.write("flashcontent");
</script>
</div>
</div>
<?php
end_frame();
?>
torrents-search.php
//GET SEARCH STRING
$searchstr = trim(unesc($_GET["search"]));
$cleansearchstr = searchfield($searchstr);
if (empty($cleansearchstr))
unset($cleansearchstr);
$thisurl = "torrents-search.php?";
$addparam = "";
$wherea = array();
$wherecatina = array();
$wherea[] = "banned = 'no'";
$wherecatina = array();
$wherecatin = "";
$res = mysql_query("SELECT id FROM categories");
while($row = mysql_fetch_assoc($res)){
if ($_GET["c$row[id]"]) {
$wherecatina[] = $row[id];
$addparam .= "c$row[id]=1&";
$addparam .= "c$row[id]=1&";
$thisurl .= "c$row[id]=1&";
}
$wherecatin = implode(", ", $wherecatina);
}
if ($wherecatin)
$wherea[] = "category IN ($wherecatin)";
replaced by
//GET SEARCH STRING
$searchstr = unesc($_GET["search"]);
$cleansearchstr = searchfield($searchstr);
if (empty($cleansearchstr))
unset($cleansearchstr);
$thisurl = "torrents-search.php?";
if ($cleansearchstr)
{
$searchcloud = sqlesc($searchstr);
$r = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM searchcloud WHERE searchedfor = $searchcloud"));
$a = $r[0];
if ($a)
{
mysql_query("UPDATE searchcloud SET howmuch = howmuch + 1 WHERE searchedfor = $searchcloud") or die(mysql_error());
}
else
{
mysql_query("INSERT INTO searchcloud (searchedfor, howmuch) VALUES ($searchcloud, 1)") or die(mysql_error());
}
}
$addparam = "";
$wherea = array();
$wherecatina = array();
$wherea[] = "banned = 'no'";
in the cloud made ??a js file and put swfobject.js
in the cloud made ??a flash file and put tagcloud.swf
enjoy
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5537"]searchcloud.rar[/url]