Help - Search - Member List - Calendar
Full Version: [Traité]URL Rewriting...
IPBR-FR > Entraide > Questions diverses
sunbeach
Bonjour à tous!

Je suis nouveau sur le forum car je viens de créer il y a une dizaine de jours un tout nouveau forum... et en fait, bon j'ai déjà un tout petit peu d'expériance là dedans et j'ai entendu dire, que pour les forums IPB, il n'ya avait pas besoin d'URL Rewriting...

Là dessus, peut etre...malgré que, je pense que les forum URL Rewrités possèdent beacoup plus de page référencées par Google notemment...

Bref, là n'est pas le plus gros problème...

Le gros avantage de l'URL Rewriting "bien fait" est que les nom des topics sont dans l'adresse du sujet...donc cela fait des mots clés en + pour l'ami google...

En effet, j'ai lu tout un livre là dessus (Google, truc de pro) et le contenu des URL est très important et les mots contenues dedans constituent des mots clés!

Voilà pourquoi, je pense que l'URL Rewriting est vraiment important pour certain sites...qui ne sont basés que sur des forums! Le référencement est donc essentiel.

Depuis cette nouvelle version 2.1, aucun mod pour l'URL Rewriting n'est sorti... sad.gif le mod précédent n'était pas parfait notamment au niveau des noms de sujets avac accents (les caractères accentués n'étaient pas pris en compte dans l'url).

Alors, je souhaiterais déjà avoir votre avis sur le sujet car je pense que l'URL Rewriting pourrait vraiment aider au bon référencement de nombreux forums...

Et j'aimerais volontier qu'un mod soit créer par la team IPBR pour l'URL Rewriting sur la 2.1.

Merci beaucoup.

PS: Je citerai un très bon exemple de forum IPB 2.1.2 très bien URL Rewrité ==> -http://www.forumfr.com/
Ckarsenti
Et bien pourquoi ne pas demander à Phobos, comment il a fait pour son forum ? rolleyes.gif happy.gif
Phobos
Le Phobos est dans l'escalier biggrin.gif
fleche.gif
Merci pour le très bien wink.gif
Tu peux reprendre la mod 2.0 qui je crois est valable aussi pour la 2.1 (je ne l'utilise pas j'ai fais ma mod avant mais bon le fonctionnement est à peu près le même si je me souviens bien wink.gif)
Pour les accents, une petite fonction de ce genre:
CODE
function sans_accent($chaine)
{
$accent = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ";
  $noaccent = "aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyyby";
  return strtr(trim($chaine),$accent,$noaccent);
}

