*/
function plugin_enabled($plugin) {
$r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
- return((bool)(count($r) > 0));
+ return ((dbm::is_result($r)) && (count($r) > 0));
}
* @return string
*/
function get_theme_screenshot($theme) {
- $a = get_app();
$exts = array('.png','.jpg');
foreach($exts as $ext) {
- if(file_exists('view/theme/' . $theme . '/screenshot' . $ext))
- return($a->get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext);
+ if(file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
+ return(App::get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext);
+ }
}
- return($a->get_baseurl() . '/images/blank.png');
+ return(App::get_baseurl() . '/images/blank.png');
}
// install and uninstall theme