continue with the install. If you are using a nuke portal, you might want to take a look into CpgNuke or use one of the (unsupported) coppermine ports - do not continue!" ); } // end check // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting (E_ALL ^ E_NOTICE); require('include/sql_parse.php'); // ---------------------------- TEST PREREQUIRED --------------------------- // function test_fs() { global $errors, $DFLT; // include must be writable to create config file if (! is_dir($DFLT['cfg_d'])) { $errors .= "
A subdirectory called '{$DFLT['cfg_d']}' should normally exist in the directory where you uploaded Coppermine. The installer can't find this directory. Check that you have uploaded all Coppermine files to your server.
The '{$DFLT['cfg_d']}' directory (located in the directory where you uploaded Coppermine) should be writable in order to save your configuration. Use your FTP program to change its mode to 777.
"; } // albums must be writable to upload pictures if (! is_dir($DFLT['alb_d'])) { $errors .= "
A subdirectory called '{$DFLT['alb_d']}' should normally exist in the directory where you uploaded Coppermine. The installer can't find this directory. Check that you have uploaded all Coppermine files to your server.
The '{$DFLT['alb_d']}' directory (located in the directory where you uploaded Coppermine) should be writable in order to allow pictures upload. Use your FTP program to change its mode to 777.
"; } // userpics must be writable to upload pictures if (! is_dir("{$DFLT['alb_d']}/{$DFLT['upl_d']}")) { $errors .= "
A subdirectory called '{$DFLT['upl_d']}' should normally exist in the 'albums' directory. The installer can't find this directory. Check that you have uploaded all Coppermine files to your server.
The '{$DFLT['upl_d']}' directory (located in the 'albums' directory on your server) should be writable in order to allow pictures upload. Use your FTP program to change its mode to 777.
"; } // edit must be writable to edit pictures if (! is_dir("{$DFLT['alb_d']}/{$DFLT['edit_d']}")) { $errors .= "
A subdirectory called '{$DFLT['edit_d']}' should normally exist in the 'albums' directory. The installer can't find this directory. Check that you have uploaded all Coppermine files to your server.
The '{$DFLT['edit_d']}' directory (located in the 'albums' directory on your server) should be writable in order to allow pictures upload. Use your FTP program to change its mode to 777.
"; } // sql directory must exist if (! is_dir("{$DFLT['sql_d']}")) { $errors .= "
A subdirectory called '{$DFLT['sql_d']}' should normally exist in the directory where you uploaded Coppermine. The installer can't find this directory. Check that you have uploaded all Coppermine files to your server.
"; } } // ----------------------------- TEST FUNCTIONS ---------------------------- // function test_sql_connection() { global $errors; if (!function_exists('mysql_connect')){ $errors .= "
mySQL could not locate a database called '{$_POST['dbname']}' please check the value entered for this
"; } } function test_admin_login() { global $errors; if ($_POST['admin_username'] == '' || $_POST['admin_password'] == '') $errors .= "
It is much better for you to provide a 'username' and a 'password' for the admin.
"; if (!preg_match('/\A\w*\Z/', $_POST['admin_username']) || !preg_match('/\A\w*\Z/', $_POST['admin_password'])) $errors .= "
Admin username and password must only contain alphanumeric characters.
"; } function test_im() { global $errors, $DFLT, $im_installed; $im_installed = false; if ($_POST['impath'] != '') { if (!preg_match('|/\Z|', $_POST['impath'])) $_POST['impath'] .= '/'; if (!is_dir($_POST['impath'])) { $errors .= "
The installer can not find the '{$_POST['impath']}' directory you have specified for ImageMagick or it does not have permission to access it. Check that your typing is correct and that you have access to the specified directory.
The installer can not find the 'convert' or 'convert.exe' ImageMagick program in directory '{$_POST['impath']}'. Check that you have entered the correct directory name.
The installer found the ImageMagick 'convert' program in '{$_POST['impath']}', however it can't be executed by the script.
You may consider using GD instead of ImageMagick.
"; if ($result && count($output)) { $errors .= "The convert program said:
";
foreach($output as $line) $errors .= htmlspecialchars($line);
$errors .= "
"; } } } return $im_installed; } // Test is safe_mode is misconfigured function test_silly_safe_mode() { global $DFLT; $test_file = "{$DFLT['alb_d']}/{$DFLT['upl_d']}/dummy/dummy.txt"; @mkdir(dirname($test_file), 0755); $fd = @fopen($test_file, 'w'); if (!$fd) { @rmdir(dirname($test_file)); return true; } fclose($fd); @unlink($test_file); @rmdir(dirname($test_file)); } // -------------------------- DETECTION FUNCTIONS -------------------------- // // What package is available for image manipulations function detect_img_package() { global $errors, $notes, $DFLT, $im_installed; $no_img_package_detected = false; $tst_image = "{$DFLT['alb_d']}/{$DFLT['upl_d']}/gd1.jpg"; $size = @getimagesize($tst_image); @unlink($tst_image); $gd1_installed = ($size[2] == 2); $tst_image = "{$DFLT['alb_d']}/{$DFLT['upl_d']}/gd2.jpg"; $size = @getimagesize($tst_image); @unlink($tst_image); $gd2_installed = ($size[2] == 2); if ($im_installed) { $_POST['thumb_method'] = 'im'; } elseif ($gd2_installed) { $_POST['thumb_method'] = 'gd2'; } elseif ($gd1_installed) { $_POST['thumb_method'] = 'gd1'; } else { $_POST['thumb_method'] = 'gd2'; $no_img_package_detected = true; $notes .= "
Your installation of PHP does not seem to include the 'GD' graphic library extension and you have not indicated that you want to use ImageMagick. Coppermine has been configured to use GD2 because the automatic GD detection sometimes fail. If GD is installed on your system, the script should work else you will need to install ImageMagick.
"; } if (!$no_img_package_detected) $notes .= "
Your server supports the following image package(s): " . ($im_installed ? ' ImageMagick (im),':'') . ($gd1_installed ? ' GD Library version 1.x (gd1),':'') . ($gd2_installed ? ' GD Library version 2.x (gd2),':'') . " the installer selected '" . $_POST['thumb_method'] . "'."; if ($_POST['thumb_method'] == 'gd1' || $_POST['thumb_method'] == 'gd2') $notes .= "
Important : older versions of the GD graphic library support only JPEG and PNG images. If this is the case for you, then the script will not be able to create thumbnails for GIF images."; } // ------------------------- HTML OUTPUT FUNCTIONS ------------------------- // function html_header() { ?>