Posted 05 June 2005, 11:47
In order to make this by the way excellent contribution to work with the "other" (topic 129041) SEO URL's contribution i had to make some little changes.
I hope it's not a problem i post them here and perhaps you can do something with it.
In googlesitemap/index.php around line 58:
// SEO OTHER BEGIN
if ( file_exists(DIR_WS_CLASSES . 'seo.class.php') ){
require_once(DIR_WS_CLASSES . 'seo.class.php');
$seo_urls = new SEO_URL($languages_id);
} else if ( file_exists(DIR_WS_CLASSES . 'url_rewrite.php') ){
require_once(DIR_WS_CLASSES . 'url_rewrite.php');
$other_rewrite = true;
}
// SEO OTHER END
In google/sitemap.class.php just below function GenerateProductSitemap(){
// SEO OTHER BEGIN
global $other_rewrite;
if (!$other_rewrite) {
$sql = "SELECT products_id as pID, products_date_added as date_added, products_last_modified as last_mod, products_ordered
FROM " . TABLE_PRODUCTS . "
WHERE products_status='1'
ORDER BY products_ordered DESC";
} else {
$sql = "SELECT p.products_id as pID, p.products_date_added as date_added, p.products_last_modified as last_mod, p.products_ordered, pd.products_name, ptc.categories_id
FROM " . TABLE_PRODUCTS . " AS p LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " AS ptc
ON ptc.products_id=p.products_id
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " AS pd
ON pd.products_id=p.products_id
WHERE p.products_status='1'
ORDER BY p.products_ordered DESC";
}
// SEO OTHER END
if ( $products_query = $this->DB->Query($sql) ){
$this->debug['QUERY']['PRODUCTS']['STATUS'] = 'success';
$this->debug['QUERY']['PRODUCTS']['NUM_ROWS'] = $this->DB->NumRows($products_query);
$container = array();
$number = 0;
$top = 0;
while( $result = $this->DB->FetchArray($products_query) ){
$top = max($top, $result['products_ordered']);
// SEO OTHER BEGIN
if (!$other_rewrite)
$location = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['pID'], 'NONSSL', false);
else
$location = tep_href_link(FILENAME_DEFAULT, 'cPath=' . tep_get_product_path($result['pID']) . '/' . $result['products_name'], 'NONSSL', false);
// SEO OTHER END
$lastmod = tep_not_null($result['last_mod']) ? $result['last_mod'] : $result['date_added'];
$changefreq = GOOGLE_SITEMAP_PROD_CHANGE_FREQ;
$ratio = $result['products_ordered']/$top;
$priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', '');