Changeset 4783


Ignore:
Timestamp:
Jan 28, 2010, 10:01:16 PM (11 years ago)
Author:
plg
Message:

bug 1404 fixed: the original filename is not used directly as photo title
anymore. Instead we fill the images.file with the original filename and
then Piwigo displays a default title based on images.file content, but without
"_" or ".jpg" extension.

Location:
extensions/upload_form
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/upload_form/include/functions_upload.inc.php

    r4739 r4783  
    2626$page['source_file'] = '/home/pierrick/public_html/test/resize/phpthumb/examples/statue_small.jpg';
    2727
    28 function add_uploaded_file($source_filepath, $name=null, $categories=null)
     28function add_uploaded_file($source_filepath, $original_filename=null, $categories=null)
    2929{
    3030  global $page;
     
    8181  // database registration
    8282  $insert = array(
    83     'file' => basename($file_path),
     83    'file' => isset($original_filename) ? $original_filename : basename($file_path),
    8484    'date_available' => $dbnow,
    8585    'tn_ext' => 'jpg',
     
    9191    );
    9292
    93   if (isset($name))
    94   {
    95     $insert['name'] = $name;
    96   }
    97 
    9893  if (isset($high_infos))
    9994  {
  • extensions/upload_form/upload.php

    r4740 r4783  
    5151    {
    5252      $source_filepath = $_FILES['image_upload']['tmp_name'][$idx];
    53       $name = $_FILES['image_upload']['name'][$idx];
    54       add_uploaded_file($source_filepath, $name, array($_POST['category']));
     53      $original_filename = $_FILES['image_upload']['name'][$idx];
     54      add_uploaded_file($source_filepath, $original_filename, array($_POST['category']));
    5555    }
    5656  }
Note: See TracChangeset for help on using the changeset viewer.