rss_converter_pump.io.xsl: add enclosure element for images
[tweeper.git] / rss_converter_pump.io.xsl
index c505a50..1577dcf 100644 (file)
                 <xsl:copy-of select="$item-content/node()"/>
                 <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>
+            <xsl:if test="$generate-enclosure = 1">
+                <xsl:variable name="image-thumb-link" select=".//img[contains(@class, 'object-image')]/@src"/>
+                <xsl:if test="$image-thumb-link">
+                    <xsl:variable name="image-link" select="php:functionString('str_replace', '_thumb', '', $image-thumb-link)"/>
+                    <xsl:copy-of select="php:functionString('Tweeper::generateEnclosure', $image-link)"/>
+                </xsl:if>
+            </xsl:if>
         </item>
     </xsl:template>