Zintegrowanie z CKEditor

9 views
Skip to first unread message

jack1142

unread,
Aug 23, 2011, 9:55:28 AM8/23/11
to Tworzenie stron WWW, kuba....@gmail.com
Słabo się znam na php
Chciałem zintegrować CKEditora ze skryptem z książki
mam dwa pliki do tworzenia treści

blog_edit.tpl


<html><head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-2" />
<title>{$title}</title>


{literal}
<style>
h1 {
font-family: sans-serif;
font-size: 20px;
}
table.inputfields {
font-family: sans-serif;
font-size: 12px;
}
table.inputfields td {
vertical-align: top;
}
</style>
<script type="text/javascript" src="edytor/ckeditor.js"></script>
{/literal}
</head>
<body>
<h1>Nowy wpis</h1>
<form method="post" action="blog_edit.php">
<table class="inputfields">
<tr> <td>Tytuł:</td><td><input name="title" type="text" /></td> </tr>
<tr> <td>Treść:</td>
<td><textarea name="content" rows="15" cols="40"></textarea></
td>
</tr>
<tr> <td>Kategoria:</td><td><input name="category" type="text" /> </
tr>
<tr> <td /><td><input name="submit" type="submit" value="Wyślij" /></
td> </tr>
</table>
</form>
</body>
</html>


,a w pliku blog_edit.php


<?php
require_once("blog_config.php");

if ($_REQUEST["submit"]) {
$content =
mysql_escape_string(strip_tags($_REQUEST["content"],
"<a><i><b><img>"));
nl2br($content);
$teaser = substr(strip_tags($content), 0, 80);
$title = mysql_escape_string(strip_tags($_REQUEST["title"]));
$category =
mysql_escape_string(strip_tags($_REQUEST["category"]));
$q = "INSERT INTO blog_entries
(title, content, category, teaser, entry_time)
VALUES ('$title', '$content', '$category', '$teaser', now())";
mysql_query($q, $connection) or die(mysql_error());
$id = mysql_insert_id($connection);
header("Location: blog_display.php?ID=$id");
} else {
$smarty->assign("title", "Wypowiedzi dzieci : Tworzenie nowego
wpisu");
$smarty->display("blog_edit.tpl");
}
?>


I chcę dodać CKEditora
który jest w katalogu edytor
,bo nie wystarczy dodać do pola tekstowego klasę ckeditor pojawia się
wtedy ckeditor, ale kod html się nie dodaje
Proszę o szybką odpowiedź
Bardzo potrzebuję tego skryptu
Reply all
Reply to author
Forward
0 new messages