Je n'arrive pas à trouver le fichier template/default/category.vtp dans la version 1.4
· 20.) Comment afficher le nombre total, de commentaires, d'images visitees et de hits ?
-dans : categorie.php (1.3), vers la ligne 159-160 inserer
Code:
$query = 'SELECT COUNT(*) AS nb_totalcomments';
$query.= ' FROM '.PREFIX_TABLE.'comments';
$query.= " WHERE validated = 'true'";
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
$vtp->setGlobalVar( $handle, 'nb_totalcomments', $row['nb_totalcomments'] );
$query = 'SELECT COUNT(*) AS nb_totalimagevisit';
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= ' WHERE hit <> 0 ';
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
$vtp->setGlobalVar( $handle, 'nb_totalimagevisit', $row['nb_totalimagevisit'] );
$query = 'SELECT SUM(hit) AS nb_totalimagehit';
$query.= ' FROM '.PREFIX_TABLE.'images';
$query.= ' WHERE hit <> 0 ';
$query.= ';';
$row = mysql_fetch_array( mysql_query( $query ) );
$vtp->setGlobalVar( $handle, 'nb_totalimagehit', $row['nb_totalimagehit'] );
- puis dans : template/default/category.vtp
Afficher selon vos besoin ces variables
Code:
<div class="totalImages">[ {#nb_totalcomments} commentaires ]</div>
<div class="totalImages">[ {#nb_totalimagevisit} images visitées ]</div>
<div class="totalImages">[ {#nb_totalimagehit} hits ]</div>
PS: ceci ne tient pas compte du multi-linguisme
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dernière modification par pavat69 (2005-04-05 16:38:59)
Hors ligne