This commit is contained in:
2017-05-25 15:38:19 -07:00
parent 2ad83fcb34
commit 62dab3d734
67 changed files with 747 additions and 118 deletions

21
web/image.php Normal file
View File

@@ -0,0 +1,21 @@
<?
// Yuba image 0.0.1
$db = $_GET['db'];
$id = $_GET['id'];
$db_file = "db/".$db.".sqlite3";
if (!file_exists($db_file)) {
echo "Can't find db!";
die;
}
$dbo = new PDO("sqlite:".$db_file);
$dbo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
header('Content-Type: image/png');
echo $dbo->query("SELECT thumb FROM thumbs WHERE (id=".$id.")")->fetch()['thumb'];
?>