1 edb Aug 23, 2006 01:06
3 yabba Aug 23, 2006 10:43
There's a couple of ways you could achieve this. The first is to copy the skin for each variation of content that you want (you would only need to have a _main.php in each folder and it could grab the rest of the files etc from the original skin folder).
The other way is to use the code I posted in the post about blocks. For your example it would look something like this :-
<?php
if( file_exists( dirname(__FILE__).'/_blog'.$Blog->ID.'_bit1.php' ) )
{
include dirname(__FILE__).'/_blog'.$Blog->ID.'_bit1.php';
}
elseif ( file_exits( dirname(__FILE__).'/_generic_bit1.php' ) )
{
include dirname(__FILE__).'/_generic_bit1.php';
}
?>
If you're going to be using a lot of different 'bits' then I'd suggest making the above a function which would simplify your skin a tad :-
<?php
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
function get_blog_bit( $bit )
{
global $Blog;
if( file_exists( dirname(__FILE__).'/_blog'.$Blog->ID.'_'.$bit.'.php' ) )
{
include dirname(__FILE__).'/_blog'.$Blog->ID.'_'.$bit.'.php';
}
elseif ( file_exits( dirname(__FILE__).'_generic_'.$bit.'.php' ) )
{
include dirname(__FILE__).'_generic_'.$bit.'.php';
}
}
.....
get_blog_bit( 'bit1' );
.....
get_blog_bit( 'bit2' );
.....
get_blog_bit( 'bit3' );
?>
¥
4 edb Aug 24, 2006 18:47
I found a neat little way to get this done. I made an _main.php file for each blog and named them _mainX.php where X is the blog number it's for. I then made the real _main.php be this:
<?php
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
// SELECT THE _MAIN FILE FOR EACH BLOG
require( dirname(__FILE__).'/_main'.$blog.'.php' );
?>
Now I use one skin and one style sheet but can tweak each blog by tweaking it's _main file. Sloppy I guess, but hey - so am I!
5 yabba Aug 24, 2006 19:44
Any answer that works after the sun is over the yardarm has my vote ;)
¥
same. What I am looking for, though I viewed it as a block-system to minimize file edits.
But if a block-system won't be available (built-in or plugin) then this method will be fine. Right now, just as suggested, I am using switches, but it'll be as EdB said, a mess once there are lots of blogs.