Bonjour.
Je me suis lancé dans la conception d'une page originale PHP/TPL avec comme prise en main, une page qui affiche la liste des membres et le nombre de leurs messages postés. Seulement, les données ne s'affichent pas...
Fichier stats.php :
Fichier stats_body.tpl (juste le code utile) :
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
25
26
27
28
29
30
31
32
33
34
35
36 <?php define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); $result = mysql_query('SELECT username, user_posts FROM phpbb_users'); $userdata = session_pagestart($user_ip, PAGE_STATS); init_userprefs($userdata); $page_title = $lang['Stats']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'stats_body.tpl') ); while( $row = mysql_fetch_array($result) ) { $template->assign_block_vars( 'user', array( 'STATS_USER' => stripslashes($row['username']), 'STATS_USER_POSTS' => $row['user_posts'] )); } $template->assign_vars( array( 'L_STATS_USER_POSTS' => $lang['Stats_user_posts'], )); $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?>
Le formatage et s'aspect sont conformes, l'étiquette L_STATS_USER_POSTS s'affiche (configurée dans lang_main.php) mais les colonnes de données restent désespérément vides.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline"> <tr> <td height="25" colspan="2" class="catHead"><span class="genmed"><b>{L_STATS_USER_POSTS}</b></span></td> </tr> <tr> <td width="70%" align="left" class="row1"><span class="genmed">{user.STATS_USER}</span></td> <td width="30%" align="left" class="row1"><span class="genmed">{user.STATS_USER_POSTS}</span></td> </tr> </table>
Un petit coup de main serait le bienvenu...
Merci.
Partager