| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | require_once('lib/init.php'); |
|---|
| 28 | |
|---|
| 29 | $filetypes = ''; |
|---|
| 30 | foreach ($mime as $f) { |
|---|
| 31 | $filetypes .= $f . ', '; |
|---|
| 32 | } |
|---|
| 33 | $filetypes = substr($filetypes, 0, -2); |
|---|
| 34 | |
|---|
| 35 | $tagjs = '<script src="js/jquery.tag.js" type="text/javascript"></script>'; |
|---|
| 36 | $tagjs .= '<script type="text/javascript">'; |
|---|
| 37 | $tagjs .= "$(function () { |
|---|
| 38 | $('#inputtags').attr('autocomplete', 'off'); |
|---|
| 39 | $('#inputtags').tagSuggest({ |
|---|
| 40 | url: 'tags.php', |
|---|
| 41 | delay: 250, |
|---|
| 42 | separator: ', ', |
|---|
| 43 | tagContainer: 'p', |
|---|
| 44 | }); |
|---|
| 45 | }); |
|---|
| 46 | |
|---|
| 47 | $(document).ready(function () { |
|---|
| 48 | $('#addimage').click(function() { |
|---|
| 49 | $('#addimage').remove(); |
|---|
| 50 | $('#inputimagecontainer').append('<span class=\"text\"> </span><input type=\"file\" size=\"39\" name=\"image[]\" /> ' + |
|---|
| 51 | '<img src=\"images/add.png\" id=\"addimage\" alt=\"Add another image\" title=\"Add another image\" /><br /><br />'); |
|---|
| 52 | $('#addimage').click(arguments.callee); |
|---|
| 53 | }); |
|---|
| 54 | }); |
|---|
| 55 | </script>"; |
|---|
| 56 | |
|---|
| 57 | $content = '<form action="upload.php" method="post" enctype="multipart/form-data"> |
|---|
| 58 | <div> |
|---|
| 59 | <input type="hidden" name="MAX_FILE_SIZE" value="' . $maxsize.'" /> |
|---|
| 60 | <div id="inputimagecontainer"> |
|---|
| 61 | <span class="text">File:</span><input type="file" size="39" name="image[]" /> |
|---|
| 62 | <img src="images/add.png" id="addimage" alt="Add another image" title="Add another image" /><br /><br /> |
|---|
| 63 | </div> |
|---|
| 64 | <span class="text">Tags:</span><input id="inputtags" type="text" size="39" name="tags" /> |
|---|
| 65 | <span class="text"> </span><input id="submit" type="submit" name="submit" value="Upload" /> |
|---|
| 66 | <p id="info"> |
|---|
| 67 | Maximum upload size: ' . byteConvert($maxsize) . '<br /> |
|---|
| 68 | Allowed file types: ' . $filetypes . '<br /> |
|---|
| 69 | Use , (comma) to seperate tags |
|---|
| 70 | </p> |
|---|
| 71 | <p id="browse"><a href="browse.php">Browse</a> | <a href="search.php">Search</a></p> |
|---|
| 72 | </div> |
|---|
| 73 | </form>'; |
|---|
| 74 | |
|---|
| 75 | outputHTML($content, array('header' => $tagjs)); |
|---|
| 76 | |
|---|
| 77 | ?> |
|---|