diff -u /home/chris/install/wordpress/plugins/google-sitemap-generator/sitemap.php google-sitemap-generator/sitemap.php --- /home/chris/install/wordpress/plugins/google-sitemap-generator/sitemap.php 2007-05-18 08:00:04.000000000 +1200 +++ google-sitemap-generator/sitemap.php 2007-06-30 08:53:21.000000000 +1200 @@ -1903,57 +1903,58 @@ //Cycle through all posts and add them foreach($postRes as $post) { - - $isPage = false; - if($wpCompat) { - $isPage = ($post->post_status == 'static'); - } else { - $isPage = ($post->post_type == 'page'); - } - - //Set the current working post - $GLOBALS['post'] = &$post; - - //Default Priority if auto calc is disabled - $prio = 0; - - if($isPage) { - //Priority for static pages - $prio = $default_prio_pages; - } else { - //Priority for normal posts - $prio = $default_prio_posts; - } - - //If priority calc. is enabled, calculate (but only for posts, not pages)! - if($prioProvider !== null && !$isPage) { + if ( !get_post_meta( $post->ID, 'sm_exclude' ) ) { + $isPage = false; + if($wpCompat) { + $isPage = ($post->post_status == 'static'); + } else { + $isPage = ($post->post_type == 'page'); + } - //Comment count for this post - $cmtcnt = (isset($comments[$post->ID])?$comments[$post->ID]:0); - $prio = $prioProvider->GetPostPriority($post->ID,$cmtcnt); + //Set the current working post + $GLOBALS['post'] = &$post; - if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry('Debug: Priority report of postID ' . $post->ID . ': Comments: ' . $cmtcnt . ' of ' . $commentCount . ' = ' . $prio . ' points')); - } - - if(!$isPage && $minPrio>0 && $prio<$minPrio) { - $prio = $minPrio; + //Default Priority if auto calc is disabled + $prio = 0; + + if($isPage) { + //Priority for static pages + $prio = $default_prio_pages; + } else { + //Priority for normal posts + $prio = $default_prio_posts; + } + + //If priority calc. is enabled, calculate (but only for posts, not pages)! + if($prioProvider !== null && !$isPage) { + + //Comment count for this post + $cmtcnt = (isset($comments[$post->ID])?$comments[$post->ID]:0); + $prio = $prioProvider->GetPostPriority($post->ID,$cmtcnt); + + if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry('Debug: Priority report of postID ' . $post->ID . ': Comments: ' . $cmtcnt . ' of ' . $commentCount . ' = ' . $prio . ' points')); + } + + if(!$isPage && $minPrio>0 && $prio<$minPrio) { + $prio = $minPrio; + } + + //Add it + $this->AddUrl(get_permalink($post->ID),$this->GetTimestampFromMySql(($post->post_modified && $post->post_modified!='0000-00-00 00:00:00'?$post->post_modified:$post->post_date)),($isPage?$cf_pages:$cf_posts),$prio); + + //Update the status every 100 posts and at the end. + //If the script breaks because of memory or time limit, + //we have a "last reponded" value which can be compared to the server settings + if($zz==100 || $z == $postCount) { + $status->SaveStep($z); + $zz=0; + } else $zz++; + + $z++; + + //Clean cache because it's incomplete + clean_post_cache($post->ID); } - - //Add it - $this->AddUrl(get_permalink($post->ID),$this->GetTimestampFromMySql(($post->post_modified && $post->post_modified!='0000-00-00 00:00:00'?$post->post_modified:$post->post_date)),($isPage?$cf_pages:$cf_posts),$prio); - - //Update the status every 100 posts and at the end. - //If the script breaks because of memory or time limit, - //we have a "last reponded" value which can be compared to the server settings - if($zz==100 || $z == $postCount) { - $status->SaveStep($z); - $zz=0; - } else $zz++; - - $z++; - - //Clean cache because it's incomplete - clean_post_cache($post->ID); } unset($postRes); unset($prioProvider); Only in google-sitemap-generator/: sitemap.php~