Subversion Repositories LCARS

Rev

Rev 26 | Rev 172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26 Rev 28
Line 44... Line 44...
44
   
44
   
45
    $episode_count = 1;
45
    $episode_count = 1;
46
    $serie['season_ranges'] = array();
46
    $serie['season_ranges'] = array();
47
    foreach ($serie['seasons'] as $season_key => $season_length)
47
    foreach ($serie['seasons'] as $season_key => $season_length)
48
    {
48
    {
-
 
49
      if (is_int($season_key))
-
 
50
      {
49
      $serie['season_ranges'][$season_key + 1] = array($episode_count, $episode_count + $season_length - 1);
51
        $serie['season_ranges'][$season_key + 1] = array($episode_count, $episode_count + $season_length - 1);
-
 
52
      }
-
 
53
     
50
      $episode_count += $season_length;
54
      $episode_count += $season_length;
51
    }
55
    }
52
  }
56
  }
-
 
57
  else
-
 
58
  {
-
 
59
    $serie['total'] = max(array_keys($serie['episodes']));
-
 
60
  }
53
 
61
 
54
  $serie['percentage'] = 0;
62
  $serie['percentage'] = 0;
55
  if ($serie['total'] > 0)
63
  if ($serie['total'] > 0)
56
  {
64
  {
57
    $serie['percentage'] = $count / $serie['total'] * 100;
65
    $serie['percentage'] = $count / $serie['total'] * 100;