diff -ruN google-sitemap-generator.old/sitemap-core.php google-sitemap-generator/sitemap-core.php --- google-sitemap-generator.old/sitemap-core.php 2009-08-30 16:22:43.000000000 -0500 +++ google-sitemap-generator/sitemap-core.php 2009-09-05 14:02:34.000000000 -0500 @@ -1036,6 +1036,7 @@ $this->_options["sm_b_robots"] = true; //Add sitemap location to WordPress' virtual robots.txt file $this->_options["sm_b_exclude"] = array(); //List of post / page IDs to exclude $this->_options["sm_b_exclude_cats"] = array(); //List of post / page IDs to exclude + $this->_options["sm_b_in_tax"]=array(); //Include tag pages $this->_options["sm_b_location_mode"]="auto"; //Mode of location, auto or manual $this->_options["sm_b_filename_manual"]=""; //Manuel filename $this->_options["sm_b_fileurl_manual"]=""; //Manuel fileurl @@ -2158,6 +2159,38 @@ if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry("Debug: End Tags")); } + //Add taxonomy pages + if($this->GetOption("b_in_tax") && $this->IsTaxonomySupported()) { + $incTaxonomies = ($this->GetOption("b_in_tax")); + foreach ($incTaxonomies as $taxonomy) { + $tax_details = get_taxonomy($taxonomy); + if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry("Debug: Start Taxonomy ".$taxonomy)); + $terms = get_terms($taxonomy,array("hide_empty"=>true,"hierarchical"=>false)); + if($terms && is_array($terms) && count($terms)>0) { + foreach($terms AS $term) { + + // Get the date of the last article for this term + + $query = $wpdb->get_results(" + SELECT UNIX_TIMESTAMP(MAX(post_date)) as mod_date + FROM wp_posts, + wp_term_relationships + WHERE wp_posts.ID = wp_term_relationships.object_id + AND wp_term_relationships.term_taxonomy_id = ".$term->term_taxonomy_id." + "); + + if (count($query)) + $mod_date = $query[0]->mod_date; + else + $mod_date = 0; + + $this->AddUrl(get_term_link($term,$taxonomy),$query[0]->mod_date,$this->GetOption("cf_tags"),$this->GetOption("pr_tags")); + } + } + if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry("Debug: End Taxonomy ".$taxonomy)); + } + } + //Add the custom pages if($debug) $this->AddElement(new GoogleSitemapGeneratorDebugEntry("Debug: Start Custom Pages")); if($this->_pages && is_array($this->_pages) && count($this->_pages)>0) { @@ -2510,4 +2543,4 @@ } -} \ No newline at end of file +} diff -ruN google-sitemap-generator.old/sitemap-ui.php google-sitemap-generator/sitemap-ui.php --- google-sitemap-generator.old/sitemap-ui.php 2009-08-30 16:22:43.000000000 -0500 +++ google-sitemap-generator/sitemap-ui.php 2009-09-04 14:12:52.000000000 -0500 @@ -261,6 +261,13 @@ foreach((array) $_POST["post_category"] AS $vv) if(!empty($vv) && is_numeric($vv)) $exCats[] = intval($vv); } $this->sg->_options[$k] = $exCats; + } else if($k == "sm_b_in_tax") { + $incTaxonomies = array(); + if (isset($_POST["sm_b_in_tax"])) { + while (list($tx,$val) = each ($_POST["sm_b_in_tax"])) + if (!empty($tx)) $incTaxonomies[$tx] = $tx; + } + $this->sg->_options[$k] = $incTaxonomies; } else { $this->sg->_options[$k]=(bool) $_POST[$k]; @@ -981,6 +988,27 @@ + sg->GetOption("b_in_tax"); + $selected = isset($selected[$tax_detail->name]); + ?> +
  • + +
  • + +