diff --git a/classes/FileItem.php b/classes/FileItem.php
index d8ccfc0..5da80ac 100644
--- a/classes/FileItem.php
+++ b/classes/FileItem.php
@@ -319,24 +319,73 @@ class FileItem extends Item
}
$size = $this->size->__get('bytes');
/* */
- if (($size < 1048576) && in_array(self::ext($filename), array('pdf', 'PDF')))
+ if (($size < 1048576000) && in_array(self::ext($filename), array('pdf', 'PDF')))
{
$icon_pdf = ICON_PATH ? Url::translate_uri($config->__get('icon_path') . 'pdf.png') : Url::translate_uri($this->parent_dir . $filename);
$heightwidth = in_array(self::ext($filename), array('pdf', 'PDF')) ? ' height="' . '150' . '" width="' . '150' . '" ' : ' ';
$this->thumb_link .= '
';
+ . ' />';
- $content = false;
+ $date = array();
+ $stringedPDF = $contentpdf = $creationdate = $str_time = $creation_time = $time = false;
$pfdcontent = file_get_contents(Url::translate_uri($this->parent_dir . $filename));
-
- $contentpdf = explode(']*width=\"(.*)\"\/>/isU', 'parent_dir . $filename))));
+ //echo(' ' . $split['year'] .' '. $split['month'] .' '. $split['day'] .' '. $split['hour'] .' '. $split['minute'] .' '. $split['second']);
+
+ $str_time = $split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second'];
+ $time = strtotime($split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second']);
+
+ if ($request->is_request('restorecdate', TYPE_NO_TAGS) && touch(Url::translate_uri($this->parent_dir . $filename), $time))
+ {
+ $creationdate = date("Y-m-d H:i:s", filemtime(Url::translate_uri($this->parent_dir . $filename)));
+ }
+ else
+ {
+ $creationdate = date("Y-m-d H:i:s", $time);
+ }
+ }
+ else if (preg_match('/ModDate\\s*\\(D:([0-9]{14})/', $pfdcontent, $date))
+ {
+ $creation_time = $date[1];
+ $split = date_parse_from_format('Ymdhis', $creation_time);
+
+ $str_time = $split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second'];
+ $time = strtotime($split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second']);
+
+ if ($request->is_request('restorecdate', TYPE_NO_TAGS) && touch(Url::translate_uri($this->parent_dir . $filename), $time))
+ {
+ $creationdate = date("Y-m-d H:i:s", filemtime(Url::translate_uri($this->parent_dir . $filename)));
+ }
+ else
+ {
+ $creationdate = date("Y-m-d H:i:s", $time);
+ }
+ //echo(' creation date: '.$creationdate);
+ }
+ else if (preg_match('/M\\s*\\(D:([0-9]{14})/', $pfdcontent, $date))
+ {
+ $creation_time = $date[1];
+ $split = date_parse_from_format('Ymdhis', $creation_time);
+
+ $str_time = $split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second'];
+ $time = strtotime($split['year']."-".$split['month']."-".$split['day']." ".$split['hour'].":".$split['minute'].":".$split['second']);
+
+ if ($request->is_request('restorecdate', TYPE_NO_TAGS) && touch(Url::translate_uri($this->parent_dir . $filename), $time))
+ {
+ $creationdate = date("Y-m-d H:i:s", filemtime(Url::translate_uri($this->parent_dir . $filename)));
+ }
+ else
+ {
+ $creationdate = date("Y-m-d H:i:s", $time);
+ }
+ //echo(' creation date: '.$creationdate);
}
}
/* */