b2evolution PHP Cross Reference Blogging Systems

Source: /skins/forums/index.main.php - 363 lines - 13855 bytes - Text - Print

Description: This is the main/default page template for the "forums" skin. This skin only uses one single template which includes most of its features. It will also rely on default includes for specific dispays (like the comment form).

   1  <?php
   2  /**

   3   * This is the main/default page template for the "forums" skin.

   4   *

   5   * This skin only uses one single template which includes most of its features.

   6   * It will also rely on default includes for specific dispays (like the comment form).

   7   *

   8   * For a quick explanation of b2evo 2.0 skins, please start here:

   9   * {@link http://b2evolution.net/man/skin-structure}

  10   *

  11   * The main page template is used to display the blog when no specific page template is available

  12   * to handle the request (based on $disp).

  13   *

  14   * @package evoskins

  15   * @subpackage forums

  16   *

  17   * @version $Id: index.main.php 9 2011-10-24 22:32:00Z fplanque $

  18   */
  19  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  20  
  21  if( version_compare( $app_version, '4.0.0-dev' ) < 0 )
  22  { // Older 2.x skins work on newer 2.x b2evo versions, but newer 2.x skins may not work on older 2.x b2evo versions.
  23      die( 'This skin is designed for b2evolution 4.0.0 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
  24  }
  25  
  26  
  27  /**

  28   * @var string Name of cookie for skin width

  29   */
  30  $cookie_skin_width_name = 'skin_width';
  31  
  32  if( isset( $_COOKIE[ $cookie_skin_width_name ] ) )
  33  { // Get skin width from $_COOKIE through param function
  34      $cookie_skin_width_value = param_cookie( $cookie_skin_width_name, '/^\d+(px|%)$/i', NULL );
  35      if( empty( $cookie_skin_width_value ) )
  36      { // Force illegal value of width to default
  37          $cookie_skin_width_value = '960px';
  38      }
  39  }
  40  
  41  if( $disp == 'posts' && ! isset( $tag ) )
  42  {
  43      // Compile cat array to set the correct category params, and change to category display only if required

  44      param_compile_cat_array();
  45  
  46      // Display a list of forums instead of posts

  47      if( ! isset( $cat ) )
  48      { // First page, Category is not selected, We should use special disp for forums
  49          $disp = 'catdir';
  50      }
  51      elseif( $cat > 0 )
  52      { // A specific category was requested
  53          $chapters = $Skin->get_chapters( $cat );
  54          if( count( $chapters ) > 0 )
  55          { // Current chapter has children
  56              $disp = 'catdir';
  57          }
  58      }
  59  }
  60  
  61  // This is the main template; it may be used to display very different things.

  62  // Do inits depending on current $disp:

  63  skin_init( $disp );
  64  
  65  // -------------------------- HTML HEADER INCLUDED HERE --------------------------

  66  skin_include( '_html_header.inc.php', array(
  67      'edit_text_create'  => T_('Start a new topic'),
  68      'edit_text_update'  => T_('Edit post'),
  69      'catdir_text'       => T_('Forum'),
  70      'category_text'     => T_('Forum').': ',
  71      'comments_text'     => T_('Latest Replies'),
  72      'useritems_text'    => T_('User\'s topics'),
  73      'usercomments_text' => T_('User\'s replies'),
  74  ) );
  75  // Note: You can customize the default HTML header by copying the generic

  76  // /skins/_html_header.inc.php file into the current skin folder.

  77  // -------------------------------- END OF HEADER --------------------------------

  78  ?>
  79  
  80  
  81  <div class="pageTop">
  82      <?php
  83          // ------------------------- "Page Top" CONTAINER EMBEDDED HERE --------------------------

  84          // Display container and contents:

  85          skin_container( NT_('Page Top'), array(
  86                  // The following params will be used as defaults for widgets included in this container:

  87                  'block_start'         => '<div class="$wi_class$">',
  88                  'block_end'           => '</div>',
  89                  'block_display_title' => false,
  90                  'list_start'          => '<ul>',
  91                  'list_end'            => '</ul>',
  92                  'item_start'          => '<li>',
  93                  'item_end'            => '</li>',
  94              ) );
  95          // ----------------------------- END OF "Page Top" CONTAINER -----------------------------

  96      ?>
  97  </div>
  98  
  99  <div class="pageHeader">
 100      <?php
 101          // ------------------------- "Header" CONTAINER EMBEDDED HERE --------------------------

 102          // Display container and contents:

 103          skin_container( NT_('Header'), array(
 104                  // The following params will be used as defaults for widgets included in this container:

 105                  'block_start'       => '<div class="$wi_class$">',
 106                  'block_end'         => '</div>',
 107                  'block_title_start' => '<h1>',
 108                  'block_title_end'   => '</h1>',
 109              ) );
 110          // ----------------------------- END OF "Header" CONTAINER -----------------------------

 111      ?>
 112  </div>
 113  
 114  <div class="top_menu_bg"></div>
 115  
 116  <div id="layout">
 117      <div id="wrapper"<?php echo ( !empty( $cookie_skin_width_value ) ) ? ' style="width:'.$cookie_skin_width_value.'"' : ''; ?>>
 118  
 119  <div class="top_menu">
 120      <ul>
 121      <?php
 122          // ------------------------- "Menu" CONTAINER EMBEDDED HERE --------------------------

 123          // Display container and contents:

 124          // Note: this container is designed to be a single <ul> list

 125          skin_container( NT_('Menu'), array(
 126                  // The following params will be used as defaults for widgets included in this container:

 127                  'block_start'         => '',
 128                  'block_end'           => '',
 129                  'block_display_title' => false,
 130                  'list_start'          => '',
 131                  'list_end'            => '',
 132                  'item_start'          => '<li>',
 133                  'item_end'            => '</li>',
 134              ) );
 135          // ----------------------------- END OF "Menu" CONTAINER -----------------------------

 136      ?>
 137      </ul>
 138      &nbsp;
 139  </div>
 140  
 141  
 142  <?php
 143  if( $disp == 'catdir' )
 144  {
 145      // ------------------------- "Menu Top" CONTAINER EMBEDDED HERE --------------------------

 146      // Display container and contents:

 147      // Note: this container is designed to be a single <ul> list

 148      skin_container( NT_('Menu Top'), array(
 149              // The following params will be used as defaults for widgets included in this container:

 150              'block_title_start'   => '',
 151              'block_title_end'     => '',
 152              'list_start'          => '',
 153              'list_end'            => '',
 154              'item_start'          => '',
 155              'item_end'            => '',
 156          ) );
 157      // ----------------------------- END OF "Menu Top" CONTAINER -----------------------------

 158  }
 159  ?>
 160  
 161  <!-- =================================== START OF MAIN AREA =================================== -->
 162  <div>
 163  
 164      <?php
 165          // ------------------------- MESSAGES GENERATED FROM ACTIONS -------------------------

 166          messages( array(
 167                  'block_start' => '<div class="action_messages">',
 168                  'block_end'   => '</div>',
 169              ) );
 170          // --------------------------------- END OF MESSAGES ---------------------------------

 171      ?>
 172  
 173      <?php
 174          if( $disp == 'edit' )
 175          {    // Add or Edit a post
 176              $p = param( 'p', 'integer', 0 ); // Edit post from Front-office

 177          }
 178          // ------------------------ TITLE FOR THE CURRENT REQUEST ------------------------

 179          request_title( array(
 180                  'title_before'      => '<h2 class="page_title">',
 181                  'title_after'       => '</h2>',
 182                  'title_single_disp' => false,
 183                  'title_page_disp'   => false,
 184                  'format'            => 'htmlbody',
 185                  'edit_text_create'  => T_('Post a new topic'),
 186                  'edit_text_update'  => T_('Edit post'),
 187                  'category_text'     => '',
 188                  'categories_text'   => '',
 189                  'catdir_text'       => '',
 190                  'comments_text'     => T_('Latest Replies'),
 191                  'useritems_text'    => T_('User\'s topics'),
 192                  'usercomments_text' => T_('User\'s replies'),
 193              ) );
 194          // ----------------------------- END OF REQUEST TITLE ----------------------------

 195      ?>
 196  
 197  
 198      <?php
 199          // -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------

 200          skin_include( '$disp$', array(
 201              'profile_avatar_before' => '<div class="center">',
 202              'profile_avatar_after'  => '<div><br />',
 203              'disp_edit_categories'  => false,
 204              'skin_form_params'      => array(
 205                      'formstart'      => '<table class="bForums" width="100%" cellspacing="1" cellpadding="2" border="0">',
 206                      'formend'        => '</table>',
 207                      'fieldset_begin' => '<tr><th colspan="3" $fieldset_attribs$>$fieldset_title$',
 208                      'fieldset_end'   => '</th></tr>',
 209                      'fieldstart'     => '<tr $ID$>',
 210                      'fieldend'       => '</tr>',
 211                      'labelstart'     => '<td class="row1 left">',
 212                      'labelend'       => '</td>',
 213                      'inputstart'     => '<td class="row2 left">',
 214                      'inputend'       => '</td>',
 215                      'infostart'      => '<td class="row2 left" colspan="2">',
 216                      'infoend'        => '</td>',
 217                      'buttonsstart'   => '<tr><td colspan="2" class="buttons">',
 218                      'buttonsend'     => '</td></tr>',
 219                      'inline_labelstart' => '<td class="left" colspan="2">',
 220                      'inline_labelend'   => '</td>',
 221                      'inline_inputstart' => '',
 222                      'inline_inputend'   => '',
 223                      'customstart'       => '<tr><td colspan="2" class="custom_content">',
 224                      'customend'         => '</td></tr>',
 225                  ),
 226                  'notify_my_text'              => T_( 'Notify me by email whenever a reply is published on one of <strong>my</strong> topics.' ),
 227                  'notify_moderator_text'       => T_( 'Notify me by email whenever a reply is posted in a forum where I am a moderator.' ),
 228                  'user_itemlist_title'         => T_('Topics created by %s'),
 229                  'user_itemlist_no_results'    => T_('User has not created any topics'),
 230                  'user_commentlist_title'      => T_('Replies posted by %s'),
 231                  'user_commentlist_no_results' => T_('User has not posted any replies'),
 232                  'user_commentlist_col_post'   => T_('Reply on:'),
 233          ) );
 234          // Note: you can customize any of the sub templates included here by

 235          // copying the matching php file into your skin directory.

 236          // ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------

 237      ?>
 238  
 239  </div>
 240  
 241  <div>
 242      <?php
 243          // ------------------------- "Sidebar" CONTAINER EMBEDDED HERE --------------------------

 244          // Display container contents:

 245          skin_container( NT_('Sidebar'), array(
 246                  // The following (optional) params will be used as defaults for widgets included in this container:

 247                  // This will enclose each widget in a block:

 248                  'block_start' => '<div class="sidebar_block $wi_class$">',
 249                  'block_end' => '<div class="clear"></div></div>',
 250                  // This will enclose the title of each widget:

 251                  'block_title_start' => '<div class="sidebar_title">',
 252                  'block_title_end' => '</div>',
 253                  // If a widget displays a list, this will enclose that list:

 254                  'list_start' => '<ul>',
 255                  'list_end' => '</ul>',
 256                  // This will enclose each item in a list:

 257                  'item_start' => '<li>',
 258                  'item_end' => '</li>',
 259                  // This will enclose sub-lists in a list:

 260                  'group_start' => '<ul>',
 261                  'group_end' => '</ul>',
 262                  // This will enclose (foot)notes:

 263                  'notes_start' => '<div class="notes">',
 264                  'notes_end' => '</div>',
 265              ) );
 266          // ----------------------------- END OF "Sidebar" CONTAINER -----------------------------

 267      ?>
 268  </div>
 269  
 270  <?php skin_include( '_legend.inc.php' ); ?>
 271  
 272      </div><?php /** END OF <div id="wrapper"> **/?>
 273  </div><?php /** END OF <div id="layout"> **/?>
 274  
 275  <!-- =================================== START OF FOOTER =================================== -->
 276  <div id="pageFooter">
 277      <?php
 278          // Display container and contents:

 279          skin_container( NT_("Footer"), array(
 280                  // The following params will be used as defaults for widgets included in this container:

 281              ) );
 282          // Note: Double quotes have been used around "Footer" only for test purposes.

 283      ?>
 284      <p class="baseline">
 285          <?php
 286              // Display footer text (text can be edited in Blog Settings):

 287              $Blog->footer_text( array(
 288                      'before'      => '',
 289                      'after'       => ' &bull; ',
 290                  ) );
 291  
 292          // TODO: dh> provide a default class for pTyp, too. Should be a name and not the ptyp_ID though..?!

 293          ?>
 294  
 295          <?php
 296              // Display a link to contact the owner of this blog (if owner accepts messages):

 297              $Blog->contact_link( array(
 298                      'before'      => '',
 299                      'after'       => ' &bull; ',
 300                      'text'   => T_('Contact'),
 301                      'title'  => T_('Send a message to the owner of this blog...'),
 302                  ) );
 303              // Display a link to help page:

 304              $Blog->help_link( array(
 305                      'before'      => ' ',
 306                      'after'       => ' &bull; ',
 307                      'text'        => T_('Help'),
 308                  ) );
 309  
 310              // Display additional credits:

 311              // If you can add your own credits without removing the defaults, you'll be very cool :))

 312              // Please leave this at the bottom of the page to make sure your blog gets listed on b2evolution.net

 313              credits( array(
 314                      'list_start'  => '',
 315                      'list_end'    => ' ',
 316                      'separator'   => '&bull;',
 317                      'item_start'  => ' ',
 318                      'item_end'    => ' ',
 319                  ) );
 320          ?>
 321      </p>
 322  </div>
 323  
 324  <?php
 325  // ------------------------- WIDTH SWITCHER --------------------------

 326  $width_switchers = array(
 327          '960px' => 'width_decrease',
 328          '100%'  => 'width_increase',
 329      );
 330  if( !empty( $cookie_skin_width_value ) )
 331  {    // Fix this cookie value because in the cookie we cannot store the width in percent values (See js function switch_width() to understand why)
 332      $cookie_skin_width_value_fixed = $cookie_skin_width_value != '960px' ? '100%' : $cookie_skin_width_value;
 333  }
 334  ?>
 335  <div id="width_switcher"<?php echo is_logged_in() ? ' style="top:30px"' : ''; ?> class="roundbutton_group">
 336  <?php
 337  $ws = 0;
 338  $ws_count = count( $width_switchers );
 339  foreach( $width_switchers as $ws_size => $ws_icon )
 340  {
 341      $ws_class = 'roundbutton';
 342      if( ( !empty( $cookie_skin_width_value ) && $cookie_skin_width_value_fixed == $ws_size ) ||
 343          ( empty( $cookie_skin_width_value ) && $ws == 0 ) )
 344      {    // Mark this switcher as selected
 345          $ws_class .= ' roundbutton_selected';
 346      }
 347      echo '<a href="#" onclick="switch_width( this, \''.$ws_size.'\', \''.$cookie_skin_width_name.'\', \''.$cookie_path.'\' ); return false;" class="'.$ws_class.'">';
 348      echo get_icon( $ws_icon );
 349      echo '</a>';
 350      $ws++;
 351  }
 352  ?>
 353  </div>
 354  <?php
 355  // ------------------------- END OF WIDTH SWITCHER --------------------------

 356  
 357  
 358  // ------------------------- HTML FOOTER INCLUDED HERE --------------------------

 359  skin_include( '_html_footer.inc.php' );
 360  // Note: You can customize the default HTML footer by copying the

 361  // _html_footer.inc.php file into the current skin folder.

 362  // ------------------------------- END OF FOOTER --------------------------------

 363  ?>

title

Description

title

Description

title

Description

title

title

Body