forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: jake on April 22, 2011, 01:43:58 am

Title: Filename to file title problem using the admin tool
Post by: jake on April 22, 2011, 01:43:58 am
Hello,
I have recently upgraded to CPG 1.5.12 and am having an issue changing my filenames to file titles using the admin tool.  This was not an issue for me under CPG1.4.xx.  As I have been adding new photos the admin tool changes the comma (,) in my filenames to “2C” in the file title, forcing me to manually change each file name.  Is there anyway I can fix this issue?

Admin tools
Filename - File title
How should the file title be modified (2):
Remove extension (.jpg or other) and replace _ (underscores) with spaces

Thanks for your time
-   Jake
Title: Re: Filename to file title problem using the admin tool
Post by: Αndré on April 26, 2011, 03:31:48 pm
cpg1.5.x has a new feature, which replaces all 'illegal' characters in file names. Anyway, you can use the replace_forbidden_conditions (http://documentation.coppermine-gallery.net/en/dev_plugin_hooks.htm#plugin_hooks_replace_forbidden_conditions) plugin hook to avoid that function.

There has been a (German) discussion about that file renaming function: http://forum.coppermine-gallery.net/index.php/topic,67987.0.html
Title: Re: Filename to file title problem using the admin tool
Post by: jake on April 29, 2011, 08:38:11 am
Αndré, thank you for the reply.
Unfortunately I do not read German, and do not understand the "replace_forbidden_conditions" code changes required in the include/functions.inc.php file to fix my issue.
Again, thanks for your time.
- Jake
Title: Re: Filename to file title problem using the admin tool
Post by: Αndré on April 29, 2011, 09:22:40 am
To avoid core code modifications, you need to create a plugin. Then, in codebase.php you can do something like
Code: [Select]
function plugin_code($condition) {
    $condition['transliteration'] = false;
    $condition['special_chars'] = false;
    return $condition;
}
to remove the new features completely. It's not recommended to disable the new features, so use it at your own risk.