0.8.0.0
This commit is contained in:
98
web/rtc.php
98
web/rtc.php
@@ -4,7 +4,7 @@
|
||||
// Yuba RTC Browser
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
$browser_version = "0.7.13.0";
|
||||
$browser_version = "0.7.13.2";
|
||||
|
||||
require "togggle.php";
|
||||
require "lib/ref/ref.php";
|
||||
@@ -12,7 +12,7 @@ require "lib/ref/ref.php";
|
||||
ref::config('expLvl', 1);
|
||||
ref::config('validHtml', TRUE);
|
||||
|
||||
$db_dir = "data/debug";
|
||||
$db_dir = "data/";
|
||||
$icon_size = 96;
|
||||
$pad = 40;
|
||||
$border_tools = array("sips","sox","ffmpeg","ql-thumbnail");
|
||||
@@ -61,7 +61,7 @@ div.iibox { display: table-cell;
|
||||
|
||||
div.diibox { display: table-cell;
|
||||
vertical-align: middle;
|
||||
background: url("/icons/directory.png");
|
||||
background: url("/yicons/directory.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: <?=$icon_size;?>px;
|
||||
background-position: center;
|
||||
@@ -105,8 +105,7 @@ img#thumb { padding: 6px;
|
||||
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
img#item { float: left; margin-right: 10px; width: 32px; height: 32px; }
|
||||
img { margin-bottom: 8px; }
|
||||
img#item { float: left; margin-right: 10px; width: 32px; height: 32px; margin-bottom: 8px; }
|
||||
|
||||
div.title { padding: 0px 10px 0px 10px; }
|
||||
|
||||
@@ -348,8 +347,8 @@ function mb_shortlabel($filename, $max = 40) {
|
||||
|
||||
function findicon($filename) {
|
||||
$ext = pathinfo($filename)['extension'];
|
||||
$good = "icons/null.png";
|
||||
foreach (glob("icons/*.png") as $file) {
|
||||
$good = "yicons/null.png";
|
||||
foreach (glob("yicons/*.png") as $file) {
|
||||
if (pathinfo($file)['filename'] == $ext) {
|
||||
$good = $file;
|
||||
}
|
||||
@@ -359,9 +358,9 @@ function findicon($filename) {
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
$db_file = $_GET['db'];
|
||||
$pid = $_GET['pid'];
|
||||
$search = $_POST['query'];
|
||||
$db_file = @$_GET['db'];
|
||||
$pid = @$_GET['pid'];
|
||||
$search = @$_POST['query'];
|
||||
$parser = new plistParser();
|
||||
|
||||
if ($db_file) {
|
||||
@@ -380,6 +379,8 @@ if ($db_file) {
|
||||
$zpath = $dbo->query("SELECT zpath FROM _skim")->fetch()['zpath'];
|
||||
$skim_version = $dbo->query("SELECT version FROM _skim")->fetch()['version'];
|
||||
|
||||
$spotlight_status = $dbo->query("SELECT mdutil FROM _skim")->fetch()['mdutil'];
|
||||
|
||||
// Check for initial view
|
||||
|
||||
$view = $dbo->query("SELECT * FROM _skim")->fetch();
|
||||
@@ -394,7 +395,7 @@ if ($db_file) {
|
||||
$view['qlmanage'] = array($view['qlmanage']);
|
||||
}
|
||||
$view['profile'] = array($view['profile']);
|
||||
if ($view['details']) {
|
||||
if (@$view['details']) {
|
||||
$view['details'] = unserialize($view['details']);
|
||||
}
|
||||
if (substr($view['disks'],0,5) == "<?xml") {
|
||||
@@ -407,10 +408,10 @@ if ($db_file) {
|
||||
} else {
|
||||
$view['diskutil'] = $view['diskutil'];
|
||||
}
|
||||
if ($view['vdisks']) {
|
||||
if (@$view['vdisks']) {
|
||||
$view['vdisks'] = $parser->parseString(utf8_for_xml($view['vdisks']));
|
||||
}
|
||||
if ($view['hdiutil']) {
|
||||
if (@$view['hdiutil']) {
|
||||
$view['hdiutil'] = $parser->parseString(utf8_for_xml($view['hdiutil']));
|
||||
}
|
||||
$view['Type'] = "dir";
|
||||
@@ -419,12 +420,14 @@ if ($db_file) {
|
||||
if (is_serial($view['stat'])) {
|
||||
$view['stat'] = unserialize($view['stat']);
|
||||
}
|
||||
$dirmdls = $dbo->query("SELECT rowid, * FROM mdls WHERE (rowid='".$view['rowid']."')")->fetch();
|
||||
if (!strpos($spotlight_status,"disabled")) {
|
||||
$dirmdls = $dbo->query("SELECT rowid, * FROM mdls WHERE (rowid='".$view['rowid']."')")->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
// Header
|
||||
|
||||
echo "<a href='?db='><img class='tiny' src='icons/home.png'>Home</a> <span class='arrow'>► </span>";
|
||||
echo "<a href='?db='><img class='tiny' src='yicons/home.png'>Home</a> <span class='arrow'>► </span>";
|
||||
$dbs = glob(pathinfo($_GET['db'],PATHINFO_DIRNAME)."/????-??-??_??-??-??.sqlite3");
|
||||
rsort($dbs);
|
||||
echo "<select>";
|
||||
@@ -440,19 +443,19 @@ if ($db_file) {
|
||||
|
||||
// Breadcrumbs
|
||||
|
||||
$crumb = breadcrumbs($zpath,$view['Pathname']);
|
||||
$crumb = breadcrumbs($zpath,@$view['Pathname']);
|
||||
$xc = "";
|
||||
|
||||
foreach ($crumb as $myparts) {
|
||||
if ($myparts[0] === null) {
|
||||
if ($view['Type'] == "dir") {
|
||||
$myicon = "icons/directory.png";
|
||||
$myicon = "yicons/directory.png";
|
||||
} else {
|
||||
$myicon = "icons/null.png";
|
||||
$myicon = "yicons/null.png";
|
||||
}
|
||||
$xc .= "<img class='tiny' src='".$myicon."'>".$myparts[1];
|
||||
} else {
|
||||
$xc .= "<a href='?db=".$db_file."&pid=".$myparts[0]."'><img class='tiny' src='icons/directory.png'>".$myparts[1]."</a> <span class='arrow'>►</span> ";
|
||||
$xc .= "<a href='?db=".$db_file."&pid=".$myparts[0]."'><img class='tiny' src='yicons/directory.png'>".$myparts[1]."</a> <span class='arrow'>►</span> ";
|
||||
}
|
||||
}
|
||||
if (!$search) { echo $xc; echo "<hr>"; }
|
||||
@@ -531,7 +534,7 @@ if ($db_file) {
|
||||
}
|
||||
$icon = "<img ".$border." src='".$realfile."' width='".$width."' height='".$height."' class='lazyload'>";
|
||||
} elseif ($row_a['Type'] == "dir") {
|
||||
$icon = "<img src='/icons/directory.png' width='512' height='512'>";
|
||||
$icon = "<img src='/yicons/directory.png' width='512' height='512'>";
|
||||
} else {
|
||||
$icon = "<img src='".findicon($row_a['Filename'])."' width='512' height='512'>";
|
||||
}
|
||||
@@ -589,16 +592,16 @@ if ($db_file) {
|
||||
|
||||
// parse old version stat
|
||||
preg_match('/^Access: ([^\r\n]*)/m', $row_a['stat'], $access);
|
||||
$fileinfo['atime (stat)'] = date("F jS, Y h:i:s",strtotime($access[1]));
|
||||
$fileinfo['atime (stat)'] = date("F jS, Y h:i:s",strtotime(@$access[1]));
|
||||
preg_match('/^Modify: ([^\r\n]*)/m', $row_a['stat'], $modify);
|
||||
$fileinfo['mtime (stat)'] = date("F jS, Y h:i:s",strtotime($modify[1]));
|
||||
$fileinfo['mtime (stat)'] = date("F jS, Y h:i:s",strtotime(@$modify[1]));
|
||||
preg_match('/^Change: ([^\r\n]*)/m', $row_a['stat'], $change);
|
||||
$fileinfo['ctime (stat)'] = date("F jS, Y h:i:s",strtotime($change[1]));
|
||||
$fileinfo['ctime (stat)'] = date("F jS, Y h:i:s",strtotime(@$change[1]));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ($row_b['spotlight']) {
|
||||
if (@$row_b['spotlight']) {
|
||||
$row_b['spotlight'] = $parser->parseString(utf8_for_xml($row_b['spotlight']));
|
||||
$fileinfo['added (mdls)'] = date("F jS, Y h:i:s",$row_b['DateAdded']);
|
||||
$fileinfo['mtime (mdls)'] = date("F jS, Y h:i:s",$row_b['ContentModificationDate']);
|
||||
@@ -629,19 +632,19 @@ if ($db_file) {
|
||||
|
||||
r($row_a);
|
||||
|
||||
if ($row_b['spotlight']) {
|
||||
if (@$row_b['spotlight']) {
|
||||
r($row_b);
|
||||
}
|
||||
|
||||
echo "</td><td valign='top'>";
|
||||
|
||||
if ($row_c) {
|
||||
if (@$row_c) {
|
||||
r(unserialize($row_c['tags']));
|
||||
}
|
||||
|
||||
ref::config('expLvl', 2);
|
||||
|
||||
if ($row_d) {
|
||||
if (@$row_d) {
|
||||
|
||||
if (substr($row_d['info'],0,5) == "<?xml") {
|
||||
r(json_decode(json_encode(simplexml_load_string(utf8_encode($row_d['info']))))->File->track);
|
||||
@@ -673,12 +676,22 @@ if ($db_file) {
|
||||
echo "<div class='container'>";
|
||||
|
||||
$spotlight_status = $dbo->query("SELECT mdutil FROM _skim")->fetch()['mdutil'];
|
||||
if (!strpos($spotlight_status,"disabled")) {
|
||||
|
||||
$sql = "SELECT mdls.*, files.*, milk.* FROM files ";
|
||||
$sql .= "LEFT JOIN mdls ON (files.rowid = mdls.rowid) ";
|
||||
$sql .= "LEFT JOIN milk ON (files.rowid = milk.rowid) ";
|
||||
$sql .= "WHERE files.rowid IN (".implode(",",$children).") ";
|
||||
$sql .= "ORDER BY files.Filename COLLATE NOCASE";
|
||||
$sql = "SELECT mdls.*, files.*, milk.* FROM files ";
|
||||
$sql .= "LEFT JOIN mdls ON (files.rowid = mdls.rowid) ";
|
||||
$sql .= "LEFT JOIN milk ON (files.rowid = milk.rowid) ";
|
||||
$sql .= "WHERE files.rowid IN (".implode(",",$children).") ";
|
||||
$sql .= "ORDER BY files.Filename COLLATE NOCASE";
|
||||
|
||||
} else {
|
||||
|
||||
$sql = "SELECT files.*, milk.* FROM files ";
|
||||
$sql .= "LEFT JOIN milk ON (files.rowid = milk.rowid) ";
|
||||
$sql .= "WHERE files.rowid IN (".implode(",",$children).") ";
|
||||
$sql .= "ORDER BY files.Filename COLLATE NOCASE";
|
||||
|
||||
}
|
||||
|
||||
$rows = $dbo->query($sql)->fetchAll();
|
||||
|
||||
@@ -692,7 +705,7 @@ if ($db_file) {
|
||||
|
||||
echo "<div class='item'>";
|
||||
|
||||
if ($item['FSInvisible'] | substr($item['Filename'],0,1) == ".") {
|
||||
if (@$item['FSInvisible'] | substr($item['Filename'],0,1) == ".") {
|
||||
$visibility = "hidden";
|
||||
} else {
|
||||
$visibility = "unhidden";
|
||||
@@ -701,7 +714,8 @@ if ($db_file) {
|
||||
////////////////////////////////////////////////
|
||||
// hack to preview mixed icon/thumb view
|
||||
$opts = unserialize($dbo->query("SELECT opts FROM _skim")->fetch()['opts']);
|
||||
$skipicon = array("jpg","png","JPG","jpeg","tif","tiff","DNG","dng","NEF");
|
||||
//$skipicon = array("jpg","png","JPG","jpeg","tif","tiff","DNG","dng","NEF");
|
||||
$skipicon = array();
|
||||
if($item['icon_filename'] && !in_array($item['Extension'],$skipicon)) {
|
||||
$item['thumb_filename'] = $item['icon_filename'];
|
||||
$item['thumb_width'] = $opts['thumb_size'];
|
||||
@@ -736,7 +750,7 @@ if ($db_file) {
|
||||
}
|
||||
$icon = "<img ".$border." class='lazyload' data-src='".$realfile."' width='".$width."' height='".$height."' data-width='".$width."' data-height='".$height."'>";
|
||||
} elseif ($item['Type'] == "dir") {
|
||||
$icon = "<img src='/icons/directory.png' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>";
|
||||
$icon = "<img src='/yicons/directory.png' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>";
|
||||
} else {
|
||||
$icon = "<img src='".findicon($item['Filename'])."' width='".$icon_size."' height='".$icon_size."' data-width='".$icon_size."' data-height='".$icon_size."'>";
|
||||
}
|
||||
@@ -755,7 +769,7 @@ if ($db_file) {
|
||||
|
||||
echo "<div class='title'>";
|
||||
|
||||
if ($item['UserTags']) {
|
||||
if (@$item['UserTags']) {
|
||||
foreach (unserialize($item['UserTags']) as $tag) {
|
||||
echo "<span class='tag ".$tag."'></span>";
|
||||
}
|
||||
@@ -793,7 +807,7 @@ if ($db_file) {
|
||||
|
||||
r($view);
|
||||
|
||||
if ($dirmdls['spotlight']) {
|
||||
if (@$dirmdls['spotlight']) {
|
||||
$dirmdls['spotlight'] = $parser->parseString(utf8_for_xml($dirmdls['spotlight']));
|
||||
r($dirmdls);
|
||||
}
|
||||
@@ -849,10 +863,10 @@ if ($db_file) {
|
||||
|
||||
echo "<a href='#' class='toggler'>toggle all</a>";
|
||||
|
||||
$icons['Disk image'] = "/icons/dmg.png";
|
||||
$icons['Folder'] = "/icons/directory.png";
|
||||
$icons['External disk'] = "/icons/firewire.png";
|
||||
$icons['Startup disk'] = "/icons/internal.png";
|
||||
$icons['Disk image'] = "/yicons/dmg.png";
|
||||
$icons['Folder'] = "/yicons/directory.png";
|
||||
$icons['External disk'] = "/yicons/firewire.png";
|
||||
$icons['Startup disk'] = "/yicons/internal.png";
|
||||
|
||||
$bundles = glob($db_dir."/*.bundle");
|
||||
|
||||
@@ -905,7 +919,7 @@ if ($db_file) {
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
echo "<hr><div id='exectime'>".round($time = microtime(true)-$_SERVER["REQUEST_TIME_FLOAT"],2)." seconds</div>";
|
||||
echo "<div>Skim version = ".$skim_version.", RTC Browser Version = ".$browser_version."</div>";
|
||||
echo "<div>Skim version = ".@$skim_version.", RTC Browser Version = ".$browser_version."</div>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user