[TYPO3-dev] get lg_typo3 with sys_language_uid

Thomas Allmer at at delusionworld.com
Sat Nov 22 08:16:40 CET 2008


hey,

I have the sys_language_uid from the current CE but I would need to have the
"name" (lg_typo3) to do a $LANG->init(...);

what's the fastest way to do so? is there any array?
I'm in the BE so no TSFE...
if needed I also have the pageid...

I played a little bit around with the db... it works but it's not nice...

http://pastie.org/321267

for those who don't want to click on links:

============ IGNORE IF YOU WATCHED THE PRETTY PASTY LINK ============
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('static_lang_isocode',
'sys_language', 'uid = ' . $this->sys_language_uid);
if ( $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) )	{
	$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('lg_typo3',
'static_languages', 'uid = ' . $row['static_lang_isocode']);
	if ( $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2) )
		$LANG->init( $row2['lg_typo3'] );
}
============ IGNORE IF YOU WATCHED THE PRETTY PASTY LINK ============

PS: yeah I know, what about joins, subselects... if there is no non DB way I
will do that, but who knows maybe there is another way (that's why I'm
asking...:) )
-- 
View this message in context: http://www.nabble.com/get-lg_typo3-with-sys_language_uid-tp20634051p20634051.html
Sent from the TYPO3 Dev mailing list archive at Nabble.com.





More information about the TYPO3-dev mailing list