Zum Inhalt springen

Probs nach Umstellung von 3.6.2 nach 3.7.0

Erstellt am 6. Dezember 2004 · 2 Antworten · letzte Antwort am 14. Dezember 2004

Tags: PHP, Update & Upgrade, Frage, TYPO3 3

DCL ·

Hallo,

nach Umstellung von Typo Version 3.6.2 auf Version 3.7.0 erhalte ich folgende Fehlermeldung beim Aufruf meiner mehrsprachigen Webseite:

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/dummy-3.7.0/fileadmin/menue/langmenue.php:26) in /srv/www/htdocs/dummy-3.7.0/tslib/class.tslib_fe.php on line 2402

Habe folgenden Code im Typo 3.7.0 eingetragen bzw. von Typo 3.6.2 übernommen:

langmenue.php:
<?php
$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"];
}

$flags = array();
if ($GLOBALS["TSFE"]->sys_language_uid==0) {
$flags[] = '<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=0" target=_top><img src="fileadmin/menue/german.gif" height="15" width="30" alt="German"></a><tab><tab><tab>';
$flags[] = '<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="fileadmin/menue/english.gif" height="15" width="30" alt="English"></a><tab><tab><tab>';
}

elseif ($GLOBALS["TSFE"]->sys_language_uid==1) {
$flags[] = '<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=0" target=_top><img src="fileadmin/menue/german.gif" height="15" width="30" alt="German"></a>';
$flags[] = '<a href="index.php?id='.$GLOBALS["TSFE"]->id.'&L=1" target=_top><img src="fileadmin/menue/english.gif" height="15" width=30" alt="English"></a>';
}

$content = implode(" ",$flags);
?>

Template Setup:
marks.SPRACHE = PHP_SCRIPT
marks.SPRACHE.file = fileadmin/menue/langmenue.php

#Standard-Definition:
config.linkVars = L
config.sys_language_uid = 0
config.language = de

# Englisch
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = uk
[global]

Im Extension Manager habe ich die Erweiterung page_php_content installiert. Unter List Weltkugel wird die hinzugefügte Sprache Englisch mit uid 1 angezeigt.

Kann es sein das ich irgendwas bei der Umstellung vergessen habe oder das sich im Vergleich von 3.6.2 auf 3.7.0 was verändert hat?

Bin für jeden Tip dankbar.

DCL ·

Hi boelting,

hier mein Lösungsvorschlag:

Die Sprachflaggen werden dann allerdings immer statisch für alle gewählten Sprachen auf der Startpage angezeigt.

Die Extension page_php_content muss installiert sein.

langmenue.php:

Dies ist die original Datei die bei Typo3 dabei ist (zufinden in media/scripts/example_languageMenu.php).
Habe die Datei nur in langmenu.php unbenannt.

<?php

if (!is_object($this)) die ('Error: No parent object present.');

// First, select all pages_language_overlay records on the current page. Each represents a possibility for a language.
$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'];
}

// 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" alt="" />'; */

// 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==0?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=0').'" target="_top"><img src="media/uploads/flag_de.gif" width="25" height="15" hspace="5" border="0" alt="" /></a>';
$flags[] = ($GLOBALS['TSFE']->sys_language_uid==1?$pointer:'').'<a href="'.htmlspecialchars('index.php?id='.$GLOBALS['TSFE']->id.'&L=1').'" target="_top"><img src="media/uploads/flag_uk'.($langArr[1]?'':'_d').'.gif" width="25" height="15" hspace="5" border="0" alt="" /></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 = implode(" ",$flags);
?>

Template Setup:

marks.SPRACHE = PHP_SCRIPT
marks.SPRACHE {
file = fileadmin/template/langmenue.php
}

# Deutsch:
[globalVar = GP:L = 0]
config.sys_language_uid = 0
config.language = de
config.locale_all = de_DE
[global]

# Englisch:
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = en
config.locale_all = english
[global]

Unter List "Weltkugel" die gewünschten Sprachen hinzufügen und entsprechend der globalVar im Template Setup und bei $flags in der langmenu.php den IDs zuordnen.