Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
searchcloud
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2012-02-01 02:38:03
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



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.php



add 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&amp;";

$addparam .= "c$row[id]=1&amp;";

$thisurl .= "c$row[id]=1&amp;";

}

$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]

searchcloud.rar
Download
2012-02-01_032708.png
2012-02-01_032708.png
Unknown User
2012-02-01 15:16:21
I don't like cloud system but nice one  ;)

may be it's better creating a folder js or script in root and place into your .js and .swf
Unknown User
2012-02-01 17:37:23
I corrected my code ;)
Unknown User
2012-09-16 18:30:26


require_once("cloud/searchcloud_block.php");



this makes the index go white php error when you make something make sure its working before posting it
Unknown User
2014-10-14 10:16:56
I use a block for the records in Search Cloud and cache this for improvement of the DB:

<?php

begin_block(T_("Search_Cloud"), CENTER);

if ($site_config["MEMBERSONLY"] && !$CURUSER) {

echo "<br /><br /><b><center>".T_("BROWSE_MEMBERS_ONLY")."</center><br /><br />";

} else {

require_once("backend/searchcloud_functions.php");

$expire = 120; // time in seconds

if (($cloudrecords = $TTCache->Get("searchcloudblock", $expire)) === false){

$cloudrecords = (cloud()!= '' ? cloud() : 'No Search records');

$TTCache->Set("searchcloudblock", $cloudrecords, $expire);

}

?>

<style type="text/css">

.tag_cloud

{

padding:

3px;

text-decoration: none;

font-family: "Trebuchet MS",Arial,Helvetica,sans-serif;

}

.tag_cloud:link

{

color: #0099FF; text-decoration:none;

}

.tag_cloud:visited

{

color: #00CCFF;

}

.tag_cloud:hover

{

background: #tranparent; color: #999;text-decoration:underline;

}

.tag_cloud:active

{

color: #0000FF; background: #FFFFFF;

}

</style>

<div id="wrapper_search" style="width:90%;border:none;">

<?php

//print out the tag cloud

print $cloudrecords;

}

?>

</div><br /><br />

<?php

end_block();

?>

In language:

//Search Cloud
$LANG["Search_Cloud"] = "Search Cloud";
Unknown User
2014-10-15 11:07:19
SAS look  ;)

good work create table sql


CREATE TABLE `searchcloud` (
`id` int(10) unsigned NOT NULL auto_increment,
`searchedfor` varchar(50) NOT NULL,
`howmuch` int(10) NOT NULL,
KEY `howmuch_searchedfor` (`howmuch`,`searchedfor`),
KEY `searchedfor` (`searchedfor`),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Unknown User
2014-10-15 17:02:31
other solution


CREATE TABLE `searchcloud` (

`id` int(10) unsigned NOT NULL auto_increment,

`searchedfor` varchar(50) NOT NULL,

`howmuch` int(10) NOT NULL,

KEY `howmuch_searchedfor` (`howmuch`,`searchedfor`),

KEY `searchedfor` (`searchedfor`),

PRIMARY KEY (`id`)

) ENGINE=MyISAM;

Unknown User
2014-10-16 14:36:59
error ligne 21 searchcloud_block.php

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7110"]searchcloud_block.php[/url]

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7111"]cloud.rar[/url]
searchcloud_block.php
Download
cloud.rar
Download
Unknown User
2014-10-16 21:08:49
change

begin_block
to

begin_frame
and

end_block
to


end_frame
Unknown User
2014-10-17 02:01:16
thank Artic  :)
Unknown User
2014-10-19 09:48:31
Hi,

Very nice cloud. How can I print only keywords that have over 50 searches ?

(Hope you understand my poor english)

Thanks
Unknown User
2014-10-19 14:04:11
searchcloud_block.php

change

$result = mysql_query("SELECT * FROM searchcloud ORDER BY howmuch DESC LIMIT 30");
to

$result = mysql_query("SELECT * FROM searchcloud where howmuch >49 ORDER BY howmuch DESC LIMIT 30");
should do that if wanted.
Unknown User
2014-10-19 15:01:52
mysql_query

???

This is not quite :


SQL_Query_exec
Unknown User
2014-10-19 15:27:16
Great !

Thanks ArcticWolf  :)
Unknown User
2014-10-19 15:50:03
Easy take this code updated

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7113"]searchcloud_block.php[/url]
searchcloud_block.php
Download
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728