Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Generare tag cloud

  1. #1

    Generare tag cloud

    salve a tutti qualcuno sa come posso associare l'apposita classe css ad un tag ?

    mi spiego meglio ho 5 diverse dimensioni
    .tag5 { font-size: 7pt; }
    .tag4 { font-size: 8pt; }
    .tag3 { font-size: 9pt; }
    .tag2 { font-size: 11pt; }
    .tag1 { font-size: 14pt; }

    poi nel db all'interno della tabella tbtags memorizzo l'id dell'immagine e il tag vero e proprio
    estraggo il numero massimo e minimo di parole

    $query = "SELECT DISTINCT COUNT( parola ) AS tot FROM tbtags GROUP BY parola ORDER BY tot DESC LIMIT 0, 1";
    $rs = mysql_query($query) or die("Errore nella query:" . mysql_error());
    while ($riga=mysql_fetch_array($rs)) {
    $vmax = $riga['tot'];
    }

    $querymin = "SELECT DISTINCT COUNT( parola ) AS tot FROM tbtags GROUP BY parola ORDER BY tot ASC LIMIT 0, 1";
    $rsdue = mysql_query($querymin) or die("Errore nella query:" . mysql_error());
    while ($rigadue=mysql_fetch_array($rsdue)) {
    $vmin = $rigadue['tot'];
    }

    poi dovrò fare il ciclo su tutti i tag nella mia tabella

    $querydue = "SELECT Count(parola) as conta,parola FROM tbtags GROUP BY parola";
    $rstags = mysql_query($querydue) or die("Errore nella query:" . mysql_error());
    while ($riga=mysql_fetch_array($rstags)) {
    .....
    ....
    Stampo il tag con il link e l'apposita classe
    }

    è proprio l'interno di questo ciclo che non riesco a realizzare
    quale operazione devo compiere per poter associare al tag l'apposita classe css ?

  2. #2
    Utente di HTML.it L'avatar di mariox
    Registrato dal
    Nov 2006
    Messaggi
    837
    dai un'occhiata qui, penso ti possa aiutare:

    http://www.yappy.it/tag_cloud_php.php

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.