close
 
'; } if ($header) { $string = "\n\n".$header."\n" . '' . "\n\n\n

" . $header . "

\n" . $text . "\n".$close_link."\n\n"; } print $string; die; } // pop-up end // check if we're using a version older than cpg1.4.0, if yes use hard-coded language (english) if (is_array($lang_versioncheck_php) == false) { $older_version = true; } $local_lang_versioncheck_php = array( 'title' => 'Versioncheck', 'what_it_does' => 'This page is meant for users who have updated their coppermine install. This script goes through the files on your webserver and tries to determine if your local file versions on the webserver are the same as the ones from the repository at http://coppermine.sourceforge.net, this way displaying the files you were meant to update as well.
It will show everything in red that needs to be fixed. Entries in yellow need looking into. Entries in green (or your default font color) are OK.
Click on the help icons to find out more.', 'online_repository_unable' => 'Unable to connect to online repository', 'online_repository_noconnect' => 'Coppermine was unable to connect to the online repository. This can have two reasons:', 'online_repository_reason1' => 'the coppermine online repository is currently down - check if you can browse this page: %s - if you can\'t access this page, try again later.', 'online_repository_reason2' => 'PHP on your webserver is configured with %s turned off (by default, it\'s turned on). If the server is yours to administer, turn this option on in php.ini (at least allow it to be overridden with %s). If you\'re webhosted, you will probably have to live with the fact that you can\'t compare your files to the online repository. This page will then only display the file versions that came with your distribution - updates will not be displayed.', 'online_repository_skipped' => 'Connection to online repository skipped', 'online_repository_to_local' => 'The script is defaulting to the local copy of the version-files now. The data may be inacurate if you have upgraded Coppermine and you haven\'t uploaded all files. Changes to the files after the release won\'t be taken into account as well.', 'local_repository_unable' => 'Unable to connect to the repository on your server', 'local_repository_explanation' => 'Coppermine was unable to connect to the repository file %s on your webserver. This probably means that you haven\'t uploaded the repository file to your webserver. Do so now and then try to run this page once more (hit refresh).
If the script still fails, your webhost might have disabled parts of PHP\'s filesystem functions completely. In this case, you simply won\'t be able to use this tool at all, sorry.', 'coppermine_version_header' => 'Installed Coppermine version', 'coppermine_version_info' => 'You have currently installed: %s', 'coppermine_version_explanation' => 'If you think this is entirely wrong and you\'re supposed to be running a higher version of Coppermine, you probably haven\'t uploaded the most recent version of the file include/init.inc.php', 'version_comparison' => 'Version comparison', 'folder_file' => 'folder/file', 'coppermine_version' => 'cpg version', 'file_version' => 'file version', 'webcvs' => 'web cvs', 'writable' => 'writable', 'not_writable' => 'not writable', 'help' => 'Help', 'help_file_not_exist_optional1' => 'file/folder does not exist', 'help_file_not_exist_optional2' => 'The file/folder %s has not been found on your server. Although it is optional you should upload it (using your FTP client) to your webserver if you are experiencing problems.', 'help_file_not_exist_mandatory1' => 'file/folder does not exist', 'help_file_not_exist_mandatory2' => 'The file/folder %s has not been found on your server, although it is mandatory. Upload the file to your webserver (using your FTP client).', 'help_no_local_version1' => 'No local file version', 'help_no_local_version2' => 'The script was unable to extract a local file version - your file is either outdated or you have modified it, removing the header information on the way. Updating the file is recommended.', 'help_local_version_outdated1' => 'Local version outdated', 'help_local_version_outdated2' => 'Your version of this file seems to be from an older version of Coppermine (you probably upgraded). Make sure to update this file as well. There might have been changes to this file after the release of the package - check the web cvs as well to look for an update.', 'help_local_version_na1' => 'Unable to extract cvs version info', 'help_local_version_na2' => 'The script could not determine what cvs version the file on your webserver is. You should upload the file from your package.', 'help_local_version_dev1' => 'Development version', 'help_local_version_dev2' => 'The file on your webserver seems to be newer than your Coppermine version. You are either using a development file (you should only do so if you know what you are doing), or you have upgraded your Coppermine install and not uploaded include/init.inc.php', 'help_not_writable1' => 'Folder not writable', 'help_not_writable2' => 'Change file permissions (CHMOD) to grant the script write access to the folder %s and everything within it.', 'help_writable1' => 'Folder writable', 'help_writable2' => 'The folder %s is writable. This is an unnecessary risk, coppermine only needs read/execute access.', 'help_writable_undetermined' => 'Coppermine was not able to determine wether the folder is writable.', 'your_file' => 'your file', 'reference_file' => 'reference file', 'summary' => 'Summary', 'total' => 'Total files/folders checked', 'mandatory_files_missing' => 'Mandatory files missing', 'optional_files_missing' => 'Optional files missing', 'files_from_older_version' => 'Files left over from outdated Coppermine version', 'file_version_outdated' => 'Outdated file versions', 'error_no_data' => 'The script made a boo, it was not able to retrieve any information. Sorry for the inconvenience.', 'go_to_webcvs' => 'go to %s', 'options' => 'Options', 'show_optional_files' => 'show optional folders/files', 'show_mandatory_files' => 'show mandatory files', 'show_file_versions' => 'show file versions', 'show_errors_only' => 'show folders/files with errors only', 'show_permissions' => 'show folder permissions', 'show_condensed_output' => 'show condensed ouput (for easier screenshots)', 'coppermine_in_webroot' => 'coppermine is installed in the webroot', 'connect_online_repository' => 'try connecting to the online repository', 'show_additional_information' => 'show additional information', 'no_webcvs_link' => 'don\'t display web cvs link', 'stable_webcvs_link' => 'display web cvs link to stable branch', 'devel_webcvs_link' => 'display web cvs link to devel branch', 'submit' => 'apply changes', 'reset_to_defaults' => 'reset to default values', ); foreach($local_lang_versioncheck_php as $key => $value) { if ($lang_versioncheck_php[$key] == '') { $lang_versioncheck_php[$key] = $value;} //print $key.'|'.$value.'
'; } if (function_exists('cpg_display_help') == false ) { function cpg_display_help($reference = '', $width = '600', $height = '350') { global $CONFIG, $USER; if ($reference == '' || $CONFIG['enable_help'] == '0') {return; } if ($CONFIG['enable_help'] == '2' && GALLERY_ADMIN_MODE == false) {return; } $help_theme = $CONFIG['theme']; if ($USER['theme']) { $help_theme = $USER['theme']; } // check if the help icon is there. If it isn't, display a plain question mark if (file_exists('images/help.gif') == true) { $help_icon = ''; } else { $help_icon = ' ? '; } $help_html = "".$help_icon.""; return $help_html; } } if ($condensed_output == 1) {$table_width = '-1';} else {$table_width = '100%';} pageheader($lang_versioncheck_php['title']); starttable($table_width, $lang_versioncheck_php['title'], $number_of_columns); if ($additional_info != 0) { //display explanation what this file does: start echo <<< EOT {$lang_versioncheck_php['what_it_does']} EOT; } //display explanation what this file does: start echo <<< EOT EOT; if (isset($older_version) && $additional_info != 0) { echo << As this file didn't come with your original version of Coppermine or was added to the package after translation was already done, there's no internationalisation - it is available in English only. EOT; } // step x: display the options $form_output = '
'; $form_output .= ''; $form_output .= '

'.$lang_versioncheck_php['options'].'

'; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= '
'; if($optional_files == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $option_checked = $optional_files ? 'checked="checked"' : ''; $form_output .= ''; $form_output .= ''; if($errors_only == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($webcvs == 0) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= '
'; if($mandatory_files == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($webroot == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($webcvs == 'stable') {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= '
'; if($additional_info == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($online == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($webcvs == 'devel') {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= '
'; if($file_versions == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($permissions == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= ''; if($condensed_output == 1) {$option_checked = 'checked="checked"';}else{$option_checked = '';} $form_output .= ''; $form_output .= '
'; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ''; $form_output .= ' '; $form_output .= '
'; $form_output .= ''; $form_output .= ''; $form_output .= '
'; print $form_output; // step one: get the data from the online repository // connect to the online repository at sourceforge.net if ($online != 0) { // try to connect to the online repository: start @ini_set("allow_url_fopen","1"); $file = @fopen ($online_repository_url, 'r'); if ($file) { while (!feof ($file)) { $line = fgets ($file, 1024); //if (trim($line) != '') {$line_counter++;} //print 'line '.$line_counter.':'.trim($line).'|
'; $repository_info = explode ( '|', $line); if ($repository_info[0] == COPPERMINE_VERSION) { $line_counter++; $repository_filename[] = $repository_info[1]; $repository_version[$repository_info[1]] = $repository_info[2]; $repository_cvs[$repository_info[1]] = $repository_info[3]; $repository_needed[$repository_info[1]] = $repository_info[4]; $repository_readwrite[$repository_info[1]] = trim(str_replace('@', '', $repository_info[5])); } } if ($line_counter > 0) {$online_repository_connection = 1;} fclose($file); @ini_set("allow_url_fopen","0"); } // if ($file): end } // try to connect to the online repository: end if ($online_repository_connection != 1) { // connecting to the online repository didn't work or didn't return any data $err_reason1 = sprintf($lang_versioncheck_php['online_repository_reason1'],''.$online_repository_url.''); $err_reason2 = sprintf($lang_versioncheck_php['online_repository_reason2'],'allow_url_fopen','ini_set'); if ($additional_info != 0 && $online == 1) { //display warning that repository connection was not possible: start echo <<

{$lang_versioncheck_php['online_repository_unable']}

{$lang_versioncheck_php['online_repository_noconnect']} {$lang_versioncheck_php['online_repository_to_local']} EOT; //display warning that repository connection was not possible: end } elseif ($additional_info != 0 && $online != 1) { echo <<

{$lang_versioncheck_php['online_repository_skipped']}

{$lang_versioncheck_php['online_repository_to_local']} EOT; } $online_repository_connection = 0; // use the data that comes with the distribution $local_file_name = 'repository.txt'; $file = cpg_offline_repository(); $line = explode ( '@', $file); foreach ($line as $value) { $repository_info = explode ( '|', $value); $repository_info[0] = trim($repository_info[0]); if ($repository_info[0] == COPPERMINE_VERSION) { $repository_filename[] = cpg_replace_albums_name($repository_info[1]); $repository_version[$repository_info[1]] = $repository_info[2]; $repository_cvs[$repository_info[1]] = $repository_info[3]; $repository_needed[$repository_info[1]] = $repository_info[4]; $repository_readwrite[$repository_info[1]] = trim($repository_info[5]); } } } $currently_installed = sprintf($lang_versioncheck_php['coppermine_version_info'],'' . COPPERMINE_VERSION . ''); if ($additional_info != 0) { //display information about current version in use: start echo <<

