Ticket #7196: 7196.diff

File 7196.diff, 6.4 KB (added by Joe Ripley <vitaminjoe@…>, 11 years ago)

Patch to add season #, episode # and subtitle support to Mythweb video module

  • mythplugins/mythweb/skins/default/video.css.php

     
    1414    .video .title {
    1515        font-weight:        bold;
    1616        margin-bottom:      .5em;
    17         height:             2.25em;
     17        height:             2.5em;
    1818        overflow:           hidden;
    1919    }
    2020
  • mythplugins/mythweb/modules/video/edit.php

     
    4545//check to see if the form has been submitted
    4646    if (isset($_REQUEST['submit'])) {
    4747        $Video->title       = $_REQUEST['title'];
     48        $Video->subtitle    = $_REQUEST['subtitle'];
     49        $Video->season      = $_REQUEST['season'];
     50        $Video->episode     = $_REQUEST['episode'];
    4851        $Video->director    = $_REQUEST['director'];
    4952        $Video->plot        = $_REQUEST['plot'];
    5053        $Video->category    = $_REQUEST['category'];
     
    8083<form method="post" action="<?php echo root_url ?>video/edit" enctype="multipart/form-data">
    8184Title<br>
    8285<input name="title" type="text" value="<?php echo htmlspecialchars($Video->title, ENT_QUOTES ); ?>"><br><br>
     86Subtitle<br>
     87<input name="subtitle" type="text" value="<?php echo htmlspecialchars($Video->subtitle, ENT_QUOTES ); ?>"><br><br>
     88Season:<br>
     89<input name="season" type="text" size="3" value="<?php echo intval($Video->season); ?>"><br><br>
     90Episode:<br>
     91<input name="episode" type="text" size="3" value="<?php echo intval($Video->episode); ?>"><br><br>
    8392Director<br>
    8493<input name="director" type="text" value="<?php echo htmlspecialchars($Video->director, ENT_QUOTES ); ?>"><br><br>
    8594Plot<br>
  • mythplugins/mythweb/modules/video/tmpl/default/video.php

     
    304304        <div id="<?php echo $video->intid; ?>_categoryid" class="hidden"><?php echo $video->category; ?></div>
    305305        <div id="<?php echo $video->intid; ?>_genre" class="hidden"><?php if (count($video->genres)) foreach ($video->genres as $genre) echo ' '.$genre.' ';?></div>
    306306        <div id="<?php echo $video->intid; ?>_browse" class="hidden"><?php echo $video->browse; ?></div>
    307         <div id="<?php echo $video->intid; ?>-title" class="title"><a href="<?php echo $video->url; ?>"><?php echo html_entities($video->title); ?></a></div>
     307        <div id="<?php echo $video->intid; ?>-title" class="title">
     308            <a href="<?php echo $video->url; ?>"><?php echo html_entities($video->title); ?></a><?php
     309                  if (($video->season > 0) && ($video->episode >= 0))
     310                      printf('(S%02d E%02d)', $video->season, $video->episode);
     311                  if (strlen($video->subtitle) > 0)
     312                      echo '<br>' . html_entities($video->subtitle);
     313            ?></div>
    308314        <div id="<?php echo $video->intid; ?>_img">                <img <?php if ($_SESSION["show_video_covers"] && file_exists($video->cover_file)) echo 'src="'.$video->cover_url.'"'; echo ' width="'.$video->cover_scaled_width.'" height="'.$video->cover_scaled_height.'"'; ?> alt="<?php echo t('Missing Cover'); ?>"></div>
    309315        <div id="<?php echo $video->intid; ?>-category">           <?php echo $Category_String[$video->category]; ?></div>
    310316        <div id="<?php echo $video->intid; ?>_playtime">           <?php echo nice_length($video->length * 60); ?></div>
  • mythplugins/mythweb/classes/Video.php

     
    77    var $category;
    88    var $rating;
    99    var $title;
     10    var $subtitle;
     11    var $season;
     12    var $episode;
    1013    var $director;
    1114    var $inetref;
    1215    var $year;
     
    4043        $this->category     = $video['category'];
    4144        $this->rating       = $video['rating'];
    4245        $this->title        = $video['title'];
     46        $this->subtitle     = $video['subtitle'];
     47        $this->season       = $video['season'];
     48        $this->episode      = $video['episode'];
    4349        $this->director     = $video['director'];
    4450        $this->inetref      = $video['inetref'];
    4551        $this->year         = $video['year'] ? $video['year'] : 'Unknown';
     
    8995                                       .(($_SESSION["show_video_covers"] && file_exists($this->cover_url)) ? ' src="data/video_covers/'.basename($this->cover_file).'"' : '')
    9096                                       .'>',
    9197                      'title'       => '<a href="'.$this->url.'">'.$this->title.'</a>',
     98                      'subtitle'    => $this->subtitle,
     99                      'season'      => $this->season,
     100                      'episode'     => $this->episode,
    92101                      'playtime'    => nice_length($this->length * 60),
    93102                      'category'    => strlen($Category_String[$this->category]) ? $Category_String[$this->category] : 'Uncategorized',
    94103                      'imdb'        => ($this->inetref != '00000000') ? '<a href="http://www.imdb.com/Title?'.$this->inetref.'">'.$this->inetref.'</a>' : '',
     
    110119                           videometadata.category     = ?,
    111120                           videometadata.rating       = ?,
    112121                           videometadata.title        = ?,
     122                           videometadata.subtitle     = ?,
     123                           videometadata.season       = ?,
     124                           videometadata.episode      = ?,
    113125                           videometadata.director     = ?,
    114126                           videometadata.inetref      = ?,
    115127                           videometadata.year         = ?,
     
    124136                    $this->category,
    125137                    $this->rating,
    126138                    $this->title,
     139                    $this->subtitle,
     140                    $this->season,
     141                    $this->episode,
    127142                    $this->director,
    128143                    $this->inetref,
    129144                    $this->year,