blob: dde3956b42bce2f1f0a304a1a98bd6c9f573c5c0 (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<?php
/**
* @package fisheye
* @subpackage functions
*/
require_once '../kernel/includes/setup_inc.php';
use Bitweaver\Fisheye\FisheyeGallery;
use Bitweaver\Fisheye\FisheyeImage;
$gBitSystem->verifyPackage( 'fisheye' );
$gSiteMapHash = [];
$gallery = new FisheyeGallery();
$listHash = [ 'max_records' => -1, 'no_thumbnails' => true ];
if( $galleries = $gallery->getList( $listHash ) ) {
foreach( $galleries as $row ) {
$url = FisheyeGallery::getDisplayUrlFromHash( $row );
if( empty( $url ) ) continue;
$gSiteMapHash['g'.$row['gallery_id']] = [
'loc' => BIT_BASE_URI . $url,
'lastmod' => date( 'Y-m-d', $row['last_modified'] ),
'changefreq' => 'monthly',
'priority' => 0.6,
];
}
}
$image = new FisheyeImage();
$listHash = [ 'max_records' => -1, 'no_thumbnails' => true ];
if( $images = $image->getList( $listHash ) ) {
foreach( $images as $row ) {
$url = FisheyeImage::getDisplayUrlFromHash( $row );
if( empty( $url ) ) continue;
$gSiteMapHash['i'.$row['image_id']] = [
'loc' => BIT_BASE_URI . $url,
'lastmod' => date( 'Y-m-d', $row['last_modified'] ),
'changefreq' => 'monthly',
'priority' => 0.5,
];
}
}
$gBitSmarty->assign( 'gSiteMapHash', $gSiteMapHash );
$gBitThemes->setFormatHeader( 'xml' );
header( 'Content-Type: application/xml; charset=utf-8' );
$gBitSystem->display( 'bitpackage:kernel/sitemap.tpl' );
|