Only display latest 10 articles on index page.

This commit is contained in:
Phyks 2014-01-23 23:57:22 +01:00
parent d00db792a9
commit 4fea12e8cc
2 changed files with 3 additions and 2 deletions

1
TODO Normal file
View File

@ -0,0 +1 @@
* Envoi de photo

View File

@ -119,8 +119,8 @@
<th>Temps</th> <th>Temps</th>
</tr> </tr>
<?php <?php
foreach($data as $trajet) { for($i = count($data) - 1; $i > max(count($data) - 11, 0); $i--) {
echo "<tr><td>".htmlspecialchars($liste_stations[$trajet['start']]['name'])."</td><td>".htmlspecialchars($liste_stations[$trajet['end']]['name'])."</td><td>".(int) $trajet['min']."min ".(int) $trajet['sec']."s</td></tr>"; echo "<tr><td>".htmlspecialchars($liste_stations[$data[$i]['start']]['name'])."</td><td>".htmlspecialchars($liste_stations[$data[$i]['end']]['name'])."</td><td>".(int) $data[$i]['min']."min ".(int) $data[$i]['sec']."s</td></tr>";
} }
?> ?>
</table> </table>