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', 'Administration' => 'admin/index.php'), "website_content_management" ); if($_POST['action']=="save") { $err=false; foreach($config['languages'] AS $lang=>$langname) { $filename=stripslashes($_POST['filename']); // $filename=ereg_replace("[^A-Za-z0-9\.\_\/]","_",$_POST['filename']); if(substr($filename,-5)!=".html") $filename=$filename.".html"; $textname="text_$lang"; $titlename="title_$lang"; $showlogoname="showlogo_$lang"; //get the dt here to insert with ALL the languages, we cant rely on the INSERT NOW() always inserting multiple records with the same timestamp! $insertdt=date("Y-m-d H:i:s"); $text=stripslashes($_POST[$textname]); mysql_query("INSERT INTO cms (filename,dt,lang,text,title,showlogo) VALUES ( '".mysql_escape_string($filename)."', '$insertdt', '$lang', '".mysql_escape_string($text)."', '".mysql_escape_string($_POST[$titlename])."', '".$_POST[$showlogoname]."' )"); if(mysql_error()) { echo error(i18n("An error occurred saving %1 in %2",array($filename,$langname))); $err=true; } } if(!$err) echo happy(i18n("%1 successfully saved",array($_POST['filename']))); } if($_GET['filename'] || $_GET['action']=="create") { echo "<< Back to file list
\n"; echo "
"; echo "\n"; if($_GET['filename']) echo "\n"; else echo "Choose filename to create: /web/.html
"; echo ""; echo "\n"; echo "
"; foreach($config['languages'] AS $lang=>$langname) { echo ""; echo "\n"; echo "\n"; echo "\n"; echo "
"; $q=mysql_query("SELECT * FROM cms WHERE filename='".mysql_escape_string($_GET['filename'])."' AND lang='$lang' ORDER BY dt DESC LIMIT 1"); if($r=mysql_fetch_object($q)) { if($r->dt=="0000-00-00 00:00:00" || !$r->dt) $dt="Never"; else $dt=$r->dt; echo "".htmlspecialchars($_GET['filename'])." - $langname    ".i18n("Last updated").": $dt
"; if($_GET['dt']) { $q2=mysql_query("SELECT * FROM cms WHERE filename='".mysql_escape_string($_GET['filename'])."' AND lang='$lang' AND dt<='".$_GET['dt']."' ORDER BY dt DESC LIMIT 1"); $r2=mysql_fetch_object($q2); if($r2->dt!=$r->dt) { echo "Displaying historical file. Date: $r->dt"; $r=$r2; } } } else { echo "$langname
"; //    ".i18n("Last updated").": $dt
"; } echo "
".i18n("Page Title").":title)."\">
".i18n("Show Logo").":"; if($r->showlogo) $ch="checked=\"checked\""; else $ch=""; echo " ".i18n("Yes"); echo "   "; if(!$r->showlogo) $ch="checked=\"checked\""; else $ch=""; echo " ".i18n("No"); echo "
"; require_once("../fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor("text_$lang") ; $oFCKeditor->BasePath = "../fckeditor/"; $oFCKeditor->Value = $r->text; $oFCKeditor->Width="100%"; $oFCKeditor->Height=400; $oFCKeditor->Create() ; echo "
\n"; echo "
"; } echo "
"; echo ""; if($_GET['historylimit']) $historylimit=intval($_GET['historylimit']); else $historylimit=30; echo "\n"; $q=mysql_query("SELECT DISTINCT(dt) FROM cms WHERE filename='".mysql_escape_string($_GET['filename'])."' ORDER BY dt DESC LIMIT $historylimit"); $first=true; if(mysql_num_rows($q)) { while($r=mysql_fetch_object($q)) { if($r->dt==$_GET['dt']) $style="font-weight: bold;"; else $style="font-weight: normal;"; if($first && !$_GET['dt']) $style="font-weight: bold;"; echo "\n"; $first=false; } } else echo "\n"; echo "
".i18n("File History")."
dt)."\" style=\"font-size: 0.75em; $style\">$r->dt
No History
\n"; echo "
"; echo "
"; echo "\n"; echo ""; echo ""; echo "
"; echo "\n"; echo "
\n"; echo "
\n"; echo "
\n"; } else { echo i18n("Choose a web page filename to edit"); echo " "; echo "".i18n("or click here to create a new file")."
\n"; echo ""; $q=mysql_query("SELECT DISTINCT(filename) AS filename FROM cms ORDER BY filename"); echo ""; while($r=mysql_fetch_object($q)) { echo ""; $q2=mysql_query("SELECT dt FROM cms WHERE filename='".mysql_escape_string($r->filename)."' ORDER BY dt DESC LIMIT 1"); $r2=mysql_fetch_object($q2); if($r2->dt=="0000-00-00 00:00:00") $dt="Never"; else $dt=$r2->dt; echo ""; echo ""; } echo "
".i18n("Filename")."".i18n("Last Update")."
filename)."\">/web/$r->filename$dt
"; } send_footer(); ?>