Hi all together,
my problem consists in replacing certain strings (e.g. {MENU_BGCOLOR}) with color strings that are saved in an array (e.g. $STYLE["MENU_BGCOLOR"]) like it is done when parsing templates. I've found a suitable code passage in the sourcecode of phpBB2 but unfortunately, I cannot use it successfully in my project:
$code = preg_replace('#{([a-z0-9-]*?)}#is', '\' . ( ( isset($this->tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code);
I'm familiar with the regular expression but I don't understand the second part of the code, in which the string is replaced, at all. Can you help me to find out how this works?
Thank you
Best regards
Christoph