<%pre> #include #include #include #include #include #include "setup.h" #include "tools.h" using namespace std; using namespace vdrlive; <%args> type = "now"; <%include>page_init.eh <{ cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); string head; if (type == "now") { head = tr("What's running at")+string(" ")+FormatDateTime(tr("%I:%M %p"), time(0)); } else { type="next"; head = tr("What's on next?"); } }> VDR-Live - <$ head $> <& tooltip.javascript &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=(type) &>
<{ 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) { string title(Event->Title() ? Event->Title() : ""); string channel_name(Channel->Name()); string short_description(Event->ShortText() ? Event->ShortText() : ""); string description(Event->Description() ? Event->Description() : ""); string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : ""); string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : ""); tChannelID channel_id(Channel->GetChannelID()); tEventID event = Event->EventID(); bool truncated = false; description = StringWordTruncate(description, 250, truncated); if (truncated) { description += string(" ") + tr("more") + string(" ..."); } }>
<$ channel_name $>
<& pageelems.event_timer channelid=(channel_id) eventid=(event) &> <& pageelems.ajax_action_href action="switch_channel" param=(*channel_id.ToString()) image="zap.png" alt="" &>
<$ start $> - <$ end $>
<$ title $>
<$ short_description $>
<{ reply.out() << StringEscapeAndBreak( description ); }>
<{ } } } } } }>
<%include>page_exit.eh