но из какого материала он берет эти title , introtext , fulltext. у меня почему-то не из текущего.
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $mosConfig_offset, $mosConfig_live_site, $mainframe;
ini_set('memory_limit', '16M');
function do_text($input_text)
{
$input_text = strip_tags($input_text);
$input_text = trim($input_text);
$input_text = html_entity_decode($input_text,ENT_QUOTES,'cp1251');
$input_text = preg_replace('/\s\s+/', ' ', $input_text);
$input_text = str_replace('_', '-', $input_text);
$input_text = str_replace('-', ' ', $input_text);
$input_text = str_replace('+', ' ', $input_text);
$input_text = str_replace('\'', ' ', $input_text);
$input_text = str_replace('\\', '-', $input_text);
$input_text = str_replace('/', ' ', $input_text);
$input_text = str_replace('{mosimage}', '', $input_text);
$input_text = str_replace('{mospagebreak}', '', $input_text);
$input_text = str_replace('«', ' ', $input_text);
$input_text = str_replace('»', ' ', $input_text);
$input_text = str_replace('.', ' ', $input_text);
$input_text = preg_replace('|["<>!()$%?&^#:;,.*=]|i', '', $input_text);
$input_text = strtolower($input_text);
return $input_text;
}
function getTexts($limit)
{
$result = null;
$query = "SELECT `title` , `introtext` , `fulltext` FROM #__content WHERE state = 1 LIMIT 0,".$limit." ";
global $database;
$database->setQuery( $query );
$result = $database->loadObjectList();
return $result;
}
$format = intval ( $params->get( 'format', 0 ) );
$wmode = intval ( $params->get( 'wmode', 0 ) );
$max_lenght = intval( $params->get( 'max_lenght', 20 ) );
$min_lenght = intval( $params->get( 'min_lenght', 5 ) );
$max_rows = intval( $params->get( 'max_rows', 100 ) );
$speed = intval ( $params->get( 'speed',100 ) );
$alt_text = strval ( $params->get( 'alt_text', 'No Flash!' ) );
$width = intval ( $params->get( 'width', 200 ) );
$height = intval ( $params->get( 'height', 200 ) );
$distr = intval ( $params->get( 'distr', '0' ) );
$bgcolor = strval ( $params->get( 'bgcolor', 'FFFFFF' ) ) ;
$text_color = strval ( $params->get( 'text_color', '000000' ) );
$text_color2 = strval ( $params->get( 'text_color2', 'f57809' ) );
$hover_color = strval ( $params->get( 'hover_color', 'ed4f09' ) );
$black_list = strval ( $params->get( 'black_list' ) );
$white_list = strval ( $params->get( 'white_list' ) );
$font_size_max = intval ( $params->get( 'font_size_max', 30 ) );
$font_size_min = intval ( $params->get( 'font_size_min', 5 ) );
$noflash = intval ( $params->get( 'noflash', 0 ) );
$result_text = getTexts($max_rows);
$hei_results=1;
if ( $format==0) {
$kolvo = intval( $params->get( 'kolvo', 20 ) );
} else {
$kolvo = '-1';
}
if ($wmode==0) {
$transparent = '';
} else {
$transparent = "transparent";
}
if ($distr==0) {
$distr_effect = 'true';
} else {
$distr_effect = 'fals';
}
if($hei_results==1)
{
foreach($result_text as $registr)
{
$grand_text[] = do_text($registr->title)." ".do_text($registr->introtext)." ".do_text($registr->fulltext);
}
$grand_text = implode(' ',$grand_text);
$grand_text = strtolower($grand_text);
$my_array = preg_split("/ /", $grand_text);
$my_array_counts = array_count_values( $my_array );
if($black_list)
{
$black_list_array = explode (",",$black_list);
foreach($black_list_array as $black_word)
{
if (isset($my_array_counts[trim($black_word)]))
{
unset($my_array_counts[trim($black_word)]);
}
}
}
$white_list_array = explode (",",$white_list);
foreach($white_list_array as $white_word)
{
$white_list_array = explode ("=",$white_word);
$words_array_filter[$white_list_array[0]] = $white_list_array[0];
}
arsort( $my_array_counts);
$i = 0;
foreach($my_array_counts as $k=>$v)
{
if ($i<=$kolvo AND strlen($k)>=$min_lenght AND strlen($k)<=$max_lenght)
{
$words_array_filter[$k] = $v;
$i++;
}
}
}
foreach($my_array_counts as $k=>$v)
{
if ($i<=$kolvo AND strlen($k)>=$min_lenght AND strlen($k)<=$max_lenght)
{
$words_array_filter[$k] = $v;
$i++;
}
}
if($hei_results==1)
{
foreach($words_array_filter as $k=>$v)
{
$vrate='';
if ($format==0) {
@$tags .= "<a href='".$mosConfig_live_site."/index.php?option=com_search%26amp;searchword=".$k."' style='font-size:".rand($font_size_min,$font_size_max)."px;'>".$k."</a>";
} else {
@$tags .= "<a href='".$mosConfig_live_site."/index.php?option=com_search%26amp;searchword=".$k."' style='font-size:".rand($font_size_min,$font_size_max)."px;'>".$k."</a>";
}
}
}
?>
<div id="wpcumuluswidgetcontent">
<?php
if ($noflash==0) {
echo htmlspecialchars('<tags>');
foreach($words_array_filter as $k=>$v)
{
echo "<a href='".$mosConfig_live_site."/index.php?option=com_search&searchword=".$k."' style='font-size:12px;'>".$k."</a>\n";
}
echo htmlspecialchars('</tags>');
} else {
echo $alt_text;
}
?>
</div>
<script type="text/javascript">
var rnumber = Math.floor(Math.random()*9999999);
var widget_so = new SWFObject("<?php echo $GLOBALS['mosConfig_live_site'];?>/modules/mod_cloud3d/tagcloud.swf?r="+rnumber, "tagcloudflash", "<?php echo $width;?>", "<?php echo $height;?>", "9", "#<?php echo $bgcolor;?>");
widget_so.addParam("wmode", "<?php echo $transparent ?>")
widget_so.addParam("allowScriptAccess", "always");
widget_so.addVariable("tcolor", "0x<?php echo $text_color;?>");
widget_so.addVariable("tcolor2", "0x<?php echo $text_color2 ?>");
widget_so.addVariable("hicolor", "0x<?php echo $hover_color ?>");
widget_so.addVariable("tspeed", "<?php echo $speed;?>");
widget_so.addVariable("distr", "<?php echo $distr_effect;?>");
widget_so.addVariable("mode", "tags");
widget_so.addVariable("tagcloud", "<?php echo htmlspecialchars('<tags>') . htmlspecialchars( str_replace( " ", " ", $tags)) . htmlspecialchars('</tags>') ?>");
widget_so.write("wpcumuluswidgetcontent");
</script>