Created
August 5, 2014 17:00
-
-
Save haroldSanchezb/b58554befed91f15f2c2 to your computer and use it in GitHub Desktop.
TV_cosa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$columns = &$vars['columns']; | |
$items = $vars['rows']['items']; | |
for ($ci=0; $ci <count($columns); $ci++) { | |
for ($rec_time=0; $rec_time < 86400; $rec_time+= 1800) { | |
$time_all = gmdate('H:i:s', $rec_time); | |
$time_brev = gmdate('H:i', $rec_time); | |
if(!isset($items[$time_all]['values'][$columns[$ci]])) { | |
$items[$time_all]['values'][$columns[$ci]] = | |
array('<div class="item false-item"><div class="view-item view-item-tv_guide_channels2"><div class="calendar dayview"><div><div class="col-30"><div class="guideWrapper"><div class="guideTitleWrapper"><div class="guideTitle no-content">PROGRAMA NO DISPONIBLE</div></div></div></div></div><div class="cutoff"></div></div></div></div>'); | |
if (!isset($items[$time_all]['hour'])) { | |
$items[$time_all]['hour'] = $time_brev; | |
$items[$time_all]['ampm'] = ''; | |
} | |
} | |
else { | |
if ($items[$time_all]['values'][$columns[$ci]][0] =='empty') { | |
unset($items[$time_all]['values'][$columns[$ci]]); | |
}else{ | |
$first_part = explode('class="col-',$items[$time_all]['values'][$columns[$ci]][0]); | |
$second_part = explode('"><div class="guideWrapper">', $first_part[1]); | |
if ($second_part[0] > 30) { | |
$counter = $second_part[0]/30; | |
$new_time = $rec_time; | |
for ($ni=1; $ni < $counter; $ni++) { | |
$new_time +=1800; | |
$time_all_new = gmdate('H:i:s', $new_time); | |
$time_brev_new = gmdate('H:i', $new_time); | |
if(!isset($items[$time_all_new]['values'][$columns[$ci]])) { | |
$items[$time_all_new]['values'][$columns[$ci]] = array('empty'); | |
if (!isset($items[$time_all_new]['hour'])) { | |
$items[$time_all_new]['hour'] = $time_brev_new; | |
$items[$time_all_new]['ampm'] = ''; | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
ksort($items); | |
$vars['rows']['items'] = $items; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment