Nube de tags

Started by Aportadordelmix, April 20, 2010, 11:13:35 AM

Previous topic - Next topic

lean

Copia este codigo entero y no debe darte problemas porque a mi me funciono bien cuando hice la prueba:

global $db_prefix, $modSettings, $context, $scripturl;

      $result = db_query("SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
        FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l
        WHERE t.ID_TAG = l.ID_TAG
        GROUP BY l.ID_TAG
        ORDER BY l.ID DESC LIMIT " . $modSettings['smftags_set_cloud_tags_to_show'], __FILE__, __LINE__);
     
      $tags = array();
     
      $tags2 = array();
     
      while ($row = mysql_fetch_array($result))
      {
          $tags[$row['tag']] = $row['quantity'];
          $tags2[$row['tag']] = $row['ID_TAG'];
      }
     
      if(count($tags2) > 0)
      {
         $max_size = $modSettings['smftags_set_cloud_max_font_size_precent']; // max font size in %
         $min_size = $modSettings['smftags_set_cloud_min_font_size_precent']; // min font size in %

         $max_qty = max(array_values($tags));
         $min_qty = min(array_values($tags));
         
         $spread = $max_qty - $min_qty;
         if (0 == $spread)
          { // we don't want to divide by zero
             $spread = 1;
         }
         
         $step = ($max_size - $min_size)/($spread);
         
         $context['poptags'] = '';
         $row_count = 0;
         foreach ($tags as $key => $value)
         {
            $row_count++;
             // 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)
             $context['poptags'] .= '<a href="' . $scripturl . '?action=tags;tagid=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
             // perhaps adjust this title attribute for the things that are tagged
            $context['poptags'] .= ' title="'.$value.' things tagged with '.$key.'"';
            $context['poptags'] .= '>'.$key.'</a> ';
            if ($row_count > $modSettings['smftags_set_cloud_tags_per_row'])
            {
               $context['poptags'] .= '<br />';
               $row_count =0;
            }
             // notice the space at the end of the link
         }
      }

      echo $context['poptags'];

Aportadordelmix

No sera otra cosa?

Porque me sale esto:

Parse error: syntax error, unexpected $end in /home/martin/domains/aportesydescargas.com.ar/public_html/foro/Sources/PortalBlocks.php(3409) : eval()'d code on line 1

Y nose que significa!  :-X

lean

Si pusiste tal cual el codigo que te pase en un bloque php de simpleportal te tiene que salir. Sino te salio ni idea. A mi me funco en un foro de pruebas y en mi foro principal.

Blackdozer

Quote from: aportadordelmix on April 20, 2010, 02:26:03 PM
Quote from: lean on April 20, 2010, 02:21:23 PM
Estas copiando un cuarto del codigo completo. Fijate bien...  :'( :'(

Pero ese el codifgo que me paso black.

global $db_prefix, $modSettings, $context, $scripturl;      $result = db_query("SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity        FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l        WHERE t.ID_TAG = l.ID_TAG        GROUP BY l.ID_TAG        ORDER BY l.ID DESC LIMIT " . $modSettings['smftags_set_cloud_tags_to_show'], __FILE__, __LINE__);            $tags = array();            $tags2 = array();            while ($row = mysql_fetch_array($result))      {          $tags[$row['tag']] = $row['quantity'];          $tags2[$row['tag']] = $row['ID_TAG'];      }
Si miras bién yo te he passado bién el código y no yo...
Copia el codigo entero, dale a "selecionar todo" para cogerlo todo sin que te quede nada ;)

Aportadordelmix

Ya voy a probar si me funciona, lo marco como resuelto.

vicram10

el unico problema es que copias el codigo y lo que copias lo pones en 1 sola linea.. para que funcione debe estar asi mismo como black o lean te paso.. con los saltos de linea correspondiente.. el error es eso.. que lo copias y pegas pero todo esta en 1 sola linea

Aportadordelmix

Este es el codigo que pego en el bloque y no me aparece nada:

global $db_prefix, $modSettings, $context, $scripturl;
      $result = db_query("SELECT t.tag AS tag, l.ID_TAG, COUNT(l.ID_TAG) AS quantity
        FROM {$db_prefix}tags as t, {$db_prefix}tags_log as l
        WHERE t.ID_TAG = l.ID_TAG
        GROUP BY l.ID_TAG
        ORDER BY l.ID DESC LIMIT " . $modSettings['smftags_set_cloud_tags_to_show'], __FILE__, __LINE__);

      $tags = array();

      $tags2 = array();

      while ($row = mysql_fetch_array($result))
      {
          $tags[$row['tag']] = $row['quantity'];
          $tags2[$row['tag']] = $row['ID_TAG'];
      }
     
      if(count($tags2) > 0)
      {
         $max_size = $modSettings['smftags_set_cloud_max_font_size_precent']; // max font size in %                     
         $min_size = $modSettings['smftags_set_cloud_min_font_size_precent']; // min font size in %
         $max_qty = max(array_values($tags));
         $min_qty = min(array_values($tags));
         
         $spread = $max_qty - $min_qty;
         if (0 == $spread)
          { // we don't want to divide by zero           
             $spread = 1;
          }
           
          $step = ($max_size - $min_size)/($spread);
         
         $context['poptags'] = '';         
         $row_count = 0;         
         foreach ($tags as $key => $value)         
         {
            $row_count++;
            // 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)
            $context['poptags'] .= '<a href="' . $scripturl . '?action=tags;tagid=' . $tags2[$key] . '" style="font-size: '.$size.'%"';
            // perhaps adjust this title attribute for the things that are tagged
            $context['poptags'] .= ' title="'.$value.' things tagged with '.$key.'"';
            $context['poptags'] .= '>'.$key.'</a> ';
            if ($row_count > $modSettings['smftags_set_cloud_tags_per_row'])
            {
                $context['poptags'] .= '<br />';
                $row_count =0;
            }
             // notice the space at the end of the link
          }
        }
        echo $context['poptags'];

vicram10

dices que tienes el google tagged, pero yo no veo instalado ese mod en tu foro

Aportadordelmix

Hola!

Aca esta el mod que yo estoy usando:

Esos son los tags.

Eso esta bien?

Aportadordelmix

Creo que puede ser que no lo tengo instalado porque tuvimos que reeplazar el archivo subs.php porque habia tenido un problema hace poco.

A partir de entonces los mod que tengo instalado aparecen, pero alguno no funcionan como por ejemplo el googletagged, que cuando lo quiero desintalar me salen estos errores:

Ejecutar Modificación ./Themes/default/languages/Modifications.english.php Éxito
2. Ejecutar Modificación ./Themes/default/languages/Modifications.brazilian.php Omitiendo archivo
3. Ejecutar Modificación ./Themes/default/languages/Modifications.brazilian-utf8.php Omitiendo archivo
4. Ejecutar Modificación ./Themes/default/languages/Modifications.english-utf8.php Omitiendo archivo
5. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish-utf8.php Omitiendo archivo
6. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish_latin-utf8.php Omitiendo archivo
7. Ejecutar Modificación ./Themes/default/languages/Modifications.turkish.php Omitiendo archivo
8. Ejecutar Modificación ./Themes/default/languages/Modifications.turkish-utf8.php Omitiendo archivo
9. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish.php Omitiendo archivo
10. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish_latin.php Prueba fallida
11. Ejecutar Modificación ./Themes/default/style.css Prueba fallida
12. Ejecutar Modificación ./Themes/default/Display.template.php Éxito
13. Ejecutar Modificación ./Themes/default/index.template.php Prueba fallida
14. Ejecutar Modificación ./index.php Éxito
15. Ejecutar Modificación ./Sources/ManagePermissions.php Éxito
16. Ejecutar Modificación ./Sources/Subs.php Prueba fallida
17. Ejecutar Modificación ./Sources/Display.php Éxito
18. Borrar Archivo ./Sources/GoogleTagged.php 
19. Borrar Archivo ./Themes/default/GoogleTagged.template.php 
20. Borrar Archivo ./Themes/default/languages/GoogleTagged.english.php 
21. Borrar Archivo ./Themes/default/languages/GoogleTagged.english-utf8.php


Como se lo puede solucionar a eso?

Muchas gracias.

vicram10

bien y como pude comprobar.. el codigo que agregas no es para el Google Tagged si miras el usuario que pidio el bloque dio como referencia este mod

http://mods.simplemachines.org/index.php?mod=579

que es el Tagging System y no el Google Tagged

es por eso que no te funciona por que es un bloque para otro mod y no para el que dices que tienes instalado..

salu2

Aportadordelmix

Ok y para desintalar el mod google tagged? Sin que se me caiga el foro?

Blackdozer

Pues en la administración dale a desinstalar, y donde de error lo desinstalas manualmente ;)

Aportadordelmix

Quote from: Blackdozer on April 21, 2010, 02:04:26 PM
Pues en la administración dale a desinstalar, y donde de error lo desinstalas manualmente ;)

No afectaria en nada?

la sombra

Amigo cada vez que hagas una practica de algo, te aconsejo a futuro que guardes un respaldo, pues el sistema de error para aprender........duele y te podria dejar con un foro estropeado y horas de tu tiempo perdido.

El sistema de escuchar a varias personas induce a error porque cada uno tiene una apreciacion distinta de tu problema.

Es necesario por tu parte dar bien los datos, pues aca todos corren y eso, que es un problema de la modernidad, produce equivocaciones.

cuando tu vez que un mod al instalarlo aparece el clasico:

Error en la Instalación del Paquete
Se ha encontrado algún error durante la prueba de la instalación de este paquete. Es altamente recomendado que no continúes la instalación a menos que sepas lo que estás haciendo, y hayas realizado una copia de seguridad muy recientemente. Este error puede haber sido causado por un conflicto entre el paquete que estás intentando instalar y otro paquete que ya has instalado, un error en el paquete, un paquete que requiere otro paquete que no has instalado aún, o un paquete diseñado para otra versión de SMF.


Debes parar, preguntar o simplemente desechar ese mod y esperar que aparezca uno compatible con tu foro.


"Es preferible tener un foro activo y sin eso que un foro echado a perder por eso."


saludos

La Sombra
"El conocimiento nos hace responsables"

