Zum Inhalt springen

Flagge der nichtausgewählten Sprache soll grau werden...

Erstellt am 11. Juni 2004 · Noch keine Antworten

Tags: PHP, Frage

headkit ·

Hi!

Ich möchte gerne, dass die Flagge der nichtausgewählten Sprache grau wird. Hierzu müsste ich das PHP-Skript verändern. Leider habe ich wenig bis keine Ahnung von PHP. Kann mir jemand helfen? Ich habe viel rumprobiert, doch bin irgendwie hängen geblieben. Hier mein bisheriges (mittendrin abgebrochenes) Script:

if (!is_object($this)) die ('Error: No parent object present.');
 $query = "SELECT * FROM pages_language_overlay WHERE pid=" .$GLOBALS["TSFE"] -> id .$GLOBALS["TSFE"] ->sys_page -> enableFields("pages_language_overlay")." GROUP BY sys_language_uid";


 
 // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language.
// alt: $res = mysql('TYPO3_DB', $query);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages_language_overlay', 'pid='.intval($GLOBALS['TSFE']->id).$GLOBALS['TSFE']->sys_page->enableFields('pages_language_overlay'), 'sys_language_uid');


$langArr = array();
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))	{
	$langArr[$row['sys_language_uid']] = $row['title'];
}

//SPrachauswahl über die Flaggen der Länder
$pointer = '';

if (sys_language_uid==0) {$pointer = '_no' 	//...?...
}											//...?...

$flags = array();
//$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=0').'" target="_top"><img src="fileadmin/Images/flag_de'.(sys_language_uid==0?'':'_no').'.gif" width="19" height="12" hspace="5" border="0" alt="" /></a>';
$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=0').'" target="_top"><img src="fileadmin/Images/flag_de'.(sys_language_uid==0?'':'_no').'.gif" width="19" height="12" hspace="5" border="0" alt="" /></a>';
$flags[] = '<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=1').'" target="_top"><img src="fileadmin/Images/flag_uk'.($langArr[1]?'':'_no').'.gif" width="19" height="12" hspace="5" border="0"  alt="" /></a>';

//Sprachauswahl über die Wahl der Sprache
/*$flags = array();
$flags[] = '<a class="table_content" href="index.php?id='.$GLOBALS['TSFE']->id.'&L=0" target="_top">DEUTSCH</a>';
$flags[] = '<a class="table_content" href="index.php?id='.$GLOBALS['TSFE']->id.'&L=1" target="_top">ENGLISH</a>';
*/

// Make the little menu. Notice, the menu does ONLY transfer the page-id and the "L" variable (which is also SPECIFIC for this website because "L" has been used in the extension template used to control the language setup)
$content = '<tr><td><div align="left">'.implode(' ',$flags).'</div></td></tr>';

Ich müsste doch nur eine Abfrage vorschalten, welche Sprache gewählt ist und danndie Endung des .gif-Bildes variieren! Aber wie!!??

Vielen Dank!
H.

Vielen Dank!