OK, i have still problem with this issue... :\'( :\'( :\'(
The purpose is to
be able to get and set the language values used in the gallery.
The reason is that i want to have also other pages in my site and of course if someone (I.E.) selects "english language" for the "LINKS" page, the same language has to be set also for the Coppermine Gallery and viceversa.
Right now the only functioning method i found in order to GET the language, as explined before, is this:
function my_get_language($cookie)
{
$decoded = base64_decode($cookie);
$lines = explode (":",$decoded);
$lastline = array_pop($lines);
$pieces = explode("\"",$lastline);
$currentLanguage = $pieces[1];
return $currentLanguage;
}
In order to SET the language i use this method:
function my_set_language($cookieName, $cookie, $newLang)
{
//GETS CURRENT LANGUAGE
$decoded = base64_decode($cookie);
$lines = explode (":",$decoded);
$lastline = array_pop($lines);
$pieces = explode("\"",$lastline);
$currentLanguage = $pieces[1];
//CREATES STRING WITH NEW LANGUAGE INFORMATION
$decoded = base64_decode($cookie);
$nonLanguageText = explode($currentLanguage, $decoded);
$newLanguageString = base64_encode($nonLanguageText[0].$newLang.$nonLanguageText[1]);
//SETS THE COOKIE WITH NEW LANGUAGE SETTINGS
setcookie ($cookieName, $newLanguageString, time() + 86400, "/");
}
The problem is that right now it's not working...
So i tryed as a test to simply delete the Coppemine cookie using this:
setcookie("cpg133_data", "", time() - 3000, "");
But this is not worknig too, so i assume i'm not catching the point of the problem.
Can you help me?
Of course any kind of simpler solution is more then well accepted and if you say me "ehi you stupid, don't you know that you can use the function
setGalleryCookieEasyer()!!" i'll be happy to hear that!