]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - sitemap.php
shorter confirmation message and web iface to confirm
[quix0rs-gnu-social.git] / sitemap.php
index 876c25251b7944fd981aba336c4c77b116c23f45..ae40d7a89a9cf21c93c6749a5e1f7faebc0a7cef 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;
@@ -228,7 +227,7 @@ function avatar_map() {
                $image = array(
                                           'url'        => common_avatar_display_url($avatars),
                                           'lastmod'    => common_date_w3dtf($avatars->modified),
-                                          'changefreq' => 'monthly',
+                                          'changefreq' => 'never',
                                           'priority'   => '0.2',
                                           );