diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
commit | 889e8eaf7c40817663dd602a21ac771062ccac3b (patch) | |
tree | ca8ac81ee202165333e5ffe16147d09e5cdaf2ab /tpl/file/index.php | |
parent | 5c4caed8560d5fded00525844dfa8386b97e7918 (diff) | |
download | Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.tar.gz Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.zip |
Big change, sir. Can now upload any kind of files.
Diffstat (limited to 'tpl/file/index.php')
-rw-r--r-- | tpl/file/index.php | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tpl/file/index.php b/tpl/file/index.php new file mode 100644 index 0000000..dc8cb52 --- /dev/null +++ b/tpl/file/index.php @@ -0,0 +1,61 @@ +<?php +require("tpl/general/top.php"); + +if (count($files) == 0) { + echo '<div class="message">You have uploaded no files yet.</div>'; +} else { + echo '<p>You have uploaded ' . count($files) .' files.</p>'; + echo '<div class="ordering_links">' . filters_html_full() . '</div>'; + echo '<table><tr><th width="' . ($img_mini_width) . 'px"></th><th>Info</th><th>Date</th></tr>'; + foreach ($files as $fl) { + $min = $baseurl . $fl['id'] . "-min." . $fl['extension']; + $flf = $baseurl . $fl['id'] . "." . $fl['extension']; + echo '<tr><td style="text-align: center; vertical-align: middle"><a href="' . $flf . '">'; + if (has_mini($fl['extension'])) { + echo '<img src="' . $min . '" />'; + } else { + echo 'download'; + } + echo '</a></td>'; + echo '<td><strong>' . $fl['name'] . '</strong>'; + if ($fl['folder_id'] != 0) { + echo ' (in folder: <a href="folder-file-' . $fl['folder_id'] . '">' . $fl['folder_name'] . '</a>)'; + } + echo '<br /><strong>MD:</strong> <code>' . (has_mini($fl['extension']) ? '!' : '') . '['.$fl['name'].']('.$flf.')</code>'; + echo '<br />' . $fl['comment_html'] . '<br />'; + /*echo '<strong>Miniature:</strong> <a href="' . $min . '">' . $min . '</a><br />'; + echo '<strong>Image:</strong> <a href="' . $flf . '">' . $flf . '</a><br />'; */ + echo '</td>'; + echo '<td>' . $fl['upl_date'] . '<br />'; + if ($can_delete) echo '<br /><a href="delete-file-' . $fl['id'] . '">delete</a>'; + if ($can_rename) echo '<br /><a href="editinfo-file-' . $fl['id'] . '">edit info</a>'; + echo '</td></tr>'; + } + echo '</table>'; +} + +if ($can_upload) { +?> +</div> +<div class="contents-left"> +<h1>Upload a file</h1> +<form method="POST" action="index.php?p=upload-file" enctype="multipart/form-data"> +If you upload an image, a <?php echo $img_mini_width; ?>px preview will be created.<br /><br /> +Title : <input type="text" name="name" style="width: 200px;" ><br /> +<input type="file" name="file" /><br /> +<input type="submit" value="Upload" /></form> + +<br /><br /> +<h1>Your folders</h1> +<ul> +<?php +foreach ($folders as $f) { + echo '<li><a href="folder-file-' . $f['id'] . '">' . $f['name'] . '</a></li>'; +} +?> +<li><a class="tool_link" href="newfld-file">[+] New folder</a></li> +</ul> +<?php +} + +require("tpl/general/bottom.php"); |