]> git.mxchange.org Git - friendica.git/blobdiff - mod/friendica.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / friendica.php
index 18d045f2d57d44244c605cf978dc14394388d241..8c9e9d7ad414cce4e586b022e25b801469209b16 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 
-if(! function_exists('friendica_init')) {
 function friendica_init(&$a) {
        if ($a->argv[1]=="json"){
                $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
@@ -25,7 +24,7 @@ function friendica_init(&$a) {
                $visible_plugins = array();
                if(is_array($a->plugins) && count($a->plugins)) {
                        $r = q("select * from addon where hidden = 0");
-                       if(count($r))
+                       if(dbm::is_result($r))
                                foreach($r as $rr)
                                        $visible_plugins[] = $rr['name'];
                }
@@ -57,9 +56,9 @@ function friendica_init(&$a) {
                killme();
        }
 }
-}
 
-if(! function_exists('friendica_content')) {
+
+
 function friendica_content(&$a) {
 
        $o = '';
@@ -71,7 +70,7 @@ function friendica_content(&$a) {
        $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' ';
        $o .= t('running at web location') . ' ' . z_root() . '</p><p>';
 
-       $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';
+       $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . '</p><p>';        
 
        $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a></p><p>';
        $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com') . '</p>';
@@ -81,7 +80,7 @@ function friendica_content(&$a) {
        $visible_plugins = array();
        if(is_array($a->plugins) && count($a->plugins)) {
                $r = q("select * from addon where hidden = 0");
-               if(count($r))
+               if(dbm::is_result($r))
                        foreach($r as $rr)
                                $visible_plugins[] = $rr['name'];
        }
@@ -103,8 +102,8 @@ function friendica_content(&$a) {
        else
                $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>';
 
-       call_hooks('about_hook', $o);
+       call_hooks('about_hook', $o);   
 
        return $o;
-}
+
 }