• Resolved prometeus

    (@prometeus)


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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter prometeus

    (@prometeus)

    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;
    		}

    Alex Rabe

    (@alexrabe)

    thanks for the info, please keep in mind it’s a development version…

    Alex Rabe

    (@alexrabe)

    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;
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: NextGEN Gallery] Add gallery in 1.7.0a not working’ is closed to new replies.