[mythtv-users] mythweb Recorded Programs Warning sorting.php line 42

Andrew Cheung agccheung at gmail.com
Wed Jan 26 09:39:32 EST 2005


That seemed to get rid of the errors! thanks! any idea about:

Warning at /var/www/html/mythweb/includes/programs.php, line 307:
Invalid argument supplied for foreach()

in the scheduled recordings? (similar sort of thing?)

Thanks very much for your help

Andrew


PS. Any ideas why i don't see recorded programs in the  "recorded
programs" section even  though i know there are recorded programs on
the system and in the database?




On Wed, 26 Jan 2005 13:09:26 +0000, Andy Whitworth <andywhit at gmail.com> wrote:
> Doh!
> 
> Typed my modification line in at work rather than cutting and
> pasting from my "real" patch.  Missed out a ")" at the end of the
> if expression.
> 
> s/b
> 
> // MY MOD START
>          if (!isset ( $_SESSION[$session] )) return false;
> // MY MOD END
> 
> Andy.
> 
> 
> ---------- Forwarded message ----------
> From: Andy Whitworth <andywhit at gmail.com>
> Date: Wed, 26 Jan 2005 12:32:18 +0000
> Subject: Re: [mythtv-users] mythweb Recorded Programs Warning
> sorting.php line 42
> To: Andrew Cheung <agccheung at gmail.com>, Discussion about mythtv
> <mythtv-users at mythtv.org>
> 
> I put in an if statement to only perform the foreach statement
> if the $_SESSION[....]  variable was set....
> 
> See "MY MOD START/END" comments to see my inserted line.
> 
>     function sort_status($field, $session = NULL) {
>     // Null session means to load the last sorted session
>         if (!$session)
>             $session = $GLOBALS['last_sort_session'];
>     // Make sure the field is lower case
>         $field = strtolower($field);
>     // No sort function for this variable
>         if (!function_exists("by_$field"))
>             return NULL;
>     // Scan the sort array for any entries matching the current
> choice, and remove them
>         $depth = 0;
> // MY MOD START
>          if (!isset ( $_SESSION[$session] ) return false;
> // MY MOD END
>         foreach ($_SESSION[$session] as $key => $sort) {
>             $depth++;
>         // No match, continue looking
>             if ($sort['field'] != $field)
>                 continue;
>         // What to do now...
>             return ($sort['reverse'] ? 0 - $depth : $depth);
>         }
>     // No match found
>         return false;
>     }
> 
> On Wed, 26 Jan 2005 12:14:27 +0000, Andrew Cheung <agccheung at gmail.com> wrote:
> > Mythweb (0.16v) displays errors whilst on the Recorded Programs:
> >
> > Warning at /var/www/html/mythweb/includes/sorting.php, line 42:
> > Invalid argument supplied for foreach()
> >
> > Doesn't display any recorded program details, even though there are recordings.
> >
> > Help would be appreciated.
> >
> > Thanks
> >
> > Andrew
> >
> >
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users at mythtv.org
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> >
> >
> >
>


More information about the mythtv-users mailing list