phpBB SEO Simple mod Rewrite 0.0.2
Kód:
##############################################################
## MOD Title: phpBB SEO Simple mod Rewrite
## MOD Author: dcz <n/a> http://www.phpbb-seo.com/
## MOD Description: This mod makes static URLs for phpBB
## Please read the author notes BEFORE using this mod.
## Check http://boards.phpbb-seo.com/phpbb-mod-rewrite/phpbb-seo-simple-mod-rewrite-vt45.html
## for the latest version or to get help with this MOD
##
## MOD Version: 0.0.2
##
## Installation Level: (Advanced)
## Installation Time: 3 Minutes
## Files To Edit: (5)
## .htaccess,
## index.php,
## includes/function.php,
## includes/session.php,
## viewtopic.php
## search.php
## Included Files: n/a
##############################################################
## Author Notes:
##
## This mod require running Apache Server with mod_Rewrite On.
##
## This mod requires the Cyber Alien guest session mod (http://www.phpbbstyles.com/viewtopic.php?t=357).
##
## With this mod, your phpBB URL will change :
##
## index.php?c=xx => catxx.html
##
## viewforum.php?t=xx => forumxx.html
##
## viewforum.php?t=xx&start=xx => forumxx-yy.html
##
## viewtopic.php?t=xx => topicxx.html
##
## viewtopic.php?t=xx&start=xx => topicxx-yy.html
##
## viewtopic.php?p=xx => postxx.html
##
## profile.php?mode=viewprofile&u=xx => memberxx.html
##
## This mod has nothing in common with other phpBB mod rewrite, it will perform the URL rewriting
## without using ob_start(), thus faster and not messing anymore whith Gun-Zip nor with the html link format,
## and will not output any pagination duplicate.
##
## This is the lightest and easiest way to deal with phpBB SEO mod Rewrite. It will rewrite all phpBB URL built using
## the append_sid() phpBB function (e.g . all decent phpBB mods ;-) ) without any additional changes.
## No issue whatsoever.
##
## NOTE : phpBB SEO recommend the use of the phpBB SEO mixed mod Rewrite in almost all cases. But this mod can be very
## convenient to allow migration from other heavier static mod Rewrites outputting many duplicates.
## Please read : http://boards.phpbb-seo.com/phpbb-seo-toolkit/phpbb-seo-mod-rewrites-vt66.html
##
## This mod is and will be compatible to all phpBB SEO modules, specific install instructions may apply.
## phpBB SEO will provide patches to allow for other URL standards support upon request,
## so that everyone can take advantage of the phpBB mod Rewrites enhancement without jeopardising his Page-Ranking.
##
## Migrating from another mod Rewrite is as well possible but should be done with care to make sure you won't loose Page-Ranking.
##
####
## 0.0.1 => 0.0.2 Update : Required changes to be found in 0.0.1_0.0.2_Simple_Update.txt
####
##
## LICENSE:
##
## We, phpBB SEO, have decided to license this mod under the RPL Licence ( http://www.opensource.org/licenses/rpl.php )
## which states you cannot remove the phpBB SEO credits and if you make any modifications you have to resubmit them
## to phpBB SEO for inclusion into this package again. You can read the license for yourself for further info.
##
## You can of course use this mod without any more limitations than those stated here and in the licence.
##
## At least a link ( http://www.phpbb-seo.com/ ) is required on every web site using this mod, or,
## if your web site does not comply with what phpBB SEO can link to, one proven link within a
## general audience hard link directory of your choice not already listing phpBB SEO.
## For more details about possible exeptions, please contact a phpBB SEO administrator (primarily SeO or dcz).
##
## Failure to comply will jeopardize support.
##
##############################################################
## MOD History:
##
## 2006-06-20 - 0.0.2
## - Added highlight fix in search.php adn fixed a small bug in search results (results posts)
## - Optimized the append_sid() filtering.
##
## 2006-05-25 - 0.0.1
## - First Beta Version
##
## 2006-03-01 - 0.0.0
## - Initial beta testing phase
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
# NOTE : Put the .htaccess file at the root level of your server.
# If you have any other rewriterules there, just put the rules in it (be careful about the order!).
# Please take a look at : http://boards.phpbb-seo.com/seo-principles/locking-the-www-in-urls-vt30.html
# to find out how to lock the use (or un use) of the www prefix in your domain's url.
# This is a major Search Engine Optimisation issue to take care of the www prefix issue.
#
.htaccess
#
# phpBB is installed at the root level :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/"
# at the beginning of the script.php file-names like "viewforum.php".
# Make sure to change example.com with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# CATEGORIES
RewriteRule ^cat([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
# PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
# phpBB is installed in a sud Folder :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/" at the beginning of "phpbb/"
# Make sure to change phpbb/ with the actual folder name where phpBB is installed and to change example.com
# with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# CATEGORIES
RewriteRule ^phpbb/cat([0-9]+)\.html$ /phpbb/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^phpbb/forum([0-9]+)-([0-9]+)\.html$ /phpbb/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^phpbb/forum([0-9]+)\.html$ /phpbb/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^phpbb/topic([0-9]+)-([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^phpbb/topic([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^phpbb/post([0-9]+)\.html$ /phpbb/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^phpbb/member([0-9]+)\.html$ /phpbb/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Send vars to template
//
#
#-----[ AFTER, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order$highlight_ok"),
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
# In the following code changes, please look at the comments, they concern the
# mx Sitemaps Module ( http://boards.phpbb-seo.com/phpbb-seo-mods/mx-site-map-module-vt4.html )
# and mxBB Portal. Just uncomment, to activate, or delete, if unused, the required lines of code upon your needs
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
global $phpEx;
$amp = ($non_html_amp) ? '&' : '&';
$find = array( $amp.'start=0',
$amp.'postdays=0',
$amp.'topicdays=0',
$amp.'postorder=asc',
);
$url = str_replace ($find, "", $url);
$urlin = array( "'(?)index.".$phpEx."\?c=([0-9]*)(".$amp."){0,1}'",
"'(?)viewforum.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewforum.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?t=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?t=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?p=([0-9]+)(".$amp."){0,1}'",
"'(?)profile.".$phpEx."\?mode\=viewprofile".$amp."u=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (Paginated Forum URL)
//"'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (mxBB map URL + pagination)
//"'(?)mx-map\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
);
$urlout = array( "cat\\1.html".if_query('\\2')."",
"forum\\1-\\2.html".if_query('\\3')."",
"forum\\1.html".if_query('\\2')."",
"topic\\1-\\2.html".if_query('\\3')."",
"topic\\1.html".if_query('\\2')."",
"post\\1.html".if_query('\\2')."",
"member\\1.html".if_query('\\2')."",
// mx Sitemaps Module (Paginated Forum URL)
//"forum-map\\1-\\2.html".if_query('\\3')."",
// mx Sitemaps Module (mxBB map URL + pagination)
//"mx-map\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
$url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;
// www.phpBB-SEO.com SEO TOOLKIT END
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ OPEN ]------------------------------------------
#
#
search.php
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($searchset); $i++)
{
#
#-----[ BEFORE, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active") . '#' . $searchset[$i]['post_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . $highlight_ok) . '#' . $searchset[$i]['post_id'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
include/function.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOLKIT BEGIN
function if_query($amp)
{
if($amp != '')
{
return '?';
}
}
// www.phpBB-SEO.com SEO TOLKIT END
#
#-----[ OPEN ]------------------------------------------
# Note : This code is going to help your site a lot, we request that you keep this copyright notice as specified in the licence.
# If You really cannot put this link, you should at least provide us with one visible (can be small but visible) link
# on your home page or your forum Index using this code for example <a href="http://www.phpbb-seo.com/" title="Search Engine Optimization">phpBB SEO</a>
#
/templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> {PHPBB_VERSION} © phpBB Group
#
#-----[ AFTER ADD]------------------------------------------
#
<br /><a href="http://www.phpbb-seo.com/" title="Search Engine Optimization" target="_phpBBSEO">phpBB SEO</a>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
phpBB SEO Mixed mod Rewrite 0.0.2Kód:
##############################################################
## MOD Title: phpBB SEO Mixed mod Rewrite
## MOD Author: dcz <n/a> http://www.phpbb-seo.com/
## MOD Description: This mod makes static URLs for phpBB
## Please read the author notes BEFORE using this mod.
## Check http://boards.phpbb-seo.com/phpbb-mod-rewrite/phpbb-seo-mixed-mod-rewrite-vt44.html
## for the latest version or to get help with this MOD.
##
## MOD Version: 0.0.2
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: (6)
## .htaccess,
## index.php,
## viewforum.php,
## viewtopic.php,
## search.php,
## overall_footer.tpl
## Included Files: n/a
##############################################################
## Author Notes:
##
## This mod require running Apache Server with mod_Rewrite On.
##
## This mod requires the Cyber Alien guest session mod (http://www.phpbbstyles.com/viewtopic.php?t=357).
##
## With this mod, your phpBB URL will change :
##
## index.php?c=xx => cat-title-vcxx.html
##
## viewforum.php?t=xx => forum-title-vfxx.html
##
## viewforum.php?t=xx&start=xx => forum-title-vfxx-yy.html
##
## viewtopic.php?t=xx => topicxx.html
##
## viewtopic.php?t=xx&start=xx => topicxx-yy.html
##
## viewtopic.php?p=xx => postxx.html
##
## profile.php?mode=viewprofile&u=xx => memberxx.html
##
## This mod has nothing in common with other phpBB mod rewrite, it will perform the URL rewriting
## without using ob_start() nor adding any SQL. It is thus faster and not messing anymore whith Gun-Zip nor with the html link format,
## and will not output any pagination duplicate.
##
## It will allow you to take advantage of nice title injected URL for Categories and Forum's URL without
## taking any risk to have very bad keyword injected in topic URL, here the admin decides what can be the
## best possible keywords to use in Categories and Forum's titles for a better Search Engine Optimization.
## Be Careful though, title should always be understandable by human ;-)
##
## Short URL feature : As for the phpBB SEO Advanced mod Rewrite everything in topic title in between
## "[" and "]" won't be injected in URL, but this feature is less useful here.
## Example :
## This Forum title : "[SOMETHING] The Forum Title" will correspond to this URL : "the-forum-title-vfxx.html"
##
## Bad Title handling : Almost useless here, but still.
## Example :
## This Forum title : """"??Very bad title handling"[hehe]!!!" will correspond to this URL : "very-bad-title-handling-vfxx.html"
##
## NOTE : phpBB SEO recommend the use of the phpBB SEO mixed mod Rewrite in almost all cases.
## Please read : http://boards.phpbb-seo.com/phpbb-seo-toolkit/phpbb-seo-mod-rewrites-vt66.html
##
## This mod is and will be compatible to all phpBB SEO modules, specific install instructions may apply.
## phpBB SEO will provide patches to allow for other URL standards support upon request,
## so that everyone can take advantage of the phpBB mod Rewrites enhancement without jeopardising his Page-Ranking.
##
## Migrating from another mod Rewrite is as well possible but should be done with care to make sure you won't loose Page-Ranking.
##
####
## 0.0.1 => 0.0.2 Update : Required changes to be found in 0.0.1_0.0.2_Mixed_Update.txt
####
##
## LICENSE:
##
## We, phpBB SEO, have decided to license this mod under the RPL Licence ( http://www.opensource.org/licenses/rpl.php )
## which states you cannot remove the phpBB SEO credits and if you make any modifications you have to resubmit them
## to phpBB SEO for inclusion into this package again. You can read the license for yourself for further info.
##
## You can of course use this mod without any more limitations than those stated here and in the licence.
##
## At least a link ( http://www.phpbb-seo.com/ ) is required on every web site using this mod, or,
## if your web site does not comply with what phpBB SEO can link to, one proven link within a
## general audience hard link directory of your choice not already listing phpBB SEO.
## For more details about possible exeptions, please contact a phpBB SEO administrator (primarily SeO or dcz).
##
## Failure to comply will jeopardize support.
##
##############################################################
## MOD History:
##
## 2006-06-20 - 0.0.2
## - optimiszed the format_url() function, just doing the same job faster.
## - added highlight fix in search.php adn fixed a small bug in search results (results posts)
## - Optimized the append_sid() filtering.
##
## 2006-05-25 - 0.0.1
## - First Beta Version
##
## 2006-03-01 - 0.0.0
## - Initial beta testing phase
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
# NOTE : Put the .htaccess file at the root level of your server.
# If you have any other rewriterules there, just put the rules in it (be careful about the order!).
# Please take a look at : http://boards.phpbb-seo.com/seo-principles/locking-the-www-in-urls-vt30.html
# to find out how to lock the use (or un use) of the www prefix in your domain's url.
# This is a major Search Engine Optimisation issue to take care of the www prefix issue.
#
.htaccess
#
# phpBB is installed at the root level :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/"
# at the beginning of the script.php file-names like "viewforum.php".
# Make sure to change example.com with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^.+/([^/]+\.html)$ /index.php [R=301,L]
# CATEGORIES
RewriteRule ^.+-vc([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^.+-vf([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^.+-vf([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
# phpBB is installed in a sud Folder :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/" at the beginning of "phpbb/"
# Make sure to change phpbb/ with the actual folder name where phpBB is installed and to change example.com
# with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^phpbb/.+/([^/]+\.html)$ /phpbb/index.php [R=301,L]
# CATEGORIES
RewriteRule ^phpbb/.+-vc([0-9]+)\.html$ /phpbb/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^phpbb/.+-vf([0-9]+)-([0-9]+)\.html$ /phpbb/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^phpbb/.+-vf([0-9]+)\.html$ /phpbb/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^phpbb/topic([0-9]+)-([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^phpbb/topic([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^phpbb/post([0-9]+)\.html$ /phpbb/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^phpbb/member([0-9]+)\.html$ /phpbb/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = $category_rows[$i]['cat_title'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
else
{
$l_moderators = ' ';
$moderator_list = ' ';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_data[$j]['forum_name'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start session management
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_row['forum_name'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$forum_name = $forum_topic_data['forum_name'];
$topic_title = $forum_topic_data['topic_title'];
$topic_id = intval($forum_topic_data['topic_id']);
$topic_time = $forum_topic_data['topic_time'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_name;
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
//
// Send vars to template
//
#
#-----[ AFTER, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
// phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order$highlight_ok"),
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
search.php
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($searchset); $i++)
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $searchset[$i]['forum_name'];
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($searchset); $i++)
{
#
#-----[ BEFORE, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active") . '#' . $searchset[$i]['post_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . $highlight_ok) . '#' . $searchset[$i]['post_id'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = FALSE;
$seo_forum_name = FALSE;
// phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
# In the following code changes, please look at the comments, they concern the
# mx Sitemaps Module ( http://boards.phpbb-seo.com/phpbb-seo-mods/mx-site-map-module-vt4.html )
# and mxBB Portal. Just uncomment, to activate, or delete, if unused, the required lines of code upon your needs
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
global $phpEx, $seo_cat_name, $seo_forum_name;
$amp = ($non_html_amp) ? '&' : '&';
$find = array( $amp.'start=0',
$amp.'postdays=0',
$amp.'topicdays=0',
$amp.'postorder=asc',
);
$url = str_replace ($find, "", $url);
if ( $seo_cat_name ) {
$urlin = array( "'(?)index.".$phpEx."\?c=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (cat URL injection)
//"'(?)sitemaps([0-9]+)\.html(".$amp."){0,1}'",
);
$urlout = array( "".format_url($seo_cat_name)."-vc\\1.html".if_query('\\2')."",
// mx Sitemaps Module (cat URL injection)
//"".format_url($seo_cat_name)."-sc\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
}
if ( $seo_forum_name ) {
$urlin = array( "'(?)viewforum.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewforum.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (forum URL injection + pagination)
//"'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
//"'(?)forum-map([0-9]+)\.html(".$amp."){0,1}'",
);
$urlout = array( "".format_url($seo_forum_name)."-vf\\1-\\2.html".if_query('\\3')."",
"".format_url($seo_forum_name)."-vf\\1.html".if_query('\\2')."",
// mx Sitemaps Module (forum URL injection + pagination)
//"".format_url($seo_forum_name)."-fmp\\1-\\2.html".if_query('\\3')."",
//"".format_url($seo_forum_name)."-fmp\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
}
$urlin = array( "'(?)viewtopic.".$phpEx."\?t=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?t=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?p=([0-9]+)(".$amp."){0,1}'",
"'(?)profile.".$phpEx."\?mode\=viewprofile".$amp."u=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (mxBB map URL + pagination)
//"'(?)mx-map\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
);
$urlout = array( "topic\\1-\\2.html".if_query('\\3')."",
"topic\\1.html".if_query('\\2')."",
"post\\1.html".if_query('\\2')."",
"member\\1.html".if_query('\\2')."",
// mx Sitemaps Module (mxBB map URL + pagination)
//"mx-map\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
$url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;
// www.phpBB-SEO.com SEO TOOLKIT END
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ OPEN ]------------------------------------------
#
include/function.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
function if_query($amp)
{
if($amp != '')
{
return '?';
}
}
function format_url($url)
{
$url = preg_replace("(\[.*\])U","",$url);
$find = array('"','&','\r\n','\n');
$url = str_replace ($find, '-', $url);
$url = str_replace ('ß', 'ss', $url);
$url = str_replace (array('ö','Ö'), 'oe', $url);
$url = str_replace (array('ä','Ä'), 'ae', $url);
$url = str_replace (array('ü','Ü'), 'ue', $url);
$find = "ŔÁÂĂĹŕáâăĺŇÓÔŐŘňóôőřČÉĘËčéęëÇçĚÍÎĎěíîďŮÚŰůúű˙Ńń";
$replace = "AAAAAaaaaaOOOOOoooooEEEEeeeeCcIIIIiiiiUUUuuuyNn";
$url = strtr($url,$find,$replace);
$url = strtolower($url);
$url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
while (strstr($url, '--')) $url = str_replace('--', '-', $url);
$url = (substr($url, 0, 1) == '-') ? substr($url, 1) : $url;
$url = (substr($url, strlen($url) - 1, 1) == '-') ? substr($url, 0, strlen($url) - 1) : $url;
return $url;
}
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
# Note : This code is going to help your site a lot, we request that you keep this copyright notice as specified in the licence.
# If You really cannot put this link, you should at least provide us with one visible (can be small but visible) link
# on your home page or your forum Index using this code for example <a href="http://www.phpbb-seo.com/" title="Search Engine Optimization">phpBB SEO</a>
#
/templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> {PHPBB_VERSION} © phpBB Group
#
#-----[ AFTER ADD]------------------------------------------
#
<br /><a href="http://www.phpbb-seo.com/" title="Search Engine Optimization" target="_phpBBSEO">phpBB SEO</a>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
phpBB SEO Advanced mod Rewrite 0.0.2Kód:
##############################################################
## MOD Title: phpBB SEO Advanced mod Rewrite
## MOD Author: dcz <n/a> http://www.phpbb-seo.com/
## MOD Description: This mod makes static URLs for phpBB
## Please read the author notes BEFORE using this mod.
## Check http://boards.phpbb-seo.com/phpbb-mod-rewrite/phpbb-seo-advanced-mod-rewrite-vt43.html
## for the latest version or to get help with this MOD.
##
## MOD Version: 0.0.2
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: (6)
## .htaccess,
## index.php,
## viewforum.php,
## viewtopic.php,
## search.php,
## overall_footer.tpl
## Included Files: n/a
##############################################################
## Author Notes:
##
## Please note that this version will not inject topic titles in post's URLS. This is to make it easier
## to disallow them with our robots.txt file, since those are duplicates any way.
## The last post link on forum Index is now statically mod rewritten postxx.html.
## People whilling to keep the old way, even though phpBB SEO does not recomand it, should read the note
## in the release thread bef ore implementing the required changes or asking for support.
##
## This mod requires running Apache Server with mod_Rewrite module loaded.
##
## This mod requires the Cyber Alien guest session mod (http://www.phpbbstyles.com/viewtopic.php?t=357) or any other SID
## removal method you may prefer.
##
## With this mod, your phpBB URL will change :
##
## index.php?c=xx => cat-title-vcxx.html
##
## viewforum.php?t=xx => forum-title-vfxx.html
##
## viewforum.php?t=xx&start=xx => forum-title-vfxx-yy.html
##
## viewtopic.php?t=xx => topic-title-vtxx.html
##
## viewtopic.php?t=xx&start=xx => topic-title-vtxx-yy.html
##
## viewtopic.php?p=xx => postxx.html
##
## profile.php?mode=viewprofile&u=xx => memberxx.html
##
## This mod has nothing in common with other phpBB mod rewrite, it will perform the URL rewriting
## without using ob_start() nor adding any SQL. It is thus faster and not messing anymore whith Gun-Zip nor with the html link format,
## and will not output any pagination duplicates.
##
## Short URL feature : everything in topic title in between "[" and "]" won't be injected in URL.
## Example :
## This topic title : "[SOMETHING] The Topic Title" will correspond to this URL : "the-topic-title-vtxx.html"
##
## Bad Title handling :
## Example :
## This topic title : """"??Véry bâd tďtle handling"[hehe]!!!" will correspond to this URL : "very-bad-title-handling-vtxx.html"
##
## WARNING : Topic title injection in URL can be hard to deal with depending on the type of subjects your
## forum is about. In almost all cases phpBB SEO recommend the use of the phpBB SEO mixed mod Rewrite instead.
## Please read : http://boards.phpbb-seo.com/phpbb-seo-toolkit/phpbb-seo-mod-rewrites-vt66.html
##
## This mod is and will be compatible to all phpBB SEO modules, specific install instructions may apply.
## phpBB SEO will provide patches to allow for other URL standards support upon request,
## so that everyone can take advantage of the phpBB mod Rewrites enhancement without jeopardising his Page-Ranking.
##
## Migrating from another mod Rewrite is as well possible but should be done with care to make sure you won't loose Page-Ranking.
##
####
## 0.0.1 => 0.0.2 Update : Required changes to be found in 0.0.1_0.0.2_Advanced_Update.txt
###
##
## LICENSE:
##
## We, phpBB SEO, have decided to license this mod under the RPL Licence ( http://www.opensource.org/licenses/rpl.php )
## which states you cannot remove the phpBB SEO credits and if you make any modifications you have to resubmit them
## to phpBB SEO for inclusion into this package again. You can read the license for yourself for further info.
##
## You can of course use this mod without any more limitations than those stated here and in the licence.
##
## At least a link ( http://www.phpbb-seo.com/ ) is required on every web site using this mod, or,
## if your web site does not comply with what phpBB SEO can link to, one proven link within a
## general audience hard link directory of your choice not already listing phpBB SEO.
## For more details about possible exeptions, please contact a phpBB SEO administrator (primarily SeO or dcz).
##
## Failure to comply will jeopardize support.
##
##############################################################
## MOD History:
##
## 2006-06-20 - 0.0.2
## - Will NOT inject topic titles in post(viewtopic.php?p=xx) URLs, to make it possible to disallow
## with robots.txt. Will be mod rewritten in a static manner instead.
## - Optimized the format_url() function, just doing the same job faster.
## - Added highlight fix in search.php adn fixed a small bug in search results (results posts)
## - Optimized the append_sid() filtering.
##
## 2006-05-25 - 0.0.1
## - First Beta Version
##
## 2006-03-01 - 0.0.0
## - Initial beta testing phase
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
# NOTE : Put the .htaccess file at the root level of your server.
# If you have any other rewriterules there, just put the rules in it (be careful about the order!).
# Please take a look at : http://boards.phpbb-seo.com/seo-principles/locking-the-www-in-urls-vt30.html
# to find out how to lock the use (or un use) of the www prefix in your domain's url.
# This is a major Search Engine Optimisation issue to take care of the www prefix issue.
#
.htaccess
#
# phpBB is installed at the root level :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/"
# at the beginning of the script.php file-names like "viewforum.php".
# Make sure to change example.com with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^.+/([^/]+\.html)$ /index.php [R=301,L]
# CATEGORIES
RewriteRule ^.+-vc([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^.+-vf([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^.+-vf([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^.+-vt([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^.+-vt([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
# phpBB is installed in a sud Folder :
#-----[ ADD ]------------------------------------------
#
# According to the specific hoster you are using, you might have to get rid of the "/" at the beginning of "phpbb/"
# Make sure to change phpbb/ with the actual folder name where phpBB is installed and to change example.com
# with you actual domain's URL.
#
# These three lines should only be added if not already done in the .htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^phpbb/.+/([^/]+\.html)$ /phpbb/index.php [R=301,L]
# CATEGORIES
RewriteRule ^phpbb/.+-vc([0-9]+)\.html$ /phpbb/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^phpbb/.+-vf([0-9]+)-([0-9]+)\.html$ /phpbb/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^phpbb/.+-vf([0-9]+)\.html$ /phpbb/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^phpbb/.+-vt([0-9]+)-([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^phpbb/.+-vt([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^phpbb/post([0-9]+)\.html$ /phpbb/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^phpbb/member([0-9]+)\.html$ /phpbb/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES
#####################################################
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = $category_rows[$i]['cat_title'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
else
{
$l_moderators = ' ';
$moderator_list = ' ';
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_data[$j]['forum_name'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
//
// Start session management
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_row['forum_name'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $topic_title;
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$forum_name = $forum_topic_data['forum_name'];
$topic_title = $forum_topic_data['topic_title'];
$topic_id = intval($forum_topic_data['topic_id']);
$topic_time = $forum_topic_data['topic_time'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_forum_name = $forum_name;
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
if ( count($orig_word) )
{
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $topic_title;
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
//
// Send vars to template
//
#
#-----[ AFTER, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order$highlight_ok"),
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
search.php
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($searchset); $i++)
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_topic_name = $searchset[$i]['topic_title'];
$seo_forum_name = $searchset[$i]['forum_name'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
for($i = 0; $i < count($searchset); $i++)
{
#
#-----[ BEFORE, ADD ]------------------------------------------
# Here You can also choose not to output any highlight, which is better as far as SEO, but a bit less user-friendly.
# To do so just delete the $highlight_ok in the next replace and do not apply this one.
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ FIND ]------------------------------------------
#
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active") . '#' . $searchset[$i]['post_id'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . $highlight_ok) . '#' . $searchset[$i]['post_id'];
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$seo_cat_name = FALSE;
$seo_forum_name = FALSE;
$seo_topic_name = FALSE;
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
#
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
# In the following code changes, please look at the comments, they concern the
# mx Sitemaps Module ( http://boards.phpbb-seo.com/phpbb-seo-mods/mx-site-map-module-vt4.html )
# and mxBB Portal. Just uncomment, to activate, or delete, if unused, the required lines of code upon your needs
#
function append_sid($url, $non_html_amp = false)
{
global $SID;
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
global $phpEx, $seo_cat_name, $seo_forum_name, $seo_topic_name;
$amp = ($non_html_amp) ? '&' : '&';
$find = array( $amp.'start=0',
$amp.'postdays=0',
$amp.'topicdays=0',
$amp.'postorder=asc',
);
$url = str_replace ($find, "", $url);
if ( $seo_cat_name ) {
$urlin = array( "'(?)index.".$phpEx."\?c=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (cat URL injection)
//"'(?)sitemaps([0-9]+)\.html(".$amp."){0,1}'",
);
$urlout = array( "".format_url($seo_cat_name)."-vc\\1.html".if_query('\\2')."",
// mx Sitemaps Module (cat URL injection)
//"".format_url($seo_cat_name)."-sc\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
}
if ( $seo_forum_name ) {
$urlin = array( "'(?)viewforum.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewforum.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (forum URL injection + pagination)
//"'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
//"'(?)forum-map([0-9]+)\.html(".$amp."){0,1}'",
);
$urlout = array( "".format_url($seo_forum_name)."-vf\\1-\\2.html".if_query('\\3')."",
"".format_url($seo_forum_name)."-vf\\1.html".if_query('\\2')."",
// mx Sitemaps Module (forum URL injection + pagination)
//"".format_url($seo_forum_name)."-fmp\\1-\\2.html".if_query('\\3')."",
//"".format_url($seo_forum_name)."-fmp\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
}
if ($seo_topic_name) {
$urlin = array( "'(?)viewtopic.".$phpEx."\?t=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
"'(?)viewtopic.".$phpEx."\?t=([0-9]+)(".$amp."){0,1}'",
);
$urlout = array("".format_url($seo_topic_name)."-vt\\1-\\2.html".if_query('\\3')."",
"".format_url($seo_topic_name)."-vt\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
}
$urlin = array( "'(?)viewtopic.".$phpEx."\?p=([0-9]+)(".$amp."){0,1}'",
"'(?)profile.".$phpEx."\?mode\=viewprofile".$amp."u=([0-9]+)(".$amp."){0,1}'",
// mx Sitemaps Module (mxBB map URL + pagination)
//"'(?)mx-map\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
);
$urlout = array( "post\\1.html".if_query('\\2')."",
"member\\1.html".if_query('\\2')."",
// mx Sitemaps Module (mxBB map URL + pagination)
//"mx-map\\1.html".if_query('\\2')."",
);
$url = preg_replace($urlin, $urlout, $url);
$url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;
// www.phpBB-SEO.com SEO TOOLKIT END
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}
return $url;
}
#
#-----[ OPEN ]------------------------------------------
#
#
include/function.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE ADD ]------------------------------------------
#
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
function if_query($amp)
{
if($amp != '')
{
return '?';
}
}
function format_url($url)
{
$url = preg_replace("(\[.*\])U","",$url);
$find = array('"','&','\r\n','\n');
$url = str_replace ($find, '-', $url);
$url = str_replace ('ß', 'ss', $url);
$url = str_replace (array('ö','Ö'), 'oe', $url);
$url = str_replace (array('ä','Ä'), 'ae', $url);
$url = str_replace (array('ü','Ü'), 'ue', $url);
$find = "ŔÁÂĂĹŕáâăĺŇÓÔŐŘňóôőřČÉĘËčéęëÇçĚÍÎĎěíîďŮÚŰůúű˙Ńń";
$replace = "AAAAAaaaaaOOOOOoooooEEEEeeeeCcIIIIiiiiUUUuuuyNn";
$url = strtr($url,$find,$replace);
$url = strtolower($url);
$url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
while (strstr($url, '--')) $url = str_replace('--', '-', $url);
$url = (substr($url, 0, 1) == '-') ? substr($url, 1) : $url;
$url = (substr($url, strlen($url) - 1, 1) == '-') ? substr($url, 0, strlen($url) - 1) : $url;
return $url;
}
// www.phpBB-SEO.com SEO TOOLKIT END
#
#-----[ OPEN ]------------------------------------------
# Note : This code is going to help your site a lot, we request that you keep this copyright notice as specified in the licence.
# If You really cannot put this link, you should at least provide us with one visible (can be small but visible) link
# on your home page or your forum Index using this code for example <a href="http://www.phpbb-seo.com/" title="Search Engine Optimization">phpBB SEO</a>
#
/templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
Powered by <a href="http://www.phpbb.com/" target="_phpbb">phpBB</a> {PHPBB_VERSION} © phpBB Group
#
#-----[ AFTER ADD]------------------------------------------
#
<br /><a href="http://www.phpbb-seo.com/" title="Search Engine Optimization" target="_phpBBSEO">phpBB SEO</a>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM