///////////////////////////////////////////////////////////////// // Yuba RTC Browser ///////////////////////////////////////////////////////////////// $browser_version = "0.3.8"; ?>
function array_unserialize($array) { foreach ($array as $key => $string) { if (substr($string, 0, 2) == "a:") { $array[$key] = unserialize($string); } } return $array; } function human_filesize($bytes, $decimals = 2) { $size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor]; } function dumpme($mixed = null) { ob_start(); var_dump($mixed); $content = ob_get_contents(); ob_end_clean(); return $content; } function breadcrumbs($dbo, $pathname) { $zpath = $dbo->query("SELECT zpath FROM _walkwalk")->fetch()['zpath']; $pathname_adjusted = str_replace($zpath."/", "", $pathname); $parts = explode("/", $pathname_adjusted); $i = count($parts); while ($i) { $search_path = $zpath."/".implode("/", array_slice($parts, 0, $i)); $id = $dbo->query("SELECT id FROM files WHERE (Pathname='".$search_path."')")->fetch()['id']; $result[] = array($id, basename($search_path)); $i--; } $home = array("0",basename($zpath)); if (basename($zpath) == $pathname) { return array($home); } else { $result[] = $home; return array_reverse($result); } } $db_dir = "db/"; $db = $_GET['db']; $id = $_GET['id']; $view = $_GET['view']; $sort = $_GET['sort']; $db_file = $db_dir.$db.".sqlite3"; if (!$view) { $view = "icon"; } // there is no db, show a list of sqlite files if (!$db) { echo "| "; $crumb = breadcrumbs($dbo, $myview['Pathname']); foreach ($crumb as $myparts) { if ($crumb[count($crumb)-1] != $myparts) { echo "\n".$myparts[1].""; echo " > "; } else { echo $myparts[1]; } } echo " | "; if ($view == "icon") { echo "icon | list"; } else { echo "icon | list"; } echo " |
";
$fdeep = $dbo->query("SELECT * FROM files WHERE (id=".$id.")")->fetchAll()[0];
$sdeep = $mdls = $dbo->query("SELECT * FROM mdls WHERE (id=".$id.")")->fetchAll()[0];
$mdeep = $meta = $dbo->query("SELECT * FROM metadata WHERE (id=".$id.")")->fetchAll()[0];
echo "".$fdeep['Pathname']."
";
if (isset($fdeep['tinfo'])) {
echo "
";
} else {
echo "
";
}
echo dumpme(array_unserialize($fdeep));
echo "Spotlight
";
echo dumpme(array_unserialize($sdeep));
echo "Mediainfo
";
echo dumpme(array_unserialize($mdeep));
echo "";
}
}
echo str_repeat("", 100);
?>