Kaizen a dit:- added replacement of "'" by $change_space instead of deleting them
c'est pas usine à gaz du tout, il est tout simple le mode de Kaizen...noot a dit:Je pense qu'il faur arréter avec vos usines à gaz. J'espère que toutes vos modifications passeront le cap de la prochaine mise à jour. Vu la fréquence ces derniers temps, ça ne saurait tarder.
Je vais regarder tout cela. ;-)Fabrice P. a dit:* Pour le point plus haut, il faudrait faire la même chose avec /:;.?,!+=><
* Sinon c'est du chippotage, mais parfois l'url se termine comme suit : -.html ce serait bien si on pouvait enlever le - final.
* Supprimer les mots de 2 lettres de l'url + une liste de mot paramétrables.
Et dans la liste des mots paramétrables (en dur dans la fonction, faut pas se faire chi## avec une lecture de fichier), on pourra mettre les mots de 3 lettres qui ne servent à rien : les des son ses ...
A chacun après de se faire sa liste.
Kaizen a dit:Vu les changements, je te conseillerai de désinstaller la v 0.1 (en faisant une recherche sur "// Search Engine Optimisation Mod" puis d'installer la v. 0.2.0. Quasiment tout le code a changé (c'est par cela que j'ai changé le numéro de version...)
Effectivement, je ne m'occupe pas (encore ?) de ce point dans mon mod. Tourne-toi vers le mod d'AbleToKnow (cité dans l'intro de mon mod) ou vers une méthode donnée dans ce forum. ;-)l'id de session est toujours présente dans l'url ?
Dans le changelog de la v. 0.2.0 tu peux lire :Et pourquoi une fois loggé on a plus les titres dans l'url
Ce qui se traduit par :- rewrite urls only for guest (wich improve speed for members)
- ré-écrit les url uniquement pour les invités (ce qui augmente la vitesse pour les membres)
J'avoue que j'ai du mal à comprendre. :?Je pense qu'il faur arréter avec vos usines à gaz.
Mêmes questions...J'espère que toutes vos modifications passeront le cap de la prochaine mise à jour.
C'est fait :arrow: v. 0.2.2* Pour le point plus haut, il faudrait faire la même chose avec /:;.?,!+=><
* Sinon c'est du chippotage, mais parfois l'url se termine comme suit : -.html ce serait bien si on pouvait enlever le - final.
Je l'ajoute au mod, mais en commentaire (pour un forum consacré à Windows XP, il est bon d'avoir "xp" dans l'url ;-) ). Décommentez-le si vous le souhaitez.* Supprimer les mots de 2 lettres de l'url
$url_title = preg_replace("/$change_space([a-z_]{1,2})$change_space/",$change_space,$url_title);
$url_title = preg_replace("/$change_space([a-z_]{1,2})$/",$change_space,$url_title);
$url_title = preg_replace("/$change_space([a-z_]{1,2})($change_space|$)/",($change_space|$),$url_title);
Ajoute-les dans la ligne+ une liste de mot paramétrables.
Et dans la liste des mots paramétrables (en dur dans la fonction, faut pas se faire chi## avec une lecture de fichier), on pourra mettre les mots de 3 lettres qui ne servent à rien : les des son ses ...
$url_title = preg_replace("/(>|<|"|&)/",$change_space,$url_title);
$url_title = preg_replace("/(>|<|"|&| les | des | son | ses)/",$change_space,$url_title);
Il y a plus simple !Kaizen a dit:À ce propos, je n'ai pas réussi à mettre cela en une ligne :
Je pensais àCode:$url_title = preg_replace("/$change_space([a-z_]{1,2})$change_space/",$change_space,$url_title); $url_title = preg_replace("/$change_space([a-z_]{1,2})$/",$change_space,$url_title);
mais ça ne passe pas.Code:$url_title = preg_replace("/$change_space([a-z_]{1,2})($change_space|$)/",($change_space|$),$url_title);
S'il y a un crack en php qui me lit... ;-)
$url_title = $change_space . strtr($url_title,'áâàäéêèëíîìïóôòöúûùüýçñ','aaaaeeeeiiiioooouuuuycn') . $change_space;
$url_title = preg_replace("/$change_space([a-z_]{1,2})$change_space/",$change_space,$url_title);
// Remove one/two-letter words (uncomment next lines if you want to use this function)
$url_title2 = preg_replace("/\-([a-z]{1,2})\-/", '-', $url_title);
while ($url_title2 != $url_title) {
$url_title = $url_title2;
$url_title2 = preg_replace("/\-([a-z]{1,2})\-/", '-', $url_title);
}
<?xml version="1.0" encoding="{S_CONTENT_ENCODING}"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="{S_CONTENT_DIRECTION}">
<head>
{FILTER_ROBOTS}
<META name="MSSmartTagsPreventParsing" content="true" />
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="Content-Style-Type" content="text/css" />
{FILTER_ROBOTS}
<META name="MSSmartTagsPreventParsing" content="true" />
if ( $_SERVER['REQUEST_URI'] == '/' || $_SERVER['REQUEST_URI'] == '/index.php' || strstr ($_SERVER['REQUEST_URI'], '.html') != FALSE )
$filter_robots = '<META name="robots" content="index,follow,noarchive" /><META name="msnbot" content="index,follow,noarchive" />';
else
$filter_robots = '<META name="robots" content="noindex,nofollow,noarchive" /><META name="msnbot" content="noindex,nofollow,noarchive" />';
//
// The following assigns all _common_ variables that may be used at any point
// in a template.
//
$template->assign_vars(array(
'FILTER_ROBOTS' => $filter_robots,
'SITENAME' => $board_config['sitename'],
'FILTER_ROBOTS' => $filter_robots
if ( $_SERVER['REQUEST_URI'] == '/' || $_SERVER['REQUEST_URI'] == '/index.php' || strstr ($_SERVER['REQUEST_URI'], '.html') != FALSE )
$filter_robots = '<META name="robots" content="index,follow,noarchive" /><META name="msnbot" content="index,follow,noarchive" />';
else
$filter_robots = '<META name="robots" content="noindex,nofollow,noarchive" /><META name="msnbot" content="noindex,nofollow,noarchive" />';
solodown a dit:moi j'ai fai la modif de dlp puis ohax
je dois tous refaire :?:
@+
solo
Pratiquement tout oui...solodown a dit:moi j'ai fai la modif de dlp puis ohax
je dois tous refaire :?:
Fabrice P. a dit:On peut aller plus loin en coupant l'indexation de certaines rubriques de forum (genre les rubriques bar ou très généralistes, on tout le monde dit des conneries qui n'ont pas nécessairement besoin d'être sur google).
RewriteEngine On
RewriteRule ^index\-([0-9]*)\.html$ /forum/index.php?c=$1 [L]
RewriteRule ^forum\-([0-9]*)\.html$ /forum/viewforum.php?f=$1 [L]
RewriteRule ^forum\-([0-9]*)\-([0-9]*)\-([0-9]*)\.html$ /forum/viewforum.php?f=$1&topicdays=$2&start=$3 [L]
RewriteRule ^sujet\-([0-9]*)\.html$ /forum/viewtopic.php?t=$1 [L]
RewriteRule ^sujet\-([0-9]*)\-([0-9]*)\.html$ /forum/viewtopic.php?t=$1&start=$2 [L]
RewriteRule ^sujet\-([0-9]*)\(([^()]*)\)\.html$ /forum/viewtopic.php?t=$1&highlight=$2 [L]
RewriteRule ^sujet\-([0-9]*)\-([0-9]*)\-([0-9]*)\-([a-zA-Z]*)\.html$ /forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4 [L]
RewriteRule ^sujet\-([0-9]*)\-([0-9]*)\-([0-9]*)\-([a-zA-Z]*)\(([^()]*)\)\.html$ /forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L]
RewriteRule ^vsujet\-([0-9]*)\.html$ /forum/viewtopic.php?p=$1 [L]
RewriteRule ^prec\-sujet\-([0-9]*)\.html$ /forum/viewtopic.php?t=$1&view=previous [L]
RewriteRule ^suiv\-sujet\-([0-9]*)\.html$ /forum/viewtopic.php?t=$1&view=next [L]
RewriteRule ^profil\-([0-9]*)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^categorie\-([0-9]*)\.html$ /forum/index.php\?c=$1 [L]
Essaie sans les "/" dans tes règles de réécriture :keupsonite a dit:bonjour,
Avec la premiéres version de ce mod, sur mon herbergeur celeonet sa marche sans problémes, mais chez changer d'hebergeur et j'ai cette erreur!
The requested URL /viewforum.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Comment sa se fait? J'ai contacter le support et il m'on dis que cela n'avait rien avoir avec le serveur, quelqu'un serait m'aider?
Merci, Keupsonite.
Le Site En Question: Ici
Dj_Apx a dit:Essaie sans les "/" dans tes règles de réécriture :keupsonite a dit:bonjour,
Avec la premiéres version de ce mod, sur mon herbergeur celeonet sa marche sans problémes, mais chez changer d'hebergeur et j'ai cette erreur!
The requested URL /viewforum.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Comment sa se fait? J'ai contacter le support et il m'on dis que cela n'avait rien avoir avec le serveur, quelqu'un serait m'aider?
Merci, Keupsonite.
Le Site En Question: Ici
viewforum.php au lieu de /viewforum.php :wink:
Oui, dans le .htaccess :wink:keupsonite a dit:Dj_Apx a dit:Essaie sans les "/" dans tes règles de réécriture :keupsonite a dit:bonjour,
Avec la premiéres version de ce mod, sur mon herbergeur celeonet sa marche sans problémes, mais chez changer d'hebergeur et j'ai cette erreur!
The requested URL /viewforum.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Comment sa se fait? J'ai contacter le support et il m'on dis que cela n'avait rien avoir avec le serveur, quelqu'un serait m'aider?
Merci, Keupsonite.
Le Site En Question: Ici
viewforum.php au lieu de /viewforum.php :wink:
Dans le .htaccess?
Merci, Keupsonite.
Dj_Apx a dit:Oui, dans le .htaccess :wink:keupsonite a dit:Dj_Apx a dit:Essaie sans les "/" dans tes règles de réécriture :keupsonite a dit:bonjour,
Avec la premiéres version de ce mod, sur mon herbergeur celeonet sa marche sans problémes, mais chez changer d'hebergeur et j'ai cette erreur!
The requested URL /viewforum.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Comment sa se fait? J'ai contacter le support et il m'on dis que cela n'avait rien avoir avec le serveur, quelqu'un serait m'aider?
Merci, Keupsonite.
Le Site En Question: Ici
viewforum.php au lieu de /viewforum.php :wink:
Dans le .htaccess?
Merci, Keupsonite.
Excuse-moi, je n'aime pas employer des anglicismes comme "Rewrite Rule" quand le français est beaucoup moins barbare pour dire la même chose.
keupsonite a dit:J'ai fais comme tu ma dis, maintenant j'ai cette erreurs:
Not Found
The requested URL /home/keupsonite/public_html/forum/viewforum.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Un programme qui installe les MODs de façon automatisée.achtungbaby a dit:C'est quoi easymod ?
Kaizen a dit:Bonjour,
Je me suis inspiré de vos posts et de vos remarques sur https://www.webrankinfo.com/forum/t/le-nom-du-titre-dans-lurl-de-votre-forum-phpbb.24693/ pour faire le mod ci-joint.
Par rapport aux mod poposé par Ohax, dont j'ai repris et adapté une partie du code (.htaccess en particulier) :
- vitesse de traitement amélorée
- les chiffres contenus dans un titre sont conservés dans l'url
- le titre apparait sur toutes les pages (celles de type viewtopic.php?t=74505&start=8595 n'étaient pas prisent en charge)
Je n'ai pas traité les aspect SID ni optimistation par supression des liens inutiles pour les invités. Le mod Able2Know.com SEO -http://www.able2know.com/forums/viewtopic.php?t=15132 le fait très bien, bien qu'on puisse aller plus loin encore (contactez-moi si vous êtes interessés)
Un grand merci à Ohax, j'aprécie l'esprit dans lequel tu partages ton travail. ;-)
J'aimerai avoir votre avis sur "la chose". Il serait sympa de faire évoluer le concept pour arriver à quelque chose de poussé.
Code:############################################################## ## MOD Title: Search Engine Friendly URLs with Title ## MOD Author: Kaizen < webmaster at teamatic dot net > (Kaizen) http://www.teamatic.net ## MOD Description: Change urls like viewtopic.php?t=xxxxxx to ftopicxxxxx--title-of-the-topic.html ## wich give better search engine visibility ## MOD Version: 0.1.0 ## ## Installation Level: (Intermediate) ## Installation Time: 10 Minutes ## Files To Edit: includes/functions.php, ## includes/page_header.php, ## includes/page_tail, ## viewforum.php ## viewtopic.php ## ## Included Files: (n/a) ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the ## latest version of this MOD. Downloading this MOD from other sites could cause malicious code ## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered ## in our MOD-Database, located at: http://www.phpbb.com/mods/ ############################################################## ## Author Notes: ## ## This is BETA version ! Use it at your own risks ## ## In order to improve indexing, you should also take a look to : ## Able2Know.com SEO - http://www.able2know.com/forums/viewtopic.php?t=15132 ## ## This mod is inspired by and use code shared by the following persons : ## Dr DLP - http://forums.phpbb-fr.com/viewtopic_39629.html ## Ohax - https://www.webrankinfo.com/forum/t/le-nom-du-titre-dans-lurl-de-votre-forum-phpbb.24693/ ## Thanks to them. ## ############################################################## ## MOD History: ## ## 2005-04-03 - Version 0.1.0 ## - first beta published ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## ############################################################## # Create a file named .htaccess in your forum folder # # Assuming you phpBB folder is mysite.com/forum use this code (without the "# ") # # RewriteEngine On # RewriteRule ^forums.* /forum/index.php # RewriteRule ^mforum([0-9]*).* /forum/viewforum.php?f=$1&mark=topics # RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /forum/viewforum.php?f=$1&topicdays=$2&start=$3 # RewriteRule ^forum([0-9]*).* /forum/viewforum.php?f=$1 # RewriteRule ^ptopic([0-9]*).* /forum/viewtopic.php?t=$1&view=previous # RewriteRule ^ntopic([0-9]*).* /forum/viewtopic.php?t=$1&view=next # RewriteRule ^stopic([0-9]*)-([0-9]*).* /forum/viewtopic.php?t=$1&watch=topic&start=$2 # RewriteRule ^utopic([0-9]*)-([0-9]*).* /forum/viewtopic.php?t=$1&unwatch=topic&start=$2 # # RewriteRule ^ftopic([0-9]*)--([0-9]*)--([a-zA-Z]*)--([0-9]*)--.* /forum/viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 # RewriteRule ^ftopic([0-9]*)--([0-9]*)--.* /forum/viewtopic.php?t=$1&start=$2 # RewriteRule ^ftopic([0-9]*)--.* /forum/viewtopic.php?t=$1 # RewriteRule ^ftopic([0-9]*)--.html /forum/viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 # # RewriteRule ^setopic([0-9]*)-([a-zA-Z0-9]*).* /forum/viewtopic.php?t=$1&highlight=$2 # RewriteRule ^sutra([0-9]*).* /forum/viewtopic.php?p=$1 # RewriteRule ^newtopic([0-9]*).* /forum/viewtopic.php?t=$1&view=newest # ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/functions.php # #-----[ FIND ]------------------------------------------ # function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) { global $lang; $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ''; } $on_page = floor($start_item / $per_page) + 1; $page_string = ''; if ( $total_pages > 10 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? ' ... ' : ', '; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { $page_string .= ', '; } } $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; } else { $page_string .= ' ... '; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { $page_string .= ', '; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = ' <a href="' . append_sid($base_url . "&start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { $page_string .= ' <a href="' . append_sid($base_url . "&start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>'; } } $page_string = $lang['Goto_page'] . ' ' . $page_string; return $page_string; } # #-----[ REPLACE WITH ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE, $url_title = "") { global $lang; $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ''; } $on_page = floor($start_item / $per_page) + 1; $page_string = ''; if ( $total_pages > 10 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") .'">' . $i . '</a>'; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? ' ... ' : ', '; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { $page_string .= ', '; } } $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; } else { $page_string .= ' ... '; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") . '">' . $i . '</a>'; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") . '">' . $i . '</a>'; if ( $i < $total_pages ) { $page_string .= ', '; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = ' <a href="' . append_sid($base_url . "&start=" . ( ( $on_page - 2 ) * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") . '">' . $lang['Previous'] . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { $page_string .= ' <a href="' . append_sid($base_url . "&start=" . ( $on_page * $per_page ) ) . ($url_title != "" ? "&url_title=" . $url_title : "") . '">' . $lang['Next'] . '</a>'; } } $page_string = $lang['Goto_page'] . ' ' . $page_string; return $page_string; } /* function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) { global $lang; $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ''; } $on_page = floor($start_item / $per_page) + 1; $page_string = ''; if ( $total_pages > 10 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? ' ... ' : ', '; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { $page_string .= ', '; } } $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; } else { $page_string .= ' ... '; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { $page_string .= ', '; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = ' <a href="' . append_sid($base_url . "&start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { $page_string .= ' <a href="' . append_sid($base_url . "&start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>'; } } $page_string = $lang['Goto_page'] . ' ' . $page_string; return $page_string; } */ // End Search Engine Friendly URLs with title mod # #-----[ OPEN ]------------------------------------------ # includes/page_header.php # #-----[ FIND ]------------------------------------------ # $template->set_filenames(array( 'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl') ); # #-----[ AFTER, ADD ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod ob_start(); function replace_mod_rewrite($s) { $urlin = array( "'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'", "'(?<!/)viewforum.php\?f=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=newest'", "'(?<!/)viewtopic.php\?t=([0-9]*)&(?:amp;)watch=topic&(?:amp;)start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&(?:amp;)unwatch=topic&(?:amp;)start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)&url_title=([a-z0-9_\-]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)&url_title=([a-z0-9_\-]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&url_title=([a-z0-9_\-]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&url_title=([a-z0-9_\-]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=([a-zA-Z0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)'", "'(?<!/)viewtopic.php\?p=([0-9]*)'"); $urlout = array( "viewforum\\1-\\2-\\3.php", "mforum\\1.php", "forum\\1.php", "ptopic\\1.php", "ntopic\\1.php", "newtopic\\1.php", "stopic\\1-\\2.php", "utopic\\1-\\2.php", "ftopic\\1--\\2--\\3--\\4--\\5.html", "ftopic\\1--\\2--\\3--\\4--\\5\\6.html", "ftopic\\1--\\2--\\3.html", "ftopic\\1--0--\\2.html", "setopic\\1-\\2.html", "ftopic\\1.php", "sutra\\1.php"); $s = preg_replace($urlin, $urlout, $s); return $s; } // End Search Engine Friendly URLs with title mod # #-----[ OPEN ]------------------------------------------ # includes/page_tail # #-----[ FIND ]------------------------------------------ # $db->sql_close(); # #-----[ FIND ]------------------------------------------ # $gzip_contents = ob_get_contents(); ob_end_clean(); # #-----[ AFTER, ADD ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod echo replace_mod_rewrite($contents); global $dbg_starttime; // End Search Engine Friendly URLs with title mod # #-----[ OPEN ]------------------------------------------ # viewforum.php # #-----[ FIND ]------------------------------------------ # if( ( $replies + 1 ) > $board_config['posts_per_page'] ) { $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] ); # #-----[ BEFORE, ADD ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod $change_space = "-"; $url_title = $topic_title; while ($url_title{0} == $change_space){ $url_title = substr($url_title,1); } $url_title=strtolower($url_title); $url_title=strtr($url_title,'áâàäéêèëíîìïóôòöúûùüýçñ','aaaaeeeeiiiioooouuuuycn'); $url_title=ereg_replace(' ',$change_space,$url_title); $url_title=ereg_replace('[^a-z0-9_\-]','',$url_title); $url_title=ereg_replace('--','-',$url_title); // End Search Engine Friendly URLs with title mod # #-----[ FIND ]------------------------------------------ # for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) { $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>'; # #-----[ REPLACE WITH ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) { $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=" . $j . "&url_title=" . $url_title ) . '">' . $times . '</a>'; /* for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) { $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>'; */ // End Search Engine Friendly URLs with title mod # #-----[ FIND ]------------------------------------------ # $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); # #-----[ REPLACE WITH ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&url_title=" . $url_title); // $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); // End Search Engine Friendly URLs with title mod # #-----[ OPEN ]------------------------------------------ # viewtopic.php # #-----[ FIND ]------------------------------------------ # $pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start); # #-----[ REPLACE WITH ]------------------------------------------ # // Start Search Engine Friendly URLs with title mod $change_space = "-"; $url_title = $topic_title; while ($url_title{0} == $change_space){ $url_title = substr($url_title,1); } $url_title=strtolower($url_title); $url_title=strtr($url_title,'áâàäéêèëíîìïóôòöúûùüýçñ','aaaaeeeeiiiioooouuuuycn'); $url_title=ereg_replace(' ',$change_space,$url_title); $url_title=ereg_replace('[^a-z0-9_\-]','',$url_title); $url_title=ereg_replace('--','-',$url_title); $pagination = generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id, $total_replies, $board_config['posts_per_page'], $start, TRUE, $url_title); //$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start); // End Search Engine Friendly URLs with title mod # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM
Kaizen a dit:Pour changer les liens de type
pourCode:ftopicX--titre-de-la-page.html (présent sur la page forumX.html)
Code:ftopicX-0-titre-de-la-page.html (qui donne la pagination)
Dans includes/page_header.php
RemplacerparCode:"ftopic\\1--\\2.html"
Code:"ftopic\\1--0--\\2.html"
Je met à jour le mod.
Le forum de phpBB.com :roll:nautiljon a dit:hein, euh, quel forum ?
Personne a déjà fait une upgrade d'un phpbb ayant des mods ? je pense que dans l'upgrade il va remplacer des fichiers que le mod pour avoir le titre dans l'url avait modifier. Donc le mieux c'est de faire quoi ? ecraser les fichiers modif par le mod puis rééxecuter le mode par derrière ?
Kaizen a dit:
Y en a un plus récent que l'autre.Tyr Ur a dit:Bonsoir
Kaizen a dit:
J'aimerais comprendre la différence entre ces 2 mods ?
En tout cas un grand merci pour ce travail
Kaizen a dit:Par rapport aux mod poposé par Ohax, dont j'ai repris et adapté une partie du code (.htaccess en particulier) :
- vitesse de traitement amélorée
- les chiffres contenus dans un titre sont conservés dans l'url
- le titre apparait sur toutes les pages (celles de type viewtopic.php?t=74505&start=8595 n'étaient pas prisent en charge)
- le titre des forums apparait dans l'url
- seuls les invités ont des url "re-writées"
Ohax a dit:
cdepoutre a dit:Ca m'apprendra à me lancer sans rechercher...
En même temps il n'est pas encore trop tard pour lui, il peut encore le faireOhax a dit:cdepoutre a dit:Ca m'apprendra à me lancer sans rechercher...
non
ça t'apprendra à ne pas prendre un hebergemment pro ;-)
:lol: :lol: :lol:
<?php
/***************************************************************************
* viewforum.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: viewforum.php,v 1.139.2.12 2004/03/13 15:08:23 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);include_once($phpbb_root_path . 'includes/functions_topics_list.'. $phpEx);
//
// Start initial var setup
//
if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) )
{
$forum_id = ( isset($HTTP_GET_VARS[POST_FORUM_URL]) ) ? intval($HTTP_GET_VARS[POST_FORUM_URL]) : intval($HTTP_POST_VARS[POST_FORUM_URL]);
}
else if ( isset($HTTP_GET_VARS['forum']))
{
$forum_id = intval($HTTP_GET_VARS['forum']);
}
else
{
$forum_id = '';
}
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
if ( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) )
{
$mark_read = (isset($HTTP_POST_VARS['mark'])) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark'];
}
else
{
$mark_read = '';
}
//
// End initial var setup
//
//
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
//
if ( !empty($forum_id) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
}
else
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}
//
// If the query doesn't return any rows this isn't a valid forum. Inform
// the user.
//
if ( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}
//
// Start session management
//
$userdata = session_pagestart($user_ip, $forum_id);
init_userprefs($userdata);
//
// End session management
//
//
// Start auth check
//
$is_auth = array();
$is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
if ( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
{
if ( !$userdata['session_logged_in'] )
{
$redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : '' );
redirect(append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
}
//
// The user is not authed to read this forum ...
//
$message = ( !$is_auth['auth_view'] ) ? $lang['Forum_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}
//
// End of auth check
//
//
// Handle marking posts
//
if ( $mark_read == 'topics' )
{
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT MAX(post_time) AS last_post
FROM " . POSTS_TABLE . "
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
if ( ( count($tracking_forums) + count($tracking_topics) ) >= 150 && empty($tracking_forums[$forum_id]) )
{
asort($tracking_forums);
unset($tracking_forums[key($tracking_forums)]);
}
if ( $row['last_post'] > $userdata['user_lastvisit'] )
{
$tracking_forums[$forum_id] = time();
setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}
}
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
);
}
$message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : '';
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : '';
//
// Do the forum Prune
//
if ( $is_auth['auth_mod'] && $board_config['prune_enable'] )
{
if ( $forum_row['prune_next'] < time() && $forum_row['prune_enable'] )
{
include($phpbb_root_path . 'includes/prune.'.$phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
auto_prune($forum_id);
}
}
//
// End of forum prune
//
//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//
$sql = "SELECT u.user_id, u.username
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
WHERE aa.forum_id = $forum_id
AND aa.auth_mod = " . TRUE . "
AND g.group_single_user = 1
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
AND u.user_id = ug.user_id
GROUP BY u.user_id, u.username
ORDER BY u.user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
$moderators = array();
while( $row = $db->sql_fetchrow($result) )
{
$moderators[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>';
}
$sql = "SELECT g.group_id, g.group_name
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g
WHERE aa.forum_id = $forum_id
AND aa.auth_mod = " . TRUE . "
AND g.group_single_user = 0
AND g.group_type <> ". GROUP_HIDDEN ."
AND ug.group_id = aa.group_id
AND g.group_id = aa.group_id
GROUP BY g.group_id, g.group_name
ORDER BY g.group_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$moderators[] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>';
}
$l_moderators = ( count($moderators) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
$forum_moderators = ( count($moderators) ) ? implode(', ', $moderators) : $lang['None'];
unset($moderators);
//
// Generate a 'Show topics in previous x days' select box. If the topicsdays var is sent
// then get it's value, find the number of topics with dates newer than it (to properly
// handle pagination) and alter the main query
//
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Topics'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']);
if ( !empty($HTTP_POST_VARS['topicdays']) || !empty($HTTP_GET_VARS['topicdays']) )
{
$topic_days = ( !empty($HTTP_POST_VARS['topicdays']) ) ? intval($HTTP_POST_VARS['topicdays']) : intval($HTTP_GET_VARS['topicdays']);
$min_topic_time = time() - ($topic_days * 86400);
$sql = "SELECT COUNT(t.topic_id) AS forum_topics
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.forum_id = $forum_id
AND p.post_id = t.topic_last_post_id
AND p.post_time >= $min_topic_time";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain limited topics count information', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$topics_count = ( $row['forum_topics'] ) ? $row['forum_topics'] : 1;
$limit_topics_time = "AND p.post_time >= $min_topic_time";
if ( !empty($HTTP_POST_VARS['topicdays']) )
{
$start = 0;
}
}
else
{
$topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1;
$limit_topics_time = '';
$topic_days = 0;
}
$select_topic_days = '<select name="topicdays">';
for($i = 0; $i < count($previous_days); $i++)
{
$selected = ($topic_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_topic_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
}
$select_topic_days .= '</select>';
//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u2.user_id
AND t.topic_type = " . POST_ANNOUNCE . "
ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_announcements++;
}
$db->sql_freeresult($result);
//
// Grab all the basic data (all topics except announcements)
// for this forum
//
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
AND t.topic_type <> " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, t.topic_priority DESC, p2.post_time DESC
LIMIT $start, ".$board_config['topics_per_page'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
$total_topics = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_topics++;
}
$db->sql_freeresult($result);
//
// Total topics ...
//
$total_topics += $total_announcements;
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//
// Post URL generation for templating vars
//
$template->assign_vars(array(
'L_DISPLAY_TOPICS' => $lang['Display_topics'],
'U_POST_NEW_TOPIC' => append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id"),
'S_SELECT_TOPIC_DAYS' => $select_topic_days,
'S_POST_DAYS_ACTION' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
);
//
// User authorisation levels output
//
$s_auth_can = ( ( $is_auth['auth_post'] ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_reply'] ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_edit'] ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_delete'] ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . '<br />';
$s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';
if ( $is_auth['auth_mod'] )
{
$s_auth_can .= sprintf($lang['Rules_moderate'], "<a href=\"modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&start=" . $start . "&sid=" . $userdata['session_id'] . '">', '</a>');
}
//
// Mozilla navigation bar
//
$nav_links['up'] = array(
'url' => append_sid('index.'.$phpEx),
'title' => sprintf($lang['Forum_Index'], $board_config['sitename'])
);
//
// Dump out the page header and load viewforum template
//
define('SHOW_ONLINE', true);
$page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'viewforum_body.tpl')
);
make_jumpbox('viewforum.'.$phpEx);
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_row['forum_name'],
'MODERATORS' => $forum_moderators,
'POST_IMG' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],
'FOLDER_IMG' => $images['folder'],
'FOLDER_NEW_IMG' => $images['folder_new'],
'FOLDER_HOT_IMG' => $images['folder_hot'],
'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'],
'FOLDER_LOCKED_IMG' => $images['folder_locked'],
'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'],
'FOLDER_STICKY_IMG' => $images['folder_sticky'],
'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'],
'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'],
'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'],
'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_MODERATOR' => $l_moderators,
'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'],
'L_POST_NEW_TOPIC' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'],
'L_NEW_POSTS_HOT' => $lang['New_posts_hot'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_STICKY' => $lang['Post_Sticky'],
'L_POSTED' => $lang['Posted'],
'L_JOINED' => $lang['Joined'],
'L_AUTHOR' => $lang['Author'],
'S_AUTH_LIST' => $s_auth_can,
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
'U_MARK_READ' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&mark=topics"))
);
//
// End header
//
//
// Okay, lets dump out the page ...
//
//-- mod : split topic type ------------------------------------------------------------------------
//-- add
// adjust the item id
for ($i=0; $i < count($topic_rowset); $i++)
{
$topic_rowset[$i]['topic_id'] = POST_TOPIC_URL . $topic_rowset[$i]['topic_id'];
}
// set the bottom sort option
$footer = $lang['Display_topics'] . ': ' . $select_topic_days . ' ' . ( !empty($s_display_order) ? $s_display_order : '') . '<input type="submit" class="liteoption" value="' . $lang['Go'] . '" name="submit" />';
// send the list
$allow_split_type = true;
$display_nav_tree = false;
topic_list('TOPICS_LIST_BOX', 'topics_list_box', $topic_rowset, '', $allow_split_type, $display_nav_tree, $footer);
//-- delete
//-- fin mod : split topic type --------------------------------------------------------------------
$topics_count -= $total_announcements;
$template->assign_vars(array(
'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )),
'L_GOTO_PAGE' => $lang['Goto_page'])
);
//-- mod : split topic type ------------------------------------------------------------------------
//-- delete
//-- fin mod : split topic type -----------------------
//
// Parse the page and print
//
$template->pparse('body');
//
// Page footer
//
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
cherche le MOD "last topics on index" pour phpBB :wink:netsba a dit:c un superbe travail et je tien a féliciter son consepteur :wink:
ma question est comme faire pour avoir un script pour les derniers postes sur ma page d'accueil avec des liens en dure
Dj_Apx a dit:cherche le MOD "last topics on index" pour phpBB :wink:netsba a dit:c un superbe travail et je tien a féliciter son consepteur :wink:
ma question est comme faire pour avoir un script pour les derniers postes sur ma page d'accueil avec des liens en dure
Je ne crois pas, non...netsba a dit:Dj_Apx a dit:cherche le MOD "last topics on index" pour phpBB :wink:netsba a dit:c un superbe travail et je tien a féliciter son consepteur :wink:
ma question est comme faire pour avoir un script pour les derniers postes sur ma page d'accueil avec des liens en dure
je connais ce mod mais le probleme c que toi tu utilise tjr les memes termes dans tes forums (ex debat-25.hmtl)
alors que ici on parle de libelé dans l'url :evil:
je parle biensure d'1 page hors phpbb (ma page d'acceuil du site)
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail
#
#-----[ FIND ]------------------------------------------
#
$db->sql_close();
ICI
#
#-----[ FIND ]------------------------------------------
#
$gzip_contents = ob_get_contents();
ob_end_clean();
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start Search Engine Friendly URLs with title mod
echo replace_mod_rewrite($contents);
global $dbg_starttime;
// End Search Engine Friendly URLs with title mod
// Start Search Engine Friendly URLs with title mod
$change_space = "-";
$url_title = $topic_title;
while ($url_title{0} == $change_space){
$url_title = substr($url_title,1);
}
$url_title=strtolower($url_title);
$url_title=strtr($url_title,'áâàäéêèëíîìïóôòöúûùüýçñ','aaaaeeeeiiiioooouuuuycn');
$url_title=ereg_replace(' ',$change_space,$url_title);
$url_title=ereg_replace('[^a-z0-9_\-]','',$url_title);
$url_title=ereg_replace('--','-',$url_title);
tu va dans viewtopic_body.tpl et tu vire le lien
mais bon ça te fait 2 remplacemments d'affilés
quel problème de apostrophe ?
pour le guillemet, il faudrait remplacer "e; par "-"
Et le faire tout au début des remplacements
Tyr Ur a dit:Bonsoir
sur le mod de Kaizen
dans functions.php
$url_title = preg_replace("/(>|<|"|&)/",$change_space,$url_title);
, il me retourne un parse error unexpected &, je ne vois pas quelle police de caractère doit fonctionner ?
puis c'est au tour
$url_title = preg_replace("/[^a-z0-9_\-]/",$change_space,$url_title)
il ne veut pas des crochets, il me retourne un parse error [
je fais les modifs avec DMX
que se passe-t-il svp ?
Merci
"
/(>|<|
"
|&)/",$change_space,$url_title);
Ohax a dit:l'url que tu as construite sera trés difficile (voir impossible) à indexer
il suffisait de suivre à la lettre les indications car là je voit vraiment pas ce que tu as fait pour rajouter une variable dans l'url de cette manière
Tyr Ur a dit:Pourquoi le sujet d'un post n'apparaît pas en titre de page ? dans l'url rewritting donné par Dr DLP et Ohax
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>Le Forum de Sagesse Primordiale : Débats, pensées, échanges, citations, Sagesse et Amour</title>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{S_CONTENT_DIRECTION}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{PAGE_TITLE} sur {SITENAME}</title>