X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fplugin.php;h=0108ce62162b72f5b1c2fc0fcf2a44cb0f8f8982;hb=98b727029570b96febd0c5046b688cab1a9bb882;hp=3a92b621be56287849fff25b6dce6181bb0b2491;hpb=63610c7b73fcaf862adbf880d4968dd2b1678d9b;p=friendica.git diff --git a/include/plugin.php b/include/plugin.php index 3a92b621be..0108ce6216 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -79,7 +79,7 @@ function reload_plugins() { if(strlen($plugins)) { $r = q("SELECT * FROM `addon` WHERE `installed` = 1"); - if(dbm::is_result($r)) + if (dbm::is_result($r)) $installed = $r; else $installed = array(); @@ -129,7 +129,7 @@ function reload_plugins() { */ 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)); } @@ -150,7 +150,7 @@ function register_hook($hook,$file,$function,$priority=0) { dbesc($file), dbesc($function) ); - if(dbm::is_result($r)) + if (dbm::is_result($r)) return true; $r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`) VALUES ( '%s', '%s', '%s', '%s' ) ", @@ -187,7 +187,7 @@ function load_hooks() { $a = get_app(); $a->hooks = array(); $r = q("SELECT * FROM `hook` WHERE 1 ORDER BY `priority` DESC, `file`"); - if(dbm::is_result($r)) { + if (dbm::is_result($r)) { foreach($r as $rr) { if(! array_key_exists($rr['hook'],$a->hooks)) $a->hooks[$rr['hook']] = array(); @@ -410,13 +410,12 @@ function get_theme_info($theme){ * @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); + 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 @@ -473,7 +472,7 @@ function service_class_allows($uid,$property,$usage = false) { $r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1", intval($uid) ); - if(dbm::is_result($r)) { + if (dbm::is_result($r)) { $service_class = $r[0]['service_class']; } } @@ -503,7 +502,7 @@ function service_class_fetch($uid,$property) { $r = q("SELECT `service_class` FROM `user` WHERE `uid` = %d LIMIT 1", intval($uid) ); - if(dbm::is_result($r)) { + if (dbm::is_result($r)) { $service_class = $r[0]['service_class']; } }