Друзья, кто в теме, помогите допилить модуль DLE (Заголовки, описания, метатеги).
Суть в чем, в модуле (Заголовки, описания, метатеги) при добавлении страницы для изменения описания и метатегов title и description все работает хорошо, но вот когда к этой странице добавить /*/ для изменения описания и метатегов на всех страницах пагинации получаются дубли метатегов title и description на всех страницах пагинации.
Покопался я в файле engine.php и решил проблему с дублями в коде:
if( $config['allow_own_meta'] ) {
if(isset($custom_metatags['simple']) AND is_array($custom_metatags['simple']) AND count($custom_metatags['simple']) AND $custom_metatags['simple'][$r_uri] ) {
if( $custom_metatags['simple'][$r_uri]['title'] ) $metatags['title'] = $custom_metatags['simple'][$r_uri]['title'];
if( $custom_metatags['simple'][$r_uri]['description'] ) $metatags['description'] = $custom_metatags['simple'][$r_uri]['description'];
if( $custom_metatags['simple'][$r_uri]['keywords'] ) $metatags['keywords'] = $custom_metatags['simple'][$r_uri]['keywords'];
if( $custom_metatags['simple'][$r_uri]['robots'] ) $metatags['robots'] = $custom_metatags['simple'][$r_uri]['robots'];
}
if(isset($custom_metatags['regex']) AND is_array($custom_metatags['regex']) AND count($custom_metatags['regex'])) {
foreach ($custom_metatags['regex'] as $key => $value) {
if(preg_match($key, $r_uri)){
if( $value['title'] ) $metatags['title'] = $value['title'].= ' » Page ' . intval($_GET['cstart']);
if( $value['description'] ) $metatags['description'] = $value['description'].= ' » Page ' . intval($_GET['cstart']);
if( $value['keywords'] ) $metatags['keywords'] = $value['keywords'];
if( $value['robots'] ) $metatags['robots'] = $value['robots'];
}
}
}
}
добавил к:
if( $value['title'] ) $metatags['title'] = $value['title'];
if( $value['description'] ) $metatags['description'] = $value['description'];
.= ' - страница ' . intval($_GET['cstart'])
Получилось так:
if( $config['allow_own_meta'] ) {
if(isset($custom_metatags['simple']) AND is_array($custom_metatags['simple']) AND count($custom_metatags['simple']) AND $custom_metatags['simple'][$r_uri] ) {
if( $custom_metatags['simple'][$r_uri]['title'] ) $metatags['title'] = $custom_metatags['simple'][$r_uri]['title'];
if( $custom_metatags['simple'][$r_uri]['description'] ) $metatags['description'] = $custom_metatags['simple'][$r_uri]['description'];
if( $custom_metatags['simple'][$r_uri]['keywords'] ) $metatags['keywords'] = $custom_metatags['simple'][$r_uri]['keywords'];
if( $custom_metatags['simple'][$r_uri]['robots'] ) $metatags['robots'] = $custom_metatags['simple'][$r_uri]['robots'];
}
if(isset($custom_metatags['regex']) AND is_array($custom_metatags['regex']) AND count($custom_metatags['regex'])) {
foreach ($custom_metatags['regex'] as $key => $value) {
if(preg_match($key, $r_uri)){
if( $value['title'] ) $metatags['title'] = $value['title'].= ' - страница ' . intval($_GET['cstart']);
if( $value['description'] ) $metatags['description'] = $value['description'].= ' - страница ' . intval($_GET['cstart']);
if( $value['keywords'] ) $metatags['keywords'] = $value['keywords'];
if( $value['robots'] ) $metatags['robots'] = $value['robots'];
}
}
}
}
И все получилось к title и description которые выводятся через модуль (Заголовки, описания, метатеги) при добавлении к ссылке страницы значения /*/ теперь добавляется и номер страницы.
Только осталась маленькая проблема на первой странице пагинации тоже стал выводится номер страницы - 0.
Пример: (<title> Слушать рок музыку на радио онлайн - страница 0</title>)
Тоже самое и в description.
Знаю, что на форуме есть гуру, которые наизусть знают код DLE и для них это мгновенное решение проблемы.
Помогите пожалуйста подправить код чтобы на первой странице пагинации не выводился номер страницы. Подскажите что и куда нужно добавить в engine.php.
Заранее большое спасибо.
Суть в чем, в модуле (Заголовки, описания, метатеги) при добавлении страницы для изменения описания и метатегов title и description все работает хорошо, но вот когда к этой странице добавить /*/ для изменения описания и метатегов на всех страницах пагинации получаются дубли метатегов title и description на всех страницах пагинации.
Покопался я в файле engine.php и решил проблему с дублями в коде:
if( $config['allow_own_meta'] ) {
if(isset($custom_metatags['simple']) AND is_array($custom_metatags['simple']) AND count($custom_metatags['simple']) AND $custom_metatags['simple'][$r_uri] ) {
if( $custom_metatags['simple'][$r_uri]['title'] ) $metatags['title'] = $custom_metatags['simple'][$r_uri]['title'];
if( $custom_metatags['simple'][$r_uri]['description'] ) $metatags['description'] = $custom_metatags['simple'][$r_uri]['description'];
if( $custom_metatags['simple'][$r_uri]['keywords'] ) $metatags['keywords'] = $custom_metatags['simple'][$r_uri]['keywords'];
if( $custom_metatags['simple'][$r_uri]['robots'] ) $metatags['robots'] = $custom_metatags['simple'][$r_uri]['robots'];
}
if(isset($custom_metatags['regex']) AND is_array($custom_metatags['regex']) AND count($custom_metatags['regex'])) {
foreach ($custom_metatags['regex'] as $key => $value) {
if(preg_match($key, $r_uri)){
if( $value['title'] ) $metatags['title'] = $value['title'].= ' » Page ' . intval($_GET['cstart']);
if( $value['description'] ) $metatags['description'] = $value['description'].= ' » Page ' . intval($_GET['cstart']);
if( $value['keywords'] ) $metatags['keywords'] = $value['keywords'];
if( $value['robots'] ) $metatags['robots'] = $value['robots'];
}
}
}
}
добавил к:
if( $value['title'] ) $metatags['title'] = $value['title'];
if( $value['description'] ) $metatags['description'] = $value['description'];
.= ' - страница ' . intval($_GET['cstart'])
Получилось так:
if( $config['allow_own_meta'] ) {
if(isset($custom_metatags['simple']) AND is_array($custom_metatags['simple']) AND count($custom_metatags['simple']) AND $custom_metatags['simple'][$r_uri] ) {
if( $custom_metatags['simple'][$r_uri]['title'] ) $metatags['title'] = $custom_metatags['simple'][$r_uri]['title'];
if( $custom_metatags['simple'][$r_uri]['description'] ) $metatags['description'] = $custom_metatags['simple'][$r_uri]['description'];
if( $custom_metatags['simple'][$r_uri]['keywords'] ) $metatags['keywords'] = $custom_metatags['simple'][$r_uri]['keywords'];
if( $custom_metatags['simple'][$r_uri]['robots'] ) $metatags['robots'] = $custom_metatags['simple'][$r_uri]['robots'];
}
if(isset($custom_metatags['regex']) AND is_array($custom_metatags['regex']) AND count($custom_metatags['regex'])) {
foreach ($custom_metatags['regex'] as $key => $value) {
if(preg_match($key, $r_uri)){
if( $value['title'] ) $metatags['title'] = $value['title'].= ' - страница ' . intval($_GET['cstart']);
if( $value['description'] ) $metatags['description'] = $value['description'].= ' - страница ' . intval($_GET['cstart']);
if( $value['keywords'] ) $metatags['keywords'] = $value['keywords'];
if( $value['robots'] ) $metatags['robots'] = $value['robots'];
}
}
}
}
И все получилось к title и description которые выводятся через модуль (Заголовки, описания, метатеги) при добавлении к ссылке страницы значения /*/ теперь добавляется и номер страницы.
Только осталась маленькая проблема на первой странице пагинации тоже стал выводится номер страницы - 0.
Пример: (<title> Слушать рок музыку на радио онлайн - страница 0</title>)
Тоже самое и в description.
Знаю, что на форуме есть гуру, которые наизусть знают код DLE и для них это мгновенное решение проблемы.
Помогите пожалуйста подправить код чтобы на первой странице пагинации не выводился номер страницы. Подскажите что и куда нужно добавить в engine.php.
Заранее большое спасибо.

