{source 0}
Event Date
array('method' => 'HEAD'))); } $head = array_change_key_case(get_headers($url1, 1)); // content-length of download (in bytes), read from Content-Length: field $clen = isset($head['content-length']) ? $head['content-length'] : 0; // cannot retrieve file size, return "-1" if (!$clen) { return -1; } if (!$formatSize) { return $clen; // return size in bytes } $size = $clen; switch ($clen) { case $clen < 1024: $size = $clen .' B'; break; case $clen < 1048576: $size = round($clen / 1024, 2) .' KBs'; break; case $clen < 1073741824: $size = round($clen / 1048576, 2) . ' MBs'; break; case $clen < 1099511627776: $size = round($clen / 1073741824, 2) . ' GBs'; break; } return $size; // return formatted size } function addYearToTable($year,$sport) { // Search for all shows that have an event date less than now that are available for VOD //Configure $server = "trms.ctv15.org"; date_default_timezone_set('America/New_York'); // End Configure $client = new SoapClient("http://" . $server . "/CablecastWS/CablecastWS.asmx?WSDL"); // Creates New SOAP client using WSDL file $showDetailsURL = "http://trms.ctv15.org/Cablecast/public-site/index.html#/show/"; // Must end with a '?' or '&' $searchDate = date("Y-m-d")."T12:00:00"; $eventDateFormatYear = "Y"; $eventDateFormat = "F jS Y"; $result = $client->AdvancedShowSearch(array( 'ChannelID' => 1, 'searchString' => $sport, 'eventDate' => date("Y-m-d") . "T00:00:00", 'dateComparator' => '<', 'restrictToCategoryID' => 42, 'restrictToProducerID' => 0, 'restrictToProjectID' => 0, 'displayStreamingShowsOnly' => 0, 'searchOtherSites' => 0, )); if(!isset($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo)) { $vods = array(); } else { $vods = is_array($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo) ? $result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo : array($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo); } if(count( $vods) == '0') { //There is probably something wrong if this shows up. echo "There are now Shows currently available for on demand viewing."; } else { // Prints out a table with time and show title with link to show detial page echo' '; foreach($vods as $vod) { if(date($eventDateFormatYear,strtotime($vod->EventDate)) == $year){ $var = $vod->VodDirectLink; $title = $vod->Title; $getFileSize = False; $defaultSize = "Approximately 1 GB"; if(!isMobile()){ if ($var) { if ($getFileSize) { $size = getRemoteFilesize($var); } else { $size = $defaultSize; } }; }; echo ""; echo " \n"; $count++; echo " \n"; $count++; } echo "\n"; } } echo'
'.$sport.' '.$year.'
'; } //this loop controls the years included in the table for ($i = 2017; $i >= 2009; $i--) { addYearToTable($i,$searchString); } ?>
{/source}