Before the end of 2017 the board will be down for a brief period of time for an upgrade.
Past experience says less than 30 minutes but I can't predict the future.
Also, there is a high probability that the forum will move to a different host, but that will not happen in 2017.
Thanks,
Doug

[Solved] if length and 0 displays link

Discuss using and your tips/tricks for CATVids
User avatar
Alex Ivanovich
Posts: 286
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: if length and 0 displays link

Postby Alex Ivanovich » Mon Dec 04, 2017 4:35 pm

now

01:00:00 ---> 1 ora OK :)

02:40:00 ---> 2 ore 40 minuti OK :)

00:30:46 ---> 0 ora 30 minuti 46 secondi WRONG 0 ora -- I want to display only minutes and seconds (if there are only these) :|


NEW CODE

Code: Select all

<xsl:if test="length/@hours!=''">
       <!-- <xsl:if test="length/@hours='0'"> -->
          <tr>           
                 <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/video/length/@name"/></td>
                 <td class="record_pane_table_fieldvalue">
                    <xsl:value-of select="length/@hours"/>
               
            <xsl:choose>
            <xsl:when test="length/@hours > 1"><!-- se la lunghezza delle ore ha valore 1 (uno) allora sostituisce ore con ora -->
              ore
            </xsl:when>
            <xsl:otherwise>
              ora
            </xsl:otherwise>
         </xsl:choose>
            <xsl:if test="length/@minutes > 0"> <!-- se la lunghezza dei secondi ha valore 0 (zero) allora non visualizzare -->
                <xsl:value-of select="length/@minutes"/><xsl:text> minuti </xsl:text>
               </xsl:if>
                <xsl:if test="length/@seconds > 0"> <!-- se la lunghezza dei secondi ha valore 0 (zero) allora non visualizzare -->
                     <xsl:value-of select="length/@seconds"/><xsl:text> secondi </xsl:text>
                </xsl:if>
              <xsl:choose>
               <xsl:when test="length='0:00'">
               inserire la durata
            <a href="http://akas.imdb.com/find?q={title}">IMDB</a>
              </xsl:when>
            </xsl:choose>
         </td>
          </tr>
       </xsl:if>

User avatar
Alex Ivanovich
Posts: 286
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: if length and 0 displays link

Postby Alex Ivanovich » Mon Dec 04, 2017 9:38 pm

finally, it works now :D

thanks Dave, ;)
for your suggestions (and patience) ;)

complete code

Code: Select all

<xsl:if test="length/@hours!=''">
       <!-- <xsl:if test="length/@hours='0'"> -->
          <tr>           
                 <td class="record_pane_table_fieldname" nowrap=""><xsl:value-of select="/data/fld/video/length/@name"/></td>
                 <td class="record_pane_table_fieldvalue">
                   
         <xsl:if test="length/@hours > 0"> <!-- se la lunghezza delle ore ha valore 0 (zero) allora non visualizzare -->
    
                     <xsl:value-of select="length/@hours"/>
               
            <xsl:choose>
            <xsl:when test="length/@hours > 1"><!-- se la lunghezza delle ore ha valore 1 (uno) allora sostituisce ore con ora -->
              ore
            </xsl:when>
            <xsl:otherwise>
              ora
            </xsl:otherwise>
         </xsl:choose>
       </xsl:if>
            <xsl:if test="length/@minutes > 0"> <!-- se la lunghezza dei secondi ha valore 0 (zero) allora non visualizzare -->
                <xsl:value-of select="length/@minutes"/><xsl:text> minuti </xsl:text>
               </xsl:if>
                <xsl:if test="length/@seconds > 0"> <!-- se la lunghezza dei secondi ha valore 0 (zero) allora non visualizzare -->
                     <xsl:text> e </xsl:text>
                <xsl:value-of select="length/@seconds"/><xsl:text> secondi </xsl:text>
                </xsl:if>
              <xsl:choose>
               <xsl:when test="length='0:00'">
               inserire la durata
            <a href="http://akas.imdb.com/find?q={title}">IMDB</a>
              </xsl:when>
            </xsl:choose>
         </td>
          </tr>
       </xsl:if>

User avatar
LotsOCds
Posts: 169
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: [Solved] if length and 0 displays link

Postby LotsOCds » Tue Dec 05, 2017 5:05 am

Excellent!
Cheers,
Dave


Return to “Using CATVids”

Who is online

Users browsing this forum: No registered users and 1 guest