1 charmy Sep 27, 2011 20:45
3 charmy Sep 30, 2011 18:49
i tried and it doesn't work with my test user who is in that group.
I changed the 44 for the id of the group I need.
Where exactly do I put it in the display_init() maybe that is the reason I couldnt't make it to work. Thanks a lot for your help.
<?php
/**
* 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/}
*
* @package skins
* @subpackage custom
*
* @version $Id: _skin.class.php,v 1.7 2010/01/19 19:38:41 fplanque Exp $
*/
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
/**
* Specific code for this skin.
*
* ATTENTION: if you make a new skin you have to change the class name below accordingly
*/
class custom_Skin extends Skin
{
/**
* Get default name for the skin.
* Note: the admin can customize it.
*/
function get_default_name()
{
return 'Custom';
}
/**
* Get default type for the skin.
*/
function get_default_type()
{
return 'normal';
}
/**
* Get definitions for editable params
*
* @see Plugin::GetDefaultSettings()
* @param local params like 'for_editing' => true
*/
function get_param_definitions( $params )
{
$r = array_merge( array(
'head_bg_color' => array(
'label' => T_('Header Background Color'),
'note' => T_('E-g: #ff0000 for red'),
'defaultvalue' => '#78a',
'valid_pattern' => array( 'pattern'=>'¤^(#([a-f0-9]{3}){1,2})?$¤i',
'error'=>T_('Invalid color code.') ),
),
'menu_bg_color' => array(
'label' => T_('Menu Background Color'),
'note' => T_('E-g: #ff0000 for red'),
'defaultvalue' => '#ddd',
'valid_pattern' => array( 'pattern'=>'¤^(#([a-f0-9]{3}){1,2})?$¤i',
'error'=>T_('Invalid color code.') ),
),
'display_post_time' => array(
'label' => T_('Post time'),
'note' => T_('Display time for each post'),
'defaultvalue' => 1,
'type' => 'checkbox',
),
'sidebar_position' => array(
'label' => T_('Sidebar position'),
'note' => '',
'defaultvalue' => 'right',
'options' => array( 'left' => $this->T_('Left'), 'right' => $this->T_('Right') ),
'type' => 'select',
),
), parent::get_param_definitions( $params ) );
return $r;
}
/**
* Get ready for displaying the skin.
*
* This may register some CSS or JS...
*/
function display_init()
{
// call parent:
parent::display_init();
// Make sure standard CSS is called ahead of custom CSS generated below:
require_css( 'style.css', true );
// Add custom CSS:
$custom_css = '';
if( $bg_color = $this->get_setting( 'head_bg_color') )
{ // Custom Header background color:
$custom_css .= ' div.pageHeader { background-color: '.$bg_color." }\n";
}
if( $bg_color = $this->get_setting( 'menu_bg_color') )
{ // Custom Meu background color:
$custom_css .= ' div.top_menu ul { background-color: '.$bg_color." }\n";
}
if( !empty( $custom_css ) )
{
$custom_css = '<style type="text/css">
<!--
'.$custom_css.' -->
</style>';
add_headline( $custom_css );
}
}
}
/*
* $Log: _skin.class.php,v $
*/
?>
4 sam2kb Sep 30, 2011 19:25
Seems like it won't work in display_init()
- then put the code in /conf/hacks.php (create a file)
- and add $use_hacks = true; param in /conf/_advanced.php to enable the hacks.php file
Use this code to allow <div> tags to members of group #44
Place the code into display_init() function in /yourskin/_skin.class.php
not tested!