URL); $BlockStart = '
'; $BlockEnd = '
'; $Content = GetTextBetween($Content, $BlockStart, $BlockEnd); if ($Content == '') { $Output .= 'Main block not isolated.
'; return $Output; } $ItemStart = '
'; $ItemEnd = 'Číst více ', '
', '
'))))); $Event->Description = GetTextBetween($Item, '
', ''))); $Event->TimeTo = strtotime(trim(GetTextBetween($Content, 'ai1ec-hidden dt-end">', '
'))); $Event->Price = trim(strip_tags(GetTextBetween($Content, 'Náklady:
', 'Price = trim(str_replace('Kč', '', $Event->Price)); if ($Event->Price == 'Zdarma') $Event->Price = 0; if ($Event->Price == '') $Event->Price = 0; return $Output; } function ParseTime($Time) { // Strip out time range if (strpos($Time, '–') !== false) $Time = substr($Time, 0, strpos($Time, '–')); if ($Time == '') return NULL; $Time = str_replace('@', '', $Time); $Parts = explode(' ', $Time); $Month = $Parts[0]; $Day = $Parts[1]; $Year = $DateParts = explode('.', $Parts[0]); if (count($Parts) > 1) { $TimeParts = explode(':', $Parts[1]); if (count($TimeParts) == 1) $TimeParts[1] = '0'; if (count($TimeParts) == 2) $TimeParts[2] = '0'; } else $TimeParts = array(0, 0, 0); $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[0], $DateParts[2]); return $Time; } }