From b4b98589299cecd42b20e3ba1c624617a9aff3f0 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 19 Feb 2010 15:17:05 +0100 Subject: Nice display of recordings date and time --- includes/inc_rec.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/inc_rec.php b/includes/inc_rec.php index b01a64c..a950d14 100755 --- a/includes/inc_rec.php +++ b/includes/inc_rec.php @@ -39,11 +39,15 @@ else while ($recname = readdir($dir_handle)) if($recname == "." || $recname == ".." || $recname == "epg.data" || $recname == 'lost+found') continue; - $recname2=addslashes($recname); + $recname2 = addslashes($recname); + + $date = preg_replace('/-/', '/', substr($recname2, 0, 10)); + $time = preg_replace('/\./', 'h', substr($recname2, 11, 5)); + $recnice = $date .' at ' .$time; if (strstr($recname, ".rec") == ".rec") { - print "
  • $recname
  • \r\n"; + print "
  • $recnice
  • \r\n"; print "
    "; print " "; print " "; -- cgit v1.2.3 From 803716beb793822942c448722808e6bf073c7666 Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 19 Feb 2010 15:31:42 +0100 Subject: Indentation --- includes/inc_media.php | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/includes/inc_media.php b/includes/inc_media.php index d6b6e59..7c5f133 100755 --- a/includes/inc_media.php +++ b/includes/inc_media.php @@ -25,8 +25,8 @@ else print "Back\r\n"; if ($dir != $mediapath) { -print "
    \r\n"; -print "\"home\"
    \r\n"; + print "
    \r\n"; + print "\"home\"
    \r\n"; } print "
    iStreamdev
    \r\n"; print "\r\n"; @@ -54,42 +54,45 @@ else while ($medianame = readdir($dir_handle)) // if ($medianame_array[0] == NULL) { -//do nothing + //do nothing } else { -sort($medianame_array); -foreach($medianame_array as $value) - { - $medianame2=addslashes($value); - // Directories - if (is_dir($dir ."/" .$value)) - { - print "
  • $value
  • \r\n"; - print ""; - print " "; - print " "; - print "\r\n"; - } - else - { - // Get file extension - $fileext = end(explode(".", $value)); + // Alphabetical sorting + sort($medianame_array); + + foreach($medianame_array as $value) + { + $medianame2=addslashes($value); - // Check if it is supported - if ( preg_match("'" .$fileext ." '", $videotypes) - || preg_match("'" .$fileext ." $'", $videotypes) - ) + // Directories + if (is_dir($dir ."/" .$value)) { - print "
  • $value
  • \r\n"; + print "
  • $value
  • \r\n"; print "
    "; - print " "; - print " "; - print " "; + print " "; + print " "; print "
    \r\n"; } + else + { + // Get file extension + $fileext = end(explode(".", $value)); + + // Check if it is supported + if ( preg_match("'" .$fileext ." '", $videotypes) + || preg_match("'" .$fileext ." $'", $videotypes) + ) + { + print "
  • $value
  • \r\n"; + print "
    "; + print " "; + print " "; + print " "; + print "
    \r\n"; + } + } } - } } $updir = dirname($dir); -- cgit v1.2.3 From 97119d9248475946e69ed8485fdd4723c5f54fbe Mon Sep 17 00:00:00 2001 From: TheTroll Date: Fri, 19 Feb 2010 15:41:05 +0100 Subject: Convert channels EPG/title to UTF8 is needed --- includes/inc_utils.php | 27 +++++++++++++++++++++++++++ includes/inc_vdr.php | 7 +++++++ includes/include.php | 1 + 3 files changed, 35 insertions(+) create mode 100644 includes/inc_utils.php diff --git a/includes/inc_utils.php b/includes/inc_utils.php new file mode 100644 index 0000000..a984794 --- /dev/null +++ b/includes/inc_utils.php @@ -0,0 +1,27 @@ + 128){ + if(($c >= 254)) return false; + elseif($c >= 252) $bits=6; + elseif($c >= 248) $bits=5; + elseif($c >= 240) $bits=4; + elseif($c >= 224) $bits=3; + elseif($c >= 192) $bits=2; + else return false; + if(($i+$bits) > $len) return false; + while($bits > 1){ + $i++; + $b=ord($str[$i]); + if($b < 128 || $b > 191) return false; + $bits--; + } + } + } + return true; +} +?> diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index 07880e7..c96217c 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -83,6 +83,13 @@ function vdrgetinfostream($stream = "NULL", $ischan = 1) $epgdesc=substr($allepg[$i], 2); } } + + // Convert if needed + if (!is_utf8($epgtitle)) + $epgtitle = utf8_encode($epgtitle); + if (!is_utf8($epgdesc)) + $epgdesc = utf8_encode($epgdesc); + return array($epgtitle, $epgdesc, $channame); } diff --git a/includes/include.php b/includes/include.php index 830b4b1..913b22a 100755 --- a/includes/include.php +++ b/includes/include.php @@ -4,6 +4,7 @@ if (file_exists('config.php')) include ('config.php'); else include ('config_default.php'); +include ('includes/inc_utils.php'); include ('includes/inc_auth.php'); include ('includes/inc_vdr.php'); include ('includes/inc_files.php'); -- cgit v1.2.3