mejoras en la nube de etiquetas

This commit is contained in:
humano 2017-11-19 05:39:52 -05:00
parent f5f6c110cb
commit 38b9848a58
1 changed files with 11 additions and 4 deletions

View File

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