| 1 |
<?php // (C) Copyright Bobbing Wide 2011 |
| 2 |
|
| 3 |
/* |
| 4 |
Plugin Name: oik blocks |
| 5 |
Plugin URI: http://www.oik-plugins.com/oik |
| 6 |
Description: Easy to use shortcode macro for blocks in content [bw_block] [bw_eblock] |
| 7 |
Version: 1.7 |
| 8 |
Author: bobbingwide |
| 9 |
Author URI: http://www.bobbingwide.com |
| 10 |
License: GPL2 |
| 11 |
|
| 12 |
Copyright 2010, 2011 Bobbing Wide (email : herb@bobbingwide.com ) |
| 13 |
|
| 14 |
This program is free software; you can redistribute it and/or modify |
| 15 |
it under the terms of the GNU General Public License version 2, |
| 16 |
as published by the Free Software Foundation. |
| 17 |
|
| 18 |
You may NOT assume that you can use any other version of the GPL. |
| 19 |
|
| 20 |
This program is distributed in the hope that it will be useful, |
| 21 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 23 |
GNU General Public License for more details. |
| 24 |
|
| 25 |
The license for this software can likely be found here: |
| 26 |
http://www.gnu.org/licenses/gpl-2.0.html |
| 27 |
|
| 28 |
*/ |
| 29 |
|
| 30 |
|
| 31 |
require_once( 'bobbfunc.inc' ); |
| 32 |
require_once( 'bobbingwide.inc' ); |
| 33 |
/* This include will enable oik shortcodes even if the oik base is not enabled. Is this is good idea? */ |
| 34 |
require_once( 'oik-add-shortcodes.php' ); |
| 35 |
/* Include functions to determine level of Artisteer theme whilst Artisteer doesn't provide it */ |
| 36 |
require_once( 'oik-artisteer.php' ); |
| 37 |
|
| 38 |
function bw_block_func( $shortcode ) { |
| 39 |
if ( function_exists( 'bw_artisteer_version' ) ) { |
| 40 |
$art_version = bw_artisteer_version(); |
| 41 |
} else { |
| 42 |
$art_version = FALSE; |
| 43 |
} |
| 44 |
|
| 45 |
//if ( $art_version == FALSE ) |
| 46 |
// bw_trace( $art_version, __FUNCTION__, __LINE__, __FILE__, "art_version is FALSE" ); |
| 47 |
//else |
| 48 |
// bw_trace( $art_version, __FUNCTION__, __LINE__, __FILE__, "art_version is not FALSE" ); |
| 49 |
|
| 50 |
if ( $art_version == FALSE ) { |
| 51 |
require_once( "bw_block.inc" ); |
| 52 |
} else { |
| 53 |
require_once( "bw_block_" . $art_version. ".inc" ); |
| 54 |
} |
| 55 |
return $shortcode . '_' . $art_version; |
| 56 |
} |
| 57 |
|
| 58 |
bw_add_shortcode( 'bw_block', 'bw_block' ); |
| 59 |
bw_add_shortcode( 'bw_eblock', 'bw_eblock' ); |
| 60 |
|
| 61 |
function bw_block( $atts=NULL ) { |
| 62 |
$func = bw_block_func( "bw_block" ); |
| 63 |
return( $func( $atts ) ); |
| 64 |
} |
| 65 |
|
| 66 |
function bw_eblock( $atts=NULL ) { |
| 67 |
$func = bw_block_func( "bw_eblock" ); |
| 68 |
return( $func( $atts ) ); |
| 69 |
} |
| 70 |
|