Tweaks
This commit is contained in:
13
helper.php
13
helper.php
@@ -16,6 +16,8 @@ $pathname = $argv[3];
|
|||||||
$bpath = $argv[4];
|
$bpath = $argv[4];
|
||||||
$mytime = $argv[5];
|
$mytime = $argv[5];
|
||||||
|
|
||||||
|
$ext = pathinfo($pathname, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
$tfile = "/tmp/Yuba/".$mytime."/".$fid.".png";
|
$tfile = "/tmp/Yuba/".$mytime."/".$fid.".png";
|
||||||
|
|
||||||
$shellpath = escapeshellarg($pathname);
|
$shellpath = escapeshellarg($pathname);
|
||||||
@@ -28,11 +30,11 @@ switch ($mode) {
|
|||||||
|
|
||||||
case "icons":
|
case "icons":
|
||||||
|
|
||||||
if (@!$dbp->query("SELECT EXISTS(SELECT 1 FROM icons WHERE fid='".$fid."')")->fetch()[0]) {
|
if (!in_array($ext, $p['i_skip']) && @!$dbp->query("SELECT EXISTS(SELECT 1 FROM icons WHERE fid='".$fid."')")->fetch()[0]) {
|
||||||
|
|
||||||
$stmt = $dbp->prepare("INSERT INTO icons VALUES (:fid, :hash, :created, :relative_path, :tool)");
|
$stmt = $dbp->prepare("INSERT INTO icons VALUES (:fid, :hash, :created, :relative_path, :tool)");
|
||||||
|
|
||||||
$cmd = $bin_qltool." di ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode > ".$tfile;
|
$cmd = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode > ".$tfile;
|
||||||
shell_exec($cmd);
|
shell_exec($cmd);
|
||||||
|
|
||||||
$stmt->BindValue(":fid",$fid);
|
$stmt->BindValue(":fid",$fid);
|
||||||
@@ -52,10 +54,17 @@ switch ($mode) {
|
|||||||
$stmt->BindValue(":tool","qltool");
|
$stmt->BindValue(":tool","qltool");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case: "thumbs":
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user