]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
restrict avatars to certain sizes in SQL
authorEvan Prodromou <evan@prodromou.name>
Thu, 17 Jul 2008 16:02:57 +0000 (12:02 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 17 Jul 2008 16:02:57 +0000 (12:02 -0400)
darcs-hash:20080717160257-84dde-8c4f78582ef0d590102c078a045826951ffcbb28.gz

sitemap.php

index 876c25251b7944fd981aba336c4c77b116c23f45..9bbeae8a87eec34aabe02c7e28f574296da2882e 100644 (file)
@@ -206,20 +206,19 @@ function user_map() {
 function avatar_map() {
        global $output_paths;
 
-       $avatars = DB_DataObject::factory('avatar');
-
-       $avatars->query('SELECT url, modified FROM avatar');
+       $avatars = new Avatar();
+       $avatars->whereAdd('original = 1', "OR");
+       $avatars->whereAdd('width = ' . AVATAR_MINI_SIZE, 'OR');
 
+       if (!$avatars->find()) {
+               return 0;
+       }
+       
        $avatar_count = 0;
        $map_count = 1;
 
        while ($avatars->fetch()) {
 
-               # We only want the original size and 24px thumbnail version - skip 96px.
-               if (preg_match('/-96-/', $avatars->url)) {
-                       continue;
-               }
-
                # Maximum 50,000 URLs per sitemap file.
                if ($avatar_count == 50000) {
                        $avatar_count = 0;