Discuss using and your tips/tricks for CATVids
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Thu Dec 07, 2017 8:16 pm
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>
Last edited by
Alex Ivanovich on Tue Jan 16, 2018 3:03 am, edited 2 times in total.
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Tue Dec 19, 2017 9:59 am
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"/>##
-
LotsOCds
- Posts: 177
- Joined: Thu Aug 20, 2015 4:23 am
- Location: California, USA
Post
by LotsOCds » 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>
Cheers,
Dave
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Mon Jan 15, 2018 11:22 am
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] 
-
Attachments
-

- Screen Capture #255.png (138.12 KiB) Viewed 1712 times
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Thu Apr 19, 2018 9:21 am
-
Attachments
-

- felixgif.gif (21.01 KiB) Viewed 1474 times
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Wed Oct 17, 2018 6:42 am
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
Last edited by
Alex Ivanovich on Wed Oct 17, 2018 8:23 am, edited 1 time in total.
-
Alex Ivanovich
- Posts: 326
- Joined: Mon Sep 07, 2015 2:24 pm
- Location: Russian - Italia
Post
by Alex Ivanovich » Wed Oct 17, 2018 8:20 am
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?

-
Attachments
-

- Cattura.PNG (28.42 KiB) Viewed 1091 times