mejoras en la nube de etiquetas

This commit is contained in:
humano 2017-11-19 05:39:52 -05:00
parent f5f6c110cb
commit 38b9848a58

View File

@ -120,6 +120,7 @@ if ( strlen($value)>3) {//no smaller than X and not in banned
$keywords="";
$cantidades="";
$count = 0;
foreach ($wordCounter as $key => $value){
@ -127,6 +128,7 @@ foreach ($wordCounter as $key => $value){
if($count < $cantidad){
//$keywords[] =$key;
$keywords[] ="$key";
$cantidades[$key] ="$value";
}else{break;} $count++;
}
}
@ -137,6 +139,9 @@ if($tags !=''){
$nube ="";
$min = min($cantidades);
$max = max($cantidades);
$diferencia = $max - $min;
foreach($tags as $c=>$valor){
//foreach($wordCounter as $c=>$valor){
//$valor = $tags[0];
@ -160,11 +165,13 @@ foreach($tags as $c=>$valor){
$ht = str_replace(array(' '), '', $c);
$limpios[] = $c;
$cant = $wordCounter[$c];
$cant = $cantidades[$c];
$valor_relativo = round((($cant - $min) / $diferencia) * 10);
$size = ($cant/4);
$tag_adicional .= "<SPAN title='$cant' CLASS='badge label-warning' draggable='true' id='#$ht ' ondragstart=\"evdragstart(event,this)\">$c </span> " ;
$nube .= "<a href='#' title='$c $cant' style='font-size: $size"."vh' id='#$ht ' >$c</a> " ;
$array_prueba = print_r($wordCounter,true);
$nube .= "<a href='#' title='$c $cant' style='font-size: $valor_relativo"."vh' id='#$ht ' >$c </a> " ;
}
}
}
@ -176,7 +183,7 @@ foreach($tags as $c=>$valor){
return $array_nombres_compuestos[0];
}elseif($tipo=="nube") {
//return $compuestos;
return $nube;
return "$nube";
}elseif($tipo=="limpio") {
//return $compuestos;
return $limpios;