X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fprofile_photo.php;h=8b3d3d371e24ea1d0907cb0addfca14da7e3fb43;hb=56ee734b00aead633d5d213a6b140b75bc17ba96;hp=c600dd1f868426c9759a89df47778540986c310a;hpb=4f25396faeaa501907e93b24ee51ebdd08f84993;p=friendica.git diff --git a/mod/profile_photo.php b/mod/profile_photo.php index c600dd1f86..8b3d3d371e 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -2,18 +2,16 @@ require_once("include/Photo.php"); -function profile_photo_init(App &$a) { +function profile_photo_init(App $a) { if (! local_user()) { return; } profile_load($a,$a->user['nickname']); - } - -function profile_photo_post(App &$a) { +function profile_photo_post(App $a) { if (! local_user()) { notice ( t('Permission denied.') . EOL ); @@ -174,13 +172,13 @@ function profile_photo_post(App &$a) { if(! function_exists('profile_photo_content')) { -function profile_photo_content(App &$a) { +function profile_photo_content(App $a) { if (! local_user()) { notice( t('Permission denied.') . EOL ); return; } - + $newuser = false; if($a->argc == 2 && $a->argv[1] === 'new') @@ -191,9 +189,9 @@ function profile_photo_content(App &$a) { notice( t('Permission denied.') . EOL ); return; }; - + // check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo'); - + $resource_id = $a->argv[2]; //die(":".local_user()); $r=q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s' ORDER BY `scale` ASC", @@ -246,7 +244,7 @@ function profile_photo_content(App &$a) { if(! x($a->config,'imagecrop')) { - + $tpl = get_markup_template('profile_photo.tpl'); $o .= replace_macros($tpl,array( @@ -284,7 +282,7 @@ function profile_photo_content(App &$a) { if(! function_exists('profile_photo_crop_ui_head')) { -function profile_photo_crop_ui_head(&$a, $ph){ +function profile_photo_crop_ui_head(App $a, $ph) { $max_length = get_config('system','max_image_length'); if (! $max_length) { $max_length = MAX_IMAGE_LENGTH; @@ -303,11 +301,11 @@ function profile_photo_crop_ui_head(&$a, $ph){ } $hash = photo_new_resource(); - + $smallest = 0; - $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 ); + $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 0 ); if ($r) { info( t('Image uploaded successfully.') . EOL ); @@ -317,7 +315,7 @@ function profile_photo_crop_ui_head(&$a, $ph){ if ($width > 640 || $height > 640) { $ph->scaleImage(640); - $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 ); + $r = $ph->store(local_user(), 0 , $hash, $filename, t('Profile Photos'), 1 ); if ($r === false) { notice( sprintf(t('Image size reduction [%s] failed.'),"640") . EOL );