X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=scripts%2Fupdateurls.php;h=80b4ffc4060ca2ad7e06ccca92cdc2119513f3f3;hb=1663e2743bb295e04a0d0399d201b45668025e88;hp=c49187c299407c194b27cb669f75ac3d395b3206;hpb=1111187d845ecd34eba1c03473f6adbc08f6ca15;p=quix0rs-gnu-social.git diff --git a/scripts/updateurls.php b/scripts/updateurls.php old mode 100644 new mode 100755 index c49187c299..80b4ffc406 --- a/scripts/updateurls.php +++ b/scripts/updateurls.php @@ -51,7 +51,6 @@ function updateUserUrls() $profile = $user->getProfile(); updateProfileUrl($profile); - updateAvatarUrls($profile); } catch (Exception $e) { echo "Error updating URLs: " . $e->getMessage(); } @@ -67,36 +66,6 @@ function updateProfileUrl($profile) $profile->update($orig); } -function updateAvatarUrls($profile) -{ - $avatar = new Avatar(); - - $avatar->profile_id = $profile->id; - if ($avatar->find()) { - while ($avatar->fetch()) { - $orig_url = $avatar->url; - $avatar->url = Avatar::url($avatar->filename); - if ($avatar->url != $orig_url) { - $sql = - "UPDATE avatar SET url = '" . $avatar->url . "' ". - "WHERE profile_id = " . $avatar->profile_id . " ". - "AND width = " . $avatar->width . " " . - "AND height = " . $avatar->height . " "; - - if ($avatar->original) { - $sql .= "AND original = 1 "; - } - - if (!$avatar->query($sql)) { - throw new Exception("Can't update avatar for user " . $profile->nickname . "."); - } else { - $touched = true; - } - } - } - } -} - function updateGroupUrls() { printfnq("Updating group URLs...\n");