echo"<a href=\"index.php\"><< ".i18n("Back to Configuration")."</a><br />";
$q=mysql_query("SELECT * FROM pagetext WHERE year='-1' ORDER BY textname");
while($r=mysql_fetch_object($q))
{
mysql_query("INSERT INTO pagetext (textname,text,year) VALUES (
'".mysql_escape_string($r->textname)."',
'".mysql_escape_string($r->text)."',
'".$config['FAIRYEAR']."')");
}
if($_POST['action']=="save")
{
mysql_query("UPDATE pagetext SET lastupdate=NOW(), text='".mysql_escape_string(stripslashes($_POST['text']))."' WHERE textname='".$_POST['textname']."' AND year='".$config['FAIRYEAR']."'");
echohappy(i18n("Page text successfully saved"));
}
if($_GET['textname'])
{
$q=mysql_query("SELECT * FROM pagetext WHERE textname='".$_GET['textname']."' AND year='".$config['FAIRYEAR']."'");