[mythtv-users] Mythweb recording schedule display

Karl Newman newmank1 at asme.org
Sun Sep 11 14:39:05 UTC 2016


On Fri, Sep 9, 2016 at 5:11 PM, R Kannan <rk111810 at gmail.com> wrote:

> Message: 15
> Date: Thu, 8 Sep 2016 18:00:33 -0700
> From: Karl Newman <newmank1 at asme.org> <newmank1 at asme.org>
> To: Discussion about MythTV <mythtv-users at mythtv.org> <mythtv-users at mythtv.org>
> Subject: Re: [mythtv-users] Mythweb recording schedule display
> Message-ID:
> 	<CAOOwNtLwxoD_6exOOnRhfCB2xh6zaTF4vu_EGr1L+SedakNB+Q at mail.gmail.com> <CAOOwNtLwxoD_6exOOnRhfCB2xh6zaTF4vu_EGr1L+SedakNB+Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Thu, Sep 8, 2016 at 4:17 PM, R Kannan <rk111810 at gmail.com> <rk111810 at gmail.com> wrote:
>
>
> Hello,
>
> Is there a way to configure what is being displayed in myweb under
> 'Recording Schedules (Manual,Custom). Currently it shows 11 columns (viz
> Title, Recording Priority, Channel, Profile, Transcode, Recording Group,
> Type, Storage Group, Start Early, End Late, Last Recorded). I would like it
> to display more columns like Inactive toggle, Autoexpire Toggle etc.
>
> Is there a way to do it?
>
> Thanks
>
>
> Yes, but it will require a little bit of template surgery. The Mythweb
> installation location varies by distribution, so I'll just give relative
> paths. Modify the file mythweb/modules/tv/tmpl/schedules.php  You'll need
> to add a <th/> header element for each column you want to add, and a <td/>
> data element for the corresponding data you want to show for each schedule.
> Follow the patterns already shown in the file. The available schedule data
> fields can be found in mythweb/modules/tv/classes/Schedule.php
> If you add a new text to be translated (using the t('...') function) then
> you'll need to rebuild the translations as follows (otherwise you'll get an
> error message):
> cd mythweb/modules/_shared/lang
> ./build_translation.pl
>
> Sincerely,
>
> Karl
>
> Thanks karl. It worked. But just a small change to your instructions. The
> schedules.php file was in the following directory
>
> .. mythtv/mythweb/modules/tv/tmpl/default
>
> My line under <td ><?php reads....
>
> echo _or($schedule->inactive,' ')
>
> The toggles show up as '1' or blank.
>
> But when Itried to get fancy with the following code, it did not work
>
> //            echo _or($schedule->inactive,' ')
>             if ($schedule->inactive ) {
>                 echo _or('Yes',' ')
>             }
>             else {
>                echo _or('No',' ')
>             }
>
> Not sure what I should be doing.
>
I think that's because $schedule->inactive is stored as an integer so it
just shows 0 or 1 instead of True or False. You're on the right track with
your if..else structure, but you don't need the _or structure--I think it's
just a way to deal with empty or null values from the database. Just use
echo 'Yes'; or echo 'No';  You could use the one-line version: echo
(($schedule->inactive) ? 'Yes' : 'No'); Or you could use 'Inactive' and
'Active' if you want.

Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160911/52b897dd/attachment.html>


More information about the mythtv-users mailing list