Bonjour
J'ai un script qui récupère des photos depuis une base de donnée pour les afficher ensuite sur une page web
Les photos sont affichées à l'aide du template:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 function showPhotos($cat,$page,$end) { global $database,$ds_cats2,$ds_cats5,$SETTINGS; $start = $page * $end - ($end); $data = ''; $query = mysql_query("SELECT * FROM ".$database['prefix']."Photos". WHERE cat = \''.$cat.'\'' )." ORDER BY name LIMIT $start,$end ") while ($PHOTO = mysql_fetch_object($query)) { $data .= '<td align="center"><img src="'.cleanData($PHOTO->pic1).'" height="100" width="90" alt="'.cleanData($PHOTO->name).'" title="'.cleanData($PHOTO->name).'"> <br /><span class="album"><a href="' 'index.php?cmd=PHOTO&cat='.$PHOTO->cat.'&PHOTO='.$PHOTO->id).'" title="'.cleanData($PHOTO->name).'">'.cleanData($PHOTO->name).'</a></span>'.($PHOTO->submitted_by ? '<br> '.$ds_cats2.' '.cleanData($PHOTO->submitted_by) : '').'</td>'; } $data .= '<br>'; return mysql_num_rows($query)>0 ? $data : '<br>'; }
Ce script m'affiche toutes les photos sur une seule ligne, ce que je veux c'est afficher 5 photos sur chaque ligne.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9<table cellpadding="4" cellspacing="1" border="0" width="100%"> <tr> <?php echo $this->PHOTOS; ?> </tr> </table>
Comment je dois m'y prendre?
Merci par avance de votre aide.
Partager