<%pre> #include #include #include #include #include #include "setup.h" #include "tools.h" using namespace vdrlive; <%args> type = "now"; <%include>page_init.eh <{ cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); std::string head; if (type == "now") { head = tr("What's running at")+std::string(" ")+FormatDateTime(tr("%I:%M %p"), time(0)); } else { head = tr("What's on next?"); } }> VDR-Live - <$ head $>
<& menu >
<& pageelems.header_box content=(head) &> <{ ReadLock channelsLock( Channels ); if (channelsLock) { for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { if (!Channel->GroupSep()) { const cSchedule *Schedule = Schedules->GetSchedule(Channel); if (Schedule) { const cEvent *Event = (type == "now" ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent()); if (Event) { std::string title(Event->Title() ? Event->Title() : ""); std::string channel_name(Channel->Name()); std::string channel_id(*Channel->GetChannelID().ToString()); std::string short_description(Event->ShortText() ? Event->ShortText() : ""); std::string description(Event->Description() ? Event->Description() : ""); std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); std::string start_h(FormatDateTime( "%H", Event->StartTime())); std::string end_h(FormatDateTime( "%H", Event->EndTime())); std::string start_m(FormatDateTime( "%M", Event->StartTime())); std::string end_m(FormatDateTime( "%M", Event->EndTime())); bool truncated = false; description = StringWordTruncate(description, 250, truncated); if (truncated) { description += std::string(" ") + tr("more") + std::string(" ..."); } }>
<$ channel_name $>
<$ start $> - <$ end $>
<$ title $>
<$ short_description $>
<$ description $>
<{ } } } } } }>
<%include>page_exit.eh