<?php
////////////////////////////////////////////////////////////////////////////
// -_- W|W PHP-master -_- //
// //
// Copyright 2008 MyIE //
// Create and Design by -_- MyIE //
// Site (web) -_- http://www.phpedited.com //
// Site (wap) -_- http://wap.phpedited.com //
// E-mail (MyIE) -_- [email protected] //
// ICQ (MyIE) -_- 952-11-78 //
// //
// Вы не имеете право убирать копирайт //
// оффициального сайта! //
//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, either version 3 of the License, or //
//(at your option) any later version. //
// //
//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. If not, see <http://www.gnu.org/licenses/>. //
////////////////////////////////////////////////////////////////////////////
require_once"../tmpl/cnf.php";
$name=$_POST['name'];
$panel_text=$_POST['panel_text'];
$name = trim($name);
$panel_text = trim($panel_text);
if (empty($name)) // если не введено имя панели
{
?>
<script language="JavaScript">
<!--
<?php
echo ("window.location.href = 'panel.php?action=noname'");
?>
// -->
</script>
<?php
exit;
}
if (empty($panel_text)) // если не введен текст панели
{
?>
<script language="JavaScript">
<!--
<?php
echo ("window.location.href = 'panel.php?action=notext'");
?>
// -->
</script>
<?php
exit;
}
$dir = opendir ("../panel/panel1/");
$i=0;
while ( $file = readdir ($dir))
{
if (( $file != ".") && ($file != ".."))
{
$i=$i+1;
}
}
$i=$i+1;
closedir ($dir);
$kaf='"';
$opostrof="'";
$trokao= 'echo ('.$kaf.'<td background='.$opostrof.'thm-wb/$url_thm/pls.gif'.$opostrof.' align=center valign=_top>'.$kaf;
////// создание файла-панели вида panelX.txt ///////
$file = fopen("../panel/panel1/panel".$i.".txt","w+");
if(!file)
{
echo("Ошибка открытия/создания файла");
}
else
{
fputs($file,"<table border=0 cellspacing=5 cellpadding=0 width=150>\n");
fputs($file,"<tr>\n");
fputs($file,"<?php\n");
fputs($file,$trokao);
fputs($file,");\n?>\n");
fputs($file,$name);
fputs($file,"\n</td>\n");
fputs($file,"</tr>\n");
fputs($file,"<tr>\n");
fputs($file,"<td valign=_top>\n");
fputs($file,$panel_text);
fputs($file,"\n</td>\n");
fputs($file,"</tr>\n");
fputs($file,"</table>");
}
$troka= 'echo ('.$kaf.'<td background='.$opostrof.'../thm-wb/$url_thm/pls.gif'.$opostrof.' align=center valign=_top>'.$kaf;
////// создание файла-панели вида panelX.txt ///////
$file = fopen("../panel/panel1q/panel".$i.".txt","w+");
if(!file)
{
echo("Ошибка открытия/создания файла");
}
else
{
fputs($file,"<table border=0 cellspacing=5 cellpadding=0 width=150>\n");
fputs($file,"<tr>\n");
fputs($file,"<?php\n");
fputs($file,$troka);
fputs($file,");\n?>\n");
fputs($file,$name);
fputs($file,"\n</td>\n");
fputs($file,"</tr>\n");
fputs($file,"<tr>\n");
fputs($file,"<td valign=_top>\n");
fputs($file,$panel_text);
fputs($file,"\n</td>\n");
fputs($file,"</tr>\n");
fputs($file,"</table>");
}
?>
<script language="JavaScript">
<!--
<?php
echo ("window.location.href = 'panel.php?action=panel_add'");
?>
// -->
</script>