b2evolution PHP Cross Reference Blogging Systems

Source: /skins/custom/_skin.class.php - 149 lines - 3870 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 custom
  10   *
  11   * @version $Id: _skin.class.php 3432 2013-04-09 23:03:55Z fplanque $
  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 custom_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 'Custom';
  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' => array(
  51                      'label' => T_('Header Background Color'),
  52                      'note' => T_('E-g: #ff0000 for red'),
  53                      'defaultvalue' => '#78a',
  54                      'type' => 'color',
  55                  ),
  56                  'menu_bg_color' => array(
  57                      'label' => T_('Menu Background Color'),
  58                      'note' => T_('E-g: #ff0000 for red'),
  59                      'defaultvalue' => '#ddd',
  60                      'type' => 'color',
  61                  ),
  62                  'display_post_time' => array(
  63                      'label' => T_('Post time'),
  64                      'note' => T_('Display time for 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          require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
 111          require_css( 'basic.css', 'blog' ); // Basic styles
 112          require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
 113          require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
 114  
 115          // Make sure standard CSS is called ahead of custom CSS generated below:
 116          require_css( 'style.css', 'relative' );
 117  
 118          // Add custom CSS:
 119          $custom_css = '';
 120  
 121          if( $bg_color = $this->get_setting( 'head_bg_color') )
 122          {    // Custom Header background color:
 123              $custom_css .= '    div.pageHeader { background-color: '.$bg_color." }\n";
 124          }
 125  
 126          if( $bg_color = $this->get_setting( 'menu_bg_color') )
 127          {    // Custom Meu background color:
 128              $custom_css .= '    div.top_menu ul { background-color: '.$bg_color." }\n";
 129          }
 130  
 131          if( !empty( $custom_css ) )
 132          {
 133              $custom_css = '<style type="text/css">
 134      <!--
 135  '.$custom_css.'    -->
 136      </style>';
 137              add_headline( $custom_css );
 138          }
 139  
 140          // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
 141          if($this->get_setting("colorbox"))
 142          {
 143              require_js_helper( 'colorbox', 'blog' );
 144          }
 145      }
 146  
 147  }
 148  
 149  ?>

title

Description

title

Description

title

Description

title

title

Body