\n"); print("\n"); print("\n"); print("\n"); print("MythTV Mobile\n"); print("\n"); print("

\n"); print("MythTV Mobile
 
\n"); /* using shell_exec(ls) because opendir and dir class both give seemingly random ordering of files */ $output = ''; $ls = shell_exec(escapeshellcmd("ls $directory")); $files = explode("\n", $ls); foreach($files as $file) { if (preg_match('/.3gp$/', $file)) { $file_trimmed = rtrim($file, '.3gp'); $data = preg_split('/~~~/', $file_trimmed); $show = preg_replace('/_/', ' ', $data[1]); $show_sub = preg_replace('/_/', ' ', $data[2]); ($data[2]) ? $title = "$show - $show_sub" : $title = $show; $date_formatted = date('D n/j/Y, g:i A', mktime(substr($data[0], 8, 2), substr($data[0], 10, 2), substr($data[0], 12, 2), substr($data[0], 4, 2), substr($data[0], 6, 2), substr($data[0], 0, 4))); $output = "$title: $date_formatted
 
\n".$output; } } print($output); print("

\n"); print("\n"); ?>