Ejemplo n.º 1
0
        echo xml_gen::p('ERROR: ' . $e->message);
    }
    CommonFooter();
    die;
}
//// Browse directory
// Fast scan of directories
$getid3->option_accurate_results = false;
// Create dir variable
$dir = @$_GET["directory"] ? realpath($_GET["directory"]) : $root_path;
// Check that path is wihtin root
if (!strstr('*' . $dir, '*' . $root_path)) {
    die('ACCESS DENIED to ' . $dir);
}
// Begin page
CommonHeader("{$dir}");
// Read files and directories
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            $full_name = "{$dir}/{$file}";
            if (is_file($full_name)) {
                $files[$full_name] = $file;
            } elseif ($file[0] != '.') {
                $dirs[$full_name] = $file;
            }
        }
        closedir($dh);
    }
}
// Create table
Ejemplo n.º 2
0
        GenreReport();
        break;
    case 'artists':
        CommonHeader('Genre Distribution');
        Summary();
        ArtistReport();
        break;
    case 'formats':
        CommonHeader('Format/Encoder Distribution');
        Summary();
        FormatReport();
        FormatEncoderReport();
        FormatEncoderOptionsReport();
        break;
    default:
        CommonHeader('demo.mysql.php - menu');
        $g = new xml_gen();
        echo $g->p('This demo shows one way of storing getID3() data in a database. The demo is not complete and will not be completed by the getID3() development team. If you find it useful and wish to complete it, please send the completed demo to us and we will add it to the next version.');
        echo $g->h3('Initial steps');
        echo $g->ul($g->li($g->a('demo.mysql.php?action=create', 'Empty/Create empty database')) . $g->li($g->a('demo.mysql.php?action=import', 'Import sample data') . ' highly recommended - then check out the reports') . $g->li($g->a('demo.mysql.php?action=analyze', 'Analyze your own audio files') . ' located in ' . $audio_path . ' (change that path in demo.mysql.php ln 56. This will delete all entries in the database!'));
        echo $g->h3('Statistics/Reports');
        echo $g->ul($g->li($g->a('demo.mysql.php?action=genres', 'Genre Distribution')) . $g->li($g->a('demo.mysql.php?action=artists', 'Artist Distribution')) . $g->li($g->a('demo.mysql.php?action=formats', 'Format/Encoder Distribution')) . $g->li("List duplicate files by md5data") . $g->li("List duplicate files by artist+title and playtime") . $g->li("List files without Genre, title, ..."));
        echo $g->h3('Searching');
        echo $g->ul($g->li('Search Metadata/Tags'));
}
CommonFooter();
die;
// HTML header
function CommonHeader($heading)
{
    header('Content-Type: text/html; charset=UTF-8');
Ejemplo n.º 3
0
        echo xml_gen::p('ERROR: ' . $e->message);
    }
    CommonFooter();
    die;
}
//// Browse directory
// Fast scan of directories
$getid3->option_accurate_results = false;
// Create dir variable
$dir = @$_GET["directory"] ? realpath($_GET["directory"]) : $root_path;
// Check that path is wihtin root
if (!strstr('*' . $dir, '*' . $root_path)) {
    //    die('ACCESS DENIED to '. $dir);
}
// Begin page
CommonHeader($dir);
// MSIE warning
if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
    echo xml_gen::p('MSIE does not display partial tables, please sit back and wait while scanning the directory...');
    echo xml_gen::p('Alternative use demo.browse.dhtml.php instead. It will display results faster.');
    flush();
}
// Read files and directories
if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            $full_name = "{$dir}/{$file}";
            if (is_file($full_name)) {
                $files[$full_name] = $file;
            } elseif ($file[0] != '.') {
                $dirs[$full_name] = $file;