Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
<div align="center">
<div class="tag_cloud" style="width: 300px; font-family: Arial, Helvetica, sans-serif; text-align: justify;">
<?php
// options /////////////////////////
// database connect
$myserveris = "localhost";
$myusername = "username";
$mypassword = "password";
$mydatabase = "database";
$mytable = "plogger_pictures";
$mycontentcolumn = "description";
// search url
$mysearchurl = "http://www.yourdomain.com/plogger/?level=search&searchterms=";
// maximum number of words to display
$mynumberofwords = "50";
// random font size
$minFontSize = "8";
$maxFontSize = "35";
// scroll down to banned words to remove common words
// END OPTIONS ////////////////////////////////////////////////////////////////////
////////////////////////////////
// remove odd ball characters //
////////////////////////////////
function normalizeString ($s = '')
{
$str = htmlentities($s);
$str = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $str);
$str = preg_replace("/\s+/i", ' ', $str);
$str = trim($str);
return $str;
}
////////////////////////////////////////////
// remove banned and high frequency words //
////////////////////////////////////////////
function removeCommonWords($input){
$commonWords = array('a','the','I','is','not');
return preg_replace('/\b('.implode('|',$commonWords).')\b/','',$input);
}
//////////////////////
// randomize arrays //
//////////////////////
function randomize_array($array)
{
$rand_items = array_rand($array, count($array));
$new_array = array();
foreach($rand_items as $value)
{
$new_array[$value] = $array[$value];
}
return $new_array;
}
//////////////////////
// connect to mysql //
//////////////////////
mysql_connect("$myserveris", "$myusername", "$mypassword") or die(mysql_error());
mysql_select_db("$mydatabase") or die(mysql_error());
$query = "SELECT $mycontentcolumn FROM $mytable WHERE $mycontentcolumn LIKE '%'";
$result = mysql_query($query) or die(mysql_error());
$countedrows = mysql_num_rows($result);
//////////////////////////////
// create arrays from query //
//////////////////////////////
$thiscount=0;
while($row = mysql_fetch_array($result)){
$loremA[] = $row[0];
$thiscount++;
}
///////////////////////////////////
// make query row results random //
///////////////////////////////////
$loremB = implode(" ",randomize_array($loremA));
// combine the arrays and make all the words random
$loremC = explode(" ",$loremB);
$loremD = implode(" ",randomize_array($loremC));
// clean the words....
$loremE = normalizeString(stripslashes(strip_tags(removeCommonWords($loremD))))." ";
///////////////////////////
// create the cloud .... //
///////////////////////////
$loremipsum = explode(" ",$loremE);
$wordcount = 0;
foreach($loremipsum as $value) {
echo "<a style=\"font-size:" . rand($minFontSize,$maxFontSize) . "px; text-decoration: none;\" href=\"".$mysearchurl.$value."\">".$value."</a> ";
if($wordcount==$mynumberofwords-1)
{
break;
}
$wordcount++;
}
?>
</div>
</div>
<meta name="ROBOTS" content="NOINDEX,FOLLOW" />
in head of page. On my Plogger site, search engines started to index a bunch of this search results pages and page juice was flowing to it. After I made this addition, they stoped and only indexed valuable pages.
1 to 18 of 18