X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fupdateavatarurl.php;h=3b6681bae907a952b7314ad80f02a4bb24ac99db;hb=650074c648d98f81674c6e2b0ebf052c473ada6e;hp=dfcfc118cf7f0129d95b8560e0d3a874d78458f2;hpb=fb646654a25dd13b38cd177f3236d8e9f2d9bbb9;p=quix0rs-gnu-social.git diff --git a/scripts/updateavatarurl.php b/scripts/updateavatarurl.php index dfcfc118cf..3b6681bae9 100644 --- a/scripts/updateavatarurl.php +++ b/scripts/updateavatarurl.php @@ -60,7 +60,8 @@ try { } } } else { - throw new Exception("You have to provide an ID or nickname or 'all'."); + show_help(); + exit(1); } } catch (Exception $e) { print $e->getMessage()."\n"; @@ -93,11 +94,11 @@ function updateAvatars($user) } } - $orig = clone($avatar); + $orig_url = $avatar->url; $avatar->url = Avatar::url($avatar->filename); - if ($avatar->url != $orig->url) { + if ($avatar->url != $orig_url) { $sql = "UPDATE avatar SET url = '" . $avatar->url . "' ". "WHERE profile_id = " . $avatar->profile_id . " ". @@ -123,6 +124,9 @@ function updateAvatars($user) } if (have_option('v', 'verbose')) { - print "DONE.\n"; + print "DONE."; + } + if (!have_option('q', 'quiet') || have_option('v', 'verbose')) { + print "\n"; } }