b2evolution PHP Cross Reference Blogging Systems

Source: /skins/evopress/_skin.class.php - 155 lines - 4567 bytes - Summary - Text - Print

Description: This file implements a class derived of the generic Skin class in order to provide custom code for the skin in this folder. This file is part of the b2evolution project - {@link http://b2evolution.net/}

   1  <?php
   2  /**
   3   * This file implements a class derived of the generic Skin class in order to provide custom code for
   4   * the skin in this folder.
   5   *
   6   * This file is part of the b2evolution project - {@link http://b2evolution.net/}
   7   *
   8   * @package skins
   9   * @subpackage evopress
  10   *
  11   * @version $Id: _skin.class.php 3780 2013-05-22 15:16:40Z yura $
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  /**
  16   * Specific code for this skin.
  17   *
  18   * ATTENTION: if you make a new skin you have to change the class name below accordingly
  19   */
  20  class evopress_Skin extends Skin
  21  {
  22    /**
  23       * Get default name for the skin.
  24       * Note: the admin can customize it.
  25       */
  26  	function get_default_name()
  27      {
  28          return 'evoPress';
  29      }
  30  
  31  
  32    /**
  33       * Get default type for the skin.
  34       */
  35  	function get_default_type()
  36      {
  37          return 'normal';
  38      }
  39  
  40  
  41      /**
  42       * Get definitions for editable params
  43       *
  44       * @see Plugin::GetDefaultSettings()
  45       * @param local params like 'for_editing' => true
  46       */
  47  	function get_param_definitions( $params )
  48      {
  49          $r = array_merge( array(
  50                  'head_bg_color_top' => array(
  51                      'label' => T_('Header gradient top color'),
  52                      'note' => T_('E-g: #ff0000 for red'),
  53                      'defaultvalue' => '#6aace6',
  54                      'type' => 'color',
  55                  ),
  56                  'head_bg_color_bottom' => array(
  57                      'label' => T_('Header gradient bottom color'),
  58                      'note' => T_('E-g: #00ff00 for green'),
  59                      'defaultvalue' => '#4280b6',
  60                      'type' => 'color',
  61                  ),
  62                  'display_post_date' => array(
  63                      'label' => T_('Post date'),
  64                      'note' => T_('Display the date of each post'),
  65                      'defaultvalue' => 1,
  66                      'type' => 'checkbox',
  67                  ),
  68                  'sidebar_position' => array(
  69                      'label' => T_('Sidebar position'),
  70                      'note' => '',
  71                      'defaultvalue' => 'right',
  72                      'options' => array( 'left' => $this->T_('Left'), 'right' => $this->T_('Right') ),
  73                      'type' => 'select',
  74                  ),
  75                  'colorbox' => array(
  76                      'label' => T_('Colorbox Image Zoom'),
  77                      'note' => T_('Check to enable javascript zooming on images (using the colorbox script)'),
  78                      'defaultvalue' => 1,
  79                      'type' => 'checkbox',
  80                  ),
  81                  'gender_colored' => array(
  82                      'label' => T_('Display gender'),
  83                      'note' => T_('Use colored usernames to differentiate men & women.'),
  84                      'defaultvalue' => 0,
  85                      'type' => 'checkbox',
  86                  ),
  87                  'bubbletip' => array(
  88                      'label' => T_('Username bubble tips'),
  89                      'note' => T_('Check to enable bubble tips on usernames'),
  90                      'defaultvalue' => 0,
  91                      'type' => 'checkbox',
  92                  ),
  93              ), parent::get_param_definitions( $params )    );
  94  
  95          return $r;
  96      }
  97  
  98  
  99      /**
 100       * Get ready for displaying the skin.
 101       *
 102       * This may register some CSS or JS...
 103       */
 104  	function display_init()
 105      {
 106          // call parent:
 107          parent::display_init();
 108  
 109          // Add CSS:
 110          // fp> Note: having those here should allow
 111          // 1) Requesting them earlier as if they are @import'ed
 112          // 2) Allow bundling
 113          // fp> I am not 100% sure though. Comments welcome :)
 114          require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
 115          require_css( 'basic.css', 'blog' ); // Basic styles
 116          require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
 117          require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
 118          require_css( 'item.css', 'relative' );
 119          require_css( 'style.css', 'relative' );
 120  
 121          // Add custom CSS:
 122          $custom_css = '';
 123  
 124          $head_bg_color_top = $this->get_setting( 'head_bg_color_top' );
 125          $head_bg_color_bottom = $this->get_setting( 'head_bg_color_bottom' );
 126          if( !empty( $head_bg_color_top ) && !empty( $head_bg_color_bottom ) )
 127          { // Custom Header background color:
 128              $custom_css .= '#headerimg {'."\n"
 129                      .'background:-webkit-linear-gradient(top, '.$head_bg_color_top.', '.$head_bg_color_bottom.');'."\n"
 130                      .'background:-moz-linear-gradient(top, '.$head_bg_color_top.', '.$head_bg_color_bottom.');'."\n"
 131                      .'background:-o-linear-gradient(top, '.$head_bg_color_top.', '.$head_bg_color_bottom.');'."\n"
 132                      .'background: -ms-linear-gradient(top, '.$head_bg_color_top.', '.$head_bg_color_bottom.');'."\n"
 133                      .'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\''.$head_bg_color_top.'\', endColorstr=\''.$head_bg_color_bottom.'\');'."\n"
 134                  .'}'."\n";
 135          }
 136  
 137          if( !empty( $custom_css ) )
 138          {
 139              $custom_css = '<style type="text/css">
 140      <!--
 141  '.$custom_css.'    -->
 142      </style>';
 143              add_headline( $custom_css );
 144          }
 145  
 146          // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
 147          if( $this->get_setting("colorbox") )
 148          {
 149              require_js_helper( 'colorbox', 'blog' );
 150          }
 151      }
 152  
 153  }
 154  
 155  ?>

title

Description

title

Description

title

Description

title

title

Body