Format files similary to original screens.
This commit is contained in:
parent
ccd7abbf0e
commit
34062abda0
|
@ -232,7 +232,6 @@ h1{
|
|||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 25px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.image {
|
||||
|
@ -248,6 +247,7 @@ h1{
|
|||
overflow: hidden;
|
||||
width: 600px;
|
||||
padding: 10px;
|
||||
margin-top: 25px;
|
||||
|
||||
box-shadow: 0 0 4px rgba(0,0,0,0.3) inset,0 -3px 2px rgba(0,0,0,0.1);
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 89 KiB |
Binary file not shown.
After Width: | Height: | Size: 61 KiB |
Binary file not shown.
After Width: | Height: | Size: 207 B |
48
index.php
48
index.php
|
@ -1,36 +1,4 @@
|
|||
<?php
|
||||
$conf = json_decode(file_get_contents('database.conf'));
|
||||
|
||||
$id = isset($_GET['image']) ? $_GET['image'] : '';
|
||||
|
||||
if($id == '' ) {
|
||||
// redirect to gallery; do with .htaccess?
|
||||
$content = 'id not set';
|
||||
} else {
|
||||
if(!is_numeric($id) || $id <= 0) {
|
||||
$message = 'This image does not exist: bad id format (' . $id . ')';
|
||||
} else {
|
||||
$db = mysqli_init();
|
||||
$db->real_connect($conf->hostname, $conf->username, $conf->password, $conf->database);
|
||||
|
||||
$query = "SELECT extension, created, original FROM screens WHERE id = $id";
|
||||
$result = $db->query($query);
|
||||
|
||||
if($result->num_rows == 0) {
|
||||
$message = 'This image does not exist: not in database';
|
||||
} else {
|
||||
// load tags
|
||||
|
||||
$image = $result->fetch_object();
|
||||
$imageOutput = '<img src="uploads/' . $id . '.' . $image->extension . '" class="image" />';
|
||||
$message = 'Uploaded on: ' . $image->created;
|
||||
$message .= '<br/>Original name: ' . $image->original;
|
||||
$message .= '<br/>View Raw: <a href="uploads/' . $id . '.' . $image->extension . '">'. $id . '.' . $image->extension . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<head>
|
||||
<title>No Chicks Allowed: Image Repository</title>
|
||||
|
@ -47,17 +15,13 @@ if($id == '' ) {
|
|||
<header>
|
||||
<h1>title or navigation or something</h1>
|
||||
</header>
|
||||
<?if (isset($imageOutput)) { ?>
|
||||
<div id="imageContainer">
|
||||
<?php echo $imageOutput; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="message">
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="dropbox">
|
||||
<span class="message">Drop images here to upload.</span>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script src="js/jquery.filedrop.js"></script>
|
||||
<script src="js/upload.js"></script>
|
||||
</body>
|
||||
</html>
|
27
upload.html
27
upload.html
|
@ -1,27 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<head>
|
||||
<title>No Chicks Allowed: Image Repository</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="css/html5reset-1.6.1.css" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>title or navigation or something</h1>
|
||||
</header>
|
||||
|
||||
<div id="dropbox">
|
||||
<span class="message">Drop images here to upload.</span>
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
<script src="js/jquery.filedrop.js"></script>
|
||||
<script src="js/upload.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -38,7 +38,7 @@ if(array_key_exists('image', $_FILES)) {
|
|||
$newId = $db->insert_id;
|
||||
|
||||
if(move_uploaded_file($file['tmp_name'], UPLOADS . $newId . '.' . $extension)) {
|
||||
echo json_encode(array('type'=>'success','status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . UPLOADS . $newId . '.' . $extension));
|
||||
echo json_encode(array('type'=>'success','status'=>'Uploaded successfully','file'=>'http://screens.p5dev.com/' . $newId));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
$conf = json_decode(file_get_contents('database.conf'));
|
||||
|
||||
$id = isset($_GET['image']) ? $_GET['image'] : '';
|
||||
|
||||
if($id == '' ) {
|
||||
// redirect to gallery; do with .htaccess?
|
||||
$message = 'id not set';
|
||||
} else {
|
||||
if(!is_numeric($id) || $id <= 0) {
|
||||
$message = 'This image does not exist: bad id format (' . $id . ')';
|
||||
} else {
|
||||
$db = mysqli_init();
|
||||
$db->real_connect($conf->hostname, $conf->username, $conf->password, $conf->database);
|
||||
|
||||
$query = "SELECT extension, created, original FROM screens WHERE id = $id";
|
||||
$result = $db->query($query);
|
||||
|
||||
if($result->num_rows == 0) {
|
||||
$message = 'This image does not exist: not in database';
|
||||
} else {
|
||||
// load tags
|
||||
|
||||
$image = $result->fetch_object();
|
||||
$imageOutput = '<img src="uploads/' . $id . '.' . $image->extension . '" class="image" />';
|
||||
$message = 'Uploaded on: ' . $image->created;
|
||||
$message .= '<br/>Original name: ' . $image->original;
|
||||
$message .= '<br/>View Raw: <a href="uploads/' . $id . '.' . $image->extension . '">'. $id . '.' . $image->extension . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<head>
|
||||
<head>
|
||||
<title>No Chicks Allowed: Image Repository</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="css/html5reset-1.6.1.css" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<h1>title or navigation or something</h1>
|
||||
</header>
|
||||
<?if (isset($imageOutput)) { ?>
|
||||
<div id="imageContainer">
|
||||
<?php echo $imageOutput; ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="message">
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue