| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?> | 
| 2 | -<?php if ($style != null) echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; ?> | |
| 2 | +<?php if ($style != null) { | |
| 3 | + echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; | |
| 4 | +} | |
| 5 | +?> | |
| 3 | 6 | <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"> | 
| 4 | 7 | <?php foreach($items as $item) : ?> | 
| 5 | 8 | <url> | 
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n"; ?> | 
| 2 | -<?php if ($style != null) echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; ?> | |
| 2 | +<?php if ($style != null) { | |
| 3 | + echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; | |
| 4 | +} | |
| 5 | +?> | |
| 3 | 6 | <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | 
| 4 | 7 | <?php foreach($sitemaps as $sitemap) : ?> | 
| 5 | 8 | <sitemap> | 
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?> | 
| 2 | -<?php if ($style != null) echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; ?> | |
| 2 | +<?php if ($style != null) { | |
| 3 | + echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; | |
| 4 | +} | |
| 5 | +?> | |
| 3 | 6 | <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"> | 
| 4 | 7 | <?php foreach($items as $item) : ?> | 
| 5 | 8 | <url> | 
| @@ -1,5 +1,8 @@ discard block | ||
| 1 | 1 | <?= '<'.'?'.'xml version="1.0" encoding="UTF-8"?>'."\n" ?> | 
| 2 | -<?php if ($style != null) echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; ?> | |
| 2 | +<?php if ($style != null) { | |
| 3 | + echo '<'.'?'.'xml-stylesheet href="'.$style.'" type="text/xsl"?>'."\n"; | |
| 4 | +} | |
| 5 | +?> | |
| 3 | 6 | <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"> | 
| 4 | 7 | <?php foreach($items as $item) : ?> | 
| 5 | 8 | <url> | 
| @@ -34,10 +37,18 @@ discard block | ||
| 34 | 37 |    foreach($item['images'] as $image) { | 
| 35 | 38 | echo "\t\t" . '<image:image>' . "\n"; | 
| 36 | 39 | echo "\t\t\t" . '<image:loc>' . $image['url'] . '</image:loc>' . "\n"; | 
| 37 | - if (isset($image['title'])) echo "\t\t\t" . '<image:title>' . $image['title'] . '</image:title>' . "\n"; | |
| 38 | - if (isset($image['caption'])) echo "\t\t\t" . '<image:caption>' . $image['caption'] . '</image:caption>' . "\n"; | |
| 39 | - if (isset($image['geo_location'])) echo "\t\t\t" . '<image:geo_location>' . $image['geo_location'] . '</image:geo_location>' . "\n"; | |
| 40 | - if (isset($image['license'])) echo "\t\t\t" . '<image:license>' . $image['license'] . '</image:license>' . "\n"; | |
| 40 | +    if (isset($image['title'])) { | |
| 41 | + echo "\t\t\t" . '<image:title>' . $image['title'] . '</image:title>' . "\n"; | |
| 42 | + } | |
| 43 | +    if (isset($image['caption'])) { | |
| 44 | + echo "\t\t\t" . '<image:caption>' . $image['caption'] . '</image:caption>' . "\n"; | |
| 45 | + } | |
| 46 | +    if (isset($image['geo_location'])) { | |
| 47 | + echo "\t\t\t" . '<image:geo_location>' . $image['geo_location'] . '</image:geo_location>' . "\n"; | |
| 48 | + } | |
| 49 | +    if (isset($image['license'])) { | |
| 50 | + echo "\t\t\t" . '<image:license>' . $image['license'] . '</image:license>' . "\n"; | |
| 51 | + } | |
| 41 | 52 | echo "\t\t" . '</image:image>' . "\n"; | 
| 42 | 53 | } | 
| 43 | 54 | } | 
| @@ -45,24 +56,58 @@ discard block | ||
| 45 | 56 |  if (!empty($item['videos'])) { | 
| 46 | 57 |    foreach($item['videos'] as $video) { | 
| 47 | 58 | echo "\t\t" . '<video:video>' . "\n"; | 
| 48 | - if (isset($video['thumbnail_loc'])) echo "\t\t\t" . '<video:thumbnail_loc>' . $video['thumbnail_loc'] . '</video:thumbnail_loc>' . "\n"; | |
| 49 | - if (isset($video['title'])) echo "\t\t\t" . '<video:title><![CDATA[' . $video['title'] . ']]></video:title>' . "\n"; | |
| 50 | - if (isset($video['description'])) echo "\t\t\t" . '<video:description><![CDATA[' . $video['description'] . ']]></video:description>' . "\n"; | |
| 51 | - if (isset($video['content_loc'])) echo "\t\t\t" . '<video:content_loc>' . $video['content_loc'] . '</video:content_loc>' . "\n"; | |
| 52 | - if (isset($video['duration'])) echo "\t\t\t" . '<video:duration>' . $video['duration'] . '</video:duration>' . "\n"; | |
| 53 | - if (isset($video['expiration_date'])) echo "\t\t\t" . '<video:expiration_date>' . $video['expiration_date'] . '</video:expiration_date>' . "\n"; | |
| 54 | - if (isset($video['rating'])) echo "\t\t\t" . '<video:rating>' . $video['rating'] . '</video:rating>' . "\n"; | |
| 55 | - if (isset($video['view_count'])) echo "\t\t\t" . '<video:view_count>' . $video['view_count'] . '</video:view_count>' . "\n"; | |
| 56 | - if (isset($video['publication_date'])) echo "\t\t\t" . '<video:publication_date>' . $video['publication_date'] . '</video:publication_date>' . "\n"; | |
| 57 | - if (isset($video['family_friendly'])) echo "\t\t\t" . '<video:family_friendly>' . $video['family_friendly'] . '</video:family_friendly>' . "\n"; | |
| 58 | - if (isset($video['requires_subscription'])) echo "\t\t\t" . '<video:requires_subscription>' . $video['requires_subscription'] . '</video:requires_subscription>' . "\n"; | |
| 59 | - if (isset($video['live'])) echo "\t\t\t" . '<video:live>' . $video['live'] . '</video:live>' . "\n"; | |
| 60 | - if (isset($video['player_loc'])) echo "\t\t\t" . '<video:player_loc allow_embed="'. $video['player_loc']['allow_embed'] .'" autoplay="'. | |
| 59 | +    if (isset($video['thumbnail_loc'])) { | |
| 60 | + echo "\t\t\t" . '<video:thumbnail_loc>' . $video['thumbnail_loc'] . '</video:thumbnail_loc>' . "\n"; | |
| 61 | + } | |
| 62 | +    if (isset($video['title'])) { | |
| 63 | + echo "\t\t\t" . '<video:title><![CDATA[' . $video['title'] . ']]></video:title>' . "\n"; | |
| 64 | + } | |
| 65 | +    if (isset($video['description'])) { | |
| 66 | + echo "\t\t\t" . '<video:description><![CDATA[' . $video['description'] . ']]></video:description>' . "\n"; | |
| 67 | + } | |
| 68 | +    if (isset($video['content_loc'])) { | |
| 69 | + echo "\t\t\t" . '<video:content_loc>' . $video['content_loc'] . '</video:content_loc>' . "\n"; | |
| 70 | + } | |
| 71 | +    if (isset($video['duration'])) { | |
| 72 | + echo "\t\t\t" . '<video:duration>' . $video['duration'] . '</video:duration>' . "\n"; | |
| 73 | + } | |
| 74 | +    if (isset($video['expiration_date'])) { | |
| 75 | + echo "\t\t\t" . '<video:expiration_date>' . $video['expiration_date'] . '</video:expiration_date>' . "\n"; | |
| 76 | + } | |
| 77 | +    if (isset($video['rating'])) { | |
| 78 | + echo "\t\t\t" . '<video:rating>' . $video['rating'] . '</video:rating>' . "\n"; | |
| 79 | + } | |
| 80 | +    if (isset($video['view_count'])) { | |
| 81 | + echo "\t\t\t" . '<video:view_count>' . $video['view_count'] . '</video:view_count>' . "\n"; | |
| 82 | + } | |
| 83 | +    if (isset($video['publication_date'])) { | |
| 84 | + echo "\t\t\t" . '<video:publication_date>' . $video['publication_date'] . '</video:publication_date>' . "\n"; | |
| 85 | + } | |
| 86 | +    if (isset($video['family_friendly'])) { | |
| 87 | + echo "\t\t\t" . '<video:family_friendly>' . $video['family_friendly'] . '</video:family_friendly>' . "\n"; | |
| 88 | + } | |
| 89 | +    if (isset($video['requires_subscription'])) { | |
| 90 | + echo "\t\t\t" . '<video:requires_subscription>' . $video['requires_subscription'] . '</video:requires_subscription>' . "\n"; | |
| 91 | + } | |
| 92 | +    if (isset($video['live'])) { | |
| 93 | + echo "\t\t\t" . '<video:live>' . $video['live'] . '</video:live>' . "\n"; | |
| 94 | + } | |
| 95 | +    if (isset($video['player_loc'])) { | |
| 96 | + echo "\t\t\t" . '<video:player_loc allow_embed="'. $video['player_loc']['allow_embed'] .'" autoplay="'. | |
| 61 | 97 | $video['player_loc']['autoplay'] .'">' . $video['player_loc']['player_loc'] . '</video:player_loc>' . "\n"; | 
| 62 | - if (isset($video['restriction'])) echo "\t\t\t" . '<video:restriction relationship="'.$video['restriction']['relationship'].'">' . $video['restriction']['restriction'] . '</video:restriction>' . "\n"; | |
| 63 | - if (isset($video['gallery_loc'])) echo "\t\t\t" . '<video:gallery_loc title="'.$video['gallery_loc']['title'].'">' . $video['gallery_loc']['gallery_loc'] . '</video:gallery_loc>' . "\n"; | |
| 64 | - if (isset($video['price'])) echo "\t\t\t" . '<video:price currency="'.$video['price']['currency'].'">' . $video['price']['price'] . '</video:price>' . "\n"; | |
| 65 | - if (isset($video['uploader'])) echo "\t\t\t" . '<video:uploader info="'.$video['uploader']['info'].'">' . $video['uploader']['uploader'] . '</video:uploader>' . "\n"; | |
| 98 | + } | |
| 99 | +    if (isset($video['restriction'])) { | |
| 100 | + echo "\t\t\t" . '<video:restriction relationship="'.$video['restriction']['relationship'].'">' . $video['restriction']['restriction'] . '</video:restriction>' . "\n"; | |
| 101 | + } | |
| 102 | +    if (isset($video['gallery_loc'])) { | |
| 103 | + echo "\t\t\t" . '<video:gallery_loc title="'.$video['gallery_loc']['title'].'">' . $video['gallery_loc']['gallery_loc'] . '</video:gallery_loc>' . "\n"; | |
| 104 | + } | |
| 105 | +    if (isset($video['price'])) { | |
| 106 | + echo "\t\t\t" . '<video:price currency="'.$video['price']['currency'].'">' . $video['price']['price'] . '</video:price>' . "\n"; | |
| 107 | + } | |
| 108 | +    if (isset($video['uploader'])) { | |
| 109 | + echo "\t\t\t" . '<video:uploader info="'.$video['uploader']['info'].'">' . $video['uploader']['uploader'] . '</video:uploader>' . "\n"; | |
| 110 | + } | |
| 66 | 111 | echo "\t\t" . '</video:video>' . "\n"; | 
| 67 | 112 | } | 
| 68 | 113 | } |