X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofiles.php;h=abc9dda5560e1bdd5d54fea48c5326ae5c473ace;hb=a7ce601580b07e9b3e7653cbdb0a9b6bbb5c474e;hp=53372f83d2bb6ba1fbd6c0fbdd3092f0b8db7c5b;hpb=abff6372ddd09be7750b5f1af5a1f889cfeb9635;p=friendica.git
diff --git a/mod/profiles.php b/mod/profiles.php
index 53372f83d2..abc9dda556 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -2,11 +2,11 @@
require_once("include/Contact.php");
require_once('include/Probe.php');
-function profiles_init(&$a) {
+function profiles_init(App $a) {
nav_set_selected('profiles');
- if(! local_user()) {
+ if (! local_user()) {
return;
}
@@ -92,7 +92,7 @@ function profiles_init(&$a) {
intval(local_user()),
intval($a->argv[2])
);
- if(! count($r1)) {
+ if(! dbm::is_result($r1)) {
notice( t('Profile unavailable to clone.') . EOL);
killme();
return;
@@ -116,7 +116,7 @@ function profiles_init(&$a) {
dbesc($name)
);
info( t('New profile created.') . EOL);
- if(count($r3) == 1)
+ if ((dbm::is_result($r3)) && (count($r3) == 1))
goaway('profiles/'.$r3[0]['id']);
goaway('profiles');
@@ -160,9 +160,9 @@ function profile_clean_keywords($keywords) {
return $keywords;
}
-function profiles_post(&$a) {
+function profiles_post(App $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) {
+function profiles_content(App $a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . 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']) ? '' . t('visible to everybody') . ''
+ '$visible' => (($rr['is-default']) ? '' . t('visible to everybody') . ''
: '' . t('Edit visibility') . '')
));
}
$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;