From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Nov 2011 09:32:21 +0000 Subject: Rewl og krat... needs cleaning up - after port to GIT. --- forum/utils/editor.php | 236 ++++++++++++++++++++----------------------------- 1 file changed, 97 insertions(+), 139 deletions(-) (limited to 'forum/utils/editor.php') diff --git a/forum/utils/editor.php b/forum/utils/editor.php index 36fb39d..768bce9 100644 --- a/forum/utils/editor.php +++ b/forum/utils/editor.php @@ -1,154 +1,112 @@ - \n"; + $str .= "function addcontent(text) {\n"; + $str .= " document.post_form.message.value += text;\n"; + $str .= " document.post_form.message.focus();\n"; + $str .= "}\n"; + $str .= "\n"; -if($fid && $tid && $pid) { - include_once("posts.php"); - $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); - if($pid != -1) $post = $posts->getPost($pid); - if($post || $pid == -1) { - - switch($task) { - case "new": - $title = "Title"; - $message = "Message"; - break; + $title = "En titel"; + $message = "Something useful"; - case "reply": - $title = "Re: " . $post->title; + if($fid && $tid && $pid) { + include_once("posts.php"); + $posts = new Posts($FORUMS_DIR . "/" . $fid . "/" . $tid . ".xml"); + if($pid != -1) $post = $posts->getPost($pid); + if($post || $pid == -1) { + + $title = ""; $message = ""; - break; + + switch($task) { + case "new": + $title = "Title"; + $message = "Message"; + break; - case "edit": - $title = $post->title; - $message = $post->message; - break; + case "reply": + if(substr($post->title, 0, 4) != "Re: ") + $title = "Re: " . $post->title; + else $title = $post->title; + $message = ""; + break; - case "quote": - $title = "Re: " . $post->title; - $user = $users->getUser($post->user); - $message = "[quote title=" . $user->name . " wrote on " .date("r", $post->date) ."]" . $post->message . "[/quote]"; - break; + case "edit": + $title = $post->title; + $message = $post->message; + break; - default: - error("No mode supplied!"); - break; - } -?> -
-;-) -;-) -;-) -;-) -B -I -U -[L  ] -[ C ] -[  R] -URL -E-Mail -Image -"Q" -c++ + case "quote": + if(substr($post->title, 0, 4) != "Re: ") + $title = "Re: " . $post->title; + else $title = $post->title; + $user = $users->getUser($post->user); + $message = "[quote title=" . $user->name . " wrote on " . + date("r", $post->date) ."]" . $post->message . "[/quote]"; + break; - + default: + $str .= error("No mode supplied!"); + return $str; + break; + } - + $str .= "\n"; + $str .= "

Title:

\n"; + $str .= "

\n"; - */ ?> -

- Title: - -

-

-\"\""; -} -?> -

-

- -

-

- To make a link, simply type the URL, and the system will - automagically transform it into an anchor (remember the - http:// part).
- Example: http://www.example.com
-

-

- To insert an image, simply type the URL to that image, it will - automagically be transformed into an image, with a link to the - original image (again, remember the http:// part).
- Example: http://www.example.com/image.jpg -

-

- -

-
-show(); + include_once($UTIL_DIR . "/smileys.php"); + foreach($smileys as $smiley) { + $smile = $smiley[0][0]; + if($smile == "\\m/") $smile = "\\\\m/"; + $str .= " \"\""; + } + $str .= "

\n"; + $str .= "

\n"; + $str .= " \n"; + $str .= "

\n"; + $str .= "

\n"; + $str .= " To make a link, simply type the URL, and the system will\n"; + $str .= " automagically transform it into an anchor (remember the\n"; + $str .= " http:// part).
\n"; + $str .= " Example: http://www.example.com
\n"; + $str .= "

\n"; + $str .= "

\n"; + $str .= " To insert an image, simply type the URL to that image, it will\n"; + $str .= " automagically be transformed into an image, with a link to the\n"; + $str .= " original image (again, remember the http:// part).
\n"; + $str .= " Example: http://www.example.com/image.jpg\n"; + $str .= "

\n"; + $str .= "

\n"; + $str .= " \n"; + $str .= "

\n"; + $str .= "\n"; + + if($pid != -1) $str .= $posts->show(); + } else { + $str .= error("Message " . $pid . " not found!"); + } } else { - error("Message " . $pid . " not found!"); + $str .= error("No message supplied!"); } -} else { - error("No message supplied!"); -} + return $str; +} ?> -- cgit v1.2.3