]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/updateurls.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / scripts / updateurls.php
index c49187c299407c194b27cb669f75ac3d395b3206..80b4ffc4060ca2ad7e06ccca92cdc2119513f3f3 100755 (executable)
@@ -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");