Hi,
I'm new here and I use Coppermine since a little time and I would like to congratulate developpers for the job they did (and they do :)).
I have a question about file "smilies.inc.php" :
I added smilies to Coppermine and, in this file, I added too a link which allows to hide/show the smilies list. However I would like to change the text of this link according to smilies being displayed or not (if smilies are displayed, link is "Hide smileys" and if smilies are hidden, link is "Show smilies"). I can put this text directly in "smilies.inc.php" and all works fine, but I would like to use the language files.
So I set 2 vars in lang files : $lang_smilies_inc_php['smiliesShow'] = "Show Smilies"
and $lang_smilies_inc_php['smiliesHide'] = "Hide smilies"
.
I try to use these 2 vars in "smilies.inc.php" (in function "generate_smilies"), so I set "$lang_smilies_inc_php" to global in "generate_smilies" but the 2 vars stay blank when I call "displayimage.php".
So my question is how can I use a var defined in a lang file in file "smilies.inc.php" ?
PS : I have shown a thread which said to add define('SMILIES_PHP', true);
in "displayimage.php", so I uncommented the line but it still doesn't work.
Thanks for your help
Where in the lang file did you add the new variables ? Try adding them into the existing array.
It's what I did, here is part of the code :
if (defined('SMILIES_PHP')) $lang_smilies_inc_php = array(
'Interrogation' => 'Interrogation',
'Heart' => 'Heartr',
...
'smiliesShow' => 'Show smilies',
'smiliesHide' => 'Hideles smilies',
);
and in "smilies.inc.php" :
function generate_smilies($form = 'post', $field = 'message')
{
global $lang_smilies_inc_php;
...
$html .= '<a href="#" onClick="'.$jsFunc.'" id="smiliesShowHide'.$smiliesListId.'">'.$lang_smilies_inc_php["smiliesShow"].'</a>';
...
I just applied the changes you describe to my test install and it worked fine. Make sure you are editing the right lang file for the lang you actually use.
Well I don't understand, I reinstalled Coppermine in another folder and $lang_smilies_inc_php is blank.
When you access an include file directly in your browser, that's expected behaviour. What's the actual problem?
I deleted line which test if SMILIES_PHP is defined in lang file and all works fine now.
Array is so available everywhere.