b2evolution PHP Cross Reference Blogging Systems

Source: /inc/collections/views/_coll_seo.form.php - 338 lines - 16695 bytes - Summary - Text - Print

Description: This file implements the UI view for the Collection SEO properties. This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}. See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the Collection SEO properties.
   4   *
   5   * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}.
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}.
   9   *
  10   * @license http://b2evolution.net/about/license.html GNU General Public License (GPL)
  11   *
  12   * {@internal Open Source relicensing agreement:
  13   * }}
  14   *
  15   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  16   *
  17   * @package admin
  18   *
  19   * @version $Id: _coll_seo.form.php 6136 2014-03-08 07:59:48Z manuel $
  20   */
  21  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  22  
  23  /**
  24   * @var Blog
  25   */
  26  global $edited_Blog;
  27  
  28  global $preset;
  29  
  30  global $rsc_url;
  31  
  32  ?>
  33  <script type="text/javascript">
  34  	function show_hide_chapter_prefix(ob)
  35      {
  36          var fldset = document.getElementById( 'category_prefix_container' );
  37          if( ob.value == 'param_num' )
  38          {
  39              fldset.style.display = 'none';
  40          }
  41          else
  42          {
  43              fldset.style.display = '';
  44          }
  45      }
  46  </script>
  47  
  48  <?php
  49  
  50  $blogurl = $edited_Blog->gen_blogurl();
  51  
  52  $Form = new Form( NULL, 'coll_features_checkchanges' );
  53  
  54  $Form->begin_form( 'fform' );
  55  
  56  $Form->add_crumb( 'collection' );
  57  $Form->hidden_ctrl();
  58  $Form->hidden( 'action', 'update' );
  59  $Form->hidden( 'tab', 'seo' );
  60  $Form->hidden( 'blog', $edited_Blog->ID );
  61  
  62  $Form->begin_fieldset( T_('Main page / post list').get_manual_link('main_page_seo') );
  63      $Form->checkbox( 'default_noindex', $edited_Blog->get_setting( 'default_noindex' ), T_('Default blog page'), T_('META NOINDEX') );
  64      $Form->checklist( array(
  65          array( 'canonical_homepage', 1, T_('301 redirect to canonical URL when possible'), $edited_Blog->get_setting( 'canonical_homepage' ) ),
  66          array( 'relcanonical_homepage', 1, T_('Use rel="canonical" if not 301 redirected'), $edited_Blog->get_setting( 'relcanonical_homepage' ) ),
  67          ), 'canonical_homepage_options', T_('Make canonical') );
  68  
  69      $Form->checkbox( 'paged_noindex', $edited_Blog->get_setting( 'paged_noindex' ), T_('"Next" blog pages'), T_('META NOINDEX').' - '.T_('Page 2,3,4...') );
  70      $Form->checkbox( 'paged_nofollowto', $edited_Blog->get_setting( 'paged_nofollowto' ), '', T_('NOFOLLOW on links to').' '.T_('Page 2,3,4...') );
  71  
  72      $Form->radio( 'title_link_type', $edited_Blog->get_setting( 'title_link_type' ), array(
  73                array( 'permalink', T_('Link to the permanent url of the post') ),
  74                array( 'linkto_url', T_('Link to the "link to URL" specified in the post (if any)') ),
  75                array( 'auto', T_('Link to the "link to URL" if specified, otherwise fall back to permanent url') ),
  76                array( 'none', T_('No links on titles') ),
  77              ), T_('Post titles'), true );
  78      // TODO: checkbox display "permalink" separately from the title
  79  
  80      $Form->radio( 'main_content', $edited_Blog->get_setting('main_content'),
  81          array(
  82                  array( 'excerpt', T_('Post excerpts') ),
  83                  array( 'normal', T_('Standard post contents (stopping at "&lt;!-- more -->")') ),
  84                  array( 'full', T_('Full post contents (including after "&lt;!-- more -->")') ),
  85              ), T_('Post contents'), true );
  86  
  87       $Form->radio( 'permalinks', $edited_Blog->get_setting('permalinks'), array(
  88                array( 'single', T_('Link to single post') ),
  89                array( 'archive', T_('Link to post in archive') ),
  90                array( 'subchap', T_('Link to post in sub-category') ),
  91              ), T_('Permalinks'), true );
  92  $Form->end_fieldset();
  93  
  94  
  95  $Form->begin_fieldset( T_('Single post pages / "Permalink" pages').get_manual_link('single_post_pages_seo') );
  96  
  97      $Form->radio( 'single_links', $edited_Blog->get_setting('single_links'),
  98          array(
  99                array( 'param_num', T_('Use param: post ID'), T_('E-g: ')
 100                                .url_add_param( $blogurl, '<strong>p=123&amp;more=1</strong>' ) ),
 101                array( 'param_title', T_('Use param: post title'), T_('E-g: ')
 102                                .url_add_param( $blogurl, '<strong>title=post-title&amp;more=1</strong>' ) ),
 103                  array( 'short', T_('Use extra-path: post title'), T_('E-g: ')
 104                                  .url_add_tail( $blogurl, '<strong>/post-title</strong>' ) ),
 105                  array( 'y', T_('Use extra-path: year'), T_('E-g: ')
 106                                  .url_add_tail( $blogurl, '<strong>/2006/post-title</strong>' ) ),
 107                  array( 'ym', T_('Use extra-path: year & month'), T_('E-g: ')
 108                                  .url_add_tail( $blogurl, '<strong>/2006/12/post-title</strong>' ) ),
 109                  array( 'ymd', T_('Use extra-path: year, month & day'), T_('E-g: ')
 110                                  .url_add_tail( $blogurl, '<strong>/2006/12/31/post-title</strong>' ) ),
 111                  array( 'subchap', T_('Use extra-path: sub-category'), T_('E-g: ')
 112                                  .url_add_tail( $blogurl, '<strong>/subcat/post-title</strong>' ) ),
 113                  array( 'chapters', T_('Use extra-path: category path'), T_('E-g: ')
 114                                  .url_add_tail( $blogurl, '<strong>/cat/subcat/post-title</strong>' ) ),
 115              ), T_('Permalink scheme'), true );
 116  
 117      $Form->text_input( 'slug_limit', $edited_Blog->get_setting('slug_limit'), 3, T_('Limit slug length to'), '', array( 'input_suffix' => ' '.T_('words') ) );
 118  
 119      $Form->checklist( array(
 120          array( 'canonical_item_urls', 1, T_('301 redirect to canonical URL when possible'), $edited_Blog->get_setting( 'canonical_item_urls' ) ),
 121          array( 'relcanonical_item_urls', 1, T_('Use rel="canonical" if not 301 redirected'), $edited_Blog->get_setting( 'relcanonical_item_urls' ) ),
 122          ), 'canonical_item_urls_options', T_('Make canonical') );
 123  
 124      $Form->checkbox( 'excerpts_meta_description', $edited_Blog->get_setting( 'excerpts_meta_description' ),
 125              T_('Meta description'), T_('When no meta description is provided for an item, use the excerpt instead.') );
 126  
 127      $Form->checkbox( 'tags_meta_keywords', $edited_Blog->get_setting( 'tags_meta_keywords' ),
 128              T_('Meta Keywords'), T_('When no meta keywords are provided for an item, use tags instead.') );
 129  
 130  $Form->end_fieldset();
 131  
 132  $Form->begin_fieldset( T_('"By date" archives').get_manual_link('archive_pages_seo') );
 133  
 134      $Form->radio( 'archive_links', $edited_Blog->get_setting('archive_links'),
 135          array(
 136                  array( 'param', T_('Use param'), T_('E-g: ')
 137                                  .url_add_param( $blogurl, '<strong>m=20071231</strong>' ) ),
 138                  array( 'extrapath', T_('Use extra-path'), T_('E-g: ')
 139                                  .url_add_tail( $blogurl, '<strong>/2007/12/31/</strong>' ) ),
 140              ), T_('Date archive URLs'), true );
 141  
 142      $Form->checklist( array(
 143          array( 'canonical_archive_urls', 1, T_('301 redirect to canonical URL when possible'), $edited_Blog->get_setting( 'canonical_archive_urls' ) ),
 144          array( 'relcanonical_archive_urls', 1, T_('Use rel="canonical" if not 301 redirected'), $edited_Blog->get_setting( 'relcanonical_archive_urls' ) ),
 145          ), 'canonical_archive_urls_options', T_('Make canonical') );
 146  
 147      $Form->checkbox( 'archive_noindex', $edited_Blog->get_setting( 'archive_noindex' ), T_('Indexing'), T_('META NOINDEX') );
 148      $Form->checkbox( 'archive_nofollowto', $edited_Blog->get_setting( 'archive_nofollowto' ), T_('Follow TO'), T_('NOFOLLOW on links to').' '.T_('date archives') );
 149  
 150      $Form->radio( 'archive_content', $edited_Blog->get_setting('archive_content'),
 151          array(
 152                  array( 'excerpt', T_('Post excerpts') ),
 153                  array( 'normal', T_('Standard post contents (stopping at "&lt;!-- more -->")') ),
 154                  array( 'full', T_('Full post contents (including after "&lt;!-- more -->")') ),
 155              ), T_('Post contents'), true );
 156  
 157      $Form->text( 'archive_posts_per_page', $edited_Blog->get_setting('archive_posts_per_page'), 4, T_('Posts per page'),
 158                                  T_('Leave empty to use blog default').' ('.$edited_Blog->get_setting('posts_per_page').')', 4 );
 159  
 160      $Form->checkbox( 'arcdir_noindex', $edited_Blog->get_setting( 'arcdir_noindex' ), T_('Archive directory'), T_('META NOINDEX') );
 161  
 162  $Form->end_fieldset();
 163  
 164  $Form->begin_fieldset( T_('Category pages').get_manual_link('category_pages_seo') );
 165  
 166      $Form->radio( 'chapter_links', $edited_Blog->get_setting('chapter_links'),
 167          array(
 168                  array( 'param_num', T_('Use param: cat ID'), T_('E-g: ')
 169                                  .url_add_param( $blogurl, '<strong>cat=123</strong>' ),'', 'onclick="show_hide_chapter_prefix(this);"'),
 170                  array( 'subchap', T_('Use extra-path: sub-category'), T_('E-g: ')
 171                                  .url_add_tail( $blogurl, '<strong>/subcat/</strong>' ), '', 'onclick="show_hide_chapter_prefix(this);"' ),
 172                  array( 'chapters', T_('Use extra-path: category path'), T_('E-g: ')
 173                                  .url_add_tail( $blogurl, '<strong>/cat/subcat/</strong>' ), '', 'onclick="show_hide_chapter_prefix(this);"' ),
 174              ), T_('Category URLs'), true );
 175  
 176          echo '<div id="category_prefix_container">';
 177              $Form->text_input( 'category_prefix', $edited_Blog->get_setting( 'category_prefix' ), 30, T_('Prefix'),
 178                                                          T_('An optional prefix to be added to the URLs of the categories'),
 179                                                          array('maxlength' => 120) );
 180          echo '</div>';
 181          if( $edited_Blog->get_setting( 'chapter_links' ) == 'param_num' )
 182          { ?>
 183          <script type="text/javascript">
 184              <!--
 185              var fldset = document.getElementById( 'category_prefix_container' );
 186              fldset.style.display = 'none';
 187              //-->
 188          </script>
 189          <?php
 190          }
 191  
 192      $Form->checklist( array(
 193          array( 'canonical_cat_urls', 1, T_('301 redirect to canonical URL when possible'), $edited_Blog->get_setting( 'canonical_cat_urls' ) ),
 194          array( 'relcanonical_cat_urls', 1, T_('Use rel="canonical" if not 301 redirected'), $edited_Blog->get_setting( 'relcanonical_cat_urls' ) ),
 195          ), 'canonical_cat_urls_options', T_('Make canonical') );
 196  
 197      $Form->checkbox( 'chapter_noindex', $edited_Blog->get_setting( 'chapter_noindex' ), T_('Indexing'), T_('META NOINDEX') );
 198  
 199      $Form->radio( 'chapter_content', $edited_Blog->get_setting('chapter_content'),
 200          array(
 201                  array( 'excerpt', T_('Post excerpts') ),
 202                  array( 'normal', T_('Standard post contents (stopping at "&lt;!-- more -->")') ),
 203                  array( 'full', T_('Full post contents (including after "&lt;!-- more -->")') ),
 204              ), T_('Post contents'), true );
 205  
 206      $Form->text( 'chapter_posts_per_page', $edited_Blog->get_setting('chapter_posts_per_page'), 4, T_('Posts per page'),
 207                                  T_('Leave empty to use blog default').' ('.$edited_Blog->get_setting('posts_per_page').')', 4 );
 208  
 209      $Form->checkbox( 'catdir_noindex', $edited_Blog->get_setting( 'catdir_noindex' ), T_('Category directory'), T_('META NOINDEX') );
 210      $Form->checkbox( 'categories_meta_description', $edited_Blog->get_setting( 'categories_meta_description' ),
 211              T_('Meta description'), T_('Use category description as meta description for category pages') );
 212  
 213      $Form->end_fieldset();
 214  
 215  
 216  $Form->begin_fieldset( T_('Tag pages').get_manual_link('tag_pages_seo'), array('id'=>'tag_links_fieldset') );
 217  
 218      $Form->radio( 'tag_links', $edited_Blog->get_setting('tag_links'),
 219          array(
 220              array( 'param', T_('Use param'), T_('E-g: ')
 221                  .url_add_param( $blogurl, '<strong>tag=mytag</strong>' ) ),
 222              array( 'prefix-only', T_('Use extra-path').': '.'Use URL path prefix only (recommended)', T_('E-g: ')
 223                  .url_add_tail( $blogurl, '<strong>/<span class="tag_links_tag_prefix"></span>mytag</strong>' ) ),
 224              array( 'dash', T_('Use extra-path').': '.'trailing dash', T_('E-g: ')
 225                  .url_add_tail( $blogurl, '<strong>/<span class="tag_links_tag_prefix"></span>mytag-</strong>' ) ),
 226              array( 'colon', T_('Use extra-path').': '.'trailing colon', T_('E-g: ')
 227                  .url_add_tail( $blogurl, '<strong>/<span class="tag_links_tag_prefix"></span>mytag:</strong>' ) ),
 228              array( 'semicolon', T_('Use extra-path').': '.'trailing semi-colon (NOT recommended)', T_('E-g: ')
 229                  .url_add_tail( $blogurl, '<strong>/<span class="tag_links_tag_prefix"></span>mytag;</strong>' ) ),
 230          ), T_('Tag page URLs'), true );
 231  
 232  
 233      $Form->text_input( 'tag_prefix', $edited_Blog->get_setting( 'tag_prefix' ), 30, T_('Prefix'),
 234          T_('An optional prefix to be added to the URLs of the tag pages'),
 235          array('maxlength' => 120) );
 236  
 237      $Form->checkbox( 'tag_rel_attrib', $edited_Blog->get_setting( 'tag_rel_attrib' ), T_('Rel attribute'),
 238          sprintf( T_('Add <a %s>rel="tag" attribute</a> to tag links.'), 'href="http://microformats.org/wiki/rel-tag"' ) );
 239  
 240      $Form->checklist( array(
 241          array( 'canonical_tag_urls', 1, T_('301 redirect to canonical URL when possible'), $edited_Blog->get_setting( 'canonical_tag_urls' ) ),
 242          array( 'relcanonical_tag_urls', 1, T_('Use rel="canonical" if not 301 redirected'), $edited_Blog->get_setting( 'relcanonical_tag_urls' ) ),
 243          ), 'canonical_tag_urls_options', T_('Make canonical') );
 244  
 245      $Form->checkbox( 'tag_noindex', $edited_Blog->get_setting( 'tag_noindex' ), T_('Indexing'), T_('META NOINDEX') );
 246  
 247      $Form->radio( 'tag_content', $edited_Blog->get_setting('tag_content'),
 248          array(
 249                  array( 'excerpt', T_('Post excerpts') ),
 250                  array( 'normal', T_('Standard post contents (stopping at "&lt;!-- more -->")') ),
 251                  array( 'full', T_('Full post contents (including after "&lt;!-- more -->")') ),
 252              ), T_('Post contents'), true );
 253  
 254      $Form->text( 'tag_posts_per_page', $edited_Blog->get_setting('tag_posts_per_page'), 4, T_('Posts per page'),
 255                                  T_('Leave empty to use blog default').' ('.$edited_Blog->get_setting('posts_per_page').')', 4 );
 256  
 257      $Form->end_fieldset();
 258  
 259  // Javascript juice for the tag fields.
 260  ?>
 261  <script type="text/javascript">
 262  jQuery("#tag_links_fieldset input[name=tag_links][type=radio]").click( function()
 263  {
 264      // Disable tag_prefix, if "param" is used. fp> TODO: visual feedback that this is disabled
 265      if( jQuery( this ).val() == 'param' )
 266      {
 267          jQuery('#tag_prefix').attr("disabled", "disabled");
 268      }
 269      else
 270      {
 271          jQuery('#tag_prefix').removeAttr("disabled");
 272      }
 273      // Disable tag_rel_attrib, if "prefix-only" is not used.
 274      jQuery('#tag_rel_attrib').attr("disabled", this.value == 'prefix-only' ? "" : "disabled");
 275  
 276      // NOTE: dh> ".closest('fieldset').andSelf()" is required for the add-field_required-class-to-fieldset-hack. Remove as appropriate.
 277      if( this.value == 'prefix-only' )
 278          jQuery('#tag_prefix').closest('fieldset').andSelf().addClass('field_required');
 279      else
 280          jQuery('#tag_prefix').closest('fieldset').andSelf().removeClass('field_required');
 281  } ).filter(":checked").click();
 282  
 283  // Set text of span.tag_links_tag_prefix according to this field, defaulting to "tag" for "prefix-only".
 284  jQuery("#tag_prefix").keyup( function() {
 285      jQuery("span.tag_links_tag_prefix").each(
 286          function() {
 287              var newval = ((jQuery("#tag_prefix").val().length || jQuery(this).closest("div").find("input[type=radio]").attr("value") != "prefix-only") ? jQuery("#tag_prefix").val() : "tag");
 288              if( newval.length ) newval += "/";
 289              jQuery(this).text( newval );
 290          }
 291      ) } ).keyup();
 292  </script>
 293  
 294  
 295  <?php
 296  $Form->begin_fieldset( T_('Other filtered pages').get_manual_link('other_filtered_pages_seo') );
 297      $Form->checkbox( 'filtered_noindex', $edited_Blog->get_setting( 'filtered_noindex' ), T_('Other filtered posts pages'), T_('META NOINDEX').' - '.T_('Filtered by keyword search, by author, etc.') );
 298  
 299      $Form->radio( 'filtered_content', $edited_Blog->get_setting('filtered_content'),
 300          array(
 301                  array( 'excerpt', T_('Post excerpts') ),
 302                  array( 'normal', T_('Standard post contents (stopping at "&lt;!-- more -->")') ),
 303                  array( 'full', T_('Full post contents (including after "&lt;!-- more -->")') ),
 304              ), T_('Post contents'), true );
 305  $Form->end_fieldset();
 306  
 307  $Form->begin_fieldset( T_('Other pages').get_manual_link('other_pages_seo') );
 308      $Form->checkbox( 'feedback-popup_noindex', $edited_Blog->get_setting( 'feedback-popup_noindex' ), T_('Comment popups'),
 309                                          T_('META NOINDEX').' - '.T_('For skins with comment popups only.') );
 310      $Form->checkbox( 'msgform_noindex', $edited_Blog->get_setting( 'msgform_noindex' ), T_('Contact forms'),
 311                                          T_('META NOINDEX').' - '.T_('WARNING: Letting search engines index contact forms will attract spam.') );
 312      $Form->checkbox( 'special_noindex', $edited_Blog->get_setting( 'special_noindex' ), T_('Other special pages'),
 313                                          T_('META NOINDEX').' - '.T_('Pages with no index setting of their own... yet.') );
 314      $Form->radio( '404_response', $edited_Blog->get_setting('404_response'),
 315          array(
 316                  array( '200', T_('200 "OK" response') ),
 317                  array( '301', T_('301 redirect to main page') ),
 318                  array( '302', T_('302 redirect to main page') ),
 319                  array( '303', T_('303 redirect to main page') ),
 320                  array( '404', T_('404 "Not found" response') ),
 321                  array( '410', T_('410 "Gone" response') ),
 322              ), T_('404 "Not Found" response'), true );
 323  
 324      $Form->radio( 'help_link', $edited_Blog->get_setting('help_link'),
 325          array(
 326              array( 'param', T_('Use param').': ?disp=help', T_('E-g: ')
 327                  .url_add_param( $blogurl, '<strong>disp=help</strong>' ) ),
 328              array( 'slug', T_('Use extra-path').': '.'/help', T_('E-g: ')
 329                  .url_add_tail( $blogurl, '<strong>/help</strong>' ) ),
 330              ), T_('Help page'), true );
 331  $Form->end_fieldset();
 332  
 333  
 334  $Form->end_form( array(
 335      array( 'submit', 'submit', T_('Save !'), 'SaveButton' ),
 336      array( 'reset', '', T_('Reset'), 'ResetButton' ) ) );
 337  
 338  ?>

title

Description

title

Description

title

Description

title

title

Body