Recent Topics

1 Sep 20, 2009 00:29    

My b2evolution Version: Not Entered

Did this in the cherryblossom skin, will move it into newlondon and 1912 and openchicago and openlegacy.

First you gotta know the version. Instead of a pass/fail version_compare, figure out if it is v2 or v3:

$v3 = false;
if( version_compare( $app_version, '2.4.1' ) < 0 ) {
	die( 'This skin is designed for b2evolution 2.4.1 and above. Please <a href="http://b2evolution.net/downloads/index.html">upgrade your b2evolution</a>.' );
	}
if( version_compare( $app_version, '3.0' ) === 1 ) {
	$v3 = true;
	}

Then you get to use it:

// get the featured post if v3:
if( $v3 && ( $Item = & get_featured_Item() ) ) {
	// ITEM BLOCK INCLUDED HERE
	skin_include( '_item_block.inc.php', array(
			'feature_block' => true,
			'content_mode' => 'auto',
			'intro_mode' => 'normal',
			'item_class' => 'featured_post',
			'image_size' => 'fit-400x320',
		) );
	}

I also used it in /myskin/_item_block.inc.php which I guess is a new file name but it doesn't matter because it's just a file name:

global $v3;
if( $v3 ) { ?>
	<div class="<?php $Item->div_classes( $params ) ?>" lang="<?php $Item->lang() ?>">
	<?php 
	} else { ?>
	<div class="bPost" lang="<?php $Item->lang() ?>">
	<?php 
	}

No preview button in this forum :roll:

2 Sep 20, 2009 01:44

The thing is the skins showing up for v3 on the skins site are listed under v2 skins. So with a wee bit 'o code thrown in they'll be compatible with both generations.

And that bit that says "2.4.1" should change to "2.4.5" because that is the oldest stable release.

3 Sep 22, 2009 05:58

EdB wrote:

And that bit that says "2.4.1" should change to "2.4.5" because that is the oldest stable release.

I guess there were some skin-related changes in 2.4.1 , this check is not based on stable or not stable thing, not sure though.

5 Sep 23, 2009 00:48

sam2kb wrote:

EdB wrote:

And that bit that says "2.4.1" should change to "2.4.5" because that is the oldest stable release.

I guess there were some skin-related changes in 2.4.1 , this check is not based on stable or not stable thing, not sure though.

True, but I'm kinda into suggesting peeps use 'stable' versions. So anything in the earliest levels of v2 really should go to 247 but technically 245 and 246 aren't "not stable" is why I figured on changing that bit.

Actually that little bit could get really fancy.
If less than 241 "you gotta upgrade"
else if less than 247 "you should upgrade to 247 and maybe more if you're feeling brave"
else if equal equal equal 3 "v3 is true"


Form is loading...