From a764acaf503f740821c38caebc9c44ff865085c1 Mon Sep 17 00:00:00 2001 From: dimka3210 Date: Wed, 30 May 2012 16:39:08 +0000 Subject: [PATCH] r425 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Допиливаем SEO в шапке. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@425 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293 --- upload/config.php | 4 ++-- upload/includes/functions.php | 12 ++++++++++++ upload/includes/page_header.php | 13 ++++++++++++- upload/templates/default/page_header.tpl | 16 ++++++++-------- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/upload/config.php b/upload/config.php index d35ee36cd..df608fb7f 100644 --- a/upload/config.php +++ b/upload/config.php @@ -56,7 +56,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 Beta'; -$bb_cfg['tp_release_state'] = 'R424'; +$bb_cfg['tp_release_state'] = 'R425'; $bb_cfg['tp_release_date'] = '30-05-2012'; // Database @@ -527,4 +527,4 @@ $bb_cfg['captcha'] = array( ); // SEO -$bb_cfg['seo_link_home_page'] = false; \ No newline at end of file +$bb_cfg['seo_link_home_page'] = true; \ No newline at end of file diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 42156ee26..f63bc3dcd 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -2869,4 +2869,16 @@ function profile_url($data) } return $profile; +} + +function seo_link_header($str){ + /** + * Функция обработки url. Сверяет url с переданным выражением. + */ + global $bb_cfg; + + $regexp = "/{$str}\.php/"; + $return = ($bb_cfg['seo_link_home_page']) ? ((preg_match($regexp, $_SERVER['SCRIPT_NAME'])) ? false : true) : true; + + return $return; } \ No newline at end of file diff --git a/upload/includes/page_header.php b/upload/includes/page_header.php index 5049d2eba..2a0bd8a44 100644 --- a/upload/includes/page_header.php +++ b/upload/includes/page_header.php @@ -165,8 +165,19 @@ if ($bb_cfg['reports_enabled']) else $report_list = ''; // Report [END] +// FOR SEO +$template->assign_vars(array( + 'SEO_LINK_INDEX_PAGE' => seo_link_header('index'), + 'SEO_LINK_TRACKER_PAGE' => seo_link_header('tracker'), + 'SEO_LINK_GALLERY_PAGE' => seo_link_header('gallery'), + 'SEO_LINK_SEARCH_PAGE' => seo_link_header('search'), + 'SEO_LINK_FAQ_PAGE' => seo_link_header('faq'), + 'SEO_LINK_GROUP_PAGE' => seo_link_header('groupcp'), + 'SEO_LINK_MEMEBERLIST_PAGE' => seo_link_header('memberlist'), +)); + + $template->assign_vars(array( - 'SEO_LINK_HOME_PAGE' => ($bb_cfg['seo_link_home_page']) ? ((preg_match('/index\.php/', $_SERVER['SCRIPT_NAME'])) ? false : true) : true, 'SIMPLE_HEADER' => !empty($gen_simple_header), diff --git a/upload/templates/default/page_header.tpl b/upload/templates/default/page_header.tpl index 27690ebc9..5a60509fb 100644 --- a/upload/templates/default/page_header.tpl +++ b/upload/templates/default/page_header.tpl @@ -319,14 +319,14 @@ function go_to_page ()
- {L_HOME}| - {L_TRACKER}| - {L_GALLERY}| - {L_SEARCH}| + {L_HOME}| + {L_TRACKER}| + {L_GALLERY}| + {L_SEARCH}| {L_TERMS}| - {L_FAQ}| - {L_USERGROUPS}| - {L_MEMBERLIST}| + {L_FAQ}| + {L_USERGROUPS}| + {L_MEMBERLIST}| @@ -346,7 +346,7 @@ function go_to_page ()