added one for reviews.
not the best coder though
basically added a new query and edit the loop
$sql2 = "SELECT products_id as pID,
products_id as products_id
FROM " . TABLE_REVIEWS . "";
/*
* Execute the query
*/
$query = tep_db_query($sql);
$query2 = tep_db_query($sql2);
/*
* If there are returned rows...
* Basic sanity check
*/
if ( tep_db_num_rows($query) > 0 ){
/*
* Initialize the variable containers
*/
$container = array();
$number = 0;
$top = 0;
/*
* Loop the query result set
*/
while( $result = tep_db_fetch_array($query)){
$pID = tep_db_fetch_array($query2);
$top = max($top, $pID['products_id'], $result['date_added']);
$location = tep_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $pID['pID'] . '&'. 'reviews_id=' . $result['rID'], 'NONSSL', false);
if ( tep_not_null($result['last_mod']) ){
$lastmod = $result['last_mod'];
} else {
$lastmod = $result['date_added'];
}
$changefreq = 'weekly';
$ratio = ($top > 0) ? ($result['date_added']/$top) : 0;
$priority = $ratio < .1 ? .1 : number_format($ratio, 1, '.', '');
/*
* Initialize the content container array
*/
$container = array('loc' => htmlspecialchars(utf8_encode($location)),
'lastmod' => date ("Y-m-d", strtotime($lastmod)),
'changefreq' => $changefreq,
'priority' => $priority
);
THANKS to who created this and the others!
More...





LinkBack URL
About LinkBacks









Bookmarks