summaryrefslogtreecommitdiff
path: root/tpl/image
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-17 16:48:29 +0200
commitd0060968b77c39bdf8abffb071c971c166b59edb (patch)
tree0be52e00a25bd298235a0cf916fb07496d3ab95f /tpl/image
downloadBits-d0060968b77c39bdf8abffb071c971c166b59edb.tar.gz
Bits-d0060968b77c39bdf8abffb071c971c166b59edb.zip
First commit.
Diffstat (limited to 'tpl/image')
-rw-r--r--tpl/image/index.php34
-rw-r--r--tpl/image/upload-ok.php12
-rw-r--r--tpl/image/upload.php15
3 files changed, 61 insertions, 0 deletions
diff --git a/tpl/image/index.php b/tpl/image/index.php
new file mode 100644
index 0000000..0f76abe
--- /dev/null
+++ b/tpl/image/index.php
@@ -0,0 +1,34 @@
+<?php
+require("tpl/general/top.php");
+
+echo '<h2>Images you have uploaded</h2>';
+
+if (count($images) == 0) {
+ echo '<div class="message">You have uploaded no images yet.</div>';
+} else {
+echo '<table><tr><th width="' . ($miniature_width) . 'px">Preview</th><th>Files</th></tr>';
+ foreach ($images as $img) {
+ $min = $baseurl . $img['id'] . "-min." . $img['extension'];
+ $imgf = $baseurl . $img['id'] . "." . $img['extension'];
+ echo '<tr><td><img src="' . $min . '" /></td>';
+ echo '<td><strong>Miniature:</strong> <a href="' . $min . '">' . $min . '</a><br />';
+ echo '<strong>Image:</strong> <a href="' . $imgf . '">' . $imgf . '</a>';
+ if ($can_delete) echo '<br /><a href="delete-image-' . $img['id'] . '">Delete this image</a>';
+ echo '</td>';
+ }
+ echo '</table>';
+}
+
+if ($can_upload) {
+?>
+</div>
+<div class="contents-left">
+<h1>Upload an image</h1>
+<form method="POST" action="index.php?p=upload-image" enctype="multipart/form-data">
+<strong>A <?php echo $miniature_width; ?>px preview will be created.</strong><br /><br />
+<input type="file" name="image" /><br />
+<input type="submit" value="Upload" /></form>
+<?php
+}
+
+require("tpl/general/bottom.php");
diff --git a/tpl/image/upload-ok.php b/tpl/image/upload-ok.php
new file mode 100644
index 0000000..1cd588c
--- /dev/null
+++ b/tpl/image/upload-ok.php
@@ -0,0 +1,12 @@
+<?php
+require("tpl/general/top.php");
+
+$minurl = $baseurl . $id . "-min." . $type;
+$imgurl = $baseurl . $id . "." . $type;
+
+?>
+ Preview : <a href="<?php echo $minurl; ?>"><?php echo $minurl; ?></a><br />
+ Image : <a href="<?php echo $imgurl; ?>"><?php echo $imgurl; ?></a><br />
+<?php
+
+require("tpl/general/bottom.php");
diff --git a/tpl/image/upload.php b/tpl/image/upload.php
new file mode 100644
index 0000000..6e9ee55
--- /dev/null
+++ b/tpl/image/upload.php
@@ -0,0 +1,15 @@
+<?php
+$title = "Upload an image";
+
+if ($user['id'] == 0) $message = "You should create an account so that you can track images you have uploaded.";
+
+$form_message = "A $miniature_width"."px preview will be created.";
+$need_file = true;
+$fields = array(
+ array("label" => "Image file : ", "type" => "file", "name" => "image")
+ );
+$validate = "Upload";
+
+require("tpl/general/form.php");
+
+