{$lang_versioncheck_php['coppermine_version_header']}

$currently_installed
{$lang_versioncheck_php['coppermine_version_explanation']} EOT; } //display information about current version in use: end // step two: draw the table header echo <<< EOT

{$lang_versioncheck_php['version_comparison']}

{$lang_versioncheck_php['folder_file']} {$lang_versioncheck_php['coppermine_version']} EOT; if ($file_versions != 0) {print ' '.$lang_versioncheck_php['file_version'].'';} if ($webcvs != '0') {print ' '.$lang_versioncheck_php['webcvs'].'';} print ''; // step three: go through all files that exist in the repository and check if they're on the webserver as well if ($webroot == 1) { $dir = ''; // this is the place to start browsing for root folders } else { $dir = '../'.cpg_get_coppermine_path().'/'; // this is the place to start browsing } if (is_array($repository_filename)) { foreach ($repository_filename as $rep_file) { //foreach start $counter_total_files++; $file_info = cpg_get_path_and_file($rep_file); cpg_output_version_row(cpg_get_fileversion($dir.$file_info['path'], $file_info['file']), $file_info, $file_info['file']); } //foreach end } else { echo << {$lang_versioncheck_php['error_no_data']} EOT; } // show summary $number_of_columns_minus_one = $number_of_columns - 1; if ($counter_file_mandatory_not_exist == 0){$style_mandatory_files='';}else{$style_mandatory_files='red';} if ($counter_file_optional_not_exist == 0){$style_optional_files='';}else{$style_optional_files='yellow';} if ($counter_cpg_version_older == 0){$style_cpg_version_older='tableb';}else{$style_cpg_version_older='tablered';} if ($counter_cvs_version_older == 0){$style_cvs_version_older='tableb';}else{$style_cvs_version_older='tablered';} echo <<

