Changeset 537 for trunk

Show
Ignore:
Timestamp:
05/09/08 14:32:35 (7 months ago)
Author:
sidtheduck
Message:

+ Fix for ticket #78 - uses the md5 file key of uploaded files as a unique id for import- thumb prefix.
(may be a little messy with the long filenames, but I couldn't think of an easier way at the moment to do unique names for import thumbs)

Location:
trunk/admin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/plog-import.php

    r536 r537  
    102102                                                        $imported++; 
    103103                                                        // delete thumbnail file if it exists 
    104                                                         $thumbpath = $config['basedir'] . 'thumbs/import-' . basename($file_name); 
     104                                                        $thumbpath = $config['basedir'] . 'thumbs/import-'.$file_key.'-'.basename($file_name); 
    105105                                                        if (is_file($thumbpath) && is_readable($thumbpath)) 
    106106                                                        { 
  • trunk/admin/plog-thumb.php

    r445 r537  
    33// first it will be used for import only. 
    44 
    5 if (empty($_GET["img"])) { 
     5if (empty($_GET['img'])) { 
    66        return "No such image"; 
    7 }; 
     7} 
    88 
    99require_once("../plog-functions.php"); 
     
    1313 
    1414 
    15 $files = get_files($config['basedir'] . 'uploads'); 
     15$files = get_files($config['basedir'] . "uploads"); 
    1616 
    1717 
     
    1919$found = false; 
    2020 
    21 $up_dir = $config['basedir'] . 'uploads'; 
     21$up_dir = $config['basedir'] . "uploads"; 
    2222 
    2323foreach($files as $file) { 
    24         if (md5($file) == $_GET["img"]) { 
     24        if (md5($file) == $_GET['img']) { 
    2525                $found = true; 
    2626                $rname = substr($file,strlen($up_dir)+1); 
    2727 
    28                 $thumbpath = generate_thumb($up_dir.'/'.$rname,"import",THUMB_SMALL); 
     28                $thumbpath = generate_thumb($up_dir.'/'.$rname,"import-".md5($file),THUMB_SMALL); 
    2929                print '<img src="'.$thumbpath.'" /></div>'; 
    3030                //print "found $relative_name!"; 
    3131                break; 
    32         }; 
    33 }; 
     32        } 
     33} 
    3434 
    3535?>