Recent Topics

Conditional display if plugin installed ...

Started by on Mar 01, 2011 – Contents updated: Mar 01, 2011

Mar 01, 2011 04:26    

My b2evolution Version: 4.0.3

I'm not really sure what to call it but I think I can explain it well enough to get a straight answer ;)

I want to check to make sure a plugin is installed and if it is I want my skin to display a block of code. I just need to know if its possible and what the code should be for my * if * ...

Code

if (plugin_installed($plugin_name))
{
  // display the code required
}
I figure there probably is something like that I can use to completely hide sidebar content blocks if the required plugin isn't installed ... not to mention other uses ;)

Mar 01, 2011 05:08

PHP

if( ($MyPlugin$GLOBALS['Plugins']->get_by_code('whatever')) !== false )
{
    if( $MyPlugin->status == 'enabled' )
    {    //plugin is enabled
             //Do something
    }
 
}

Mar 01, 2011 06:01

Thank you very much :D

It looks like exactly what I need, do you know of any examples I could look at to fully understand the code?

Mar 01, 2011 09:06

PHP

if( ($PingPlugin$GLOBALS['Plugins']->get_by_code('ping_b2evonet')) !== false )
{
    if( $PingPlugin->status == 'enabled' )
    {    
             echo "you have b2evolution ping plugin installed.";
    }
 
}


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.