Hallo,
ich sitze gerade voll auf dem Schlauch. Wie kann ich es mit der my_languageMenue.php realisieren, dass die Flagge der Sprache die gerade benutzt wird grau wird?
$query = "SELECT * FROM pages_language_overlay WHERE pid=".$GLOBALS["TSFE"]->id.$GLOBALS["TSFE"]->sys_page->enableFields("pages_language_overlay")." GROUP BY sys_language_uid";
$res = mysql(TYPO3_db,$query);
$langArr=array();
while($row=mysql_fetch_assoc($res)) {
$langArr[$row["sys_language_uid"]]=$row["title"];
}
// Little red arrow, which is inserted to the left of the flag-icon if the TSFE->sys_language_uid equals the language uid (notice that 0=english, 1=danish and 2=german is SPECIFIC to this database, because these numbers refer to uid's of the table sys_language)
//$pointer = '<img src="t3lib/gfx/content_client.gif" width="7" height="10" align=middle>';
// Set each icon. If the language is the current, red arrow is printed to the left. If the language is NOT found (represented by a pages_language_overlay record on this page), the icon is dimmed.
$flags = array();
$flags[] = ($GLOBALS["TSFE"]->sys_language_uid==2?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=2" target=_top><img src="fileadmin/xxx/img/de.gif" width="18" height="12" hspace=5 border="0"></a>';
$flags[] = ($GLOBALS["TSFE"]->sys_language_uid==1?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="fileadmin/xxx/img/en'.($langArr[3]?"":"").'.gif" width="18" height="12" hspace=5 border="0"></a>';
Danke Gruß Fiberman
Hallo,
es ging auch ohne die Erweiterung! Einfach zusätzlich noch eine if-Abfrage vor die Ausgabe der Flaggen, mit der die Defaultsprache abgefangen wird.
Gruß Fiberman
Hallo Fibermann,
Ich benutze auch den Sprachumschalter auf einer meiner Websites und würde auch gern die Flagge der aktiven Sprache auf grau setzen.
Allerdings bin ich in PHP nicht fit genug um diese if abfrage einzubauen.
Es ist zwar etwas dreist aber könntest Du mir Deinen Codeschnipsel dafür zur Verfügung stellen?
Das wär suuuuper cool.
also vielen Dank schon mal im voraus
Grüße
Martin
Hallo Fibermann,
Supervielen Dank für Deine Hilfe und die schnelle Antwort.
Ich habe den code in meine my_language_menu.php eingesetzt und die id´s angepasst.
Wenn ich jetzt auf die deutsche Seite aufrufe ist alles gut bei der englischen bekomme ich folgende Fehlermeldung:
Warning: implode(): Bad arguments. in .../typo3/cms/fileadmin/my_languageMenu.php on line 50
<?php
if ($GLOBALS["TSFE"]->sys_language_uid!=0 && $GLOBALS["TSFE"]->sys_language_uid!=1 ) {
$flags[] = '<img src="typo3/sysext/cms/tslib/media/flags/flag_de_d.gif" hspace="8" border="0"> <a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="typo3/sysext/cms/tslib/media/flags/flag_uk.gif" hspace="8" border="0"></a>';
} elseif ($GLOBALS["TSFE"]->sys_language_uid==1){
} elseif ($GLOBALS["TSFE"]->sys_language_uid==0) {
$flags[] = '<img src="typo3/sysext/cms/tslib/media/flags/flag_de_d.gif" hspace="8" border="0"> <a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="typo3/sysext/cms/tslib/media/flags/flag_uk.gif" hspace="8" border="0"></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 = '<table border=0 cellpadding=0 cellspacing=0><tr>
<td><img src=clear.gif width=30 height=1></td>
<td>'.implode("",$flags).'</td></tr></table>';
?>
kannst Du damit irgendwas anfangen?
Was hab ich falsch gemacht?
Ich habe schon ordentlich rumprobiert aber komm nicht weiter.
Ich hoffe Du kannst mir nochmals helfen?
viele Grüße
Martin
Hi,
der Part sollte noch mit dem Copyright notice über den Teil:
// First, select all pages_language_overlay records on the current page. Each represents a possibility for a language.
$query = "SELECT * FROM pages_language_overlay WHERE pid=".$GLOBALS["TSFE"]->id.$GLOBALS["TSFE"]->sys_page->enableFields("pages_language_overlay")." GROUP BY sys_language_uid";
$res = mysql(TYPO3_db,$query);
$langArr=array();
while($row=mysql_fetch_assoc($res)) {
$langArr[$row["sys_language_uid"]]=$row["title"];
}
// Little red arrow, which is inserted to the left of the flag-icon if the TSFE->sys_language_uid equals the language uid (notice that 0=english, 1=danish and 2=german is SPECIFIC to this database, because these numbers refer to uid's of the table sys_language)
//$pointer = '<img src="t3lib/gfx/content_client.gif" width="7" height="10" align=middle>';
// Set each icon. If the language is the current, red arrow is printed to the left. If the language is NOT found (represented by a pages_language_overlay record on this page), the icon is dimmed.
//$flags = array();
Gruß Fiberman
Hi Fiberman,
Vielen, vielen Dank für Deine Hilfe.
Ich hab´s hinbekommen!
Grüße
Martin