Support » Plugin: UploadPlus : File Name Cleaner » [Plugin: Upload ] File name suffix

  • Resolved difreo


    I added option “wordpress style” wich adds the suffix to the filename just like the wordpress uploader does it. If the filename is not unique, then a number will be added to the filename before the extension, and will continue adding numbers until the filename is unique. I think its better then the looong timestamps etc. I hope the author will check this out.

    In the plugins uploadplus.php
    added to the switch:

    $standard = get_option('uploadplus_prefix');
    //here goes the standard code
    //and below what i added
    case "B":
    $uploads = wp_upload_dir();
    $dir = ( $uploads['path'] );
    $filename = wp_unique_filename( $dir, $file_name, $unique_filename_callback = null );
    $file_name = $filename;

    and here:

    $otherstyles = array(
    	"7" => '[random (mt-rand)] '.mt_rand().$sep,
    	"8" => '[random md5(mt-rand)] '.md5(mt_rand()).$sep,
     	"9" => '[blog name] '.str_replace( array(".", " ", "-", "_") ,$sep,strtolower(get_bloginfo('name'))).$sep,
     	"A" => '[short blog name] '.str_replace( array(".","_","-"," "),"",strtolower(get_bloginfo('name'))).$sep,
    	"B" => 'wordpress style' // added this option

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Upload ] File name suffix’ is closed to new replies.