Salut
Comment puis-je insérer les 10 derniers message de mon forum sur mon index du site ?
domaine/index.php (insérer ici le code)
domaine/Forum/index.php (pour appeler ici les 10 derniers messages postés)
Merci
Modérateur: Equipe


<?php
define('IN_PHPBB', TRUE);
$phpbb_root_path = 'forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$sql = 'SELECT p.*, t.* FROM ' . POSTS_TABLE . ' p JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id ORDER BY p.post_id DESC LIMIT 10';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
echo 'Message posté dans <a href="' . $phpbb_root_path . 'viewtopic.php?t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a>:<br />';
echo $row['post_text'] . '<br /><br />';
}
?>



echo $row['post_text'] . '<br /><br />';echo substr($row['post_text'], 0, 25) . '...<br /><br />';



<?php
define('IN_PHPBB', TRUE);
$phpbb_root_path = 'forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
// Start session management
$user->session_begin();
$sql = 'SELECT p.*, t.* FROM ' . POSTS_TABLE . ' p JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id ORDER BY p.post_id DESC LIMIT 10';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$bbcode_bitfield = base64_decode($row['bbcode_bitfield']);
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
// Parse the message and subject
$message = censor_text($row['post_text']);
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message);
echo 'Message posté dans <a href="' . $phpbb_root_path . 'viewtopic.php?t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a>:<br />';
echo substr($message, 0, 150) . '...<br /><br />';
}
?>



$user->session_begin();$user->setup('', $forum_data['forum_style']);

Warning: message_die(Scripts/ForumFr/language/lang_english/lang_main.php): failed to open stream: No such file or directory in /home/alrassoul/domains/voodaa.net/public_html/Fr/Scripts/ForumFr/includes/functions.php on line 690
Warning: message_die(Scripts/ForumFr/language/lang_english/lang_main.php): failed to open stream: No such file or directory in /home/alrassoul/domains/voodaa.net/public_html/Fr/Scripts/ForumFr/includes/functions.php on line 690
Warning: message_die(): Failed opening 'Scripts/ForumFr/language/lang_english/lang_main.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /home/alrassoul/domains/voodaa.net/public_html/Fr/Scripts/ForumFr/includes/functions.php on line 690
phpBB :
Could not query config information
DEBUG MODE
SQL Error : 1146 Table 'DB_ForumFr.phpbb_config' doesn't exist
SELECT * FROM phpbb_config
Line : 219
File : common.php

language/lang_english/lang_main.php






<?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 'Sujet: <a href="' . $phpbb_root_path . 'viewtopic.php?t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a><br />';
echo 'Réponse de: <a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&u=' . $row['user_id'] . '">' . $row['username'] . '</a> à ' . $user->format_date($row['post_time']) . '<br /><br />';
}
?>

Utilisateurs parcourant ce forum: Bing [Bot] et 14 invités