]> git.mxchange.org Git - friendica.git/blobdiff - mod/profiles.php
Merge pull request #3047 from annando/1612-indexlength
[friendica.git] / mod / profiles.php
index 1ea3c3f4623db051a724457fd5c429d45d276879..9321aacb5928984f26e867b88691b2b0b3fc8866 100644 (file)
@@ -6,7 +6,7 @@ function profiles_init(&$a) {
 
        nav_set_selected('profiles');
 
-       if(! local_user()) {
+       if (! local_user()) {
                return;
        }
 
@@ -15,7 +15,7 @@ function profiles_init(&$a) {
                        intval($a->argv[2]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        goaway('profiles');
                        return; // NOTREACHED
@@ -130,7 +130,7 @@ function profiles_init(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        killme();
                        return;
@@ -162,7 +162,7 @@ function profile_clean_keywords($keywords) {
 
 function profiles_post(&$a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
@@ -502,8 +502,9 @@ function profiles_post(&$a) {
 
                        // Update global directory in background
                        $url = $_SESSION['my_url'];
-                       if($url && strlen(get_config('system','directory')))
+                       if ($url && strlen(get_config('system','directory'))) {
                                proc_run(PRIORITY_LOW, "include/directory.php", $url);
+                       }
 
                        require_once('include/profile_update.php');
                        profile_change();
@@ -594,14 +595,15 @@ function profile_activity($changed, $value) {
        $arr['deny_gid']  = $a->user['deny_gid'];
 
        $i = item_store($arr);
-       if($i)
+       if ($i) {
                proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i);
+       }
 }
 
 
 function profiles_content(&$a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }
@@ -613,7 +615,7 @@ function profiles_content(&$a) {
                        intval($a->argv[1]),
                        intval(local_user())
                );
-               if(! dbm::is_result($r)) {
+               if (! dbm::is_result($r)) {
                        notice( t('Profile not found.') . EOL);
                        return;
                }
@@ -778,24 +780,26 @@ function profiles_content(&$a) {
                if (dbm::is_result($r)) {
 
                        $tpl = get_markup_template('profile_entry.tpl');
-                       foreach($r as $rr) {
+
+                       $profiles = '';
+                       foreach ($r as $rr) {
                                $profiles .= replace_macros($tpl, array(
-                                       '$photo' => $a->remove_baseurl($rr['thumb']),
-                                       '$id' => $rr['id'],
-                                       '$alt' => t('Profile Image'),
+                                       '$photo'        => $a->remove_baseurl($rr['thumb']),
+                                       '$id'           => $rr['id'],
+                                       '$alt'          => t('Profile Image'),
                                        '$profile_name' => $rr['profile-name'],
-                                       '$visible' => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
+                                       '$visible'      => (($rr['is-default']) ? '<strong>' . t('visible to everybody') . '</strong>'
                                                : '<a href="'.'profperm/'.$rr['id'].'" />' . t('Edit visibility') . '</a>')
                                ));
                        }
 
                        $tpl_header = get_markup_template('profile_listing_header.tpl');
                        $o .= replace_macros($tpl_header,array(
-                               '$header' => t('Edit/Manage Profiles'),
-                               '$chg_photo' => t('Change profile photo'),
-                               '$cr_new' => t('Create New Profile'),
+                               '$header'      => t('Edit/Manage Profiles'),
+                               '$chg_photo'   => t('Change profile photo'),
+                               '$cr_new'      => t('Create New Profile'),
                                '$cr_new_link' => 'profiles/new?t=' . get_form_security_token("profile_new"),
-                               '$profiles' => $profiles
+                               '$profiles'    => $profiles
                        ));
                }
                return $o;