Ce Mod est basé sur PunOOgle permettant de faire de l'url re-writing avec un forum punBB.
N'ayant aucune relation avec l'auteur de PunOOgle j'ai décidé de renommer ce mod en NewPunReWrite.
Essayez-le vous ne serez pas déçu ! Venez exposer vos problèmes sur mon forum je tenterai de vous aider.
J'ai ajouté plusieurs corrections :
De nombreuses URL non ReWrité avec PunOOgle le sont avec mon mod.
Merci à tous ceux qui participent au developpement de ce mod.
Vous trouverez une version .txt "téléchargeable" à cette adresse : http://www.tcheval.net/newpunrewrite.txt.
Vous pourrez trouver un plan sitemap compatible google avec les url rewrité à cette adresse : http://www.tcheval.net/sitemapmodNPRW.php.
Dernière mise à jours : 25 octobre 2006 à 18 heure 30.
## ## Mod version: V0.5 ## Works on PunBB: 1.2.14 FR (http://www.punbb.fr/) ## Release date: 30/10/2006 à 22h30 ## ## ## Affected files: index.php ## viewforum.php ## viewtopic.php ## search.php ## userlist.php ## footer.php ## extern.php ## post.php **Mise à jours du 25/10/2006** ## edit.php **Mise à jours du 25/10/2006** ## include/functions.php ## include/cache.php **Mise à jours du 30/10/2006** ## ## ## Affects DB: No ## ## Notes: Licence GPL. You must use Apache with mod_rewrite enabled. ## ## DISCLAIMER: Please note that "mods" are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## ## # #---------[ 1. UPLOAD ]------------------------------------------------------- # .htaccess to / # #---------[ 2. OPEN ]--------------------------------------------------------- # include/function.php # #---------[ 3. FIND (line: 243) ]--------------------------------------------- # $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>'; $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>'; # #---------[ 4. REPLACE WITH ]------------------------------------------------- # $links[] = '<li id="navindex"><a href="index.html">'.$lang_common['Index'].'</a>'; $links[] = '<li id="navuserlist"><a href="utilisateurs.html">'.$lang_common['User list'].'</a>'; # #---------[ 3. FIND (line: 252) ]--------------------------------------------- # $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>'; $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>'; # #---------[ 4. REPLACE WITH ]------------------------------------------------- # $links[] = '<li id="navsearch"><a href="recherche.html">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navregister"><a href="inscription.html">'.$lang_common['Register'].'</a>'; $links[] = '<li id="navlogin"><a href="connexion.html">'.$lang_common['Login'].'</a>'; # #---------[ 4a. FIND (line: 264) ]--------------------------------------------- # $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; } else { $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>'; $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; # #---------[ 4b. REPLACE WITH ]------------------------------------------------- # $links[] = '<li id="navsearch"><a href="recherche.html">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profil-'.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; } else { $links[] = '<li id="navsearch"><a href="recherche.html">'.$lang_common['Search'].'</a>'; $links[] = '<li id="navprofile"><a href="profil-'.$pun_user['id'].'">'.$lang_common['Profile'].'</a>'; $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>'; $links[] = '<li id="navlogout"><a href="login.php?action=out&id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>'; # #---------[ 5. FIND (line: 527) ]--------------------------------------------- # $pages[] = '<a href="'.$link_to.'&p=1">1</a>'; # #---------[ 6. REPLACE WITH ]------------------------------------------------- # $pages[] = '<a href="'.$link_to.'-1.html">1</a>'; # #---------[ 7. FIND (line: 539) ]--------------------------------------------- # $pages[] = '<a href="'.$link_to.'&p='.$current.'">'.$current.'</a>'; # #---------[ 8. REPLACE WITH ]------------------------------------------------- # $pages[] = '<a href="'.$link_to.'-'.$current.'.html">'.$current.'</a>'; # #---------[ 9. FIND ]--------------------------------------------- # function confirm_referrer($script) { global $pun_config, $lang_common; if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')))) message($lang_common['Bad referrer']); } # #---------[ 10. REPLACE WITH ]------------------------------------------------- # function cconfirm_referrer($script) { global $pun_config, $lang_common; $url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $tab = explode("/",$url); $newurl = $tab[count($tab)-1]; if ($script == "viewtopic.php") { if ((!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')))) and (substr($newurl, 0, strpos($newurl,"-"))!="sujet") and (substr($newurl, 0, strpos($newurl,"-"))!="message")) message($lang_common['Bad referrer']); } else { if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/'.$script, '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')))) message($lang_common['Bad referrer']); } } # #---------[ 11. AT THE END, ADD ]------------------------------------------------- # function pun_url($str,$more=false) { if((!isset($more)) || ($more == false)){ $max = 2; }else{ $max = $more; } $str = strtr($str,"ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÌÍÎÏìíîïÙÚÛÜùúûüÿÑñÇç'`", "AAAAAAaaaaaaOOOOOOooooooEEEEeeeeIIIIiiiiUUUUuuuuyNnCc "); $str = strtolower($str); $str = preg_replace('/[^a-z0-9_\.\s]/',' ',$str); $str = preg_replace('/[^a-z0-9_\s]\./','',trim($str)); $str = str_replace('.',' ',$str); $str = str_replace('_',' ',$str); $str = " ".$str." "; $str = ereg_replace(' .{1,'.$max.'} ', ' ', $str); $str = ereg_replace(' .{1,'.$max.'} ', ' ', $str); $rep = array(" quel ", " crois ", " etes ", " quand ", " suis ", " aux "," moi ", " sont ", " quelle ", " quoi ", " mon ", " est ", " plus ", " que ", " vous ", " faites ", " par "," dans "," pour "," pas "," les "," des "," que "," une "," avec "," qui "," sur "," mes "); $str = str_replace($rep," ",$str); $str = trim($str); $str = preg_replace('/[\s]+/','-',$str); if(count(explode("-", $str)) >= 8){ $max++; $str = pun_url(str_replace('-',' ',$str),$max); } if(!$more){ if((!isset($str)) || ($str == "")){ $str = "punoogle"; } } return $str; } # #---------[ 8. OPEN ]--------------------------------------------------------- # footer.php # #---------[ 9. FIND (line: 53) ]--------------------------------------------- # echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n"; echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n"; # #---------[ 10. REPLACE WITH ]------------------------------------------------- # echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt>'."\n\t\t\t\t".'<dd><a href="recherche-24-heures.html">'.$lang_common['Show recent posts'].'</a></dd>'."\n"; echo "\t\t\t\t".'<dd><a href="recherche-sans-reponse.html">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n"; # #---------[ 11. FIND (line: 57) ]--------------------------------------------- # echo "\t\t\t\t".'<dd><a href="search.php?action=show_subscriptions">'.$lang_common['Show subscriptions'].'</a></dd>'."\n"; # #---------[ 12. REPLACE WITH ]------------------------------------------------- # echo "\t\t\t\t".'<dd><a href="mes-marque-pages.html">'.$lang_common['Show subscriptions'].'</a></dd>'."\n"; # #---------[ 13. FIND (line: 59) ]--------------------------------------------- # echo "\t\t\t\t".'<dd><a href="search.php?action=show_user&user_id='.$pun_user['id'].'">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n"; # #---------[ 14. REPLACE WITH ]------------------------------------------------- # echo "\t\t\t\t".'<dd><a href="'.$pun_user['id'].'-mes-messages.html">'.$lang_common['Show your posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n"; # #---------[ 15. FIND (line: 65) ]--------------------------------------------- # echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="search.php?action=show_24h">'.$lang_common['Show recent posts'].'</a></dd>'."\n"; echo "\t\t\t\t".'<dd><a href="search.php?action=show_unanswered">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n"; # #---------[ 16. REPLACE WITH ]------------------------------------------------- # echo "\n\t\t\t".'<dl id="searchlinks" class="conl">'."\n\t\t\t\t".'<dt><strong>'.$lang_common['Search links'].'</strong></dt><dd><a href="recherche-24-heures.html">'.$lang_common['Show recent posts'].'</a></dd>'."\n"; echo "\t\t\t\t".'<dd><a href="recherche-sans-reponse.html">'.$lang_common['Show unanswered posts'].'</a></dd>'."\n\t\t\t".'</dl>'."\n"; # #---------[ 17. FIND (line: 109) ]--------------------------------------------- # <p class="conr">Propulsé par <a href="http://www.punbb.org/">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />© Copyright 2002–2005 Rickard Andersson<br /> Traduction par <a href="http://www.punbb.fr/">punbb.fr</a></p> # #---------[ 18. REPLACE WITH ]------------------------------------------------- # <p class="conr">Propulsé par <a href="http://www.punbb.org/" rel="nofollow">PunBB</a><?php if ($pun_config['o_show_version'] == '1') echo ' '.$pun_config['o_cur_version']; ?><br />© Copyright 2002–2005 Rickard Andersson<br /> Traduction par <a href="http://www.punbb.fr/">punbb.fr</a></p> # #---------[ 19. OPEN ]--------------------------------------------------------- # index.php # #---------[ 20. FIND (line: 100) ]--------------------------------------------- # $forum_field = '<h3><a href="viewforum.php?id='.$cur_forum['fid'].'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>'; # #---------[ 21. REPLACE WITH ]------------------------------------------------- # $forum_field = '<h3><a href="forum-'.$cur_forum['fid'].'-'.pun_url($cur_forum['forum_name']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>'; # #---------[ 22. FIND (line: 111) ]--------------------------------------------- # $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>'; # #---------[ 23. REPLACE WITH ]------------------------------------------------- # $last_post = '<a href="message-'.$cur_forum['last_post_id'].'.html#p'.$cur_forum['last_post_id'].'" rel="nofollow">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>'; # #---------[ 24. FIND (line: 121) ]--------------------------------------------- # $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>'; # #---------[ 25. REPLACE WITH ]------------------------------------------------- # $moderators[] = '<a href="profil-'.$mod_id.'-'.pun_url($mod_username).'">'.pun_htmlspecialchars($mod_username).'</a>'; # #---------[ 26. FIND (line: 174) ]--------------------------------------------- # <dd><?php echo $lang_index['Newest user'] ?>: <a href="profile.php?id=<?php echo $stats['last_user']['id'] ?>"><?php echo pun_htmlspecialchars($stats['last_user']['username']) ?></a></dd> # #---------[ 27. REPLACE WITH ]------------------------------------------------- # <dd><?php echo $lang_index['Newest user'] ?>: <a href="profil-<?php echo $stats['last_user']['id'].'-'.pun_url($stats['last_user']['username']); ?>"><?php echo pun_htmlspecialchars($stats['last_user']['username']) ?></a></dd> # #---------[ 28. FIND (line: 187) ]--------------------------------------------- # $users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>'; # #---------[ 29. REPLACE WITH ]------------------------------------------------- # $users[] = "\n\t\t\t\t".'<dd><a href="profil-'.$pun_user_online['user_id'].'-'.pun_url($pun_user_online['ident']).'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>'; # #---------[ 30. OPEN ]--------------------------------------------------------- # search.php # #---------[ 31. FIND (line: 423) ]--------------------------------------------- # header('Location: search.php?search_id='.$search_id); # #---------[ 32. REPLACE WITH ]------------------------------------------------- # header('Location: recherche-'.$search_id.'.html'); # #---------[ 33. FIND (line: 478) ]--------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'search.php?search_id='.$search_id); # #---------[ 34. REPLACE WITH ]------------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'recherche-'.$search_id); # #---------[ 35. FIND (line: 543) ]--------------------------------------------- # $forum = '<a href="viewforum.php?id='.$temp[0].'">'.pun_htmlspecialchars($temp[1]).'</a>'; # #---------[ 36. REPLACE WITH ]------------------------------------------------- # $forum = '<a href="forum-'.$temp[0].'-'.pun_url($temp[1]).'">'.pun_htmlspecialchars($temp[1]).'</a>'; # #---------[ 37. FIND (line: 553) ]--------------------------------------------- # $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>'; # #---------[ 38. REPLACE WITH ]------------------------------------------------- # $subject = '<a href="sujet-'.$search_set[$i]['tid'].'-'.pun_url($search_set[$i]['subject']).'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a>'; # #---------[ 39. FIND (line: 566) ]--------------------------------------------- # $pposter = '<strong><a href="profile.php?id='.$search_set[$i]['poster_id'].'">'.$pposter.'</a></strong>'; # #---------[ 40. REPLACE WITH ]------------------------------------------------- # $pposter = '<strong><a href="profile-'.$search_set[$i]['poster_id'].'-'.pun_url($pposter).'">'.$pposter.'</a></strong>'; # #---------[ 41. FIND (line: 580) ]--------------------------------------------- # <h2><?php echo $forum ?> » <?php echo $subject ?> » <a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo format_time($search_set[$i]['pposted']) ?></a></h2> # #---------[ 42. REPLACE WITH ]------------------------------------------------- # <h2><?php echo $forum ?> » <?php echo $subject ?> » <a href="message-<?php echo $search_set[$i]['pid'].'.html#p'.$search_set[$i]['pid'] ?>" rel="nofollow"><?php echo format_time($search_set[$i]['pposted']) ?></a></h2> # #---------[ 43. FIND (line: 588) ]--------------------------------------------- # <dd><p class="clearb"><a href="viewtopic.php?pid=<?php echo $search_set[$i]['pid'].'#p'.$search_set[$i]['pid'] ?>"><?php echo $lang_search['Go to post'] ?></a></p></dd> # #---------[ 44. REPLACE WITH ]------------------------------------------------- # <dd><p class="clearb"><a href="message-<?php echo $search_set[$i]['pid'].'.html#p'.$search_set[$i]['pid'] ?>" rel="nofollow"><?php echo $lang_search['Go to post'] ?></a></p></dd> # #---------[ 45. FIND (line: 612) ]--------------------------------------------- # $subject = '<a href="viewtopic.php?id='.$search_set[$i]['tid'].'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['poster']).'</span>'; # #---------[ 46. REPLACE WITH ]------------------------------------------------- # $subject = '<a href="sujet-'.$search_set[$i]['tid'].'-'.pun_url($search_set[$i]['subject']).'">'.pun_htmlspecialchars($search_set[$i]['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['poster']).'</span>'; # #---------[ 47. FIND (line: 634) ]--------------------------------------------- # $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$search_set[$i]['tid']).' ]'; # #---------[ 48. REPLACE WITH ]------------------------------------------------- # $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'sujet-'.$search_set[$i]['tid']).' ]'; # #---------[ 49. FIND (line: 657) ]--------------------------------------------- # <td class="tcr"><?php echo '<a href="viewtopic.php?pid='.$search_set[$i]['last_post_id'].'#p'.$search_set[$i]['last_post_id'].'">'.format_time($search_set[$i]['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['last_poster']) ?></td> # #---------[ 50. REPLACE WITH ]------------------------------------------------- # <td class="tcr"><?php echo '<a href="message-'.$search_set[$i]['last_post_id'].'.html#p'.$search_set[$i]['last_post_id'].'" rel="nofollow">'.format_time($search_set[$i]['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($search_set[$i]['last_poster']) ?></td> # #---------[ 51. FIND (line: 691) ]--------------------------------------------- # <form id="search" method="get" action="search.php"> # #---------[ 52. REPLACE WITH ]------------------------------------------------- # <form id="search" method="get" action="recherche.html"> # #---------[ 53. OPEN ]--------------------------------------------------------- # userlist.php # #---------[ 54. FIND (line: 166) ]--------------------------------------------- # <td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td> # #---------[ 55. REPLACE WITH ]------------------------------------------------- # <td class="tcl"><?php echo '<a href="profil-'.$user_data['id'].'-'.pun_url($user_data['username']).'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td> # #---------[ 56. OPEN ]--------------------------------------------------------- # viewforum.php # #---------[ 57. FIND (line: 76) ]--------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewforum.php?id='.$id); # #---------[ 58. REPLACE WITH ]------------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'forum-'.$id); # #---------[ 59. FIND (line: 88) ]--------------------------------------------- # <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> # #---------[ 60. REPLACE WITH ]------------------------------------------------- # <ul><li><a href="index.html"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> # #---------[ 61. FIND (line: 148) ]--------------------------------------------- # $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; # #---------[ 62. REPLACE WITH ]------------------------------------------------- # $last_post = '<a href="message-'.$cur_topic['last_post_id'].'.html#p'.$cur_topic['last_post_id'].'" rel="nofollow">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; # #---------[ 63. FIND (line: 156) ]--------------------------------------------- # $subject = $lang_forum['Moved'].': <a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; else if ($cur_topic['closed'] == '0') $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; else { $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; # #---------[ 64. REPLACE WITH ]------------------------------------------------- # $subject = $lang_forum['Moved'].': <a href="sujet-'.$cur_topic['id'].'-'.pun_url($cur_topic['subject']).'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; else if ($cur_topic['closed'] == '0') $subject = '<a href="sujet-'.$cur_topic['id'].'-'.pun_url($cur_topic['subject']).'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; else { $subject = '<a href="sujet-'.$cur_topic['id'].'-'.pun_url($cur_topic['subject']).'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>'; # #---------[ 65. FIND (line: 196) ]--------------------------------------------- # $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]'; # #---------[ 66. REPLACE WITH ]------------------------------------------------- # $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'sujet-'.$cur_topic['id']).' ]'; # #---------[ 67. FIND (line: 247) ]--------------------------------------------- # <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> # #---------[ 68. REPLACE WITH ]------------------------------------------------- # <ul><li><a href="index.html"><?php echo $lang_common['Index'] ?></a> </li><li>» <?php echo pun_htmlspecialchars($cur_forum['forum_name']) ?></li></ul> # #---------[ 69. OPEN ]--------------------------------------------------------- # viewtopic.php # #---------[ 70. FIND (line: 135) ]--------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'viewtopic.php?id='.$id); # #---------[ 71. REPLACE WITH ]------------------------------------------------- # $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'sujet-'.$id); # #---------[ 72. FIND (line: 172) ]--------------------------------------------- # <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul> # #---------[ 73. REPLACE WITH ]------------------------------------------------- # <ul><li><a href="index.html"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="forum-<?php echo $cur_topic['forum_id'].'-'.pun_url($cur_topic['forum_name']); ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul> # #---------[ 74. FIND (line: 200) ]--------------------------------------------- # $username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>'; # #---------[ 75. REPLACE WITH ]------------------------------------------------- # $username = '<a href="profil-'.$cur_post['poster_id'].'-'.pun_url($cur_post['username']).'">'.pun_htmlspecialchars($cur_post['username']).'</a>'; # #---------[ 76. FIND (line: 355) ]--------------------------------------------- # <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul> # #---------[ 77. REPLACE WITH ]------------------------------------------------- # <ul><li><a href="index.html"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="forum-<?php echo $cur_topic['forum_id'].'-'.pun_url($cur_topic['forum_name']); ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_topic['subject']) ?></li></ul> # #---------[ 78. OPEN ]--------------------------------------------------------- # extern.php # #---------[ 79. FIND (line: 261) ]--------------------------------------------- # echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n"; # #---------[ 80. REPLACE WITH ]------------------------------------------------- # echo '<li><a href="'.$pun_config['o_base_url'].'/sujet-'.$cur_topic['id'].'-'.pun_url($cur_topic['subject']).'.html" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n"; # #---------[ MISE A JOUR 0.3 ]------------------------------------------------- # ####################################################### ## Tout ce qui suit est ajouté depuis la version 0.2 ## ####################################################### ############################################################ ## Merci à Keulig pour sa gestion des URLs des numéros de ## ## pages dans la liste des membres ## ############################################################ ###################################################################### ## N'Oubliez pas de mettre à jours le fichier .htaccess également ! ## ###################################################################### # #---------[ 81. OPEN ]--------------------------------------------------------- # post.php # #---------[ 82. FIND (line: 251) ]--------------------------------------------- # $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); # #---------[ 83. REPLACE WITH ]------------------------------------------------- # $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/message-'.$new_pid.'.html#p'.$new_pid, $mail_message); # #---------[ 82. FIND (line: 259) ]--------------------------------------------- # $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full); # #---------[ 83. REPLACE WITH ]------------------------------------------------- # $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/message-'.$new_pid.'.html#p'.$new_pid, $mail_message_full); # #---------[ 82. FIND (line: 323) ]--------------------------------------------- # redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']); # #---------[ 83. REPLACE WITH ]------------------------------------------------- # redirect('message-'.$new_pid.'.html#p'.$new_pid, $lang_post['Post redirect']); # #---------[ 84. OPEN ]--------------------------------------------------------- # userlist.php # #---------[ 85. FIND (line: 129) ]--------------------------------------------- # // Generate paging links $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'userlist.php?username='.urlencode($username).'&show_group='.$show_group.'&sort_by='.$sort_by.'&sort_dir='.strtoupper($sort_dir)); # #---------[ 86. REPLACE WITH ]------------------------------------------------- # // Generate paging links $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'utilisateurs-pseudo'.urlencode($username).'-groupe'.$show_group.'-sort'.$sort_by.'-ordre'.strtoupper($sort_dir)); # #---------[ 84. OPEN ]--------------------------------------------------------- # include/fonctions.php # #---------[ 85. FIND (line: 527) ]--------------------------------------------- # $pages[] = '<a href="'.$link_to.'&p=1">1</a>'; # #---------[ 86. REPLACE WITH ]------------------------------------------------- # $pages[] = '<a href="'.$link_to.'-1.html">1</a>'; # #---------[ 85. FIND (line: 539) ]--------------------------------------------- # $pages[] = '<a href="'.$link_to.'&p='.$current.'">'.$current.'</a>'; # #---------[ 86. REPLACE WITH ]------------------------------------------------- # $pages[] = '<a href="'.$link_to.'-'.$current.'.html">'.$current.'</a>'; # #---------[ 85. FIND (line: 549) ]--------------------------------------------- # $pages[] = '<a href="'.$link_to.'&p='.$num_pages.'">'.$num_pages.'</a>'; # #---------[ 86. REPLACE WITH ]------------------------------------------------- # $pages[] = '<a href="'.$link_to.'-'.$num_pages.'.html">'.$num_pages.'</a>'; # #---------[ MISE A JOUR 0.4 ]------------------------------------------------- # ####################################################### ## Tout ce qui suit est ajouté depuis la version 0.3 ## ####################################################### # #---------[ 81. OPEN ]--------------------------------------------------------- # edit.php # #---------[ 82. FIND (line: 129) ]--------------------------------------------- # redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']); # #---------[ 83. REPLACE WITH ]------------------------------------------------- # redirect('message-'.$id.'.html#p'.$id, $lang_post['Edit redirect']); # #---------[ 82. FIND (line: 145) ]--------------------------------------------- # <ul><li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="viewforum.php?id=<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul> # #---------[ 83. REPLACE WITH ]------------------------------------------------- # <ul><li><a href="index.html"><?php echo $lang_common['Index'] ?></a></li><li> » <a href="message-<?php echo $cur_post['fid'] ?>"><?php echo pun_htmlspecialchars($cur_post['forum_name']) ?></a></li><li> » <?php echo pun_htmlspecialchars($cur_post['subject']) ?></li></ul> # #---------[ MISE A JOUR 0.3 ]------------------------------------------------- # ####################################################### ## Tout ce qui suit est ajouté depuis la version 0.4 ## ####################################################### ########################################################### ## Merci à Morph1er pour sa contribution très importante ## ########################################################### ###################################################################### ## N'oubliez pas de mettre à jours le fichier .htaccess également ! ## ###################################################################### # #---------[ 84. OPEN ]--------------------------------------------------------- # include/functions.php # #---------[ 85. FIND (line: 248) ]--------------------------------------------- # $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>'; # #---------[ 86. REPLACE WITH ]------------------------------------------------- # $links[] = '<li id="navrules"><a href="regles.html">'.$lang_common['Rules'].'</a>'; # #---------[ 87. OPEN ]--------------------------------------------------------- # viewtopic.php # #---------[ 88. FIND (line: 314) ]--------------------------------------------- # <h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?> </span><a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2> # #---------[ 89. REPLACE WITH ]------------------------------------------------- # <h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?> </span><a href="message-<?php echo $cur_post['id'].'.html#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2> # #---------[ 90. OPEN ]--------------------------------------------------------- # extern.php # #---------[ 91. FIND (line: 230) ]--------------------------------------------- # echo "\t\t".'<title>'.pun_htmlspecialchars($cur_topic['subject']).'</title>'."\r\n"; echo "\t\t".'<description><![CDATA['.escape_cdata($lang_common['Forum'].': <a href="'.$pun_config['o_base_url'].'/viewforum.php?id='.$cur_topic['fid'].'">'.$cur_topic['forum_name'].'</a><br />'."\r\n".$lang_common['Author'].': '.$cur_topic['poster'].'<br />'."\r\n".$lang_common['Posted'].': '.date('r', $cur_topic['posted']).'<br />'."\r\n".$lang_common['Last post'].': '.date('r', $cur_topic['last_post'])).']]></description>'."\r\n"; # #---------[ 92. REPLACE WITH ]------------------------------------------------- # echo "\t\t".'<link>'.$pun_config['o_base_url'].'/sujet-'.$cur_topic['id'].'-'.pun_url($cur_topic['subject']).'</link>'."\r\n"; echo "\t\t".'<description><![CDATA['.escape_cdata($lang_common['Forum'].': <a href="'.$pun_config['o_base_url'].'/forum-'.$cur_topic['fid'].'-'.pun_url($cur_topic['forum_name']).'">'.$cur_topic['forum_name'].'</a><br />'."\r\n".$lang_common['Author'].': '.$cur_topic['poster'].'<br />'."\r\n".$lang_common['Posted'].': '.date('r', $cur_topic['posted']).'<br />'."\r\n".$lang_common['Last post'].': '.date('r', $cur_topic['last_post'])).']]></description>'."\r\n"; # #---------[ 93. FIND (line: 285) ]--------------------------------------------- # $users[] = '<a href="'.$pun_config['o_base_url'].'/profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>'; # #---------[ 94. REPLACE WITH ]------------------------------------------------- # $users[] = '<a href="'.$pun_config['o_base_url'].'/profil-'.$pun_user_online['user_id'].'-'.pun_url($pun_user_online['ident']).'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>'; # #---------[ 95. FIND (line: 322) ]--------------------------------------------- # echo $lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profile.php?id='.$stats['last_user']['id'].'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a><br />'; # #---------[ 96. REPLACE WITH ]------------------------------------------------- # echo $lang_index['Newest user'].': <a href="'.$pun_config['o_base_url'].'/profil-'.$stats['last_user']['id'].'-'.pun_url($stats['last_user']['username']).'">'.pun_htmlspecialchars($stats['last_user']['username']).'</a><br />'; # #---------[ 97. OPEN ]--------------------------------------------------------- # include/cache.php # #---------[ 98. FIND (line: 178) ]--------------------------------------------- # $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common['Jump to'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=('viewforum.php?id='+this.options[this.selectedIndex].value)">'."\n"; # #---------[ 99. REPLACE WITH ]------------------------------------------------- # $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common['Jump to'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=('forum-'+this.options[this.selectedIndex].value)">'."\n"; # #---------[ 100. FIND (line: 196) ]--------------------------------------------- # $output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? ' selected="selected"' : '' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n"; # #---------[ 101. REPLACE WITH ]------------------------------------------------- # $output .= "\t\t\t\t\t\t\t".'<option value="'.$cur_forum['fid'].'-'.pun_url($cur_forum['forum_name']).'"<?php echo ($forum_id == '.$cur_forum['fid'].') ? ' selected="selected"' : '' ?>>'.pun_htmlspecialchars($cur_forum['forum_name']).$redirect_tag.'</option>'."\n";
Fichier .htaccess standard
RewriteEngine on RewriteRule ^index.html$ index.php [L] RewriteRule ^forum-([0-9]+)-([0-9]+).html$ viewforum.php?id=$1&p=$2 [L] RewriteRule ^forum-([0-9]+)(.*)$ viewforum.php?id=$1 [L] RewriteRule ^sujet-([0-9]+)-([0-9]+).html$ viewtopic.php?id=$1&p=$2 [L] RewriteRule ^sujet-([0-9]+)(.*)$ viewtopic.php?id=$1 [L] RewriteRule ^message-([0-9]+)(.*)$ viewtopic.php?pid=$1 [L] RewriteRule ^profil-([0-9]+)(.*)$ profile.php?id=$1 [L] RewriteRule ^inscription.html$ register.php [L] RewriteRule ^connexion.html$ login.php [L] RewriteRule ^recherche.html$ search.php [L] RewriteRule ^recherche-([0-9]+).html$ search.php?search_id=$1 [L] RewriteRule ^recherche-([0-9]+)-([0-9]+).html$ search.php?search_id=$1&p=$2 [L] RewriteRule ^utilisateurs.html$ userlist.php [L] RewriteRule ^recherche-24-heures.html$ search.php?action=show_24h [L] RewriteRule ^([0-9]+)-mes-messages.html$ search.php?action=show_user&user_id=$1 [L] RewriteRule ^mes-marque-pages.html$ search.php?action=show_subscriptions [L] RewriteRule ^recherche-sans-reponse.html$ search.php??action=show_unanswered [L] RewriteRule ^profile-([0-9]+)(.*)$ profile.php?id=$1 [L] RewriteRule ^utilisateurs-pseudo(.*)-groupe(.*)-sort(.*)-ordre(.*)-([0-9]+)(.*)$ userlist.php?username=$1&show_group=$2&sort_by=$3&sort_dir=$4&p=$5 [L] RewriteRule ^regles.html$ misc.php?action=rules [L]
Si votre forum est hebergé sur OVH, il faut ajouter des /. Aidez vous du fichier ci-dessous par exemple :
RewriteEngine on RewriteRule ^index.html$ /index.php [L] RewriteRule ^forum-([0-9]+)-