mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
BUGFIX: fixed notice level error. MINOR: updated readme to markdown format.
This commit is contained in:
parent
20842ce5fe
commit
8886348de0
19
README.md
Normal file
19
README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Google Sitemaps Module
|
||||
|
||||
## Maintainer Contact
|
||||
|
||||
* Will Rossiter (Nickname: <wrossiter, willr>)
|
||||
<will@silverstripe.com>
|
||||
|
||||
## Requirements
|
||||
|
||||
* SilverStripe 2.4
|
||||
|
||||
## Documentation
|
||||
|
||||
* http://doc.silverstripe.com/doku.php?id=modules:googlesitemaps
|
||||
|
||||
## Installation Instructions
|
||||
|
||||
* See http://doc.silverstripe.org/modules#installation
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Initial implementation of Sitemap support.
|
||||
* GoogleSitemap should handle requests to 'sitemap.xml'
|
||||
@ -18,6 +19,7 @@
|
||||
*
|
||||
* @package googlesitemaps
|
||||
*/
|
||||
|
||||
class GoogleSitemap extends Controller {
|
||||
|
||||
/**
|
||||
@ -60,14 +62,12 @@ class GoogleSitemap extends Controller {
|
||||
|
||||
// If the page has been set to 0 priority, we set a flag so it won't be included
|
||||
if($page->canView() && (!isset($page->Priority) || $page->Priority > 0)) {
|
||||
// The one field that isn't easy to deal with in the template is
|
||||
// Change frequency, so we set that here.
|
||||
$properties = $page->toMap();
|
||||
$created = new SS_Datetime();
|
||||
$created->value = $properties['Created'];
|
||||
|
||||
$created = $page->dbObject('Created');
|
||||
|
||||
$now = new SS_Datetime();
|
||||
$now->value = date('Y-m-d H:i:s');
|
||||
$versions = $properties['Version'];
|
||||
$versions = $page->Version;
|
||||
$timediff = $now->format('U') - $created->format('U');
|
||||
|
||||
// Check how many revisions have been made over the lifetime of the
|
||||
@ -156,4 +156,4 @@ class GoogleSitemap extends Controller {
|
||||
public static function disable() {
|
||||
self::$enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
@ -83,6 +83,4 @@ class GoogleSitemapDecorator extends SiteTreeDecorator {
|
||||
return $this->owner->getField('Priority');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
}
|
Loading…
Reference in New Issue
Block a user