Pour le flux rss il faut prendre la versin de GYM adapté à ton forum
http://www.phpbb-seo.com/forums/gym-sit ... -vt30.html ( pour phpbb2 )
http://www.phpbb-seo.com/forums/gym-sit ... t3136.html ( phpbb3 )
Trefle.
Modérateur: Modérateurs

thegigistouch a écrit:Qu'entends tu par "ne partage pas le code"?
$topic_id = (int) $topic_data['topic_id'];// www.phpBB-SEO.com SEO TOOLKIT BEGIN
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]);
}
if ( empty($phpbb_seo->seo_url['forum'][$topic_data['forum_id']]) ) {
$phpbb_seo->seo_url['forum'][$topic_data['forum_id']] = $phpbb_seo->set_url($topic_data['forum_name'], $topic_data['forum_id'], $phpbb_seo->seo_static['forum']);
}
// www.phpBB-SEO.com SEO TOOLKIT END$viewtopic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start);$viewforum_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start);
http://forum.example.org/nom-topic-t22.htmlprivate function _rewriteUrl($url = "", $type, $firstId, $lastId = ""){
//remove [] from url
$url = preg_replace('`\[.*\]`U','',$url);
//convert html caracters (e -> &ecute;)
$url = htmlentities($url, ENT_COMPAT, "utf-8");
//convert html entities to unaccentuated values (&ecute; -> e)
$url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\\1", $url );
$url_pattern = Array('`&(amp;|#)?[a-z0-9]+;`i',
'`[^a-z0-9]`i',
'`(^|-)[a-z0-9]{1,2}(?=-|$)`i',
'`[-]+`');
$url = preg_replace( $url_pattern , '-', $url);
$url = strtolower(trim($url, '-'));
if ($type == "post") {
$url .= "-t" . $firstId . ".html";
if ($lastId != "")
$url .= "#p" . $lastId;
} else if ($type == "forum") {
$url .= "-f" . $firstId . ".html";
}
return($url);
}
$newUrl = _rewriteUrl("Comment tester la fonction de réecriture d'url?","topic", "22","4");
/comment-tester-fonction-reecriture-url-t22.html#4

<?php
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
include('forum/phpbb_seo/phpbb_seo_class.php');
$phpbb_seo = new phpbb_seo();
$phpbb_seo->seo_path['phpbb_script'] = 'forum/';
$phpbb_seo->seo_path['root_url'] = 'http://www.fond-ecran-gratuit.biz/';
$phpbb_seo->seo_path['phpbb_url'] = $phpbb_seo->seo_path['root_url'] . $phpbb_seo->seo_path['phpbb_script'];
$phpbb_seo->seo_url['user'] = $this->seo_static['user'] = 'membre';
// www.phpBB-SEO.com SEO TOOLKIT END
// Connexion à la BDD
$db = .......;
// Sélection des 5 derniers posts
$sql = "SELECT TP.topic_id, TP.topic_title, PT.post_text, PST.post_time, PST.poster_id, PST.post_username, US.username
FROM phpbb_topics TP, phpbb_posts_text PT, phpbb_posts PST, phpbb_users US
WHERE PT.post_id = TP.topic_first_post_id
AND PST.post_id = TP.topic_first_post_id
AND US.user_id = TP.topic_poster
GROUP BY TP.topic_id
ORDER BY TP.topic_id DESC
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
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$post_title = "<a href=\"" . $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->format_url($db_data['topic_title']) . $phpbb_seo->seo_delim['topic'] . $db_data['topic_id'] . $phpbb_seo->seo_ext['topic'] . "\">" . $db_data['topic_title'] . "</a>";
// www.phpBB-SEO.com SEO TOOLKIT END
// Extrait du post
$post = $db_data['post_text'];
$max_caracteres = 400;
if (strlen($post)>$max_caracteres) {
$max_caracteres=strrpos(substr($post, 0, $max_caracteres), " ");
$post = substr($post, 0, $max_caracteres);
$post .= " (...)";
}
$post = preg_replace("(\[.*\])U","",$post );
$poster = "<a href=\"" . $phpbb_seo->seo_path['phpbb_url'] . $phpbb_seo->seo_static['user'] . $db_data['poster_id'] . $phpbb_seo->seo_ext['user'] . "\" class=\"nav\" >".$db_data['username']."</a>";
$post_time = strftime("%A %e %B @ %H:%M", $db_data['post_time']+(0));
echo "<p align=\"left\">$post_title, by $poster, $post_time<br />
$post</p>";
}
?>
// Connexion à la BDD
$db = .......; Retourner vers mod Rewrite Avancé phpBB2
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 3 invités