Aportadordelmix

Cuando quiero desintalar el mod googletagged me salen estos errores:

Tipo Acción Descripción
1. Ejecutar Modificación ./Themes/default/languages/Modifications.english.php Éxito
2. Ejecutar Modificación ./Themes/default/languages/Modifications.brazilian.php Omitiendo archivo
3. Ejecutar Modificación ./Themes/default/languages/Modifications.brazilian-utf8.php Omitiendo archivo
4. Ejecutar Modificación ./Themes/default/languages/Modifications.english-utf8.php Omitiendo archivo
5. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish-utf8.php Omitiendo archivo
6. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish_latin-utf8.php Omitiendo archivo
7. Ejecutar Modificación ./Themes/default/languages/Modifications.turkish.php Omitiendo archivo
8. Ejecutar Modificación ./Themes/default/languages/Modifications.turkish-utf8.php Omitiendo archivo
9. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish.php Omitiendo archivo
10. Ejecutar Modificación ./Themes/default/languages/Modifications.spanish_latin.php Prueba fallida
11. Ejecutar Modificación ./Themes/default/style.css Prueba fallida
12. Ejecutar Modificación ./Themes/default/Display.template.php Éxito
13. Ejecutar Modificación ./Themes/default/index.template.php Prueba fallida
14. Ejecutar Modificación ./index.php Éxito
15. Ejecutar Modificación ./Sources/ManagePermissions.php Éxito
16. Ejecutar Modificación ./Sources/Subs.php Prueba fallida
17. Ejecutar Modificación ./Sources/Display.php Éxito
18. Borrar Archivo ./Sources/GoogleTagged.php 
19. Borrar Archivo ./Themes/default/GoogleTagged.template.php 
20. Borrar Archivo ./Themes/default/languages/GoogleTagged.english.php 
21. Borrar Archivo ./Themes/default/languages/GoogleTagged.english-utf8.php


Y cuando voy a desintalar manualmente como me dijo black, no encuentro los archivos que debo reitar.

Por ejemplo en mi subs.php dice que busque este codigo


   'googletagged_settings' => '<a href="' . $scripturl . '?action=tagged;sa=admin;sesc=' . $sc . '">' . $txt['googletagged_menu'] . '</a>',

Pasa que hace poco tuvimos un fatal error en ese archivo (Subs.php)

Debido a la instalacion manual de Hide.

Entonces tuvimos que reemplazar algunos archivos.

Me gustaria saber los pasos para poder desintalar y hacer que todo quede  bien.

Desde ya muchas gracias.

Advertisement: