xml-sitemap-feed
Last commit date
feed-xml.php
16 years ago
feed-xsl.php
16 years ago
readme.txt
16 years ago
xml-sitemap.php
16 years ago
feed-xsl.php
106 lines
| 1 | <?php |
| 2 | /* ------------------------------------- |
| 3 | XML Sitemap Feed Styleheet Template |
| 4 | ------------------------------------- */ |
| 5 | |
| 6 | if (!empty($_SERVER['SCRIPT_FILENAME']) && 'feed-xsl.php' == basename($_SERVER['SCRIPT_FILENAME'])) |
| 7 | die ('Please do not load this page directly. Thanks!'); |
| 8 | |
| 9 | @header('Content-Type: text/xsl; charset=' . get_option('blog_charset'), true); |
| 10 | |
| 11 | echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> |
| 12 | <xsl:stylesheet version="2.0" |
| 13 | xmlns:html="http://www.w3.org/TR/REC-html40" |
| 14 | xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" |
| 15 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 16 | <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> |
| 17 | <xsl:template match="/"> |
| 18 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 19 | <head> |
| 20 | <title>XML Sitemap Feed</title> |
| 21 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 22 | <style type="text/css"> |
| 23 | body { |
| 24 | font-family:"Lucida Grande","Lucida Sans Unicode",Tahoma,Verdana; |
| 25 | font-size:13px; |
| 26 | } |
| 27 | |
| 28 | td { |
| 29 | font-size:11px; |
| 30 | } |
| 31 | |
| 32 | th { |
| 33 | text-align:left; |
| 34 | padding-right:30px; |
| 35 | font-size:11px; |
| 36 | } |
| 37 | |
| 38 | tr.high { |
| 39 | background-color:whitesmoke; |
| 40 | } |
| 41 | |
| 42 | #header, #footer { |
| 43 | padding:2px; |
| 44 | margin:10px; |
| 45 | font-size:8pt; |
| 46 | color:gray; |
| 47 | } |
| 48 | |
| 49 | a { |
| 50 | color:black; |
| 51 | } |
| 52 | </style> |
| 53 | </head> |
| 54 | <body> |
| 55 | <h1>XML Sitemap Feed</h1> |
| 56 | <div id="header"> |
| 57 | This is an XML Sitemap to aid search engines like <a href="http://www.google.com">Google</a>, <a href="http://search.msn.com">MSN Search</a>, <a href="http://www.yahoo.com">Yahoo!</a> and <a href="http://www.ask.com">Ask.com</a> indexing your site better. Read more about XML sitemaps on <a href="http://sitemaps.org">Sitemaps.org</a>. |
| 58 | </div> |
| 59 | <div id="content"> |
| 60 | <table cellpadding="5"> |
| 61 | <tr style="border-bottom:1px black solid;"> |
| 62 | <th>#</th> |
| 63 | <th>URL</th> |
| 64 | <th>Priority</th> |
| 65 | <th>Change Frequency</th> |
| 66 | <th>Last Changed</th> |
| 67 | </tr> |
| 68 | <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/> |
| 69 | <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> |
| 70 | <xsl:for-each select="sitemap:urlset/sitemap:url"> |
| 71 | <tr> |
| 72 | <xsl:if test="position() mod 2 != 1"> |
| 73 | <xsl:attribute name="class">high</xsl:attribute> |
| 74 | </xsl:if> |
| 75 | <td> |
| 76 | <xsl:value-of select="position()"/> |
| 77 | </td> |
| 78 | <td> |
| 79 | <xsl:variable name="itemURL"> |
| 80 | <xsl:value-of select="sitemap:loc"/> |
| 81 | </xsl:variable> |
| 82 | <a href="{$itemURL}"> |
| 83 | <xsl:value-of select="sitemap:loc"/> |
| 84 | </a> |
| 85 | </td> |
| 86 | <td> |
| 87 | <xsl:value-of select="concat(sitemap:priority*100,'%')"/> |
| 88 | </td> |
| 89 | <td> |
| 90 | <xsl:value-of select="concat(translate(substring(sitemap:changefreq, 1, 1),concat($lower, $upper),concat($upper, $lower)),substring(sitemap:changefreq, 2))"/> |
| 91 | </td> |
| 92 | <td> |
| 93 | <xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)))"/> |
| 94 | </td> |
| 95 | </tr> |
| 96 | </xsl:for-each> |
| 97 | </table> |
| 98 | </div> |
| 99 | <div id="footer"> |
| 100 | Generated by <a href="http://4visions.nl/en/index.php?section=57" title="XML Sitemap Feed plugin for WordPress">XML Sitemap Feed <?php echo XMLSFVERSION ?></a> running on <a href="http://wordpress.org/">WordPress</a>.<br /> |
| 101 | </div> |
| 102 | </body> |
| 103 | </html> |
| 104 | </xsl:template> |
| 105 | </xsl:stylesheet> |
| 106 |