HALLOWEEN JE TADY: Získej 66 % extra kreditů zdarma při nákupu od 1199 kreditů s promo kódem NEBOJSEIT66. Zjisti více:
NOVINKA: Začni v IT jako webmaster s komplexním akreditovaným online kurzem Tvůrce WWW stránek. Zjisti více:
Avatar
Matěj
Neregistrovaný
Avatar
Matěj:23.10.2013 15:06

Čau lidi, může mě někdo nakopnout? Neukládá se mi Inline editace v CKEditoru, viz. kód.

<head><script src="ckeditor/cke­ditor.js"></scrip­t></head>

<body>

<?php

if (!function_exis­ts('file_put_con­tents')) {
function file_put_conten­ts($filename, $data) {
$f = @fopen($filename, 'w');
if (!$f) {
return false;
} else {
$bytes = fwrite($f, $data);
fclose($f);
return $bytes;
}
}
}

if (!function_exis­ts('file_get_con­tents')) {
function file_get_conten­ts($filename) {
$fhandle = fopen($filename, "r");
$fcontents = fread($fhandle, filesize($file­name));
fclose($fhandle);
return $fcontents;
}
}

function showForm($data = '') {
?>

<form method="post" action="index.php">
<div contenteditable="tru­e" id="uprava"><?php echo htmlspecialchar­s($data, ENT_QUOTES); ?></div>
<input type="submit" value="ulož"></for­m>

<script>
CKEDITOR.inline( 'uprava' );
</script>

<?php
}
if (!isset($_POS­T['index'])) {
showForm(file_get_con­tents('data/in­dex.inc'));
} else {
if (get_magic_qu­otes_gpc()) {
$_POST['index'] = stripslashes($_POS­T['index']);
}
@unlink('.tem­p.html');
file_put_conten­ts('data/temp­.html', $_POST['index']);
unlink('data/in­dex.inc');
rename('data/tem­p.html', 'data/index.inc');
showForm(file_get_con­tents('data/in­dex.inc'));
}
?>

</body>

<script>
CKEDITOR.inline( 'uprava' );
</script>

<?php
}
if (!isset($_POS­T['index'])) {
showForm(file_get_con­tents('data/in­dex.inc'));
} else {
if (get_magic_qu­otes_gpc()) {
$_POST['index'] = stripslashes($_POS­T['index']);
}
@unlink('.tem­p.html');
file_put_conten­ts('data/temp­.html', $_POST['index']);
unlink('data/in­dex.inc');
rename('data/tem­p.html', 'data/index.inc');
showForm(file_get_con­tents('data/in­dex.inc'));
}
?>

</body></html>

 
Odpovědět
23.10.2013 15:06
Děláme co je v našich silách, aby byly zdejší diskuze co nejkvalitnější. Proto do nich také mohou přispívat pouze registrovaní členové. Pro zapojení do diskuze se přihlas. Pokud ještě nemáš účet, zaregistruj se, je to zdarma.

Zobrazeno 1 zpráv z 1.