est bien efficace, à utiliser dans la fonction nettoyant le titre dans l'url wink.gif
sticky-fingers
QUOTE(Phobos @ mardi 18 octobre 2005 à 17:27)
Tu peux reprendre la mod 2.0 qui je crois est valable aussi pour la 2.1 (je ne l'utilise pas j'ai fais ma mod avant mais bon le fonctionnement est à peu près le même si je me
*



Quel mod stp ? wink.gif
Fabien
URL Rewriting ça sert presqu'à rien sur un IPB.
sticky-fingers
Ah ? Peux tu expliciter Fabien stp ?
sunbeach
L'URL Rewriting n'est pas indispensable sur IPB, ok, mais comme je l'ai dis, pour les mots clés il est essentiel et surtout pour un site basé uniquement sur un forum, comme le miens...

Sinon, Phobos, merci de m'avoir répondu! wink.gif Merci pour ton astuce pour les accents, par contre, le mod ne fonctionne pas, j'ai essayé hier et j'obtenais des erreurs... Puis-je t'en faire part? unsure.gif

Merci beaucoup.
Phobos
Oui vas-y, poste les erreurs que tu obtiens, je parle de cette mod: http://mods.invisionize.com/db/index.php/f/4303 wink.gif
L'url rewriting n'est effectivement pas indispensable mais il n'est pas inutile du tout wink.gif
sticky-fingers
Merci Phobos wink.gif
sunbeach
Merci Phobos!

Alors moi déjà je n'utilise pas la version que tu as donnée car c'est une ancienne et l'autre est beaucoup mieux ==> http://mods.invisionize.com/db/index.php/f/5086

Sinon, donc ça y est je l'ai mis, alors l'URL Rewriting ne fonctionne pas et tout s'affiche en très gros et il y a une erreur en haut, je te laisse regarder ==> http://www.sunbeach-club.com/


Merci beaucoup!
Phobos
De la 2.0 à la 2.1 un gros changement au niveau des variables a eu lieu, il faut remplacer $ibforums par $this->ipsclass wink.gif
sunbeach
Merci... je viens de le faire, j'ai un nouveau soucis, une erreur maintenant:

CODE

Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /home3/s/sunbeach-club/www/FURL.php on line 116


A la ligne 116, je vois pas le pb:

CODE
//TOPIC FUNCTIONS
function create_topic_url($tid, $title, $topictitle){
 global $this->ipsclass;
 $safeurl = $this->make_text_safe($topictitle);
 return "<a href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-t{$tid}.html\" title=\"{$title}\">{$topictitle}</a>";
}


Merci pour ta réponse.
sunbeach
Bon j'ai supprimé les "Global" devant à chaque fois... il y avait 4-5 erreurs de ce type, j'ai viré les global... et là, pluus d'erreurs, j'arrive sur la page index de mon forum... par contre quand je vais dans un forum...

CODE
Not Found

The requested URL /www.sunbeach-club.com/index.php was not found on this server.


Merci pour ta réponse... wink.gif
Phobos
Là ça vient vraisemblablement du .htaccess, pose une ligne de celui-ci ici wink.gif
si cette ligne contient "www.sunbeach-club.com/" il faut supprimer ça smile.gif
sunbeach
Par exemple...

CODE
# DO THE FORUM URLS
RewriteRule ^(.*)-new-topic-f([0-9]*)\.html(.*)$ index.php?act=Post&CODE=00&f=$2$3
RewriteRule ^(.*)-new-poll-f([0-9]*)\.html(.*)$ index.php?act=Post&CODE=10&f=$2$3
RewriteRule ^(.*)-f([0-9][0-9]*)\.html(.*)$ index.php?showforum=$2$3


et il ne contient pas www.sunbeach-club.com ...

Si tu le veux en entier dis le moi... je te l'envois par mail... wink.gif

Merci beaucoup!
Phobos
essaye avec /index au lieu de index
sunbeach
Merci beaucoup...!!! ça fonctionne! wink.gif

Par contre, pour la fonction que tu m'as donné j'ai pas bien compris où il faut mettre ça??

Merci beaucoup!!!!

EDIT: je me suis un peu avancé! lol ça fonctionne pour les forum mais pour les topics, j'ai tjs des adresses de ce genre: -http://www.sunbeach-club.com/http://ipb2.ipbr-fr.com/index.php?showtopic=65

unsure.gif je comprends pas trop...??

Merci!
sunbeach
Bon je résume:

Pour les accents, je n'ai pas utilisé ta fonction car dans le code du fichier FYRL.php, j'ai trouvé des trucs come ça:

CODE
$text = str_replace( "ä", "ae", $text);
$text = str_replace( "ö", "oe", $text);
$text = str_replace( "ü", "ue", $text);


et donc... j'ai rajouté une ligne:

CODE
$text = str_replace( "é", "e", $text);


et ça marche...donc ça c'est bon normalement!

Par contre, j'ai toujours les anciennes URL pour les topics! unsure.gif

Merci pour ton aide... wink.gif
Phobos
ma fonction modifie plus d'accents, tu la palce ou tu veux et tu l'utilise une fois a la place de tous les
CODE
$text = str_replace( "ä", "ae", $text);

wink.gif

Pour les anciennes urls des topics ça vient du fonctionnnement de la mod, essaye en supprimant le debut des chaines dans les preg replace des noms de sujets, en fait la 2.1.2 ajoute un id dans les liens des topics avant le href wink.gif tu dois trouver dans le preg replace des noms de sujets des passages commençant par "<a", supprime ces parties jusqu'a "href" wink.gif

pour les forums il faut recopier la ligne du preg replace en modifiant les \" par des ' wink.gif
(suffisait d'afficher la source pour voir que la chaine n'allait pas smile.gif)

(si tu ne comprends vraiment rien, au pire colle le contenu de ton FURL.php ici et je le modif au même endroit pour que tout le monde profite en même temps wink.gif
sunbeach
ouai...c'est un peu compiqué pour un débutant...si tu veux bien me le faire, ça en fera profiter tout le monde en +...et ça me premettra ensuite de comprendre et d'apprendre! wink.gif

Voilà le code actuel de mon FURL.php:

CODE

<?php

$FURL = new FURL;
$oldskin = "";
while ($this->ipsclass->skin['_wrapper']!=$oldskin){
$oldskin = $this->ipsclass->skin['_wrapper'];



//Topic URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("#<a href=\"{$this->ipsclass->vars['board_url']}/index.php\?showtopic=([0-9]*)&amp;st=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_topic_page_url('\\1','\\2','\\3')", $this->ipsclass->skin['_wrapper'], 1);
$this->ipsclass->skin['_wrapper'] = preg_replace("#<a href=\"{$this->ipsclass->vars['board_url']}/index.php\?showtopic=([0-9]*)\" title=\"(.+?)\">(.+?)</a>#ie", "\$FURL->create_topic_url('\\1','\\2','\\3')", $this->ipsclass->skin['_wrapper'], 1);

//Member Profiles
$this->ipsclass->skin['_wrapper'] = preg_replace("#<a href='{$this->ipsclass->vars['board_url']}/index.php\?showuser=([0-9]*)'>(.+?)</a>#ie", "\$FURL->create_member_profile_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);

//Forum URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("#<a href=\"{$this->ipsclass->vars['board_url']}/index.php\?showforum=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_forum_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);
$this->ipsclass->skin['_wrapper'] = preg_replace("#<a href=\"{$this->ipsclass->vars['board_url']}/index.php\?act=SF&amp;f=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_forum_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);

}

//*******************************************//
//***************** USER CP *****************//
//*******************************************//
// > UserCP <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=00'","my-controls.html",$this->ipsclass->skin['_wrapper']);
// > Messenger <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=04'","compose-new-message.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01&amp;VID=in'","inbox.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01&amp;VID=sent'","sent-items.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=20'","saved-pms.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=delete'","empty-pm-folders.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=07'","edit-storage-folders.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=02'","pm-buddies.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=14'","archive-messages.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=30'","message-tracker.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01'","new-messages.html",$this->ipsclass->skin['_wrapper']);
// > Subscriptions <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=26'","view-topic-subscriptions.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=50'","view-forum-subscriptions.html",$this->ipsclass->skin['_wrapper']);
// > Personal Profile <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=01'","edit-profile-info.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=22'","edit-signature.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=24'","edit-avatar-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=photo'","change-personal-photo.html",$this->ipsclass->skin['_wrapper']);
// > Options <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=attach'","manage-your-attachments.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=ignore'","manage-ignored-users.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=02'","email-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=04'","board-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=08'","change-email-address.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=28'","change-password.html",$this->ipsclass->skin['_wrapper']);
// > Moderator Tools <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=iptool'","ip-tool.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=memtool'","member-tool.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=announce_start'","manage-anoucements.html",$this->ipsclass->skin['_wrapper']);
//*******************************************//
//***************** USER CP *****************//
//*******************************************//


// Search URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Search&amp;CODE=getnew'","get-new-posts.html",$this->ipsclass->skin['_wrapper']);

// Do the forum index
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=idx'","forums.html",$this->ipsclass->skin['_wrapper']);

// Login/Logout/Register
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Login&amp;CODE=03'","logout.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Login&amp;CODE=00'","login.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Reg&amp;CODE=00'","register.html",$this->ipsclass->skin['_wrapper']);

// Stats and legends
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Stats&amp;CODE=leaders'","the-moderating-team.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Stats'","todays-top-10-posters.html",$this->ipsclass->skin['_wrapper']);

// Members List
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Members'","member-list.html",$this->ipsclass->skin['_wrapper']);

// Online
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Online'","online-list.html",$this->ipsclass->skin['_wrapper']);


// Calendar
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=newevent'","add-new-event.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=find&amp;what=thismonth'","events-this-month.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=find&amp;what=thisweek'","events-this-week.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;m=([0-9]*)&amp;y=([0-9]*)'","go-to-month-\\1-\\2.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=showweek&amp;week=([0-9]*)'","show-week-\\1.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=showday&amp;y=([0-9]*)&amp;m=([0-9]*)&amp;d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?&act=calendar&amp;CODE=showday&amp;y=([0-9]*)&amp;m=([0-9]*)&amp;d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$this->ipsclass->skin['_wrapper']);

$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar'","calendar.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?&amp;act=calendar'","calendar.html",$this->ipsclass->skin['_wrapper']);

// Tracking Code / Copyright String
// !!Please leave this code in!!
//
// I went to alot of time making this mod
// and would like a little in return, this just links back to my site
// to improve my rating on Search Engines, the link only appears to
// search bots though so its not on every page.
//
// Its also because i like seeing my mods in use on other peoples sites!
foreach(explode("\n",$this->ipsclass->vars['search_engine_bots']) as $bot){list($ua, $n)=explode("=", $bot);if ($ua and $n){$this->bot_map[strtolower($ua)] = $n;$this->bot_safe[]=preg_quote($ua,"/");}}if (preg_match('/('.implode('|',$this->bot_safe ).')/i',$_SERVER['HTTP_USER_AGENT'],$match)){print "SEO Powered By FURL 3.0 By KiM (<a href='http://www.alt-man.co.uk'>Alterative Manchester</a>)";}
//

class FURL {
function FURL()
{

}


//TOPIC FUNCTIONS
function create_topic_url($tid, $title, $topictitle){
$this->ipsclass;
$safeurl = $this->make_text_safe($topictitle);
return "<a href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-t{$tid}.html\" title=\"{$title}\">{$topictitle}</a>";

}
function create_topic_page_url($tid, $st, $linktext){
$this->ipsclass;
$pagenum = str_replace("&raquo; ","",$linktext);
return "<a href=\"{$this->ipsclass->vars['board_url']}/page-{$pagenum}-t{$tid}-s{$st}.html\">{$linktext}</a>";
}

//MEMBER PROFILES
function create_member_profile_url($mid, $membername){
$this->ipsclass;
$safeurl = $this->make_text_safe($membername);
return "<a href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-m{$mid}.html\">{$membername}</a>";
}

//FORUMS
function create_forum_url($fid, $forumname){
$this->ipsclass;
$safeurl = $this->make_text_safe($forumname);
return "<a href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-f{$fid}.html\">{$forumname}</a>";
}




function make_text_safe($text){
$this->ipsclass;
//Charachters must be in ASCII and certain ones aint allowed

$text = html_entity_decode ($text);
$text = str_replace(" / ","-",$text);
$text = str_replace("/","-",$text);
$text = str_replace("'","-",$text);
$text = str_replace(" - ","-",$text);
$text = str_replace("_","-",$text);
$text = str_replace(" ","-",$text);
$text = str_replace( "é", "e", $text);
$text = str_replace( "ä", "ae", $text);
$text = str_replace( "ö", "oe", $text);
$text = str_replace( "ü", "ue", $text);
$text = str_replace( "Ä", "Ae", $text);
$text = str_replace( "Ö", "Oe", $text);
$text = str_replace( "Ü", "Ue", $text);
$text = str_replace( "ß", "ss", $text);
$text = str_replace( "&", "and", $text);
$text = str_replace( "%", "Percent", $text);
$text = ereg_replace("[^A-Za-z0-9-]", "", $text);
$text = str_replace("----","-",$text);
$text = str_replace("---","-",$text);
$text = str_replace("--","-",$text);
return $text;
}


}

?>




Merci beaucoup en tout cas! wink.gif
Phobos
CODE
<?php

$FURL = new FURL;
$oldskin = "";
while ($this->ipsclass->skin['_wrapper']!=$oldskin){
$oldskin = $this->ipsclass->skin['_wrapper'];



//Topic URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("#href=\"{$this->ipsclass->vars['board_url']}/index.php\?showtopic=([0-9]*)&amp;st=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_topic_page_url('\\1','\\2','\\3')", $this->ipsclass->skin['_wrapper'], 1);
$this->ipsclass->skin['_wrapper'] = preg_replace("#href=\"{$this->ipsclass->vars['board_url']}/index.php\?showtopic=([0-9]*)\" title=\"(.+?)\">(.+?)</a>#ie", "\$FURL->create_topic_url('\\1','\\2','\\3')", $this->ipsclass->skin['_wrapper'], 1);

//Member Profiles
$this->ipsclass->skin['_wrapper'] = preg_replace("#href='{$this->ipsclass->vars['board_url']}/index.php\?showuser=([0-9]*)'>(.+?)</a>#ie", "\$FURL->create_member_profile_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);

//Forum URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("#href=\"{$this->ipsclass->vars['board_url']}/index.php\?showforum=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_forum_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);
$this->ipsclass->skin['_wrapper'] = preg_replace("#href='{$this->ipsclass->vars['board_url']}/index.php\?showforum=([0-9]*)'>(.+?)</a>#ie", "\$FURL->create_forum_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);
$this->ipsclass->skin['_wrapper'] = preg_replace("#href=\"{$this->ipsclass->vars['board_url']}/index.php\?act=SF&amp;f=([0-9]*)\">(.+?)</a>#ie", "\$FURL->create_forum_url('\\1','\\2')", $this->ipsclass->skin['_wrapper'], 1);

}

//*******************************************//
//***************** USER CP *****************//
//*******************************************//
// > UserCP <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=00'","my-controls.html",$this->ipsclass->skin['_wrapper']);
// > Messenger <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=04'","compose-new-message.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01&amp;VID=in'","inbox.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01&amp;VID=sent'","sent-items.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=20'","saved-pms.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=delete'","empty-pm-folders.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=07'","edit-storage-folders.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=02'","pm-buddies.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=14'","archive-messages.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=30'","message-tracker.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&amp;CODE=01'","new-messages.html",$this->ipsclass->skin['_wrapper']);
// > Subscriptions <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=26'","view-topic-subscriptions.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=50'","view-forum-subscriptions.html",$this->ipsclass->skin['_wrapper']);
// > Personal Profile <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=01'","edit-profile-info.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=22'","edit-signature.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=24'","edit-avatar-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=photo'","change-personal-photo.html",$this->ipsclass->skin['_wrapper']);
// > Options <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=attach'","manage-your-attachments.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=ignore'","manage-ignored-users.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=02'","email-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=04'","board-settings.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=08'","change-email-address.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=28'","change-password.html",$this->ipsclass->skin['_wrapper']);
// > Moderator Tools <
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=iptool'","ip-tool.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=memtool'","member-tool.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&amp;CODE=announce_start'","manage-anoucements.html",$this->ipsclass->skin['_wrapper']);
//*******************************************//
//***************** USER CP *****************//
//*******************************************//


// Search URL's
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Search&amp;CODE=getnew'","get-new-posts.html",$this->ipsclass->skin['_wrapper']);

// Do the forum index
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=idx'","forums.html",$this->ipsclass->skin['_wrapper']);

// Login/Logout/Register
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Login&amp;CODE=03'","logout.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Login&amp;CODE=00'","login.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Reg&amp;CODE=00'","register.html",$this->ipsclass->skin['_wrapper']);

// Stats and legends
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Stats&amp;CODE=leaders'","the-moderating-team.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Stats'","todays-top-10-posters.html",$this->ipsclass->skin['_wrapper']);

// Members List
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Members'","member-list.html",$this->ipsclass->skin['_wrapper']);

// Online
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=Online'","online-list.html",$this->ipsclass->skin['_wrapper']);


// Calendar
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=newevent'","add-new-event.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=find&amp;what=thismonth'","events-this-month.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=find&amp;what=thisweek'","events-this-week.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;m=([0-9]*)&amp;y=([0-9]*)'","go-to-month-\\1-\\2.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=showweek&amp;week=([0-9]*)'","show-week-\\1.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&amp;CODE=showday&amp;y=([0-9]*)&amp;m=([0-9]*)&amp;d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?&act=calendar&amp;CODE=showday&amp;y=([0-9]*)&amp;m=([0-9]*)&amp;d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$this->ipsclass->skin['_wrapper']);

$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?act=calendar'","calendar.html",$this->ipsclass->skin['_wrapper']);
$this->ipsclass->skin['_wrapper'] = preg_replace("'index.php\?&amp;act=calendar'","calendar.html",$this->ipsclass->skin['_wrapper']);

// Tracking Code / Copyright String
// !!Please leave this code in!!
//
// I went to alot of time making this mod
// and would like a little in return, this just links back to my site
// to improve my rating on Search Engines, the link only appears to
// search bots though so its not on every page.
//
// Its also because i like seeing my mods in use on other peoples sites!
foreach(explode("\n",$this->ipsclass->vars['search_engine_bots']) as $bot){list($ua, $n)=explode("=", $bot);if ($ua and $n){$this->bot_map[strtolower($ua)] = $n;$this->bot_safe[]=preg_quote($ua,"/");}}if (preg_match('/('.implode('|',$this->bot_safe ).')/i',$_SERVER['HTTP_USER_AGENT'],$match)){print "SEO Powered By FURL 3.0 By KiM (href='http://www.alt-man.co.uk'>Alterative Manchester</a>)";}
//

class FURL {
function FURL()
{

}


//TOPIC FUNCTIONS
function create_topic_url($tid, $title, $topictitle){
$this->ipsclass;
$safeurl = $this->make_text_safe($topictitle);
return "href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-t{$tid}.html\" title=\"{$title}\">{$topictitle}</a>";

}
function create_topic_page_url($tid, $st, $linktext){
$this->ipsclass;
$pagenum = str_replace("&raquo; ","",$linktext);
return "href=\"{$this->ipsclass->vars['board_url']}/page-{$pagenum}-t{$tid}-s{$st}.html\">{$linktext}</a>";
}

//MEMBER PROFILES
function create_member_profile_url($mid, $membername){
$this->ipsclass;
$safeurl = $this->make_text_safe($membername);
return "href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-m{$mid}.html\">{$membername}</a>";
}

//FORUMS
function create_forum_url($fid, $forumname){
$this->ipsclass;
$safeurl = $this->make_text_safe($forumname);
return "href=\"{$this->ipsclass->vars['board_url']}/{$safeurl}-f{$fid}.html\">{$forumname}</a>";
}




function make_text_safe($text){
$this->ipsclass;
//Charachters must be in ASCII and certain ones aint allowed

$accent = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ";
$noaccent = "aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyyby";

$text = html_entity_decode ($text);
$text = str_replace(" / ","-",$text);
$text = str_replace("/","-",$text);
$text = str_replace("'","-",$text);
$text = str_replace(" - ","-",$text);
$text = str_replace("_","-",$text);
$text = str_replace(" ","-",$text);
$text = strtr($text,$accent,$noaccent);
$text = str_replace( "ß", "ss", $text);
$text = str_replace( "&", "et", $text);
$text = str_replace( "%", "Pourcents", $text);
$text = ereg_replace("[^A-Za-z0-9-]", "", $text);
$text = str_replace("----","-",$text);
$text = str_replace("---","-",$text);
$text = str_replace("--","-",$text);
return $text;
}


}

?>


comme ça ça devrait être fonctionnel wink.gif

PS: Utilise CODEBOX plutôt que CODE pour les gros morceaux wink.gif
sunbeach
Yess! Merci beaucoup ça fonctionne! wink.gif

Maintenant je vais voir de plus près le fonctionnement mais je crois que je commence à comprendre! wink.gif

En tout cas merci beaucoup Phobos, et ça servira à d'autres, j'en suis sur! smile.gif
Ckarsenti
Parcontre tu as tjrs des adresses bizzares pour les ' !
Comme la http://www.sunbeach-club.com/Yugooooooo-ce...33et33-t16.html
Tu devrai rajouter un filtre pour eux aussi wink.gif
Phobos
Il faudrait alors suppriemr cette ligne a mon avis smile.gif
CODE
$text = html_entity_decode ($text);
sunbeach
Ouai j'ai remarqué... mais sinon ça marche pas phobos ce que tu me dis... j'ai supprimé cette ligne et c'est tjs pareil...

Par exemple ==>

le sujet nommé "tadaaaaaa !!!" dans ce forum http://www.sunbeach-club.com/Presentations-f4.html , l'adresse pour ce sujet est

http://www.sunbeach-club.com/tadaaaaaa-et33et33et33-t44.html

donc ouaip ya un souci... unsure.gif
Phobos
la remplacer par
CODE
$text = preg_replace("'&(.*?);'","",$text);
smile.gif
sunbeach
ouai ça marche... wink.gif

Juste une question par contre: c'est normal que quelque fois, par exemple ce matin je vais sur le forum et je regarde l'adresse pour le forum "présentation" et ça m'affiche cette adresse:

http://www.sunbeach-club.com/index.php?s=8......&showforum=4

Après j'actualise et là ça remarche... etrange... unsure.gif


Sinon, j'ai essayé de faire l'URL Rewriting pour "Recherche" mais ça fonctionne pas... il y a un truc particulier ou, j'ai pu faire une fausse manip?

ca fonctionne pas du tout en fait ce n'est pas du tout URL Rewrité... donc je sais pas...

Merci beaucoup!
sunbeach
J'ai un autre problème... plusieurs membres et moi même se faisons déconecté quelque fois tout seul!

Penses-tu savoir d'où ça peut venir?

Merciiii! wink.gif
Phobos
C'est un sid dans l'url, ce n'est pas étrange, c'est normal, cela permet de garder la session lorsque le navigateur n'a pas encore accepté le cookie, ne t'inuiètes pas les robots renseignés dans la liste dans ton panneau d'admin ne verront jamais ce genre d'url wink.gif
Pour la déconnexion intempestive, vois du côté de la configuration de tes cookies dans l'acp, cela ne vient aps de l'url rewriting wink.gif
sunbeach
ok merci beaucoup... wink.gif

J'aurais ptete encore qq questions ces prochains jours... je reviendrais ici! mais en totu cas le principal est fait! wink.gif


Merci merci vraiment! wink.gif
sunbeach
arf... j'ai encore un pb.... sad.gif

En fait j'viens d'installer "user Agent Switcher" et je me suis fais donc passé par un robot google et j'ai visité mon forum... et c'est une cata! lol en fait, ça fais comme au début.... c'est a dire, en haut ya marqué "SEO Powered By FURL 3.0 By KiM (href='http://www.alt-man.co.uk'>Alterative Manchester)"

et... tout les caractère sont très très gros!


Merci pour ton aide... unsure.gif
Phobos
ça c'est le copyright bourrin qu'a ajouté l'auteur de la mod :s

CODE
foreach(explode("\n",$this->ipsclass->vars['search_engine_bots']) as $bot){list($ua, $n)=explode("=", $bot);if ($ua and $n){$this->bot_map[strtolower($ua)] = $n;$this->bot_safe[]=preg_quote($ua,"/");}}if (preg_match('/('.implode('|',$this->bot_safe ).')/i',$_SERVER['HTTP_USER_AGENT'],$match)){print "SEO Powered By FURL 3.0 By KiM (href='http://www.alt-man.co.uk'>Alterative Manchester</a>)";}

supprime cette ligne et fait reference à l'auteur de la mod où tu le souhaite wink.gif
sunbeach
Ok!! ça fonctionne merci! ;à je ferais référence à l'auteur dans les partenaires à la limite!!

Merci encore! wink.gif

Ce coup ci c'est bon normalement... laugh.gif

Merci! smile.gif
skrib
QUOTE(Phobos @ jeudi 20 octobre 2005 à 18:50)
C'est un sid dans l'url, ce n'est pas étrange, c'est normal, cela permet de garder la session lorsque le navigateur n'a pas encore accepté le cookie, ne t'inuiètes pas les robots renseignés dans la liste dans ton panneau d'admin ne verront jamais ce genre d'url wink.gif
Pour la déconnexion intempestive, vois du côté de la configuration de tes cookies dans l'acp, cela ne vient aps de l'url rewriting wink.gif
*



comment virer le sid pour avoir dès le depart (sans rechargement de la page) les url rewritées ?
thx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.