예제 #1
0
파일: seo.class.php 프로젝트: Geotex/v6
 /**
  * Create sitemap link
  *
  * @param string $input
  * @param string $updated
  * @param string $type
  */
 private function _sitemap_link($input, $updated = false, $type = false)
 {
     $updated = !$updated ? time() : $updated;
     $store_url = CC_SSL ? $GLOBALS['config']->get('config', 'ssl_url') : $GLOBALS['config']->get('config', 'standard_url');
     if (!isset($input['url']) && !empty($type)) {
         $input['url'] = $store_url . '/' . $this->generatePath($input['id'], $type, '', false, true);
     }
     $this->_sitemap_xml->startElement('url');
     $this->_sitemap_xml->setElement('loc', htmlspecialchars($input['url']), false, false);
     $this->_sitemap_xml->setElement('lastmod', date('c', $updated), false, false);
     $this->_sitemap_xml->endElement();
 }
예제 #2
0
 /**
  * Create sitemap link
  *
  * @param string $input
  * @param string $updated
  * @param string $type
  */
 private function _sitemap_link($input, $updated = false, $type = false)
 {
     $updated = !$updated || "0000-00-00" == substr($updated, 0, 10) ? 'NOW' : $updated;
     $dateTime = new DateTime($updated);
     $updated = $dateTime->format(DateTime::W3C);
     $store_url = CC_SSL ? $GLOBALS['config']->get('config', 'ssl_url') : $GLOBALS['config']->get('config', 'standard_url');
     if (!isset($input['url']) && !empty($type)) {
         $input['url'] = $store_url . '/' . $this->generatePath($input['id'], $type, '', false, true);
     }
     $this->_sitemap_xml->startElement('url');
     $this->_sitemap_xml->setElement('loc', htmlspecialchars($input['url']), false, false);
     $this->_sitemap_xml->setElement('lastmod', $updated, false, false);
     $this->_sitemap_xml->endElement();
 }