Hallo....
Ich habe eine Seite mit dem "one-fits-all" System
aufgesetzt und diese funzt prima so.
Jetzt hab ich aber noch ein paar offene Fragen:
(1)
Was ich aber gerne ändern möchte ist...:
Die Fahne der aktiven Sprache soll gedimmt sein und
die Fahne der inaktiven Sprache normal.
Im PHP language Script wird leider nur auf das vorhanden-
sein der Sprache gecheckt nicht aber welche aktive ist.
Wie kann ich das dementsprechend ummodeln...? :o
(2)
Ausserdem geht dieses System davon aus dass alle
Funktionen Sprachbezogen sein sollen.
Wenn nun zb. ein Bi-Linguales Gästebuch/Linkpage
oder so eingebaut werden soll (eines das beide
Sprachen anzeigen soll) habe ich so doch ein Problem.
Gibt es da Möglichkeiten mit beiden Threads in eine
gemeinsame Seite zu springen?
Merci für euren Input....
Und nen feuchtfröhlichen Rutsch ins 2004
Gruss
peay
Sodele...
Ich hab my_languageMenu.php etwas umgeschrieben, so
dass es etwas besser in meine Seite passt.
Wie oben bereits beschrieben wird nun:
- die aktive Seite gedimmt
- die inaktive und verfügbaren Seiten normal angezeigt
- der Link bei inaktiv und nicht verfügbar auf die akutelle Sprach-ID, wo man sich zur Zeit, befindet gelegt
funzt auch bei mehr als 1 zusätzlichen Sprache.
Hier wäre noch der Code falls jemand interessiert ist:
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2002 Kasper Skårhøj (kasper@typo3.com)
* All rights reserved
*
* This script is part of the Typo3 project. The Typo3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* example_languageMenu.php
*
* THIS IS AN EXAMPLE designed to work with the official Typo3 testsite, section "Another site in the ..."
*
* @author Kasper Skårhøj <kasper@typo3.com>
*
* 14.01.2004 modified by peay <info@peay.ch>
*
* History:
* In this version the active language will be dimmed and the inactive shown.
* In case there is no translation available the other language is dimmed also and
* the link points to the current language.
*/
// 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
$pointer = '<img src="t3lib/gfx/content_client.gif" width="7" height="10" align=middle>';
// get current Sytem UID
$curLang = $GLOBALS["TSFE"]->sys_language_uid;
// Set each icon. If the language is the current, it will be dimmed. If the language is NOT found, the icon is dimmed and the link pointet to active language.
$flags = array();
$flags[] = ($curLang==0?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=0" target=_top><img src="media/uploads/flag_de'.($GLOBALS["TSFE"]->sys_language_uid==0?"_d":"").'.gif" width="21" height="13" hspace=5 border="0"></a>';
// Additional language with lang-id 1
$dimmed = ($GLOBALS["TSFE"]->sys_language_uid==1)||(!$langArr[1]);
$flags[] = ($curLang==1?$pointer:"").'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L='.(($dimmed)?$curLang:"1").'" target=_top><img src="media/uploads/flag_uk'.(($dimmed)?"_d":"").'.gif" width="21" height="13" hspace=5 border="0"></a>';
// For more languages uncomment/copy next 2 lines below and change value X to ID of the desired language
//$dimmed = ($GLOBALS["TSFE"]->sys_language_uid==X)||(!$langArr[X]);
//$flags[] = ($curLang==X?$pointer:"")'<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L='.(($dimmed)?$curLang:"X").'" target=_top><img src="media/uploads/flag_dk'.(($dimmed)?"_d":"").'.gif" width="21" height="13" hspace=5 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=10 height=1></td><td>'.implode("",$flags).'</td></</tr></table>';
?>
Viel Spass peay
wollt mich nur mal eben für diese sehr nette Verbesserung am Skript mit dem "Abdimmen" bedanken. Funzt bei mir perfekt. 😃