WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Add gallery in 1.7.0a not working (4 posts)

  1. prometeus
    Member
    Posted 3 years ago #

    The gallery path is not set, when you add a new gallery in version 1.7.0a.

  2. prometeus
    Member
    Posted 3 years ago #

    Found this piece of coding in the function.php folder.
    That is not working.
    It has to do in setting the $alt_name but I'm no coder.
    I've replace the code piece of code of the old 1.6 nextgen with some adjustmenst for the the new naming of gallery variables.
    And first test seems to work
    ########## shameless hack without knowing concequences ##
    $nggpath = $defaultpath . $name;

    if ( !is_dir(WINABSPATH . $nggpath) ) {
    			if ( !wp_mkdir_p (WINABSPATH . $nggpath) )
    				$txt  = __('Unable to create directory ', 'nggallery').$nggpath.'!<br />';
    		}

    ########## Code not working ###############

    if ( is_dir(WINABSPATH . $defaultpath . $name ) ) {
    			$suffix = 1;
    			do {
    				$alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix";
    				$dir_check = is_dir(WINABSPATH . $defaultpath . $alt_name );
    				$suffix++;
    			} while ( $dir_check );
    			$name = $alt_name;
             $nggpath = $defaultpath . $name;
    		}
  3. Alex Rabe
    Member
    Posted 3 years ago #

    thanks for the info, please keep in mind it's a development version...

  4. Alex Rabe
    Member
    Posted 3 years ago #

    Here is the fix :

    if ( is_dir(WINABSPATH . $defaultpath . $name ) ) {
    			$suffix = 1;
    			do {
    				$alt_name = substr ($name, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "_$suffix";
    				$dir_check = is_dir(WINABSPATH . $defaultpath . $alt_name );
    				$suffix++;
    			} while ( $dir_check );
    			$name = $alt_name;
     		}
    $nggpath = $defaultpath . $name;

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.