J'utilise ce code pour afficher les dix derniers messages de mon forum sur une page externe :
- Code: Tout sélectionner
<?php
define('IN_PHPBB', TRUE);
$phpbb_root_path = 'forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$user->setup('', $forum_data['forum_style']);
$sql = 'SELECT p.*, t.*, u.user_id, u.username FROM ' . POSTS_TABLE . ' p JOIN ' . TOPICS_TABLE . ' t JOIN ' . USERS_TABLE . ' u
ON p.topic_id = t.topic_id
AND u.user_id = p.poster_id
ORDER BY p.post_id DESC LIMIT 10';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
echo '<a href="' . $phpbb_root_path . 'viewtopic.php?t="' . $row['topic_id'] . '" target="_blank" >' . utf8_decode($row['topic_title']) . '</a> posté par <a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&u=' . $row['user_id'] . '"target="_blank" >' . $row['username'] . '</a> à '$user->format_date($row['topic_time'])'<br />';
}
?>
ça m'affiche cette erreur :
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in dernierssujets.php on line 20
Voici la ligne 20 en question:
- Code: Tout sélectionner
echo '<a href="' . $phpbb_root_path . 'viewtopic.php?t=' . $row['topic_id'] . '"target="_blank" >' . utf8_decode($row['topic_title']) . '</a> posté par <a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&u=' . $row['user_id'] . '"target="_blank" >' . $row['username'] . '</a> à '$user->format_date($row['topic_time'])'<br />';
Que dois je changer?
Ensuite, j'aimerais utiliser la réécriture d'url avancée dans ce script.
Comment faire?
Merci d'avance !

Français |
Anglais
