]> git.p6c8.net - jirafeau/pcanterino.git/blobdiff - lib/functions.php
Updated CHANGELOG
[jirafeau/pcanterino.git] / lib / functions.php
index 7ac4c9e3f4eb18fb27c2e443131e339b1cf54227..84bcea8ebaff44c805ac6a33d4b03c8abcd39c32 100644 (file)
@@ -623,7 +623,7 @@ function jirafeau_is_viewable($mime)
     if (!empty($mime)) {
         $viewable = array('image', 'video', 'audio');
         $decomposed = explode('/', $mime);
-        if (in_array($decomposed[0], $viewable) && stripos($mime, 'image/svg+xml') === false) {
+        if (in_array($decomposed[0], $viewable) && stripos($mime, 'image/svg+xml') === false && strpos($mime, ',') === false) {
             return true;
         }
         $viewable = array('text/plain');
@@ -771,6 +771,9 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
                     if (!empty($link_hash) && $link_hash != $node) {
                         continue;
                     }
+
+                    /* Get download statistics */
+                    $ld = jirafeau_get_download_stats($node);
                     /* Print link information. */
                     echo '<tr>';
                     echo '<td><strong>';
@@ -793,6 +796,11 @@ function jirafeau_admin_list($name, $file_hash, $link_hash)
                     if (strlen($l['ip']) > 0) {
                         echo t('ORIGIN') . ': ' . $l['ip'] . '<br/>';
                     }
+                    echo t('DOWNLOAD_COUNT') . ': ' . $ld['count'] . '<br/>';
+                    if ($ld['count'] > 0) {
+                        echo t('DOWNLOAD_DATE') . ': ' . jirafeau_get_datetimefield($ld['date']) . '<br/>';
+                        echo t('DOWNLOAD_IP') . ': ' . $ld['ip'] . '<br/>';
+                    }
                     echo '</td><td>';
 
                     if (!$l['crypted'] && !$l['crypted_legacy']) {
@@ -1779,7 +1787,7 @@ function jirafeau_write_download_stats($hash, $ip)
     fclose($handle);
 }
 
-function jirafeau_create_upload_finished_box($preview = true)
+function jirafeau_create_upload_finished_box($preview = true, $download_pass = null)
 {
     ?>
 
@@ -1796,6 +1804,21 @@ function jirafeau_create_upload_finished_box($preview = true)
     </p>
     </div>
 
+    <?php if (!is_null($download_pass)) { ?>
+    <div id="show_password">
+    <p><?php echo t('PSW') ?></p>
+
+    <div id="download_password">
+    <p>
+        <?php echo '<input id="output_key" value="' . $download_pass . '" readonly/>'?>
+        <button id="password_copy_button">&#128203;</button>
+    </p>
+    </div>
+    </div>
+    <?php
+    }?>
+
+
     <?php
     if ($preview == true) { ?>
     <div id="upload_finished_preview">

patrick-canterino.de