]> git.mxchange.org Git - friendica.git/blobdiff - include/contact_widgets.php
Merge pull request #3526 from annando/bugfix-index
[friendica.git] / include / contact_widgets.php
index e1c34b8d8fcc0f8f641446dc10e6bfcd904d1647..db077b420ff32ca441690fcd4c6431b08b9c1b22 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Friendica\App;
+
 function follow_widget($value = "") {
 
        return replace_macros(get_markup_template('follow.tpl'), array(
@@ -17,10 +19,11 @@ function findpeople_widget() {
 
        $a = get_app();
 
+       if (get_config('system', 'invitation_only')) {
                $x = get_pconfig(local_user(), 'system', 'invites_remaining');
                if ($x || is_site_admin()) {
                        $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
-                       . sprintf( tt('%d invitation available','%d invitations available', $x), $x)
+                       . sprintf( tt('%d invitation available', '%d invitations available', $x), $x)
                        . '</div>' . $inv;
                }
        }
@@ -95,7 +98,7 @@ function networks_widget($baseurl, $selected = '') {
                return '';
        }
 
-       if (!feature_enabled(local_user(),'networks')) {
+       if (!feature_enabled(local_user(), 'networks')) {
                return '';
        }
 
@@ -136,11 +139,11 @@ function fileas_widget($baseurl, $selected = '') {
                return '';
        }
 
-       if (! feature_enabled(local_user(),'filing')) {
+       if (! feature_enabled(local_user(), 'filing')) {
                return '';
        }
 
-       $saved = get_pconfig(local_user(),'system', 'filetags');
+       $saved = get_pconfig(local_user(), 'system', 'filetags');
        if (! strlen($saved)) {
                return;
        }
@@ -151,7 +154,7 @@ function fileas_widget($baseurl, $selected = '') {
        if ($cnt) {
                foreach ($matches as $mtch) {
                        $unescaped = xmlify(file_tag_decode($mtch[1]));
-                       $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+                       $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
                }
        }
 
@@ -170,22 +173,23 @@ function categories_widget($baseurl, $selected = '') {
 
        $a = get_app();
 
-       if (! feature_enabled($a->profile['profile_uid'],'categories')) {
+       if (! feature_enabled($a->profile['profile_uid'], 'categories')) {
                return '';
        }
 
-       $saved = get_pconfig($a->profile['profile_uid'],'system', 'filetags');
+       $saved = get_pconfig($a->profile['profile_uid'], 'system', 'filetags');
        if (! strlen($saved)) {
                return;
        }
 
        $matches = false;
        $terms = array();
-        $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
-        if ($cnt) {
-                foreach ($matches as $mtch) {
-                       $unescaped = xmlify(file_tag_decode($mtch[1]));
-                       $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+       $cnt = preg_match_all('/<(.*?)>/', $saved, $matches, PREG_SET_ORDER);
+
+       if ($cnt) {
+               foreach ($matches as $mtch) {
+                       $unescaped = xmlify(file_tag_decode($mtch[1]));
+                       $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
                }
        }
 
@@ -204,8 +208,9 @@ function common_friends_visitor_widget($profile_uid) {
 
        $a = get_app();
 
-       if (local_user() == $profile_uid)
+       if (local_user() == $profile_uid) {
                return;
+       }
 
        $cid = $zcid = 0;