mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
feature 606: search engine spider restrictions (meta robots)
git-svn-id: http://piwigo.org/svn/trunk@1703 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
Executable → Regular
+7
-5
@@ -2,7 +2,7 @@
|
|||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $Id$
|
// | file : $Id$
|
||||||
@@ -187,7 +187,8 @@ $template->assign_block_vars(
|
|||||||
array(
|
array(
|
||||||
'URL' => get_root_url().'random.php',
|
'URL' => get_root_url().'random.php',
|
||||||
'TITLE' => $lang['random_cat_hint'],
|
'TITLE' => $lang['random_cat_hint'],
|
||||||
'NAME' => $lang['random_cat']
|
'NAME' => $lang['random_cat'],
|
||||||
|
'REL'=> 'rel="nofollow"'
|
||||||
));
|
));
|
||||||
|
|
||||||
// recent pics
|
// recent pics
|
||||||
@@ -196,7 +197,7 @@ $template->assign_block_vars(
|
|||||||
array(
|
array(
|
||||||
'URL' => make_index_url(array('section' => 'recent_pics')),
|
'URL' => make_index_url(array('section' => 'recent_pics')),
|
||||||
'TITLE' => $lang['recent_pics_cat_hint'],
|
'TITLE' => $lang['recent_pics_cat_hint'],
|
||||||
'NAME' => $lang['recent_pics_cat']
|
'NAME' => $lang['recent_pics_cat'],
|
||||||
));
|
));
|
||||||
// recent cats
|
// recent cats
|
||||||
$template->assign_block_vars(
|
$template->assign_block_vars(
|
||||||
@@ -204,7 +205,7 @@ $template->assign_block_vars(
|
|||||||
array(
|
array(
|
||||||
'URL' => make_index_url(array('section' => 'recent_cats')),
|
'URL' => make_index_url(array('section' => 'recent_cats')),
|
||||||
'TITLE' => $lang['recent_cats_cat_hint'],
|
'TITLE' => $lang['recent_cats_cat_hint'],
|
||||||
'NAME' => $lang['recent_cats_cat']
|
'NAME' => $lang['recent_cats_cat'],
|
||||||
));
|
));
|
||||||
|
|
||||||
// calendar
|
// calendar
|
||||||
@@ -221,7 +222,8 @@ $template->assign_block_vars(
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
'TITLE' => $lang['calendar_hint'],
|
'TITLE' => $lang['calendar_hint'],
|
||||||
'NAME' => $lang['calendar']
|
'NAME' => $lang['calendar'],
|
||||||
|
'REL'=> 'rel="nofollow"'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
//--------------------------------------------------------------------- summary
|
//--------------------------------------------------------------------- summary
|
||||||
|
|||||||
+14
-2
@@ -2,10 +2,10 @@
|
|||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $RCSfile$
|
// | file : $Id$
|
||||||
// | last update : $Date$
|
// | last update : $Date$
|
||||||
// | last modifier : $Author$
|
// | last modifier : $Author$
|
||||||
// | revision : $Revision$
|
// | revision : $Revision$
|
||||||
@@ -71,6 +71,18 @@ if (count($header_notes) > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !empty($page['meta_robots']) )
|
||||||
|
{
|
||||||
|
$template->assign_block_vars('head_element',
|
||||||
|
array(
|
||||||
|
'CONTENT' =>
|
||||||
|
'<meta name="robots" content="'
|
||||||
|
.implode(',', array_keys($page['meta_robots']))
|
||||||
|
.'">'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// refresh
|
// refresh
|
||||||
if ( isset( $refresh ) and intval($refresh) >= 0
|
if ( isset( $refresh ) and intval($refresh) >= 0
|
||||||
and isset( $url_link ) and isset( $redirect_msg ) )
|
and isset( $url_link ) and isset( $redirect_msg ) )
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $Id$
|
// | file : $Id$
|
||||||
@@ -247,7 +247,7 @@ else if ('list' == $tokens[$next_token])
|
|||||||
$next_token++;
|
$next_token++;
|
||||||
|
|
||||||
$page['list'] = array();
|
$page['list'] = array();
|
||||||
|
|
||||||
// No pictures
|
// No pictures
|
||||||
if (empty($tokens[$next_token]))
|
if (empty($tokens[$next_token]))
|
||||||
{
|
{
|
||||||
@@ -350,9 +350,9 @@ if ('categories' == $page['section'])
|
|||||||
'cat_commentable' => $result['commentable'],
|
'cat_commentable' => $result['commentable'],
|
||||||
'cat_id_uppercat' => $result['id_uppercat'],
|
'cat_id_uppercat' => $result['id_uppercat'],
|
||||||
'uppercats' => $result['uppercats'],
|
'uppercats' => $result['uppercats'],
|
||||||
'title' =>
|
'title' =>
|
||||||
get_cat_display_name($result['name'], '', false),
|
get_cat_display_name($result['name'], '', false),
|
||||||
'thumbnails_include' =>
|
'thumbnails_include' =>
|
||||||
(($result['nb_images'] > 0) or (isset($page['flat_recent_cat'])))
|
(($result['nb_images'] > 0) or (isset($page['flat_recent_cat'])))
|
||||||
? 'include/category_default.inc.php'
|
? 'include/category_default.inc.php'
|
||||||
: 'include/category_cats.inc.php'
|
: 'include/category_cats.inc.php'
|
||||||
@@ -362,7 +362,7 @@ if ('categories' == $page['section'])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$page['title'] = $lang['no_category'];
|
$page['title'] = $lang['no_category'];
|
||||||
$page['thumbnails_include'] =
|
$page['thumbnails_include'] =
|
||||||
(isset($page['flat_recent_cat']))
|
(isset($page['flat_recent_cat']))
|
||||||
? 'include/category_default.inc.php'
|
? 'include/category_default.inc.php'
|
||||||
: 'include/category_cats.inc.php';
|
: 'include/category_cats.inc.php';
|
||||||
@@ -373,11 +373,11 @@ if ('categories' == $page['section'])
|
|||||||
$page['title'] = $lang['recent_pics_cat'].' : '.$page['title'] ;
|
$page['title'] = $lang['recent_pics_cat'].' : '.$page['title'] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
(!isset($page['chronology_field'])) and
|
(!isset($page['chronology_field'])) and
|
||||||
(
|
(
|
||||||
(isset($page['category'])) or
|
(isset($page['category'])) or
|
||||||
(isset($page['flat_recent_cat']))
|
(isset($page['flat_recent_cat']))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -458,7 +458,7 @@ SELECT distinct image_id
|
|||||||
// special sections
|
// special sections
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$forbidden =
|
$forbidden =
|
||||||
get_sql_condition_FandF
|
get_sql_condition_FandF
|
||||||
(
|
(
|
||||||
array
|
array
|
||||||
@@ -729,5 +729,28 @@ SELECT id,file
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add meta robots noindex, nofollow to avoid unnecesary robot crawls
|
||||||
|
$page['meta_robots']=array();
|
||||||
|
if ( isset($page['chronology_field']) or isset($page['flat_recent_cat'])
|
||||||
|
or 'list'==$page['section'] or 'recent_pics'==$page['section'] )
|
||||||
|
{
|
||||||
|
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
|
||||||
|
}
|
||||||
|
elseif ('tags' == $page['section'])
|
||||||
|
{
|
||||||
|
if ( count($page['tag_ids'])>1 )
|
||||||
|
{
|
||||||
|
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ('recent_cats'==$page['section'])
|
||||||
|
{
|
||||||
|
$page['meta_robots']['nofollow']=1;
|
||||||
|
}
|
||||||
|
if ( $filter['enabled'] )
|
||||||
|
{
|
||||||
|
$page['meta_robots']['noindex']=1;
|
||||||
|
}
|
||||||
|
|
||||||
trigger_action('loc_end_section_init');
|
trigger_action('loc_end_section_init');
|
||||||
?>
|
?>
|
||||||
+4
-7
@@ -2,10 +2,10 @@
|
|||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $RCSfile$
|
// | file : $Id$
|
||||||
// | last update : $Date$
|
// | last update : $Date$
|
||||||
// | last modifier : $Author$
|
// | last modifier : $Author$
|
||||||
// | revision : $Revision$
|
// | revision : $Revision$
|
||||||
@@ -60,11 +60,8 @@ $feed_image_only_url=$feed_url.'&image_only';
|
|||||||
|
|
||||||
$title = l10n('Notification');
|
$title = l10n('Notification');
|
||||||
$page['body_id'] = 'theNotificationPage';
|
$page['body_id'] = 'theNotificationPage';
|
||||||
$template->assign_block_vars('head_element',
|
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
|
||||||
array(
|
|
||||||
'CONTENT' => '<meta name="robots" content="noindex,nofollow">'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$template->assign_block_vars('head_element',
|
$template->assign_block_vars('head_element',
|
||||||
array(
|
array(
|
||||||
'CONTENT' => '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
|
'CONTENT' => '<link rel="alternate" type="application/rss+xml" href="'.$feed_url.'">'
|
||||||
|
|||||||
+7
-2
@@ -2,10 +2,10 @@
|
|||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | PhpWebGallery - a PHP based picture gallery |
|
// | PhpWebGallery - a PHP based picture gallery |
|
||||||
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
||||||
// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | branch : BSF (Best So Far)
|
// | branch : BSF (Best So Far)
|
||||||
// | file : $RCSfile$
|
// | file : $Id$
|
||||||
// | last update : $Date$
|
// | last update : $Date$
|
||||||
// | last modifier : $Author$
|
// | last modifier : $Author$
|
||||||
// | revision : $Revision$
|
// | revision : $Revision$
|
||||||
@@ -427,6 +427,7 @@ if ( isset( $_GET['slideshow'] ) and isset($page['next_item']) )
|
|||||||
array('slideshow'=>$refresh)
|
array('slideshow'=>$refresh)
|
||||||
);
|
);
|
||||||
$redirect_msg = nl2br(l10n('redirect_msg'));
|
$redirect_msg = nl2br(l10n('redirect_msg'));
|
||||||
|
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images'];
|
$title_nb = ($page['current_rank'] + 1).'/'.$page['cat_nb_images'];
|
||||||
@@ -447,6 +448,10 @@ if ($metadata_showable)
|
|||||||
{
|
{
|
||||||
$url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
|
$url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$page['body_id'] = 'thePicturePage';
|
$page['body_id'] = 'thePicturePage';
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<!-- END mode_normal -->
|
<!-- END mode_normal -->
|
||||||
|
|
||||||
<!-- BEGIN flat_recent_cat -->
|
<!-- BEGIN flat_recent_cat -->
|
||||||
<li><a href="{flat_recent_cat.URL}" title="{lang:flat_recent_cat_hint}"><img src="{pwg_root}{themeconf:icon_dir}/flat_recent_cat.png" class="button" alt="{lang:flat_recent_cat_hint}"></a></li>
|
<li><a href="{flat_recent_cat.URL}" title="{lang:flat_recent_cat_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/flat_recent_cat.png" class="button" alt="{lang:flat_recent_cat_hint}"></a></li>
|
||||||
<!-- END flat_recent_cat -->
|
<!-- END flat_recent_cat -->
|
||||||
|
|
||||||
<!-- BEGIN mode_posted -->
|
<!-- BEGIN mode_posted -->
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<!-- END links -->
|
<!-- END links -->
|
||||||
<dl id="mbCategories">
|
<dl id="mbCategories">
|
||||||
<!-- BEGIN start_filter -->
|
<!-- BEGIN start_filter -->
|
||||||
<a href="{start_filter.URL}" title="{lang:start_filter_hint}"><img src="{pwg_root}{themeconf:icon_dir}/start_filter.png" class="buttonmenu" alt="{lang:start_filter_hint}"></a>
|
<a href="{start_filter.URL}" title="{lang:start_filter_hint}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/start_filter.png" class="buttonmenu" alt="{lang:start_filter_hint}"></a>
|
||||||
<!-- END start_filter -->
|
<!-- END start_filter -->
|
||||||
<!-- BEGIN stop_filter -->
|
<!-- BEGIN stop_filter -->
|
||||||
<a href="{stop_filter.URL}" title="{lang:stop_filter_hint}"><img src="{pwg_root}{themeconf:icon_dir}/stop_filter.png" class="buttonmenu" alt="{lang:stop_filter_hint}"></a>
|
<a href="{stop_filter.URL}" title="{lang:stop_filter_hint}"><img src="{pwg_root}{themeconf:icon_dir}/stop_filter.png" class="buttonmenu" alt="{lang:stop_filter_hint}"></a>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<!-- BEGIN tag -->
|
<!-- BEGIN tag -->
|
||||||
<li>
|
<li>
|
||||||
<!-- BEGIN add -->
|
<!-- BEGIN add -->
|
||||||
<a href="{tags.tag.add.URL}" title="{tags.tag.add.TITLE}"><img src="{pwg_root}{themeconf:icon_dir}/add_tag.png" alt="+"></a>
|
<a href="{tags.tag.add.URL}" title="{tags.tag.add.TITLE}" rel="nofollow"><img src="{pwg_root}{themeconf:icon_dir}/add_tag.png" alt="+"></a>
|
||||||
<!-- END add -->
|
<!-- END add -->
|
||||||
<a href="{tags.tag.URL}" class="{tags.tag.CLASS}" title="{tags.tag.TITLE}">{tags.tag.NAME}</a>
|
<a href="{tags.tag.URL}" class="{tags.tag.CLASS}" title="{tags.tag.TITLE}">{tags.tag.NAME}</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<ul>
|
<ul>
|
||||||
<!-- BEGIN special_cat -->
|
<!-- BEGIN special_cat -->
|
||||||
<li><a href="{special_cat.URL}" title="{special_cat.TITLE}">{special_cat.NAME}</a></li>
|
<li><a href="{special_cat.URL}" title="{special_cat.TITLE}" {special_cat.REL}>{special_cat.NAME}</a></li>
|
||||||
<!-- END special_cat -->
|
<!-- END special_cat -->
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
Reference in New Issue
Block a user