<?php
//# R.K. Frimen, modul zapisei informacyji.
if(!defined('DATALIFEENGINE')) {
die("Hacking attempt!");
}
if($action == "dosaveFM"){
$find[] = "'\r'";
$replace[] = "";
$find[] = "'\n'";
$replace[] = "";
$save_con = $save_con + $config;
if($member_db[1] != 1){ msg("error", $lang['opt_denied'], $lang['opt_denied']); }
$handler = fopen(ENGINE_DIR.'/data/config.php', "w");
fwrite($handler, "<?PHP \n\n//System Configurations\n\n\$config = array (\n\n");
foreach($save_con as $name => $value)
{
$value=trim(stripslashes ($value));
$value=htmlspecialchars ($value, ENT_QUOTES);
$value = preg_replace($find,$replace,$value);
fwrite($handler, "'{$name}' => \"{$value}\",\n\n");
}
fwrite($handler, ");\n\n?>");
fclose($handler);
clear_cache ();
msg("info", $lang['opt_sysok'], "$lang[opt_sysok_1]<br /><br /><a href=$PHP_SELF?mod=fm_happy_day&action=saved>$lang[db_prev]</a>");
} elseif ($action == "ctotoFM"){
//siuda kakuju nit vashu figniu...
echoheader("home", $lang['db_info']);
echo "Blagodarnosti - R.K. Frimen - za jego kod";
echofooter();
} else {
//siuda vasu formu dlia zapisei naprimer
echoheader("home", $lang['db_info']);
echo <<<HTML
<Br><BR>
<div class="unterline"></div>
<form action="" method="POST">
<input
<table width="100%">
<tr><td background="engine/skins/images/mline.gif" height="1" colspan="2"></td></tr>
<tr>
<td class="option" style="padding-bottom:10px; padding-top:10px; padding-left:10px;" colspan="2">
<a href="?mod=fm_happy_day&action=ctotoFM">Kakajato Info</a>
</td>
</tr>
<tr>
<td class="option" style="padding:4px;">
<b>Data: </b><br />
<span class="small">Data cerez zapiatuju, naprimer: 11-22,6-18</span>
</td>
<td align="middle" width="400">
<input class="edit" style="text-align:center" size="70" value="{$config['fm_happy_day']}" name="save_con[fm_happy_day]"></td>
</tr>
<tr><td background="engine/skins/images/mline.gif" height="1" colspan="2"></td>
</tr>
<tr>
<td class="option" style="padding:4px;">
<b>Kartinka: </b><br />
<span class="small">Kartinka cerez zapiatuju, naprimer: 11_22.png,6_18.jpg</span>
</td>
<td align="middle" width="400">
<input class="edit" style="text-align:center" size="70" value="{$config['fm_happy_day_img']}" name="save_con[fm_happy_day_img]"></td>
</tr>
<tr><td background="engine/skins/images/mline.gif" height="1" colspan="2"></td>
</tr>
<tr><td background="engine/skins/images/mline.gif" height="1" colspan="2"></td></tr>
<tr>
<td class="option" style="padding-bottom:10px; padding-top:10px; padding-left:10px;" colspan="2">
<input class="buttons" type="hidden" name="action" value="dosaveFM" />
<input class="buttons" type="hidden" name="mod" value="fm_happy_day" />
<input class="buttons" type="submit" name="do" value=" Save " />
</td>
</tr>
</table>
</form>
HTML;
echofooter();
}
?>