Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Skrypt na datę dodania pliku
niki12345
post 18.07.2009, 15:56:03
Post #1





Grupa: Zarejestrowani
Postów: 6
Pomógł: 0
Dołączył: 18.07.2009

Ostrzeżenie: (0%)
-----


Witam otoz mam swoj upload na forum ale chcialbym do downloadu dorzucic coś takiego jak: Data dodania pliku. Mógłby ktoś podać gotowy skrypt byłbym bardzo wdzięczny
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Pawel_W
post 20.07.2009, 21:34:34
Post #2





Grupa: Zarejestrowani
Postów: 1 675
Pomógł: 286
Dołączył: 15.06.2009
Skąd: Wieliczka

Ostrzeżenie: (0%)
-----


  1. <table width="560" cellspacing="0" cellpadding="5" border="0" class="table_decoration" style="padding-left:6px">
  2. <tr bgcolor="yellow">
  3.   <td align="left" width="46%" height="50"><b>NAZWA PLIKU</b></td>
  4.   <td align="center" width="12%"><b>TYP</b></td>
  5.   <td align="center" width="12%"><b>ROZMIAR</b></td>
  6.   <td align="center" width="15%"><b>FUNKCJE</b></td>
  7.   <td align="center" width="15%"><b>DATA DODANIA</b></td>
  8. </tr>
  9. <?
  10.               for($i=1;$i<=count($sort);$i++)
  11.               {
  12.                   list($key,$value)=each($sort);
  13.  
  14.                   if ($value)
  15.                   {
  16.                       $value_en = base64_encode($value);
  17.                       $value_view=$value;
  18.                      
  19.                           if (strlen($value) >= 48)
  20.                           {
  21.                               $value_view = substr($value_view, 0, 45) . '...';
  22.                           }
  23. ?>
  24. <tr>
  25.   <td width="30%"><?="<a href=\"?act=view&file=$value_en\">$value_view</a>"?></td>
  26.   <td align="center" width="5%"><? echo strtoupper(getlast($value)); ?></td>
  27.   <td align="center" width="5%"><?
  28.  
  29.       $value_full = $dir_store."/".$value;
  30.       $file_size = filesize($value_full);
  31.      
  32.       if ($file_size >= 1048576)
  33.       {
  34.           $show_filesize = number_format(($file_size / 1048576),2) . " MB";
  35.       }
  36.       elseif ($file_size >= 1024)
  37.       {
  38.           $show_filesize = number_format(($file_size / 1024),2) . " KB";
  39.       }
  40.       elseif ($file_size >= 0)
  41.       {
  42.           $show_filesize = $file_size . " bytes";
  43.       }
  44.       else
  45.       {
  46.           $show_filesize = "0 bytes";
  47.       }
  48.  
  49.       echo "$show_filesize";
  50.      
  51. ?></td>
  52.   <td align="center" width="5%"><?="<a title=\"view\" href=\"?act=view&file=$value_en\">&lt;view&gt;</a>"?> |
  53. <?
  54.   if ($file_del_allow == 1)
  55.   {
  56.       echo"<a title=\"download\" href=\"?act=dl&file=$value_en\">&lt;dl&gt;</a>";
  57.    }
  58.   else
  59.   {
  60.       echo"<a title=\"Download file\" href=\"?act=dl&file=$value_en\">&lt;download&gt;</a>";
  61.   }
  62.  
  63.   if ($file_del_allow == 1)
  64.   {
  65.       echo"&nbsp;|&nbsp;<a title=\"Delete file\" href=\"java script:;\" onClick=\"cf=confirm('Are you sure you want to delete this file?');if (cf)window.location='?act=del&file=$value_en'; return false;\">&lt;delete&gt;</a>";
  66.   }
  67.   else
  68.   {
  69.       echo"&nbsp;";
  70.   }
  71. ?>
  72.   </td>
  73. <td>
  74. <?php
  75. echo date("d.m.Y, H:i", filemtime($value_full));
  76. ?>
  77. </td>
  78. </tr>

zamień na
  1. <table width="560" cellspacing="0" cellpadding="5" border="0" class="table_decoration" style="padding-left:6px">
  2. <tr bgcolor="yellow">
  3.   <td align="left" width="46%" height="50"><b>NAZWA PLIKU</b></td>
  4.   <td align="center" width="12%"><b>TYP</b></td>
  5.   <td align="center" width="12%"><b>ROZMIAR</b></td>
  6.   <td align="center" width="30%"><b>FUNKCJE</b></td>
  7. </tr>
  8. <?
  9.               for($i=1;$i<=count($sort);$i++)
  10.               {
  11.                   list($key,$value)=each($sort);
  12.  
  13.                   if ($value)
  14.                   {
  15.                       $value_en = base64_encode($value);
  16.                       $value_view=$value;
  17.                      
  18.                           if (strlen($value) >= 48)
  19.                           {
  20.                               $value_view = substr($value_view, 0, 45) . '...';
  21.                           }
  22. ?>
  23. <tr>
  24.   <td width="30%"><?="<a href=\"?act=view&file=$value_en\">$value_view</a>"?></td>
  25.   <td align="center" width="5%"><? echo strtoupper(getlast($value)); ?></td>
  26.   <td align="center" width="5%"><?
  27.  
  28.       $value_full = $dir_store."/".$value;
  29.       $file_size = filesize($value_full);
  30.      
  31.       if ($file_size >= 1048576)
  32.       {
  33.           $show_filesize = number_format(($file_size / 1048576),2) . " MB";
  34.       }
  35.       elseif ($file_size >= 1024)
  36.       {
  37.           $show_filesize = number_format(($file_size / 1024),2) . " KB";
  38.       }
  39.       elseif ($file_size >= 0)
  40.       {
  41.           $show_filesize = $file_size . " bytes";
  42.       }
  43.       else
  44.       {
  45.           $show_filesize = "0 bytes";
  46.       }
  47.  
  48.       echo "$show_filesize";
  49.      
  50. ?></td>
  51.   <td align="center" width="5%"><?="<a title=\"view\" href=\"?act=view&file=$value_en\">&lt;view&gt;</a>"?> |
  52. <?
  53.   if ($file_del_allow == 1)
  54.   {
  55.       echo"<a title=\"download\" href=\"?act=dl&file=$value_en\">&lt;dl&gt;</a>";
  56.    }
  57.   else
  58.   {
  59.       echo"<a title=\"Download file\" href=\"?act=dl&file=$value_en\">&lt;download&gt;</a>";
  60.   }
  61.  
  62.   if ($file_del_allow == 1)
  63.   {
  64.       echo"&nbsp;|&nbsp;<a title=\"Delete file\" href=\"java script:;\" onClick=\"cf=confirm('Are you sure you want to delete this file?');if (cf)window.location='?act=del&file=$value_en'; return false;\">&lt;delete&gt;</a>";
  65.   }
  66.   else
  67.   {
  68.       echo"&nbsp;";
  69.   }
  70. ?>
  71.   </td>
  72. </tr>

o ile zmienna $value_full zawiera ścieżkę winksmiley.jpg
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 20:11