e_shortcode.php

To use efiction stuff on other places of e107 CMS


if (!defined('e107_INIT')) {
    exit;
}

class efiction_shortcodes extends e_shortcode
{
...
}
   public function sc_efiction_block_content($parm = NULL)
    {    
        global $current;
        
        if ($parm == '') {
            return '';
        }
        $pagelinks = efiction_pagelinks::get_pagelinks();
        $blocks = efiction_blocks::get_blocks();  //all blocks have to be used, because blocks/... 
        
        $block = $parm['key'];
        $value = $blocks[$block];

        if(empty($value['status']) || ($value['status'] == 2 && $current != "home")) return '';
        if(empty($value['file'])) return '';
 
        if($value['status'] && file_exists(_BASEDIR."blocks/".$value['file'])) {
            $content = "";
            if(file_exists(_BASEDIR."blocks/".$value['file'])) include(_BASEDIR."blocks/".$value['file']);
            $block_content =  $content;
            return $block_content;  
        }
           
        return $block_content;    
    }

Last updated