Weekly recordings -> PHP error in LGMenu

Ir abajo

Weekly recordings -> PHP error in LGMenu Empty Weekly recordings -> PHP error in LGMenu

Mensaje  alfred.fent el Jue Nov 04, 2010 12:17 am

Hi all,

I have a strange observation: when programming a weekly recording not via the WWW interface (LGMenu), but directly at the MS450, and then looking at it in LGMenu, I get PHP error messages like this:
Código:

Notice: Undefined variable: frequency in /tmp/hdd/root/custom/var/www/lgmenu/act_Schedule.inc on line 469

This happened to me with LGmenu 1.0.3 and also with the new 1.0.4 that I installed yesterday.

I had a look at that file, and added a default-statement to the switch-block starting in line 434 to see which $row("date") values my weekly recordings have:
Código:

switch ($row["date"]) { 
...
case 7:                                             
    $frequency = REC_WEEK;           
    break;                                         
default :                                   
    $frequency = "date is " . $row["date"] ;       
    break ;
}

From the output, it looks like $row["date"] is dependent on the weekday of the recording: for weekly recordings on Sunday, I get "date is 5", for Monday "date is 6", for Tuesday "Weekly" (7 is captured by the switch statement already ;-)), Wednesday "date is 8", ... until Saturday "date is 11".

So I changed the switch statement to:

Código:
switch ($row["date"]) {                                       
case 0:                                               
    $frequency = REC_ONCE;                         
    break;                                         
case 1:                                               
    $frequency = REC_EVERYDAY;                     
    break;                                         
case 2:                                               
    $frequency = REC_MON_FRI;                     
    break;                                         
case 3:                                     
    $frequency = REC_MON_SAT;         
    break;                                         
case 5:                                               
case 6:                                           
case 7:                                             
case 8:                                   
case 9:                                               
case 10:                                     
case 11:                                               
    $frequency = REC_WEEK;                         
    break;                                         
default :                     
    $frequency = "unknown frequency" ;
}

which now works for me.

Am I the only one with this issue? Do you want to / can you include this in a future version of LGMenu?

But this now poses the question if, when entering recordings into the data base, the entry also needs to be different based on the weekday (i.e. 5 for programming weekly recordings for Sunday, 6 for Mondays, etc.).

Thanks and regards


Alfred

alfred.fent

Mensajes : 13
Fecha de inscripción : 17/10/2010

Volver arriba Ir abajo

Weekly recordings -> PHP error in LGMenu Empty Re: Weekly recordings -> PHP error in LGMenu

Mensaje  vic1972 el Jue Nov 04, 2010 10:40 am

Hello Alfred,
thanks so much for your comments and fixings Wink
I am sure keltek will appreciate as well; we will wait his comments.
Smile regards
vic1972
vic1972

Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 47
Localización : Malaga

Volver arriba Ir abajo

Weekly recordings -> PHP error in LGMenu Empty Re: Weekly recordings -> PHP error in LGMenu

Mensaje  alfred.fent el Jue Nov 04, 2010 12:19 pm

Hi,

I did some additional investigation, and noticed the following: if I enter a weekly recording via the web interface and then try to edit it via the normal device interface (= on TV), I get error messages "illegal date / time". In order to make this error disappear, I have to edit the date (can be one day forward and then backward, so that the original date is there again, but I have to touch it on the device interface). For me, this indicates that entering weekly recordings with frequency "7" is somehow wrong.

I did some additional investigation in the act_Scheduling file and made some additional changes, so that when adding or editing a weekly recording, a frequency value between 5 and 11 is entered based on the weekday.

I put my version of the file onto http://www.fent.org/act_Schedule.inc (don't want to post 500+ lines of code here), and marked my changes with "BEGIN/END AF CHANGE" comments. Maybe someone can have a look, check with his device if everything works, and then we can include it into the next release. It works for me, and it in particular makes the "illegal date/time" issue described above disappear :-)

Hm, I just see that I hard-coded then english term "Every" and "unknown frequency", so for the next release also a change to the language files would be required. By the way, I can also take care of providing a German language file (out of pure egoism ;-)), if wanted...?

Regards


Alfred

alfred.fent

Mensajes : 13
Fecha de inscripción : 17/10/2010

Volver arriba Ir abajo

Weekly recordings -> PHP error in LGMenu Empty Re: Weekly recordings -> PHP error in LGMenu

Mensaje  Keltek el Jue Nov 18, 2010 5:25 pm

Alfred, thank you very very much. I make a changes into new Schedule page but need to test it. I'll send the test version to our testing team. I also make a changes in language files. So if you want, please make a translation to Germany. (get the English file from ->here<- and send the translation to me privately). It will be very valuable.
It is good to know there is already someone who knows the PHP and can helps with new features Smile
Once again, many thanks to you.
Keltek
Keltek

Mensajes : 291
Fecha de inscripción : 10/03/2010
Edad : 42
Localización : Praha - Czech Republic

http://www.fozona.cz/

Volver arriba Ir abajo

Weekly recordings -> PHP error in LGMenu Empty Re: Weekly recordings -> PHP error in LGMenu

Mensaje  Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba


 
Permisos de este foro:
No puedes responder a temas en este foro.