0.3.8.1
This commit is contained in:
21
web/image.php
Normal file
21
web/image.php
Normal 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'];
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user