Changeset 1703


Ignore:
Timestamp:
Jan 9, 2007, 2:30:02 AM (17 years ago)
Author:
rvelices
Message:

feature 606: search engine spider restrictions (meta robots)

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/menubar.inc.php

    • Property svn:executable deleted
    r1677 r1703  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
     
    188188    'URL' => get_root_url().'random.php',
    189189    'TITLE' => $lang['random_cat_hint'],
    190     'NAME' => $lang['random_cat']
     190    'NAME' => $lang['random_cat'],
     191    'REL'=> 'rel="nofollow"'
    191192    ));
    192193
     
    197198    'URL' => make_index_url(array('section' => 'recent_pics')),
    198199    'TITLE' => $lang['recent_pics_cat_hint'],
    199     'NAME' => $lang['recent_pics_cat']
     200    'NAME' => $lang['recent_pics_cat'],
    200201    ));
    201202// recent cats
     
    205206    'URL' => make_index_url(array('section' => 'recent_cats')),
    206207    'TITLE' => $lang['recent_cats_cat_hint'],
    207     'NAME' => $lang['recent_cats_cat']
     208    'NAME' => $lang['recent_cats_cat'],
    208209    ));
    209210
     
    222223      ),
    223224    'TITLE' => $lang['calendar_hint'],
    224     'NAME' => $lang['calendar']
     225    'NAME' => $lang['calendar'],
     226    'REL'=> 'rel="nofollow"'
    225227    )
    226228  );
  • trunk/include/page_header.php

    r1678 r1703  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    7272}
    7373
     74if ( !empty($page['meta_robots']) )
     75{
     76  $template->assign_block_vars('head_element',
     77      array(
     78          'CONTENT' =>
     79              '<meta name="robots" content="'
     80              .implode(',', array_keys($page['meta_robots']))
     81              .'">'
     82        )
     83    );
     84}
     85
    7486// refresh
    7587if ( isset( $refresh ) and intval($refresh) >= 0
  • trunk/include/section_init.inc.php

    r1701 r1703  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
     
    248248
    249249  $page['list'] = array();
    250  
     250
    251251  // No pictures
    252252  if (empty($tokens[$next_token]))
     
    351351        'cat_id_uppercat'    => $result['id_uppercat'],
    352352        'uppercats'          => $result['uppercats'],
    353         'title'             => 
     353        'title'             =>
    354354          get_cat_display_name($result['name'], '', false),
    355         'thumbnails_include' => 
     355        'thumbnails_include' =>
    356356          (($result['nb_images'] > 0) or (isset($page['flat_recent_cat'])))
    357357          ? 'include/category_default.inc.php'
     
    363363  {
    364364    $page['title'] = $lang['no_category'];
    365     $page['thumbnails_include'] = 
     365    $page['thumbnails_include'] =
    366366      (isset($page['flat_recent_cat']))
    367367          ? 'include/category_default.inc.php'
     
    374374  }
    375375
    376   if 
     376  if
    377377    (
    378378      (!isset($page['chronology_field'])) and
    379379      (
    380         (isset($page['category'])) or 
     380        (isset($page['category'])) or
    381381        (isset($page['flat_recent_cat']))
    382382      )
     
    459459else
    460460{
    461   $forbidden = 
     461  $forbidden =
    462462    get_sql_condition_FandF
    463463    (
     
    730730}
    731731
     732// add meta robots noindex, nofollow to avoid unnecesary robot crawls
     733$page['meta_robots']=array();
     734if ( isset($page['chronology_field']) or isset($page['flat_recent_cat'])
     735      or 'list'==$page['section'] or 'recent_pics'==$page['section'] )
     736{
     737  $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
     738}
     739elseif ('tags' == $page['section'])
     740{
     741  if ( count($page['tag_ids'])>1 )
     742  {
     743    $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
     744  }
     745}
     746elseif ('recent_cats'==$page['section'])
     747{
     748  $page['meta_robots']['nofollow']=1;
     749}
     750if ( $filter['enabled'] )
     751{
     752  $page['meta_robots']['noindex']=1;
     753}
     754
    732755trigger_action('loc_end_section_init');
    733756?>
  • trunk/notification.php

    r1636 r1703  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    6161$title = l10n('Notification');
    6262$page['body_id'] = 'theNotificationPage';
    63 $template->assign_block_vars('head_element',
    64     array(
    65       'CONTENT' => '<meta name="robots" content="noindex,nofollow">'
    66       )
    67   );
     63$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
     64
    6865$template->assign_block_vars('head_element',
    6966    array(
  • trunk/picture.php

    r1682 r1703  
    33// | PhpWebGallery - a PHP based picture gallery                           |
    44// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
    5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
     5// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
    66// +-----------------------------------------------------------------------+
    77// | branch        : BSF (Best So Far)
    8 // | file          : $RCSfile$
     8// | file          : $Id$
    99// | last update   : $Date$
    1010// | last modifier : $Author$
     
    428428    );
    429429  $redirect_msg = nl2br(l10n('redirect_msg'));
     430  $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
    430431}
    431432
     
    447448  {
    448449    $url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
     450  }
     451  else
     452  {
     453    $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
    449454  }
    450455}
  • trunk/template/yoga/index.tpl

    r1677 r1703  
    3333
    3434      <!-- BEGIN flat_recent_cat -->
    35       <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>
     35      <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>
    3636      <!-- END flat_recent_cat -->
    3737
  • trunk/template/yoga/menubar.tpl

    r1677 r1703  
    1515<dl id="mbCategories">
    1616  <!-- BEGIN start_filter -->
    17   <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>
     17  <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>
    1818  <!-- END start_filter -->
    1919  <!-- BEGIN stop_filter -->
     
    3535      <li>
    3636        <!-- BEGIN add -->
    37         <a href="{tags.tag.add.URL}" title="{tags.tag.add.TITLE}"><img src="{pwg_root}{themeconf:icon_dir}/add_tag.png" alt="+"></a>
     37        <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>
    3838        <!-- END add -->
    3939        <a href="{tags.tag.URL}" class="{tags.tag.CLASS}" title="{tags.tag.TITLE}">{tags.tag.NAME}</a>
     
    5050    <ul>
    5151      <!-- BEGIN special_cat -->
    52       <li><a href="{special_cat.URL}" title="{special_cat.TITLE}">{special_cat.NAME}</a></li>
     52      <li><a href="{special_cat.URL}" title="{special_cat.TITLE}" {special_cat.REL}>{special_cat.NAME}</a></li>
    5353      <!-- END special_cat -->
    5454    </ul>
Note: See TracChangeset for help on using the changeset viewer.