[TYPO3-german] Re: [Typo3-german] Default language nachtraeglich aendern
Jochen Stange
derstange at gmx.de
Thu Nov 9 17:00:04 CET 2006
Hallo Markus.
Dein Script hat mir sehr geholfen. An einigen Stellen hat es noch etwas
gehakt, wo von Hand noch umgestellt werden musste. Dieses Script habe ich
geschrieben, um auch die Seiten im Backend umzustellen:
--------------------------
<?
$sql = "SELECT title, `uid` , `pid` , `l18n_cfg` FROM `pages`";
$erg = mysql_query($sql) or die(mysql_error());
if (!$erg) die(mysql_error());
else {
while ($row = mysql_fetch_array($erg, MYSQL_ASSOC)) {
$old_title = $row["title"];
$sql_over = "SELECT uid, pid, sys_language_uid, title FROM
pages_language_overlay where pid = ".$row['uid']." and sys_language_uid =
1";
#echo $sql_over."<br>\n";
$erg_over = mysql_query($sql_over) or die(mysql_error());
$zei_over = mysql_fetch_array($erg_over);
$new_title = $zei_over["title"];
#echo "old:". $old_title."<br>";
#echo "new:". $new_title."<br>";
if($new_title !="") {
$sql_swap_orig = "update pages set title = '".$new_title."' where uid =
".$row["uid"].";";
#echo $sql_swap_orig."<br>\n";
mysql_query($sql_swap_orig);
$sql_swap_new = "update pages_language_overlay set title =
'".$old_title."' where pid = ".$row["uid"]." and sys_language_uid = 1;";
#echo $sql_swap_new."<br>\n";
mysql_query($sql_swap_new);
#echo "SWAPPED!<br><br>";
}
#echo "<br>";
}
}
?>
--------------------------
Sonnige Grüße,
Jochen
More information about the TYPO3-german
mailing list