change of $settings['gallery_default_name'] does not work

ongong
edited March 2013 in Troubleshooting
Hi,

I want to upload images to directories encoded with the date - for example, if I upload today, i would use "2010_07_07" as directoryname (below /galleries/ of course!). Tomorrow I would use "2010_07_08" and so on.
I changed the settings.php
Instead of
$settings['gallery_default_name'] = 'venezuela';
I am using this:
$heute = date("Y_m_d");
$settings['gallery_default_name'] = $heute;

Also set:
$settings['gallery_default'] = true;

My problem: It does NOT work! Always the gallery which fits the FIRST of the
$settings['gallery_sorting'] = 5;
definition is shown on startup.

... please - any idea?
Olaf
Tagged:

Comments

  • if you care to tell me *how* it does not work i can help you. the more info, the easier is to us to help you.
  • I'm having the same issue. gallery_default is set to true and gallery_default_name is set to '307' in my case. Problem is that it always loads the first gallery in the sorted list instead of the specified gallery. I know it can find the gallery because it worked fine when 307 was the only gallery available.
  • Hi Victor,
    I've got the same problem. At settings.php, I changed:
    $settings['gallery_default'] = true;
    $settings['gallery_default_name'] = '2000s'; which is the folder name "2000s" under galleries folder. But the app always loads the first gallery there, in this case is "1960s". Not sure what else I need to modify?

    Best regards,
    Beckmann
  • edited March 2013
    To fix this, change the following line in libraries/general.init.php $g_default_name_exists =
    (file_exists("galleries/".$settings['gallery_default_name'])) ? "true" : "false";
    to $g_default_name_exists =
    (file_exists(ROOT."galleries/".$settings['gallery_default_name'])) ? "true" : "false";


    and in libraries/ajax.functions.js in updateGalleryMenu():
    (g_default_name != '')
    to
    (g_default_name !== undefined && g_default_name != '')
  • I've added both of Sebastian's changes to the codebase. Thanks Sebastian!
Sign In or Register to comment.