summarylogtreecommitdiffstats
path: root/001-mythwebcount.patch
blob: 336c6817446bb8edd83d4be3b0c80b3db119aef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/modules/tv/classes/Schedule.php b/modules/tv/classes/Schedule.php
index c63f9483..1814d6e2 100644
--- a/modules/tv/classes/Schedule.php
+++ b/modules/tv/classes/Schedule.php
@@ -103,7 +103,9 @@ class Schedule extends MythBase {
     public static function findAll($sort = true) {
         global $db;
         $orderby = '';
-        if ($sort && count($_SESSION['schedules_sortby'])) {
+        if ($_SESSION['schedules_sortby']) $schedule_sort = count($_SESSION['schedules_sortby']);
+        else $schedule_sort = 0;
+        if ($sort && $schedule_sort) {
             $orderby = 'ORDER BY ';
             foreach ($_SESSION['schedules_sortby'] AS $key => $sort) {
                 if ($key > 0)
diff --git a/modules/tv/tmpl/default/detail.php b/modules/tv/tmpl/default/detail.php
index f6d1faa9..4a4ee5e1 100644
--- a/modules/tv/tmpl/default/detail.php
+++ b/modules/tv/tmpl/default/detail.php
@@ -842,7 +842,9 @@
             }
             echo '            </ul>';
         }
-        if (count($program->jobs['queue'])) {
+        if ($program->jobs['queue']) $jobcount = (count($program->jobs['queue']));
+        else $jobcount = 0;
+        if ($jobcount) {
             echo t('Queued jobs'), ':',
                  '            <ul class="-queued">';
             foreach ($program->jobs['queue'] as $job) {
@@ -856,7 +858,9 @@
             }
             echo '            </ul>';
         }
-        if (count($program->jobs['done'])) {
+        if ($program->jobs['done']) $jobsdone = count($program->jobs['done']);
+        else $jobsdone = 0;
+        if ($jobsdone) {
             echo t('Recently completed jobs'), ':',
                  '            <ul class="-done">';
             foreach ($program->jobs['done'] as $job) {