Alors, afin de rendre l'url rewriting opérationnel sur le module tutoriels, il vous faudra éditer 2 fichiers : url_rewrite.php :
Dans //********** AJOUT D URL_IN ***********\\ ajoutez à la fin :
Code : '/(?<!\/)href="index.php\?file=Tutoriels&op=tutoriels&tutid=([0-9]+)((&)|(&)){0,1}([^>]+>)<big><b>(.*?)<\/b><\/big><\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=tutoriels&tutid=([0-9]+)&p=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=tutoriels&tutid=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=categorie&catid=([0-9]*)&orderby=([a-z]+)&p=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=categorie&orderby=([a-z]+)&catid=([0-9]*)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=categorie&catid=([0-9]+)((&)|(&)){0,1}([^>]+>)<b>(.*?)<\/b><\/a>/e', '/(?<!\/)href="index.php\?file=Tutoriels&op=categorie&catid=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e');
Mais attention, notez la toute fin " ); " , vous aurez aussi cela sur la dernière ligne avant de coller ces lignes nouvelles. Donc, la ligne qui est juste avant ce que vous venez de coller se termine aussi par " ); " et il faudra la remplacer par " , " sinon vous aurez une erreur qui plantera tout votre site.
Ensuite dans //********** AJOUT D URL_OUT ***********\\ ajoutez à la fin :
Code : "'href=\"' . make_url_friendly('\\6') . '-av-tuto\\1.html' . if_query('\\2') . stripslashes('\\5') . '<big><b>'. stripslashes('\\6') . '</b></big></a>'", "'href=\"' . make_url_friendly('\\6') . '-p-tuto\\2-av\\1.html' . if_query('\\3') . stripslashes('\\6') . ''. stripslashes('\\7') . '</a>'", "'href=\"' . make_url_friendly('\\6') . '-av-tuto\\1.html' . if_query('\\2') . stripslashes('\\5') . ''. stripslashes('\\6') . '</a>'", "'href=\"' . make_url_friendly('\\8') . '-o-tuto\\2-p\\3-acat\\1.html' . if_query('\\4') . stripslashes('\\7') . ''. stripslashes('\\8') . '</a>'", "'href=\"' . make_url_friendly('\\7') . '-o-tuto\\1-acat\\2.html' . if_query('\\3') . stripslashes('\\6') . ''. stripslashes('\\7') . '</a>'", "'href=\"' . make_url_friendly('\\6') . '-acat-tuto\\1.html' . if_query('\\2') . stripslashes('\\5') . '<b>'. stripslashes('\\6') . '</b></a>'", "'href=\"' . make_url_friendly('\\6') . '-acat-tuto\\1.html' . if_query('\\2') . stripslashes('\\5') . ''. stripslashes('\\6') . '</a>'");
Même recommandation, pensez à modifier ); en ,
Enfin dans //********** MODIF DES BUFFER ***********\\ ajoutez :
Code : $buffer = str_replace('href="index.php?file=Tutoriels"','href="tutoriels.html"',$buffer); $buffer = str_replace('href="index.php?file=Tutoriels&op=classe&orderby=news"','href="tutoriels-last.html"',$buffer); $buffer = str_replace('href="index.php?file=Tutoriels&op=classe&orderby=count"','href="tutoriels-top.html"',$buffer);
Vous pouvez sauvegarder le modifications.
Maintenant dans votre .htaccess :
Rajoutez ces lignes EN PREMIER (très important) :
Code : RewriteRule [.]*-o-tuto([a-z]+)-p([0-9]+)-acat([0-9]+) index.php\?file=Tutoriels&op=categorie&catid=$3&orderby=$1&p=$2 [L] RewriteRule [.]*-o-tuto([a-z]+)-acat([0-9]+) index.php\?file=Tutoriels&op=categorie&catid=$2&orderby=$1 [L] RewriteRule [.]*-acat-tuto([0-9]+) index.php\?file=Tutoriels&op=categorie&catid=$1 RewriteRule [.]*-p-tuto([0-9]+)-av([0-9]+) index.php\?file=Tutoriels&op=tutoriels&tutid=$2&p=$1 [L] RewriteRule [.]*-av-tuto([0-9]+) index.php\?file=Tutoriels&op=tutoriels&tutid=$1
On sauve, on envoie les 2 fichiers et l'url rewrite du module tutoriels est fonctionnel.
EDIT : je capte pas pourquoi j'ai des smileys vu que j'ai utilisé la balise code !
[Edit : NK a ses limites ^^. Dans ce cas utilise l'option "Désactiver les smileys dans ce message"] (erwansims)
|