Recent Topics

1 Jun 10, 2007 22:05    

My b2evolution Version: 1.10.2

I'm building a series of custom templates for XHTML-STRICT, and would like to like to have image icons auto-included for each template... For example, a sample line from /src/icons/_icons.php reads:

	'email' => array(
		'file' => $rsc_subdir.'icons/envelope.gif',		
		'alt'  => T_('Email'),
		'size' => array( 13, 10 ),
	),

Is there a way to have the 'skin name' auto-included, so that the path to the image will change dynamically as the skin is changed...? For example, something like:

	'email' => array(
		'file' => $rsc_subdir.'../skins/SKINNAME/img/icons/envelope.gif',		
		'alt'  => T_('Email'),
		'size' => array( 13, 10 ),
	),

or maybe just...

	'email' => array(
		'file' => $rsc_subdir.'SKINNAME/img/icons/envelope.gif',		
		'alt'  => T_('Email'),
		'size' => array( 13, 10 ),
	),

jj.

2 Jun 12, 2007 11:24

Try this near the top of your skins _main.php

$new_folder = $skins_subdir.$skin.'/img/';
foreach( $map_iconfiles as $icon => $def )
	$map_iconfiles[ $icon ]['file'] = str_replace( $rsc_subdir, $new_folder, $def['file'] );

¥

3 Jun 14, 2007 19:54

Thanks, that code works, except that the icon dimensions are controlled from the same array, so the icon has to be the same size as what is listed in the _icons.php file otherwise the other places where the "edit" icon are used (in the admin panel, for example) will be distorted. I suppose it's okay if the edit icon is distorted in the admin panel, better there than on the blog itself.

jj.


Form is loading...