Database join plugin - php injection to the WHERE

k0d1

New Member
I need to inject to the DATA-WHERE condition of the Databasejoin type filed the php: substr(JFactory::getLanguage()->getTag(),0,2) to filter options list.
Unfortenately condition:
Lang = '{substr(JFactory::getLanguage()->getTag(),0,2)}' - doesn't work(
How can I do this?
Thank you for the help!
 
Unfortunately, I can't think of a way of doing this. We don't do PHP evaluation in the join's WHERE condition.

So it looks like you are trying to include the first two letters of the currently selected language code, yes? Like 'en' or 'fr'?

I'll have a think, see if I can come up with a way of doing that.

-- hugh
 
OK ... although we don't evaluate PHP in the WHERE clause, we do do our standard placeholder replacement. And the placeholder {lang} should give you the full language code, like en-GB (except we replace - with _, otherwise it ends up being a - mathematical operator) ... so I think if you do this ...

Lang = SUBSTRING('{lang}', 1, 2)

... that should work.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top