Copyright (C) 2008 James Grant This program 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, version 2. This program 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. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> 'committee_main.php', 'SFIAB Configuration' => 'config/index.php') ,"page_texts" ); $q=mysql_query("SELECT * FROM pagetext WHERE conferences_id='-1' ORDER BY textname"); while($r=mysql_fetch_object($q)) { foreach($config['languages'] AS $lang=>$langname) { mysql_query("INSERT INTO pagetext (textname,textdescription,text,conferences_id,lang) VALUES ( '".mysql_escape_string($r->textname)."', '".mysql_escape_string($r->textdescription)."', '".mysql_escape_string($r->text)."', '".$conference['id']."', '".mysql_escape_string($lang)."')"); } } if($_POST['action']=="save") { foreach($config['languages'] AS $lang=>$langname) { $textvar="text_$lang"; $text=mysql_escape_string(stripslashes($_POST[$textvar])); mysql_query("UPDATE pagetext SET lastupdate=NOW(), text='$text' WHERE textname='".mysql_escape_string($_POST['textname'])."' AND conferences_id='".$conference['id']."' AND lang='$lang'"); } echo happy(i18n("Page texts successfully saved")); } if($_GET['textname']) { $q=mysql_query("SELECT * FROM pagetext WHERE textname='".mysql_escape_string($_GET['textname'])."' AND conferences_id='".$conference['id']."'"); //needs to be at least one entry in any languages if($r=mysql_fetch_object($q)) { echo "
"; echo "\n"; echo "textname\">\n"; foreach($config['languages'] AS $lang=>$langname) { $q=mysql_query("SELECT * FROM pagetext WHERE textname='".mysql_escape_string($_GET['textname'])."' AND conferences_id='".$conference['id']."' AND lang='$lang'"); $r=mysql_fetch_object($q); if(!$r) { mysql_query("INSERT INTO pagetext (textname,conferences_id,lang) VALUES ('".mysql_escape_string($_GET['textname'])."','".$conference['id']."','$lang')"); echo mysql_error(); } if($r->lastupdate=="0000-00-00 00:00:00" || !$r->lastupdate) $lastupdate="Never"; else $lastupdate=$r->lastupdate; echo "".htmlspecialchars($_GET['textname'])." - $langname    ".i18n("Last updated").": $lastupdate
"; require_once("../fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor("text_$lang") ; $oFCKeditor->BasePath = "../fckeditor/"; $oFCKeditor->Value = $r->text; $oFCKeditor->Width="100%"; $oFCKeditor->Height=300; $oFCKeditor->Create() ; echo "
"; } echo "
"; echo "\n"; echo ""; echo ""; echo "
"; echo "\n"; echo "
\n"; echo "
\n"; } else { echo error(i18n("Invalid text name")); } } else { echo "
"; echo i18n("Choose a page text to edit"); echo ""; $q=mysql_query("SELECT * FROM pagetext WHERE conferences_id='".$conference['id']."' AND lang='".$config['default_language']."' ORDER BY textname"); echo ""; while($r=mysql_fetch_object($q)) { echo ""; if($r->lastupdate=="0000-00-00 00:00:00") $lastupdate="Never"; else $lastupdate=$r->lastupdate; echo ""; echo ""; } echo "
".i18n("Page Text Description")."".i18n("Last Update")."
textname\">$r->textdescription$lastupdate
"; } send_footer(); ?>