📄 tv.xsl
字号:
<xsl:when test="@stop">
<xsl:choose>
<xsl:when test="((number(substring(@stop,9,2))*60)+number(substring(@stop,11,2))) > ((number(substring(@start,9,2))*60)+number(substring(@start,11,2)))">
<xsl:value-of select="(((number(substring(@stop,9,2))*60)+number(substring(@stop,11,2)))-((number(substring(@start,9,2))*60)+number(substring(@start,11,2))))"/>
</xsl:when>
<xsl:otherwise> <!--otherwise it must be concluding tomorrow, so the result will be negative. Add the number of minutes in a day. -->
<xsl:value-of select="(((number(substring(@stop,9,2))*60)+number(substring(@stop,11,2)))-((number(substring(@start,9,2))*60)+number(substring(@start,11,2)))) + 1440"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$StopDisplayCode - $StartTime"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="StopTime" select="$StartTime+$Length"/>
<xsl:variable name="RatingRounded">
<xsl:choose>
<xsl:when test="contains(substring-before(star-rating,'/'),'.')">
<xsl:value-of select="number(substring-before(substring-before(star-rating,'/'),'.'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number(substring-before(star-rating,'/'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="position()=1 and number($StartTime) > number($StartDisplayCode)"><td class="empty" colspan="{number($StartTime)-number($StartDisplayCode)}"></td></xsl:if>
<td>
<xsl:choose>
<xsl:when test="$OnClick='IMDB'">
<xsl:attribute name="onclick">
<xsl:text>window.open('http://www.imdb.com/find?q=</xsl:text>
<xsl:call-template name="replace">
<xsl:with-param name="string">
<xsl:call-template name="replace">
<xsl:with-param name="string">
<xsl:call-template name="replace">
<xsl:with-param name="string">
<xsl:call-template name="fixquotes">
<xsl:with-param name="string" select="translate(title,' ','+')" />
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="pattern" select="'&'"/>
<xsl:with-param name="replacement" select="'%26'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="pattern" select="'='"/>
<xsl:with-param name="replacement" select="'%3d'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="pattern" select="'?'"/>
<xsl:with-param name="replacement" select="'%3f'"/>
</xsl:call-template>
<xsl:text>')</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="$OnClick='URL'">
<xsl:if test="url">
<xsl:attribute name="onclick">
<xsl:text>window.open('</xsl:text><xsl:value-of select="url"/><xsl:text>')</xsl:text>
</xsl:attribute>
</xsl:if>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="number($StartTime) >= number($StartDisplayCode) and $StopTime <= $StopDisplayCode">
<!-- Program starts during and concludes during display window. Putting first since most likely.-->
<xsl:attribute name="colspan"><xsl:value-of select="$Length"/></xsl:attribute>
</xsl:when>
<xsl:when test="number($StartTime) < number($StartDisplayCode) and $StopTime <= $StopDisplayCode">
<!-- Program starts before and concludes during display window-->
<xsl:attribute name="colspan"><xsl:value-of select="(($Length - ($StartDisplayCode - $StartTime)))"/></xsl:attribute>
</xsl:when>
<xsl:when test="$StartTime >= $StartDisplayCode and $StopTime > $StopDisplayCode">
<!-- Program starts during and concludes after display window -->
<xsl:attribute name="colspan"><xsl:value-of select="(($Length - ($StopTime - $StopDisplayCode)))"/></xsl:attribute>
</xsl:when>
<xsl:when test="$StartTime < $StartDisplayCode and $StopTime > $StopDisplayCode">
<!-- Program starts before and concludes after display window. Least likely. -->
<xsl:attribute name="colspan"><xsl:value-of select="(($Length - ($StopTime - $StopDisplayCode) - ($StartDisplayCode - $StartTime)))"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:attribute name="class">
<xsl:if test="$Categories">
<xsl:value-of select="substring(episode-num[@system='dd_progid'],1,2)"/><xsl:text> </xsl:text>
<xsl:for-each select="category">
<xsl:value-of select="translate(.,' ','_')" /><xsl:text> </xsl:text>
</xsl:for-each>
<xsl:if test="$Grabber='tv_grab_de' and string(number(category))!='NaN'">
MV
</xsl:if>
<xsl:if test="$Length > 69">
Longshow
</xsl:if>
</xsl:if>
<xsl:if test="($Length > 69) and (number($RatingRounded) >= number($HighlightMovies))">
Goodmovie
</xsl:if>
<xsl:if test="$HighlightClickable and ($OnClick='IMDB' or ($OnClick='URL' and url))">
Clickable
</xsl:if>
<xsl:if test="$HighlightNew and string-length(date) = 8">
<xsl:if test="(substring(date,1,4)=$CurrentYear) and (substring(date,5,2)=$CurrentMonth) and (substring(date,7,2)=$CurrentDay)">
Newshow
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:if test="$DescriptionPopups">
<xsl:attribute name="title">
<xsl:text>header=[</xsl:text>
<xsl:value-of select="title" />
<xsl:text>] body=[</xsl:text>
<xsl:if test="$PopupTimes or ($PopupRating and rating) or ($PopupSubtitle and sub-title) or ($PopupDescription and desc) or ($PopupDate and date) or ($PopupCategories and category) or ($PopupStarRating and star-rating)">
<xsl:if test="$PopupTimes">
<span class="popuptimes">
<xsl:value-of select="number(substring(@start,9,2))"/>:<xsl:value-of select="substring(@start,11,2)"/>-<xsl:choose><xsl:when test="@stop"><xsl:value-of select="number(substring(@stop,9,2))"/>:<xsl:value-of select="substring(@stop,11,2)"/></xsl:when><xsl:otherwise>???</xsl:otherwise></xsl:choose>
</span>
</xsl:if>
<xsl:if test="$PopupRating">
<span class="popuprating"><xsl:value-of select="rating/value" /></span>
</xsl:if>
<xsl:if test="($PopupTimes or ($PopupRating and rating)) and (($PopupSubtitle and sub-title) or ($PopupDescription and desc))">
<hr class="popuphr1"/>
</xsl:if>
<xsl:if test="$PopupSubtitle and sub-title">
<span class="subtitle">
<xsl:value-of select="sub-title"/>
</span>
<br />
</xsl:if>
<xsl:if test="$PopupDescription">
<span class="popupdesc">
<xsl:choose>
<xsl:when test="$DescriptionBR">
<xsl:call-template name="lf2br"><xsl:with-param name="StringToTransform" select="desc"/></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="desc"/>
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:if>
<xsl:if test="$PopupDate and date">
<xsl:if test="$PopupTimes or ($PopupRating and rating) or ($PopupSubtitle and sub-title) or ($PopupDescription and desc)"><hr class="popuphr2"/></xsl:if>
<span class="popupdate">
<xsl:choose>
<xsl:when test="string-length(date) = 8">
<xsl:choose>
<xsl:when test="$DayFirst">
<xsl:value-of select="concat(substring(date,7,2),'/',substring(date,5,2),'/',substring(date,1,4))" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring(date,5,2),'/',substring(date,7,2),'/',substring(date,1,4))" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(date) = 4">
<xsl:value-of select="date" />
</xsl:when>
</xsl:choose>
</span>
</xsl:if>
<xsl:if test="$PopupDate and $Grabber='tv_grab_de' and string(number(category))!='NaN'">
<xsl:if test="$PopupTimes or ($PopupRating and rating) or ($PopupSubtitle and sub-title) or ($PopupDescription and desc)"><hr class="popuphr2"/></xsl:if>
<span class="popupdate">
<xsl:value-of select="category" />
</span>
</xsl:if>
<xsl:if test="$PopupCategories and category">
<xsl:if test="$PopupTimes or ($PopupRating and rating) or ($PopupSubtitle and sub-title) or ($PopupDescription and desc) or ($PopupDate and date)"><hr class="popuphr3"/></xsl:if>
<ul class="popupcategorylist">
<xsl:for-each select="category">
<xsl:if test="($Grabber='tv_grab_de' and string(number(.))='NaN') or $Grabber!='tv_grab_de'">
<li><xsl:value-of select="." /></li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:if>
<xsl:if test="$PopupStarRating and star-rating">
<xsl:if test="$PopupTimes or ($PopupRating and rating) or ($PopupSubtitle and sub-title) or ($PopupDescription and desc) or ($PopupDate and date) or ($PopupCategories and category)"><hr class="popuphr4"/></xsl:if>
<xsl:variable name="Stars">
<xsl:choose>
<xsl:when test="contains(substring-before(star-rating,'/'),'.')">
<xsl:value-of select="number(substring-before(substring-before(star-rating,'/'),'.'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="number(substring-before(star-rating,'/'))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="StarsHalf">
<xsl:choose>
<xsl:when test="contains(substring-before(star-rating,'/'),'.')">
<xsl:choose>
<xsl:when test="substring-after(substring-before(star-rating,'/'),'.') < 5">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="StarsOutOf"><xsl:value-of select="number(substring-after(star-rating,'/'))"/></xsl:variable>
<ul class="starlist">
<xsl:call-template name="starrating">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$Stars"/></xsl:with-param>
<xsl:with-param name="type">filled</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="starrating">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$StarsHalf"/></xsl:with-param>
<xsl:with-param name="type">half</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="starrating">
<xsl:with-param name="i">1</xsl:with-param>
<xsl:with-param name="count"><xsl:value-of select="$StarsOutOf - $StarsHalf - $Stars"/></xsl:with-param>
<xsl:with-param name="type">empty</xsl:with-param>
</xsl:call-template>
</ul>
</xsl:if>
</xsl:if>
<xsl:text>] cssheader=[popupheader] cssbody=[popupbody] delay=[</xsl:text>
<xsl:value-of select="$PopupDelay"/>
<xsl:text>]</xsl:text>
</xsl:attribute>
</xsl:if>
<table class="internal"><tr>
<xsl:if test="number($StartTime) < number($StartDisplayCode)">
<td class="extendleft"><span><xsl:value-of select="$ExtendLeftText" /></span></td>
</xsl:if>
<td class="program">
<xsl:value-of select="title" />
<xsl:if test="$PrintDates and string-length(date) = 4">
(<xsl:value-of select="date"/>)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -