Page 1 of 1
CMD:COUNT leadingrole, title
Posted: Thu Dec 07, 2017 8:16 pm
by Alex Ivanovich
in VideoBrowse is present code contents for leadingrole
I would like to make the count (next to the name) of leadingrole (all movie)
example:
Elizabeth Montgomery - Samantha Stephens;(
254) Dick York - Darrin Stephens (
170) ecc..
I tried with this code but I calculate all the movies in the database
not for the actor or actress
Code: Select all
##CMD:COUNT:video,contents=<xsl:value-of select="leadingroles/leadingrole"/>##
Code: Select all
<xsl:if test="count(leadingroles/leadingrole) > 0">
<tr>
<td class="record_pane_table_fieldname" nowrap=""><xsl:text>Cast</xsl:text></td>
<td class="record_pane_table_fieldvalue">
<xsl:call-template name="format-cast">
<xsl:with-param name="cast" select="leadingroles/leadingrole"/>
<xsl:with-param name="characters" select="'True'"/><!-- per visualizzare il campo "role" -->
<xsl:with-param name="newline" select="'False'"/>
<xsl:with-param name="newwindow" select="'True'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<a href="Contents_Credits.xsl?ID={contentsid}" target="_blank"><img border="0" src="GotoPage.gif"/></a>
##CMD:COUNT:video,contents=<xsl:value-of select="leadingroles/leadingrole"/>##
</td>
</tr>
</xsl:if>
Re: CMD:COUNT leadingrole, title
Posted: Fri Dec 08, 2017 12:19 pm
by Alex Ivanovich
Re: CMD:COUNT leadingrole, title
Posted: Thu Dec 14, 2017 7:23 pm
by Alex Ivanovich
dead forum

Re: CMD:COUNT leadingrole, title
Posted: Tue Dec 19, 2017 9:59 am
by Alex Ivanovich
this code works, but it's not what I want
but I do not understand how to take data from the "leadingrole" field automatically
Code: Select all
##CMD:COUNT:Contents,Leadingrole=Elizabeth Montgomery##
this does not work
Code: Select all
##CMD:COUNT:Contents,Leadingrole=<xsl:value-of select="leadingroles/leadingrole"/>##
Re: CMD:COUNT leadingrole, title
Posted: Mon Dec 25, 2017 10:09 pm
by LotsOCds
You need to put the CMD:Count statement into the format-cast template which is in Common.xsl. Also, be certain the XPATH is correct. This depends upon where you locate the code.
Code: Select all
<xsl:template name="format-cast">
<xsl:param name="cast"/>
<xsl:param name="characters" select="'False'"/>
<xsl:param name="newwindow" select="'True'"/>
<xsl:param name="newline" select="'True'"/>
<xsl:param name="separator1" select="'; '"/>
<xsl:param name="separator2" select="'; '"/>
<xsl:for-each select="$cast">
<xsl:choose>
<xsl:when test="$newwindow='True'">
<a href="Person_Credits.xsl?ID={@id}" target="_blank"><xsl:value-of select="name"/></a>
</xsl:when>
<xsl:otherwise>
<a href="Person_Credits.xsl?ID={@id}"><xsl:value-of select="name"/></a>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$characters='True'">
<xsl:if test="count(characters/character)>0">
<xsl:text> - </xsl:text>
<xsl:for-each select="characters/character">
<xsl:value-of select="."/>
[##CMD:COUNT:video,contents.leadingrole=<xsl:value-of select="../../name"/>##]
<xsl:if test="position() < last()">
<xsl:text>/</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
<xsl:choose>
<xsl:when test="$newline='True'">
<xsl:if test="position() < last()">
<br/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="position() < last() -1">
<xsl:value-of select="$separator1"/>
</xsl:if>
<xsl:if test="position() = last() -1">
<xsl:value-of select="$separator2"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
Re: CMD:COUNT leadingrole, title
Posted: Mon Jan 15, 2018 11:22 am
by Alex Ivanovich
I'm sorry for the late reply
my computer was broken and I had to buy a new one
also I did not remember the pass to access from iphone to this site
I entered the code and it not works perfect
cast leading role display
Elizabeth Montgomery - Samantha Stephens [8] is incorrett
correct this
Elizabeth Montgomery - Samantha Stephens [254] 
Re: CMD:COUNT leadingrole, title
Posted: Thu Apr 19, 2018 9:21 am
by Alex Ivanovich
Re: CMD:COUNT leadingrole, title
Posted: Wed Oct 17, 2018 6:42 am
by Alex Ivanovich
LotsOCds wrote: ↑Mon Dec 25, 2017 10:09 pm
You need to put the CMD:Count statement into the format-cast template which is in Common.xsl. Also, be certain the XPATH is correct. This depends upon where you locate the code.
Code: Select all
<xsl:template name="format-cast">
<xsl:param name="cast"/>
<xsl:param name="characters" select="'False'"/>
<xsl:param name="newwindow" select="'True'"/>
<xsl:param name="newline" select="'True'"/>
<xsl:param name="separator1" select="'; '"/>
<xsl:param name="separator2" select="'; '"/>
<xsl:for-each select="$cast">
<xsl:choose>
<xsl:when test="$newwindow='True'">
<a href="Person_Credits.xsl?ID={@id}" target="_blank"><xsl:value-of select="name"/></a>
</xsl:when>
<xsl:otherwise>
<a href="Person_Credits.xsl?ID={@id}"><xsl:value-of select="name"/></a>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$characters='True'">
<xsl:if test="count(characters/character)>0">
<xsl:text> - </xsl:text>
<xsl:for-each select="characters/character">
<xsl:value-of select="."/>
[##CMD:COUNT:video,contents.leadingrole=<xsl:value-of select="../../name"/>##]
<xsl:if test="position() < last()">
<xsl:text>/</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
<xsl:choose>
<xsl:when test="$newline='True'">
<xsl:if test="position() < last()">
<br/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="position() < last() -1">
<xsl:value-of select="$separator1"/>
</xsl:if>
<xsl:if test="position() = last() -1">
<xsl:value-of select="$separator2"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
I found an error in your code
In XML < or & are strictly illegal to use as values. There are more which are not strictly illegal but are better avoided. Use an entity reference instead. So your XML file generates an error. The entity reference for < is < and > is >
the problem of counting
this code counts the
Series (Season), "
but not the episodes" in which he played the actor
how to solve?
please Dave or others help me
Re: CMD:COUNT leadingrole, title
Posted: Wed Oct 17, 2018 8:20 am
by Alex Ivanovich
maybe I found the solution
I'm not sure, I'm testing
count episodes for leading role
Code: Select all
##CMD:COUNT:contents,episode=@videoseries@leadingrole=<xsl:value-of select="../../name"/>## , leading role]
now there is another problem
if the actor has a "
leading role" he is counted
I have solved the problem with "
supporting role"
there are things to fix
1) display "
supporting role" only if present
I put this code but it does not seem to work
Code: Select all
<xsl:param name="supportingrole" select="'True'"/>
Code: Select all
<xsl:if test="$supportingrole='True'">
##CMD:COUNT:contents,episode=@videoseries@supportingrole=<xsl:value-of select="../../name"/>## , supporting role]
</xsl:if>
2) join "
leading role" and "
supporting role" and make the count
the problem and I do not know the code
tips?
