X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=sitemap.php;h=ae40d7a89a9cf21c93c6749a5e1f7faebc0a7cef;hb=485331f99d5dfdfd7f1dca60853dac292f721b55;hp=876c25251b7944fd981aba336c4c77b116c23f45;hpb=d57063abebdcd0c63cd314ab02adc6d00a077223;p=quix0rs-gnu-social.git diff --git a/sitemap.php b/sitemap.php index 876c25251b..ae40d7a89a 100644 --- a/sitemap.php +++ b/sitemap.php @@ -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', );