Mercurial > SimpleWebPresenter
comparison Sitemap.inc @ 113:d547cae319f0
Fix missing closing XML tag.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Wed, 16 Mar 2016 12:09:31 +0100 |
| parents | 4854db07f14f |
| children | f498ea087d67 |
comparison
equal
deleted
inserted
replaced
| 112:4854db07f14f | 113:d547cae319f0 |
|---|---|
| 79 | 79 |
| 80 $doc = new DOMDocument(); | 80 $doc = new DOMDocument(); |
| 81 | 81 |
| 82 if (file_exists($fentry)) { | 82 if (file_exists($fentry)) { |
| 83 $doc->load($fentry); | 83 $doc->load($fentry); |
| 84 | 84 |
| 85 $opts = array(); | 85 $opts = array(); |
| 86 if (count($acceptedLanguages) > 1) { | 86 if (count($acceptedLanguages) > 1) { |
| 87 $opts['lang'] = $lang; | 87 $opts['lang'] = $lang; |
| 88 } | 88 } |
| 89 | 89 |
| 107 } | 107 } |
| 108 closedir($handle); | 108 closedir($handle); |
| 109 } | 109 } |
| 110 return $urls; | 110 return $urls; |
| 111 } | 111 } |
| 112 | 112 |
| 113 function generateContent() { | 113 function generateContent() { |
| 114 | 114 |
| 115 /// The final output variable | 115 /// The final output variable |
| 116 $out = '<?xml version="1.0" encoding="UTF-8"?>'; | 116 $out = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 117 $out .= "\n"; | 117 $out .= "\n"; |
| 141 $urls=array_merge($urls, | 141 $urls=array_merge($urls, |
| 142 $this->processDir("common", $lang, | 142 $this->processDir("common", $lang, |
| 143 $acceptedLanguages, $base) | 143 $acceptedLanguages, $base) |
| 144 ); | 144 ); |
| 145 } | 145 } |
| 146 | 146 |
| 147 usort($urls, "cmp_length_lex"); | 147 usort($urls, "cmp_length_lex"); |
| 148 | 148 |
| 149 foreach($urls as $location) { | 149 foreach($urls as $location) { |
| 150 $headers = Http::getHeaders($location, 5); | 150 $headers = Http::getHeaders($location, 5); |
| 151 | 151 |
| 167 $out .= "<lastmod>${lastmod}</lastmod>\n"; | 167 $out .= "<lastmod>${lastmod}</lastmod>\n"; |
| 168 $out .= "</url>\n"; | 168 $out .= "</url>\n"; |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 $out .= '</urlset>'; | 172 $out .= "</urlset>\n"; |
| 173 $out .= "</xml>"; | |
| 173 | 174 |
| 174 $res = new PageContent($out); | 175 $res = new PageContent($out); |
| 175 $cache=new SimpleCache($this->lastmod); | 176 $cache=new SimpleCache($this->lastmod); |
| 176 $cache->setMaxAge(86400); | 177 $cache->setMaxAge(86400); |
| 177 $this->setCache($cache); | 178 $this->setCache($cache); |
