Avec phpbb2 j'affichais les derniers posts de mon forum sur une page extérieure au forum (ma page d'accueil). J'étais en mode simple et ajoutais simplement le numéro du topic à la fin d'une url type de sujet (ex : -exemple.com/forum/topic$id.html)
J'aimerais tout simplement faire la même chose avec phpbb3 mais cette fois ci en mode avancé. La chose m'impose donc de fait de passer par la fonction de phpbb seo permettant de "convertir" les urls.
Je ne suis pas sûr de la bonne utilisation de la chose, mais j'ai un autre problème avant celui là :-/.
Voici mon code :
- Code: Tout sélectionner
// Connexion à la BDD
(...)
// Change this to your phpBB URL
$urlPath = "http://www.exemple.com/forum";
// Change this to your phpBB path
$phpbb_root_path = './forum/';
define('IN_PHPBB', true);
include($phpbb_root_path . 'phpbb_seo/phpbb_seo_class.php');
include($phpbb_root_path . 'common.php');
// Sélection des 10 derniers posts
$sql = "SELECT PST.post_subject, PST.post_text, PST.poster_id, PST.post_time, U.username
FROM phpbb3_posts PST, phpbb3_users U
WHERE U.username = PST.poster_id
GROUP BY PST.topic_id
ORDER BY PST.post_time ASC
LIMIT 10";
$req = mysql_query($sql) or die(mysql_error());
// Boucle d'affichage du post
while($db_data = mysql_fetch_assoc($req)) {
// Titre du post
$post_title = $db_data['post_subject'];
// Url du post
$topic_id = $db_data['topic_id'];
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
if ($topic_data['topic_type'] == POST_GLOBAL) {
$phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
}
$phpbb_seo->seo_censored[$topic_id] = censor_text($topic_data['topic_title']);
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id");
Le message suivant s'affiche :
The config. file could not be found.
Click here to install phpBB
J'imagine bien que c'est dans la déclaration de mes fichiers de base que ça bug, mais je ne vois pas comment rectifier la chose afin de rebidouiller ça dans le bon sens.
Pourriez-vous m'aider à biduler le trublion dans le bon sens s'il vous plait
ps : en plus je pense que ça pourra intéresser quelques personnes

Français |
Anglais


