<?php
define('IN_SITE', true);
define('IN_PHPBB', true);
$phpbb_root_path = forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Sélection des 10 derniers posts
$sql = "SELECT t.topic_replies_real,t.topic_replies,t.topic_title,t.forum_id,t.topic_id,t.topic_type,t.topic_last_post_id,f.forum_name,t.topic_last_poster_name,t.topic_last_post_time
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.topic_approved = 1
AND t.topic_status <> 2
AND t.forum_id = f.forum_id
ORDER BY t.topic_last_post_time DESC
LIMIT 6";
$result = $db->sql_query($sql);
// Boucle d'affichage du post
while($topic_data = $db->sql_fetchrow($result))
{
// Données du topic
$topic_title = $topic_data['topic_title'];
$topic_replies = $topic_data['topic_replies'];
$topic_replies_real = $topic_data['topic_replies_real'];
$forum_id = $topic_data['forum_id'];
$topic_id = $topic_data['topic_id'];
$forum_name = $topic_data['forum_name'];
$topic_last_post_id = $topic_data['topic_last_post_id'];
$topic_last_post_time = $topic_data['topic_last_post_time'];
$topic_last_poster_name = $topic_data['topic_last_poster_name'];
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_replies_real : $topic_replies;
$start = floor(($replies) / $config['posts_per_page']) * $config['posts_per_page'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
if ($line[$i]['topic_type'] == POST_GLOBAL) {
$phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
}
$phpbb_seo->seo_censored[$topic_id] = $topic_title;
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
$phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($line[$i]['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id . '&f=' . $forum_id . '&start=' . $start ) . '#p' . $topic_last_post_id;
$topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id . '&f=' . $forum_id );
//On affiche
echo '<li><a href="'.$topic_url.'">'.$topic_title.'</a> - '.$forum_name.' - <a rel="nofollow" href="'.$post_url.'">Dernier message par '.$topic_last_poster_name.'</a> - '.strftime('%d/%m/%y ',$topic_last_post_time).' à '.strftime('%H:%M ',$topic_last_post_time).'</li>';
}
$db->sql_freeresult($result);
?>
Yoyo a écrit://Script 1
- Code: Tout sélectionner
<ul>
<?php
define('IN_SITE', true);
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Sélection des 10 derniers posts
$sql = "SELECT topic_replies_real,topic_replies,topic_title,forum_id,topic_id,topic_type,topic_last_post_id
FROM phpbb3_topics
WHERE topic_approved = 1
ORDER BY topic_last_post_time DESC
LIMIT 10";
$result = $db->sql_query($sql);
// Boucle d'affichage du post
while($topic_data = $db->sql_fetchrow($result))
{
// Données du topic
$topic_title = $topic_data['topic_title'];
$topic_replies = $topic_data['topic_replies'];
$topic_replies_real = $topic_data['topic_replies_real'];
$forum_id = $topic_data['forum_id'];
$topic_id = $topic_data['topic_id'];
$topic_last_post_id = $topic_data['topic_last_post_id'];
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_replies_real : $topic_replies;
$start = floor(($replies) / $config['posts_per_page']) * $config['posts_per_page'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN, à enlever si vous n'avez pas installé les mods phpbb-seo !
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
if ($line[$i]['topic_type'] == POST_GLOBAL) {
$phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
}
$phpbb_seo->seo_censored[$topic_id] = $topic_title;
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
$phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($line[$i]['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id . '&f=' . $forum_id . '&start=' . $start ) . '#p' . $topic_last_post_id;
//On affiche
echo '<li><a href="'.$post_url.'">'.$topic_title.'</a></li>';
}
$db->sql_freeresult($result);
?>
</ul>
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]);
}
// http://www.phpBB-SEO.com SEO TOOLKIT BEGIN
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
if (empty($phpbb_seo->seo_opt['virtual_folder'] || !empty($phpbb_seo->seo_url['forum'][$forum_id]) || $topic_data['topic_type'] == POST_GLOBAL) {
$phpbb_seo->prepare_iurl($topic_data, 'topic', $topic_data['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$forum_id]);
}
// http://www.phpBB-SEO.com SEO TOOLKIT END
Yoyo a écrit:Comme l'a dit dcz sur son forum phpbb-seo.com . Il y a eu des modifications.
Voici ses préconisations au niveau de ce script:
Remplacer:
- Code: Tout sélectionner
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]);
}
Par:
- Code: Tout sélectionner
// http://www.phpBB-SEO.com SEO TOOLKIT BEGIN
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
if (empty($phpbb_seo->seo_opt['virtual_folder'] || !empty($phpbb_seo->seo_url['forum'][$forum_id]) || $topic_data['topic_type'] == POST_GLOBAL) {
$phpbb_seo->prepare_iurl($topic_data, 'topic', $topic_data['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$forum_id]);
}
// http://www.phpBB-SEO.com SEO TOOLKIT END
Voila, donc tu adaptes ces modifications à ton script. les noms de variables ne sont pas les mêmes à 100% j'imagine.
Parse error: syntax error, unexpected '?' in /home/laryngo/public_html/test.htm on line 98
echo '<li><a href="'.$post_url.'">'.$topic_title????A?.'</a></li>';
<?php
define('IN_SITE', true);
define('IN_PHPBB', true);
$phpbb_root_path = './projet/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Sélection des 10 derniers posts
$sql = "SELECT topic_replies_real,topic_replies,topic_title,forum_id,topic_id,topic_type,topic_last_post_id
FROM phpbb3_topics
WHERE topic_approved = 1
ORDER BY topic_last_post_time DESC
LIMIT 10";
$result = $db->sql_query($sql);
// Boucle d'affichage du post
while($topic_data = $db->sql_fetchrow($result))
{
// Données du topic
$topic_title = $topic_data['topic_title'];
$topic_replies = $topic_data['topic_replies'];
$topic_replies_real = $topic_data['topic_replies_real'];
$forum_id = $topic_data['forum_id'];
$topic_id = $topic_data['topic_id'];
$topic_last_post_id = $topic_data['topic_last_post_id'];
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_replies_real : $topic_replies;
$start = floor(($replies) / $config['posts_per_page']) * $config['posts_per_page'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN, à enlever si vous n'avez pas installé les mods phpbb-seo !
if ( empty($phpbb_seo->seo_url['topic'][$topic_id]) ) {
if ($line[$i]['topic_type'] == POST_GLOBAL) {
$phpbb_seo->seo_opt['topic_type'][$topic_id] = POST_GLOBAL;
}
$phpbb_seo->seo_censored[$topic_id] = $topic_title;
$phpbb_seo->seo_url['topic'][$topic_id] = $phpbb_seo->format_url($phpbb_seo->seo_censored[$topic_id]);
}
if ( empty($phpbb_seo->seo_url['forum'][$forum_id]) ) {
$phpbb_seo->seo_url['forum'][$forum_id] = $phpbb_seo->set_url($line[$i]['forum_name'], $forum_id, $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END
$post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id . '&f=' . $forum_id . '&start=' . $start ) . '#p' . $topic_last_post_id;
//On affiche
echo '<li><a href="'.$post_url.'">'.$topic_title????A?.'</a></li>';
}
$db->sql_freeresult($result);
?>
echo '<li><a href="'.$post_url.'">'.$topic_title????A?.'</a></li>';
echo '<li><a href="'.$post_url.'">'.$topic_title.'</a></li>';
Warning: include(./projet/common.htm) [function.include]: failed to open stream: No such file or directory in /home/laryngo/public_html/test.htm on line 59
Warning: include(./projet/common.htm) [function.include]: failed to open stream: No such file or directory in /home/laryngo/public_html/test.htm on line 59
Warning: include() [function.include]: Failed opening './projet/common.htm' for inclusion (include_path='.usr/lib/php:/usr/local/lib/php') in /home/laryngo/public_html/test.htm on line 59
Fatal error: Call to a member function sql_query() on a non-object in /home/laryngo/public_html/test.htm on line 67
include($phpbb_root_path . 'common.' . $phpEx);
$result = $db->sql_query($sql);
Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 0 invités
Copyright TutoMaker.com © Rentabiliser son site
Toute reproduction totale ou partielle du site est interdite sans l'accord de l'auteur, surtout que ça se voit vite ;)