-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsitemap.php
More file actions
32 lines (29 loc) · 991 Bytes
/
sitemap.php
File metadata and controls
32 lines (29 loc) · 991 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once( '../kernel/includes/setup_inc.php' );
require_once( BITCOMMERCE_PKG_CLASS_PATH.'CommerceProduct.php' );
$gSiteMapHash = array();
$listHash['max_records'] = -1;
$listHash['commissioned'] = TRUE;
if( $productList = $gBitProduct->getList($listHash) ) {
foreach( $productList as $key=>$hash ) {
if( !empty( $hash['display_url'] ) ) {
$newHash = array();
$newHash['loc'] = BIT_BASE_URI.$hash['display_url'];
$newHash['priority'] = .8;
$lastMod = strtotime( $hash['products_last_modified'] );
$newHash['lastmod'] = date( 'Y-m-d', $lastMod );
if( (time() - $lastMod) < 86400 ) {
$freq = 'daily';
} elseif( (time() - $lastMod) < (86400 * 7) ) {
$freq = 'weekly';
} else {
$freq = 'monthly';
}
$newHash['changefreq'] = $freq;
$gSiteMapHash[$key] = $newHash;
}
}
}
$gBitSmarty->assignByRef( 'gSiteMapHash', $gSiteMapHash );
$gBitThemes->setFormatHeader( 'xml' );
print $gBitSmarty->display( 'bitpackage:kernel/sitemap.tpl' );