From 889e8eaf7c40817663dd602a21ac771062ccac3b Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 21 Jun 2012 16:34:27 +0200 Subject: Big change, sir. Can now upload any kind of files. --- tpl/file/folder.php | 56 +++++++++++++++++++++++++++++++++++++++++++++ tpl/file/index.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ tpl/file/upload-ok.php | 21 +++++++++++++++++ tpl/file/upload.php | 16 +++++++++++++ tpl/general/top.php | 6 ++--- tpl/image/folder.php | 52 ----------------------------------------- tpl/image/index.php | 55 -------------------------------------------- tpl/image/upload-ok.php | 21 ----------------- tpl/image/upload.php | 16 ------------- 9 files changed, 157 insertions(+), 147 deletions(-) create mode 100644 tpl/file/folder.php create mode 100644 tpl/file/index.php create mode 100644 tpl/file/upload-ok.php create mode 100644 tpl/file/upload.php delete mode 100644 tpl/image/folder.php delete mode 100644 tpl/image/index.php delete mode 100644 tpl/image/upload-ok.php delete mode 100644 tpl/image/upload.php (limited to 'tpl') diff --git a/tpl/file/folder.php b/tpl/file/folder.php new file mode 100644 index 0000000..d7ebd73 --- /dev/null +++ b/tpl/file/folder.php @@ -0,0 +1,56 @@ +edit folder info | '; + echo 'delete folder'; +} + +echo $fld['comment_html']; + +if (count($files) == 0) { + echo '
This folder has no files.
'; +} else { + echo ''; + echo ''; + foreach ($files as $fl) { + $min = $baseurl . $fl['id'] . "-min." . $fl['extension']; + $flf = $baseurl . $fl['id'] . "." . $fl['extension']; + echo ''; + echo ''; + echo ''; + } + echo '
InfoDate
'; + if (has_mini($fl['extension'])) { + echo ''; + } else { + echo 'download'; + } + echo '' . $fl['name'] . ''; + echo '
' . $fl['comment_html'] . '
'; + echo '
' . $fl['upl_date'] . '
'; + if ($can_edit) echo '
delete'; + if ($can_edit) echo '
edit info'; + echo '
'; +} + +echo '
'; +if ($is_owner) { + echo '

Your folders

'; +} else { + echo '

' . $fld["ownername"] . "'s folders

"; +} +echo ''; + +require("tpl/general/bottom.php"); 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 @@ +You have uploaded no files yet.
'; +} else { + echo '

You have uploaded ' . count($files) .' files.

'; + echo ''; + echo ''; + foreach ($files as $fl) { + $min = $baseurl . $fl['id'] . "-min." . $fl['extension']; + $flf = $baseurl . $fl['id'] . "." . $fl['extension']; + echo ''; + echo ''; + echo ''; + } + echo '
InfoDate
'; + if (has_mini($fl['extension'])) { + echo ''; + } else { + echo 'download'; + } + echo '' . $fl['name'] . ''; + if ($fl['folder_id'] != 0) { + echo ' (in folder: ' . $fl['folder_name'] . ')'; + } + echo '
MD: ' . (has_mini($fl['extension']) ? '!' : '') . '['.$fl['name'].']('.$flf.')'; + echo '
' . $fl['comment_html'] . '
'; + /*echo 'Miniature: ' . $min . '
'; + echo 'Image: ' . $flf . '
'; */ + echo '
' . $fl['upl_date'] . '
'; + if ($can_delete) echo '
delete'; + if ($can_rename) echo '
edit info'; + echo '
'; +} + +if ($can_upload) { +?> + +
+

Upload a file

+
+If you upload an image, a px preview will be created.

+Title :
+
+
+ +

+

Your folders

+ + +

Preview :
+ Image :
+ Markdown code : ]()

+

+

+ Back to upload form + = $apps['file']['index']) + echo ' - back to list of uploaded files'; + ?> +

+ "Image file : ", "type" => "file", "name" => "file"), + array("label" => "Image title (optionnal) : ", "type" => "text", "name" => "name") + ); +$validate = "Upload"; + +require("tpl/general/form.php"); + + diff --git a/tpl/general/top.php b/tpl/general/top.php index 08481fd..e2b168a 100644 --- a/tpl/general/top.php +++ b/tpl/general/top.php @@ -34,11 +34,11 @@ if ($user['id'] == 0) { My studies'; - echo 'Uploaded images'; + echo 'Uploaded files'; } else { echo 'Studies'; - if ($user['priv'] >= $apps['image']['upload']) { - echo 'Upload image'; + if ($user['priv'] >= $apps['file']['upload']) { + echo 'Upload file'; } } ?> diff --git a/tpl/image/folder.php b/tpl/image/folder.php deleted file mode 100644 index 5d5e57b..0000000 --- a/tpl/image/folder.php +++ /dev/null @@ -1,52 +0,0 @@ -edit folder info | '; - echo 'delete folder
'; -} - -echo $fld['comment_html']; - -if (count($images) == 0) { - echo '
This folder has no images.
'; -} else { - echo ''; - echo ''; - foreach ($images as $img) { - $min = $baseurl . $img['id'] . "-min." . $img['extension']; - $imgf = $baseurl . $img['id'] . "." . $img['extension']; - echo ''; - echo ''; - echo ''; - } - echo '
PreviewInfoDate
' . $img['name'] . ''; - echo '
' . $img['comment_html'] . '
'; - /*echo 'Miniature: ' . $min . '
'; - echo 'Image: ' . $imgf . '
'; */ - echo '
' . $img['upl_date'] . '
'; - if ($can_edit) echo '
delete'; - if ($can_edit) echo '
edit info'; - echo '
'; -} - -echo '
'; -if ($is_owner) { - echo '

Your folders

'; -} else { - echo '

' . $fld["ownername"] . "'s folders

"; -} -echo ''; - -require("tpl/general/bottom.php"); diff --git a/tpl/image/index.php b/tpl/image/index.php deleted file mode 100644 index a89d024..0000000 --- a/tpl/image/index.php +++ /dev/null @@ -1,55 +0,0 @@ -You have uploaded no images yet.
'; -} else { - echo '

You have uploaded ' . count($images) .' images.

'; - echo ''; - echo ''; - foreach ($images as $img) { - $min = $baseurl . $img['id'] . "-min." . $img['extension']; - $imgf = $baseurl . $img['id'] . "." . $img['extension']; - echo ''; - echo ''; - echo ''; - } - echo '
PreviewInfoDate
' . $img['name'] . ''; - if ($img['folder_id'] != 0) { - echo ' (in folder: ' . $img['folder_name'] . ')'; - } - echo '
MD: !['.$img['name'].']('.$imgf.')'; - echo '
' . $img['comment_html'] . '
'; - /*echo 'Miniature: ' . $min . '
'; - echo 'Image: ' . $imgf . '
'; */ - echo '
' . $img['upl_date'] . '
'; - if ($can_delete) echo '
delete'; - if ($can_rename) echo '
edit info'; - echo '
'; -} - -if ($can_upload) { -?> - -
-

Upload an image

-
-A px preview will be created.

-Title :
-
-
- -

-

Your folders

- - -

Preview :
- Image :
- Markdown code : ![]()

-

-

- Back to upload form - = $apps['image']['index']) - echo ' - back to list of uploaded images'; - ?> -

- "Image file : ", "type" => "file", "name" => "image"), - array("label" => "Image title (optionnal) : ", "type" => "text", "name" => "name") - ); -$validate = "Upload"; - -require("tpl/general/form.php"); - - -- cgit v1.2.3