{$lang_versioncheck_php['summary']}

{$lang_versioncheck_php['total']}: $counter_total_files {$lang_versioncheck_php['mandatory_files_missing']}: $counter_file_mandatory_not_exist {$lang_versioncheck_php['optional_files_missing']}: $counter_file_optional_not_exist {$lang_versioncheck_php['files_from_older_version']}: $counter_cpg_version_older {$lang_versioncheck_php['file_version_outdated']}: $counter_cvs_version_older EOT; endtable(); print '
'; pagefooter(); ////////////////////////////////// functions /////////////////////////////// function cpg_get_coppermine_path() { //global $PHP_SELF; $return = str_replace('/', '',strrchr(str_replace('/'.str_replace('/', '',strrchr($_SERVER['PHP_SELF'], '/')), '', $_SERVER['PHP_SELF']),'/')); return $return; } function cpg_get_path_and_file($string) { // check if $string contains delimiter that triggers replacement $delimiter = '**'; while (strstr($string, $delimiter) == TRUE) { $string = cpg_replace_vars_from_config($string, $delimiter); } $return['path'] = str_replace(str_replace('/', '', strrchr($string, '/')), '', $string); $return['file'] = str_replace('/', '', strrchr($string, '/')); if (strstr($return['path'], '.') != FALSE && $return['file'] == '') { $return['file'] = $return['path']; $return['path'] = ''; } if (strstr($return['file'], '.') == FALSE) { $return['path'] = $return['path'].$return['file']; $return['file'] = ''; } return $return; } function cpg_replace_vars_from_config($string, $delimiter = '**') { global $CONFIG; // check the string for $delimiter and replace the stuff within $delimiter with the config values $asterisk = ''; $asterisk = strstr($string, $delimiter); // now the full string starting from the first $delimiter is in $asterrisk $asterisk = ltrim($asterisk, $delimiter); // trim the first to $delimiter $asterisk = str_replace(strstr($asterisk, $delimiter), '', $asterisk); // trim the bits after and including the remaining $delimiter. Now $asterisk contains only the keyword // replace the keyword and $delimiter in $string with the actual $CONFIG value $string = str_replace($delimiter.$asterisk.$delimiter, rtrim($CONFIG[$asterisk],'/'), $string); return $string; } function cpg_get_fileversion($folder = '',$file = '') { $handle = @fopen($folder.$file, 'r'); $blob = @fread($handle, filesize($folder.$file)); @fclose($handle); $cvs_string1 = '$'.'I'.'d'.':'; $cvs_string2 = '$'.'Revision'.':'; $cpg_version_determination = 'Coppermine' . ' ' . 'version:'; $blob = str_replace(''; print $return['cpg_version']; print ""; print $double_slash_position; print "
\n"; */ if (strlen($return['cpg_version']) > 5) {$return['cpg_version']='n/a';} // Fallback to the "old" cpg version determination method if no result (for compatibility with older versions) if ($return['cpg_version'] == '') { $return['cpg_version'] = substr($blob,strpos($blob, 'Coppermine Photo Gallery')); $return['cpg_version'] = substr($return['cpg_version'],0,strpos($return['cpg_version'], '//')); $return['cpg_version'] = trim(str_replace('Coppermine Photo Gallery', '', $return['cpg_version'])); if (strlen($return['cpg_version']) > 5) {$return['cpg_version']='n/a';} } // Determine file (cvs) revision $return['cvs_version'] = str_replace($cvs_string2, '', substr($blob,strpos($blob, $cvs_string2),25)); $return['cvs_version'] = trim(substr($return['cvs_version'], 0, strpos($return['cvs_version'], '$'))); // Fallback to the "old" revision determination method if no result (for compatibility with older versions) if ($return['cvs_version'] == '' || !is_numeric($return['cvs_version'])) { $return['cvs_version'] = substr($blob,strpos($blob, $cvs_string1)); $return['cvs_version'] = substr($return['cvs_version'],0,strpos($return['cvs_version'], 'Exp')); $return['cvs_version'] = str_replace($cvs_string1, '', $return['cvs_version']); // get rid of the filename inside the string $return['cvs_version'] = trim(str_replace($file.',v ', '',$return['cvs_version'])); $return['cvs_version'] = str_replace('v ', '', $return['cvs_version']); //if ($file=='picmgmt.inc.php' || $file=='index.php') {print $folder.$file.':'.$return['cvs_version'].'
';} $return['cvs_version'] = trim(str_replace(strstr($return['cvs_version'], ' '), '', $return['cvs_version'])); } if (strlen($return['cvs_version']) > 5) {$return['cvs_version']='n/a';} if (file_exists($folder.$file)) { $return['exists'] = 1; } else { $return['exists'] = 0; } if($file == '') { //we have a folder here. Check if it's writable $return['writable'] = cpg_is_writable($folder); } // check for the existance of a folder $return['is_dir'] = 0; if ($file == '') { if ($handle = @opendir($folder.$file)) { $return['is_dir'] = 1; @closedir($handle); } } return $return; } function cpg_is_writable($folder) { $return = 0; $file_content = "this is just a test file that hasn't been deleted properly.\nIt's safe to delete it now"; @unlink($folder.'/cpgvc_tf.txt'); if ($fd = @fopen($folder.'/cpgvc_tf.txt', 'w')) { @fwrite($fd, $file_content); @fclose($fd); @unlink($folder.'/cpgvc_tf.txt'); $return = 1; } else { $return = -1; } return $return; } function cpg_output_version_row($file_version_info = '', $file_path = '', $cpg_is_file='') { global $repository_filename, $repository_version, $repository_cvs, $repository_needed, $repository_readwrite, $lang_versioncheck_php, $counter_file_mandatory_not_exist, $counter_file_optional_not_exist, $counter_cpg_version_older, $counter_cpg_version_younger, $counter_cvs_version_older, $counter_cvs_version_younger, $optional_files, $webcvs, $file_versions, $errors_only,$permissions, $mandatory_files; $file_complete_path = $file_path['path'].$file_path['file']; // don't return anything if the options are set to filter optional files the actual file IS optional if ($optional_files != 1 && $repository_needed[$file_complete_path] == 'optional') {return;} if ($mandatory_files != 1 && $repository_needed[$file_complete_path] == 'mandatory') {return;} $error_counter = 0; ob_start(); // stop output temporarily print ''; print ''; print ''; if ($cpg_is_file == '') { print ''; } else { print ''; } print ''; $help_ouput = ''; if ($file_version_info['exists'] == 1) { $stylecolor = ''; $helptitle = ''; } else { if ($repository_needed[$file_complete_path] == 'optional') { $stylecolor = 'yellow'; $helptitle = $lang_versioncheck_php['help_file_not_exist_optional1']; $helpoutput = sprintf($lang_versioncheck_php['help_file_not_exist_optional2'], '"'.$file_complete_path.'"'); $counter_file_optional_not_exist++; $error_counter++; } else { $stylecolor = 'red'; $helptitle = $lang_versioncheck_php['help_file_not_exist_mandatory1']; $helpoutput = sprintf($lang_versioncheck_php['help_file_not_exist_mandatory2'], '"'.$file_complete_path.'"'); $counter_file_mandatory_not_exist++; $error_counter++; } } print ''; print $file_path['path']; print $file_path['file']; print ''; if ($stylecolor != '') { print ' '; print cpg_display_help('f=index.html&base=64&h='.urlencode(base64_encode(serialize($helptitle))).'&t='.urlencode(base64_encode(serialize($helpoutput))),400,150); } // writable ? start if (!$cpg_is_file && $permissions == 1) { // we have a folder: start $stylecolor = ''; $writable_output = ''; $helptitle = ''; $helpoutput = ''; // check if the writable icon is there. If it isn't, display a plain text if (file_exists('images/writable_true_wrong.gif') == true && file_exists('images/writable_true_right.gif') == true && file_exists('images/writable_false_wrong.gif') == true && file_exists('images/writable_false_right.gif') == true) { // image files exist: start $writable_true_wrong = ''; $writable_true_right = ''; $writable_false_wrong = ''; $writable_false_right = ''; $writable_false_undetermined = ''; } else { // image files exist: end $writable_true_wrong = '('.$lang_versioncheck_php['writable'].')'; $writable_true_right = '('.$lang_versioncheck_php['writable'].')'; $writable_false_wrong = '('.$lang_versioncheck_php['not_writable'].')'; $writable_false_right = '('.$lang_versioncheck_php['not_writable'].')'; $writable_false_undetermined = '(?'; } if ($repository_readwrite[$file_complete_path] == 'w') { if ($file_version_info['writable'] == '-1') { $stylecolor = 'red'; $writable_output = $writable_false_wrong; $helptitle = $lang_versioncheck_php['help_not_writable1']; $helpoutput = sprintf($lang_versioncheck_php['help_not_writable2'], '"'.$file_complete_path.'"'); $error_counter++; } elseif ($file_version_info['writable'] == 1) { $stylecolor = 'green'; $writable_output = $writable_true_right; } elseif ($file_version_info['writable'] == 0) { $stylecolor = 'yellow'; $writable_output = $writable_false_undetermined; $helptitle = $helptitle = $lang_versioncheck_php['help_not_writable1']; $helpoutput = sprintf($lang_versioncheck_php['help_writable_undetermined'], '"'.$file_complete_path.'"'); $error_counter++; } } elseif ($repository_readwrite[$file_complete_path] == 'r') { if ($file_version_info['writable'] == '-1') { $stylecolor = 'green'; $writable_output = $writable_false_right; } elseif ($file_version_info['writable'] == 1) { $stylecolor = 'yellow'; $writable_output = $writable_true_wrong; $helptitle = $lang_versioncheck_php['help_writable1']; $helpoutput = sprintf($lang_versioncheck_php['help_writable2'], '"'.$file_complete_path.'"'); $error_counter++; } elseif ($file_version_info['writable'] == 0) { $stylecolor = 'yellow'; $writable_output = $writable_false_undetermined; $helptitle = $lang_versioncheck_php['help_not_writable1']; $helpoutput = sprintf($lang_versioncheck_php['help_writable_undetermined'], '"'.$file_complete_path.'"'); $error_counter++; } } print ' '; print $writable_output; if ($helptitle != '') { print ' '; print cpg_display_help('f=index.html&base=64&h='.urlencode(base64_encode(serialize($helptitle))).'&t='.urlencode(base64_encode(serialize($helpoutput)).'&css=1'),400,150); $helptitle = ''; $helpoutput = ''; } } // we have a folder: end // writable ? end print ''; // cpg version start $cvs_version_check = 'enable'; if (!$repository_version[$file_complete_path]) { $repository_version[$file_complete_path] = '?'; } if ($file_version_info['exists'] != 1) { print '-'; $helptitle = ''; } elseif (!$file_version_info['cpg_version'] && $repository_version[$file_complete_path] == '?') { print ''; print 'n/a'; } elseif ((!$file_version_info['cpg_version'] || $file_version_info['cpg_version'] == 'n/a') && $repository_version[$file_complete_path] != '?') { $cvs_version_check = 'disable'; print ''; print '?'; print cpg_vc_help($lang_versioncheck_php['help_no_local_version1'],$lang_versioncheck_php['help_no_local_version2']); print ''; print $repository_version[$file_complete_path]; $counter_cpg_version_older++; $error_counter++; } elseif ((!$file_version_info['cpg_version'] || $file_version_info['cpg_version'] == 'n/a') && $repository_version[$file_complete_path] == '?') { $cvs_version_check = 'disable'; print ''; print '-'; } elseif ($file_version_info['cpg_version'] == $repository_version[$file_complete_path]) { print ''; print $file_version_info['cpg_version']; print ''; print $file_version_info['cpg_version']; } elseif ($file_version_info['cpg_version'] < $repository_version[$file_complete_path]) { $cvs_version_check = 'disable'; print ''; print $file_version_info['cpg_version']; print cpg_vc_help($lang_versioncheck_php['help_local_version_outdated1'],$lang_versioncheck_php['help_local_version_outdated2']); print ''; print $repository_version[$file_complete_path]; $counter_cpg_version_older++; $error_counter++; } elseif ($file_version_info['cpg_version'] > $repository_version[$file_complete_path]) { $cvs_version_check = 'disable'; print ''; print $file_version_info['cpg_version']; print ''; print $repository_version[$file_complete_path]; print cpg_vc_help($lang_versioncheck_php['help_local_version_dev1'],$lang_versioncheck_php['help_local_version_dev2']); $counter_cpg_version_younger++; $error_counter++; } else { $cvs_version_check = 'disable'; print ''; print $file_version_info['cpg_version']; print ''; print $repository_version[$file_complete_path]; $counter_cpg_version_older++; $error_counter++; } // cpg version end print ''; if ($file_versions == 1) { //display file versions: start //print ''; // cvs version start $helptitle = ''; if($file_version_info['cvs_version'] == '//') {$file_version_info['cvs_version'] = '';} if ($cvs_version_check != 'disable') { if (!$repository_cvs[$file_complete_path]) { $repository_cvs[$file_complete_path] = '?'; } if ($file_version_info['exists'] != 1) { print '-'; } elseif (!$file_version_info['cvs_version'] && $repository_cvs[$file_complete_path] == '?') { print 'n/a'; } elseif ($file_version_info['cvs_version'] == 'n/a' && $file_version_info['cvs_version'] == 'n/a') { print 'n/a'; } elseif (!$file_version_info['cvs_version'] || $file_version_info['cvs_version'] == 'n/a') { print ''; print $file_version_info['cvs_version']; print cpg_vc_help($lang_versioncheck_php['help_local_version_na1'],$lang_versioncheck_php['help_local_version_na2']); print ''; print ''; print $repository_cvs[$file_complete_path]; $counter_cvs_version_older++; $error_counter++; } elseif (cpg_version_compare($file_version_info['cvs_version']) == cpg_version_compare($repository_cvs[$file_complete_path])) { print ''; print $file_version_info['cvs_version']; print ''; print ''; print $repository_cvs[$file_complete_path]; } elseif (cpg_version_compare($file_version_info['cvs_version']) < cpg_version_compare($repository_cvs[$file_complete_path])) { print ''; print $file_version_info['cvs_version']; print cpg_vc_help($lang_versioncheck_php['help_local_version_outdated1'],$lang_versioncheck_php['help_local_version_outdated2']); print ''; print ''; print $repository_cvs[$file_complete_path]; $counter_cvs_version_older++; $error_counter++; } elseif (cpg_version_compare($file_version_info['cvs_version']) > cpg_version_compare($repository_cvs[$file_complete_path])) { print ''; print $file_version_info['cvs_version']; print ''; print ''; print $repository_cvs[$file_complete_path]; print cpg_vc_help($lang_versioncheck_php['help_local_version_dev1'],$lang_versioncheck_php['help_local_version_dev2']); $counter_cvs_version_younger++; $error_counter++; } else { print ''; print $file_version_info['cvs_version']; print cpg_vc_help($lang_versioncheck_php['help_local_version_outdated1'],$lang_versioncheck_php['help_local_version_outdated2']); print ''; print ''; print $repository_cvs[$file_complete_path]; $counter_cvs_version_older++; $error_counter++; } } else { print '-'; } // cvs version end print ''; } //display file versions: end if ($webcvs != '0') { print ''; // web cvs start $webcvslink = 'http://cvs.sourceforge.net/viewcvs.py/coppermine/'; if ($webcvs == "devel") {$webcvslink .= 'devel/';} else {$webcvslink .= 'stable/';} $webcvslink .= $file_complete_path; print sprintf($lang_versioncheck_php['go_to_webcvs'],''.$lang_versioncheck_php['webcvs'].''); // web cvs end print ""; } print "\n"; $string = ob_get_contents(); ob_end_clean(); // don't return anything if the options are set to filter stuff and the conditions match if ($errors_only == '1' && $error_counter == 0) {return;} print $string; } //end of function function cpg_replace_albums_name($path) { global $CONFIG; //split the $path var $second_part = ltrim(strstr($path, '/'),'/'); $first_part = str_replace($second_part, '', $path); $third_part = ltrim(strstr($second_part, '/'),'/'); $second_part = str_replace($third_part, '', $second_part); if ($first_part == 'albums/') {$first_part = $CONFIG['fullpath'];} if ($second_part == 'userpics/') {$second_part = $CONFIG['userpics'];} if ($second_part == 'userpics' && $third_part == '') {$second_part = rtrim($CONFIG['userpics'], '/');} $return = $first_part.$second_part.$third_part; if ($return == 'albums'){$return = rtrim($CONFIG['fullpath'], '/');} return $return; } function cpg_version_compare($version) { $return = ''; $version_info = explode ( '.', $version); for ($i=0;$i