Browse Source

Updated StyleCI configuration

tags/v7.0.1^0
Rumen Damyanov 4 months ago
parent
commit
9326fc2452
Signed by: darumen <[email protected]> GPG Key ID: 1B56A3172ACB052F
3 changed files with 41 additions and 33 deletions
  1. +10
    -2
      .styleci.yml
  2. +20
    -20
      src/views/google-news.php
  3. +11
    -11
      src/views/xml.php

+ 10
- 2
.styleci.yml View File

@@ -1,3 +1,11 @@
preset: psr-2

risky: true
risky: true
finder:
exclude:
- modules
- node_modules
- storage
- vendor
- views
name: "*.php"
not-name: "*.blade.php"

+ 20
- 20
src/views/google-news.php View File

@@ -1,30 +1,30 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
<?php
if ($item['lastmod'] !== null) {
echo '<lastmod>'.date('Y-m-d\TH:i:sP', strtotime($item['lastmod'])).'</lastmod>'."\n";
}
?>
?>
<?php
if (! empty($item['alternates'])) {
foreach ($item['alternates'] as $alternate) {
echo '<xhtml:link rel="alternate" media="'.$alternate['media'].'" href="'.$alternate['url'].'" />'."\n";
}
}
?>
<news:news>
<news:publication>
<news:name><?= $item['googlenews']['sitename'] ?></news:name>
<news:language><?= $item['googlenews']['language'] ?></news:language>
</news:publication>
<news:publication_date><?= date('Y-m-d\TH:i:sP', strtotime($item['googlenews']['publication_date'])) ?></news:publication_date>
<news:title><?= $item['title'] ?></news:title>
?>
<news:news>
<news:publication>
<news:name><?= $item['googlenews']['sitename'] ?></news:name>
<news:language><?= $item['googlenews']['language'] ?></news:language>
</news:publication>
<news:publication_date><?= date('Y-m-d\TH:i:sP', strtotime($item['googlenews']['publication_date'])) ?></news:publication_date>
<news:title><?= $item['title'] ?></news:title>
<?php
if (isset($item['googlenews']['access'])) {
echo "\t\t".'<news:access>'.$item['googlenews']['access'].'</news:access>'."\n";
@@ -41,8 +41,8 @@
if (isset($item['googlenews']['stock_tickers'])) {
echo "\t\t".'<news:stock_tickers>'.implode(',', $item['googlenews']['stock_tickers']).'</news:stock_tickers>'."\n";
}
?>
</news:news>
</url>
<?php endforeach; ?>
</urlset>
?>
</news:news>
</url>
<?php endforeach; ?>
</urlset>

+ 11
- 11
src/views/xml.php View File

@@ -1,11 +1,11 @@
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?>
<?php if (null != $style) {
echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n";
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
} ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<?php foreach ($items as $item) : ?>
<url>
<loc><?= $item['loc'] ?></loc>
<?php

if (! empty($item['translations'])) {
@@ -111,8 +111,8 @@ if (! empty($item['videos'])) {
}
}

?>
</url>
<?php endforeach; ?>
</urlset>
?>
</url>
<?php endforeach; ?>
</urlset>

Loading…
Cancel
Save