|
[MOD] Search, Tag, Word Cloud August 24, 2007 08:30AM |
Registered: 5 years ago Posts: 4 |
|
Re: [MOD] Search, Tag, Word Cloud September 06, 2007 01:52AM |
Registered: 5 years ago Posts: 13 |
|
Re: [MOD] Search, Tag, Word Cloud October 20, 2007 01:29PM |
Registered: 5 years ago Posts: 6 |
|
Re: [MOD] Search, Tag, Word Cloud October 21, 2007 06:17AM |
Registered: 6 years ago Posts: 129 |
|
Re: [MOD] Search, Tag, Word Cloud October 26, 2007 09:43PM |
Registered: 5 years ago Posts: 7 |
|
Re: [MOD] Search, Tag, Word Cloud October 28, 2007 07:02PM |
Registered: 5 years ago Posts: 6 |
|
Re: [MOD] Search, Tag, Word Cloud October 28, 2007 10:15PM |
Registered: 5 years ago Posts: 43 |
|
Re: [MOD] Search, Tag, Word Cloud October 29, 2007 11:31PM |
Registered: 5 years ago Posts: 43 |
|
Re: [MOD] Search, Tag, Word Cloud October 30, 2007 12:07AM |
Registered: 6 years ago Posts: 12 |
|
Re: [MOD] Search, Tag, Word Cloud June 04, 2008 01:00AM |
Registered: 5 years ago Posts: 29 |
|
Re: [MOD] Search, Tag, Word Cloud June 05, 2008 06:37AM |
Registered: 6 years ago Posts: 21 |
|
Re: [MOD] Search, Tag, Word Cloud June 15, 2008 08:27AM |
Registered: 5 years ago Posts: 4 |
|
Re: [MOD] Search, Tag, Word Cloud June 23, 2008 09:28PM |
Registered: 4 years ago Posts: 1 |
|
Re: [MOD] Search, Tag, Word Cloud July 19, 2008 06:53PM |
Registered: 5 years ago Posts: 18 |
With prefix search_)
|
Re: [MOD] Search, Tag, Word Cloud November 20, 2008 07:24AM |
Registered: 4 years ago Posts: 17 |
|
Re: [MOD] Search, Tag, Word Cloud December 11, 2008 12:35PM |
Registered: 4 years ago Posts: 4 |
Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[www.w3.org];
<html xmlns="[www.w3.org];
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>SearchCloud</title>
<style>
#tags {
float: none;
width: 220px;
margin: 10px 0px;
padding: 10px;
background:#ececec;
color:#333;
border: 1px dashed #cccccc;
text-align: justify;
}
#tags .title {
font-family:arial;
font-size:16px;
font-weight:bold;
background-color: transparent;
padding: 4px 4px;
color:#808080;
}
#tags a {
color:#39c;
background-color: transparent;
padding: 2px 4px;
white-space: nowrap;
text-decoration: none;
font-family:arial;
}
#tags a:hover {
color:#39c;
background: silver;
text-decoration: none;
}
</style>
</head>
<body>
<div id="tags">
<div class="title">Populaire Zoektermen</div>
<?php
$include_dir = "./include";
$template_dir = "./templates";
$settings_dir = "./settings";
$language_dir = "./languages";
require_once("$settings_dir/database.php"
require_once("$language_dir/en-language.php"
require_once("$include_dir/searchfuncs.php"
require_once("$include_dir/categoryfuncs.php"
include "$settings_dir/conf.php";
// Snippet taken from [prism-perfect.net]
// include "/path/to/public_html/search/settings/database.php";
// include "/path/to/public_html/search/settings/conf.php";
// In the SQL below, change these three things:
// thing is the column name that you are making a tag cloud for
// id is the primary key
// my_table is the name of the database table
// added by essexboyracer:
// dont return zero result words and limit the cloud to 10 phrases
$query = "SELECT query AS tag, COUNT(*) AS quantity
FROM ".$mysql_table_prefix."query_log
WHERE results > 0
GROUP BY query
ORDER BY query ASC
LIMIT 10";
$result = mysql_query($query) or die(mysql_error());
// here we loop through the results and put them into a simple array:
// $tag['thing1'] = 12;
// $tag['thing2'] = 25;
// etc. so we can use all the nifty array functions
// to calculate the font-size of each tag
while ($row = mysql_fetch_array($result)) {
$tags[$row['tag']] = $row['quantity'];
}
// change these font sizes if you will
$max_size = 30; // max font size in %
$min_size = 11; // min font size in %
// get the largest and smallest array values
$max_qty = max(array_values($tags));
$min_qty = min(array_values($tags));
// find the range of values
$spread = $max_qty - $min_qty;
if (0 == $spread) { // we don't want to divide by zero
$spread = 1;
}
// determine the font-size increment
// this is the increase per tag quantity (times used)
$step = ($max_size - $min_size)/($spread);
// loop through our tag array
foreach ($tags as $key => $value) {
// calculate CSS font-size
// find the $value in excess of $min_qty
// multiply by the font-size increment ($size)
// and add the $min_size set above
$size = $min_size + (($value - $min_qty) * $step);
// uncomment if you want sizes in whole %:
// $size = ceil($size);
// you'll need to put the link destination in place of the #
// (assuming your tag links to some sort of details page)
echo '<a href="./search.php?query='.$key.'&search=1" style="font-size: '.$size.'px"';
// perhaps adjust this title attribute for the things that are tagged
echo ' title="'.$value.' things tagged with '.$key.'"';
echo '>'.$key.'</a> ';
// notice the space at the end of the link
}
?>
</div>
</body>
</html>
Change to this:Quote
break;
}
include "$template_dir/$template/footer.html";
?>
Quote
break;
}
echo '<div align=center>';
include "cloud.php";
echo '</div>';
include "$template_dir/$template/footer.html";
?>
|
Re: [MOD] Search, Tag, Word Cloud June 04, 2009 06:26PM |
Registered: 4 years ago Posts: 15 |
|
Re: [MOD] Search, Tag, Word Cloud July 01, 2009 08:25PM |
Registered: 3 years ago Posts: 1 |
|
Re: [MOD] Search, Tag, Word Cloud July 22, 2009 06:45AM |
Registered: 4 years ago Posts: 17 |
|
Re: [MOD] Search, Tag, Word Cloud August 13, 2009 10:15PM |
Registered: 3 years ago Posts: 1 |
|
Re: [MOD] Search, Tag, Word Cloud September 28, 2009 09:53PM |
Registered: 3 years ago Posts: 4 |
|
Re: [MOD] Search, Tag, Word Cloud September 30, 2009 11:55PM |
Registered: 4 years ago Posts: 2 |
|
Re: [MOD] Search, Tag, Word Cloud January 15, 2010 12:20PM |
Registered: 3 years ago Posts: 4 |
|
Re: [MOD] Search, Tag, Word Cloud November 11, 2011 07:08PM |
Registered: 4 years ago Posts: 38 |
|
Re: [MOD] Search, Tag, Word Cloud November 11, 2011 08:17PM |
Registered: 4 years ago Posts: 38 |
echo '<a href="./search.php?query='.$key.'&search=1" style="font-size: '.$size.'px"';
echo '<a href="./search.php?query='.urlencode($key).'&search=1" style="font-size: '.$size.'px"';
|
Re: [MOD] Search, Tag, Word Cloud November 24, 2011 10:37PM |
Registered: 1 year ago Posts: 18 |
|
Re: [MOD] Search, Tag, Word Cloud November 28, 2011 08:07PM |
Registered: 4 years ago Posts: 38 |
|
Re: [MOD] Search, Tag, Word Cloud November 29, 2011 03:37PM |
Registered: 1 year ago Posts: 18 |