From 47c7bfca996170b82d146cfaa0f65cba55ff1862 Mon Sep 17 00:00:00 2001 From: pecesama Date: Wed, 2 Jan 2008 04:08:43 +0000 Subject: [PATCH] Added support for basic HTML (+ Textile) formating and a WYSIWYG editor. --- admin/bm.php | 10 +-- admin/comments.php | 9 ++- admin/index.php | 22 ++++--- admin/scripts/nicEdit.js | 55 +++++++++++++++++ admin/scripts/nicEditorIcons.gif | Bin 0 -> 3202 bytes api.php | 95 +++++++++++++++++------------ classes/functions.php | 16 ++++- classes/gelato.class.php | 18 ++++++ classes/mysql_connection.class.php | 4 -- index.php | 9 +-- notice.txt | 6 +- rss.php | 18 +++--- 12 files changed, 185 insertions(+), 77 deletions(-) create mode 100644 admin/scripts/nicEdit.js create mode 100644 admin/scripts/nicEditorIcons.gif diff --git a/admin/bm.php b/admin/bm.php index b31ce8a..bb1b0dd 100644 --- a/admin/bm.php +++ b/admin/bm.php @@ -55,14 +55,14 @@ if ($user->isAdmin()) { if (!get_magic_quotes_gpc()) { $_POST["title"] = addslashes($_POST["title"]); $_POST["description"] = addslashes($_POST["description"]); - } + } - $_POST["title"] = strip_tags($_POST["title"]); - $_POST["description"] = strip_tags($_POST["description"]); + $textile = new Textile(); + + $_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"])); + $_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"])); if ($tumble->addPost($_POST)) { - //header("Location: ".$conf->urlGelato."/admin/index.php?added=true"); - //die(); $input = array("{type}"); $output = array("1"); diff --git a/admin/comments.php b/admin/comments.php index 8cdd0ea..601ab41 100644 --- a/admin/comments.php +++ b/admin/comments.php @@ -22,9 +22,12 @@ $commentId = ($isEdition) ? $_GET["edit"] : NULL; if(isset($_POST["btnAdd"])) { unset($_POST["btnAdd"]); - $_POST["username"] = strip_tags($_POST["username"]); - $_POST["email"] = strip_tags($_POST["email"]); - $_POST["web"] = strip_tags($_POST["web"]); + + $textile = new Textile(); + + $_POST["username"] = $textile->TextileThis(removeBadTags($_POST["username"])); + $_POST["email"] = $textile->TextileThis(removeBadTags($_POST["email"])); + $_POST["web"] = $textile->TextileThis(removeBadTags($_POST["web"])); if (isset($_POST["id_comment"])) { if ($isAdmin) { diff --git a/admin/index.php b/admin/index.php index 3e05547..3236fc9 100644 --- a/admin/index.php +++ b/admin/index.php @@ -66,11 +66,12 @@ if ($user->isAdmin()) { if (!get_magic_quotes_gpc()) { $_POST["title"] = addslashes($_POST["title"]); $_POST["description"] = addslashes($_POST["description"]); - } + } - $_POST["title"] = strip_tags($_POST["title"]); - $_POST["description"] = strip_tags($_POST["description"]); + $textile = new Textile(); + $_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"])); + $_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"])); if (isset($_POST["id_post"])) { $tumble->modifyPost($_POST, $_POST["id_post"]); @@ -109,6 +110,16 @@ if ($user->isAdmin()) { Lightbox.fileLoadingImage = "css/images/loading.gif"; Lightbox.fileBottomNavCloseImage = "css/images/closelabel.gif"; +richText) { +?> + + +