summaryrefslogtreecommitdiff
path: root/tpl/image
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/image')
-rw-r--r--tpl/image/index.php23
-rw-r--r--tpl/image/upload-ok.php11
-rw-r--r--tpl/image/upload.php3
3 files changed, 26 insertions, 11 deletions
diff --git a/tpl/image/index.php b/tpl/image/index.php
index 0f76abe..4f9db8e 100644
--- a/tpl/image/index.php
+++ b/tpl/image/index.php
@@ -1,20 +1,24 @@
<?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>';
+ echo '<p>You have uploaded ' . count($images) .' images.</p>';
+ echo '<div class="ordering_links">' . filters_html_full() . '</div>';
+ echo '<table><tr><th width="' . ($miniature_width) . 'px">Preview</th><th>Info</th><th>Date</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 '<tr><td><a href="' . $imgf . '"><img src="' . $min . '" /></a></td>';
+ echo '<td><strong>' . $img['name'] . '</strong><br /><br />';
+ echo '<strong>Miniature:</strong> <a href="' . $min . '">' . $min . '</a><br />';
+ echo '<strong>Image:</strong> <a href="' . $imgf . '">' . $imgf . '</a><br />';
+ echo '<strong>Markdown:</strong> <code>!['.$img['name'].']('.$imgf.')</code></td>';
+ echo '<td>' . $img['upl_date'] . '<br />';
+ if ($can_delete) echo '<br /><a href="delete-image-' . $img['id'] . '">delete</a>';
+ if ($can_rename) echo '<br /><a href="rename-image-' . $img['id'] . '">rename</a>';
+ echo '</td></tr>';
}
echo '</table>';
}
@@ -25,7 +29,8 @@ if ($can_upload) {
<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 />
+A <?php echo $miniature_width; ?>px preview will be created.<br /><br />
+Title : <input type="text" name="name" style="width: 200px;" ><br />
<input type="file" name="image" /><br />
<input type="submit" value="Upload" /></form>
<?php
diff --git a/tpl/image/upload-ok.php b/tpl/image/upload-ok.php
index 1cd588c..6242d93 100644
--- a/tpl/image/upload-ok.php
+++ b/tpl/image/upload-ok.php
@@ -5,8 +5,17 @@ $minurl = $baseurl . $id . "-min." . $type;
$imgurl = $baseurl . $id . "." . $type;
?>
- Preview : <a href="<?php echo $minurl; ?>"><?php echo $minurl; ?></a><br />
+ <p>Preview : <a href="<?php echo $minurl; ?>"><?php echo $minurl; ?></a><br />
Image : <a href="<?php echo $imgurl; ?>"><?php echo $imgurl; ?></a><br />
+ Markdown code : <code>![<?php echo $name; ?>](<?php echo $imgurl; ?>)</code></p>
+ <p>
+ <p>
+ <a href="upload-image">Back to upload form</a>
+ <?php
+ if ($user['priv'] >= $apps['image']['index'])
+ echo ' - <a href="index-image">back to list of uploaded images</a>';
+ ?>
+ </p>
<?php
require("tpl/general/bottom.php");
diff --git a/tpl/image/upload.php b/tpl/image/upload.php
index 6e9ee55..71283cf 100644
--- a/tpl/image/upload.php
+++ b/tpl/image/upload.php
@@ -6,7 +6,8 @@ if ($user['id'] == 0) $message = "You should create an account so that you can t
$form_message = "A $miniature_width"."px preview will be created.";
$need_file = true;
$fields = array(
- array("label" => "Image file : ", "type" => "file", "name" => "image")
+ array("label" => "Image file : ", "type" => "file", "name" => "image"),
+ array("label" => "Image title (optionnal) : ", "type" => "text", "name" => "name")
);
$validate = "Upload";