|
7 | 7 | <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
|
8 | 8 | <link rel="stylesheet" href="dropzone/dropzone.css" type="text/css">
|
9 | 9 | <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
| 10 | +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.css" type="text/css"> |
10 | 11 | <!-- Place this tag in your head or just before your close body tag. -->
|
11 | 12 | <script async defer src="https://buttons.github.io/buttons.js"></script>
|
12 | 13 | </head>
|
|
15 | 16 | //deleteing images
|
16 | 17 | if(isset($_REQUEST['img']) and $_REQUEST['img']!=""){
|
17 | 18 | @unlink('uploads/'.$_REQUEST['img']);
|
| 19 | + @unlink('uploads/thumb/'.$_REQUEST['img']); |
18 | 20 | $msg = '<div class="alert alert-success">Image delete successfully.</div>';
|
19 | 21 | }
|
20 | 22 | ?>
|
|
29 | 31 | <!-- Place this tag where you want the button to render. -->
|
30 | 32 | <a class="github-button" href="https://github.com/learncodeweb" data-style="mega" data-show-count="true" aria-label="Follow @learncodeweb on GitHub">Follow @LCW</a>
|
31 | 33 | <!-- Place this tag where you want the button to render. -->
|
32 |
| - <a class="github-button" href="https://github.com/learncodeweb/Dropzone-with-Image-Resizer" data-icon="octicon-star" data-style="mega" data-show-count="true" aria-label="Star learncodeweb/Dropzone-with-Image-Resizer on GitHub">Star</a> |
| 34 | + <a class="github-button" href="https://github.com/learncodeweb/Dropzone-with-PHP-Image-Resizer" data-icon="octicon-star" data-style="mega" data-show-count="true" aria-label="Star learncodeweb/Dropzone-with-PHP-Image-Resizer on GitHub">Star</a> |
33 | 35 | <div id="msg"><?php echo isset($msg)?$msg:''; ?></div>
|
34 | 36 | <div class="card">
|
35 | 37 | <div class="card-header"><i class="glyphicon glyphicon-upload"></i> Upload Multiple Files</div>
|
|
60 | 62 | <div class="card-body" style="overflow-y: scroll">
|
61 | 63 | <div class="card-columns">
|
62 | 64 | <?php
|
63 |
| - $directory = 'uploads'; |
| 65 | + $directory = 'uploads/thumb'; |
64 | 66 | $scanned_directory = array_diff(scandir($directory), array('..', '.'));
|
65 | 67 | foreach($scanned_directory as $img){
|
66 | 68 | ?>
|
67 | 69 | <div class="card">
|
68 |
| - <img src="uploads/<?php echo $img; ?>" alt="<?php echo $img; ?>"> |
| 70 | + <a href="uploads/<?php echo $img; ?>" data-fancybox="true"> <img src="uploads/thumb/<?php echo $img; ?>" alt="<?php echo $img; ?>" class="img-thumbnail"></a> |
69 | 71 | <div class="card-body">
|
70 | 72 | <a href="index.php?img=<?php echo $img; ?>" class="btn btn-block btn-danger"><i class="fa fa-trash"></i></a>
|
71 | 73 | </div>
|
|
81 | 83 | <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
|
82 | 84 | <!--Only these JS files are necessary-->
|
83 | 85 | <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
|
| 86 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.js"></script> |
84 | 87 | <script src="dropzone/dropzone.js"></script>
|
85 | 88 | <script>
|
86 | 89 | //Dropzone script
|
|
92 | 95 | uploadMultiple: true,
|
93 | 96 | autoProcessQueue: false,
|
94 | 97 | parallelUploads: 50,
|
95 |
| - maxFilesize: 2, // MB |
| 98 | + maxFilesize: 30, // MB |
96 | 99 | acceptedFiles: ".png, .jpeg, .jpg, .gif",
|
97 | 100 | url: "ajax/actions.ajax.php",
|
98 | 101 | });
|
|
0 commit comments