Skip to content

Commit

Permalink
Added FCKeditor (http://fckeditor.net/) support. Unpack the FCKeditor…
Browse files Browse the repository at this point in the history
… sources

 in the root of your news tree (so FCKeditor dir is at same level as queue.php).
 This is optional, but REALLY handy!
  • Loading branch information
icculus committed Feb 9, 2005
1 parent f9f58a9 commit f61a630
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions php_interface/queue.php
Expand Up @@ -738,12 +738,36 @@ function output_news_edit_widgets($item, $queues, $chosen_queue, $allow_submit)
printf("\n<hr>\n\n");
} // if

$editor = '';
if (isset($_REQUEST['fckeditor']))
{
$t = addslashes($item[text]);
$t = str_replace("\r", '\r', $t);
$t = str_replace("\n", '\n', $t);
$t = str_replace("&lt;", '<', $t);
$t = str_replace("&gt;", '>', $t);
$t = str_replace("&amp;", '&', $t);
$editor = "<script type='text/javascript'>\n" .
"<!--\n" .
"var oFCKeditor = new FCKeditor('form_text');\n" .
"oFCKeditor.BasePath = 'FCKeditor/';\n" .
"oFCKeditor.Value = \"$t\";\n" .
"oFCKeditor.Create();\n" .
"//-->\n" .
"</script>\n" .
"<input type='hidden' name='fckeditor' value='1'>\n";
}
else
{
$editor = "<textarea rows='10' name='form_text' cols='80'>{$item['text']}</textarea>";
}

echo <<< EOF
<form method="post" action="${_SERVER['PHP_SELF']}?action=post$idarg">
<input type="hidden" name="form_fromuser" value="{$item['author']}">
<input type="hidden" name="form_postdate" value="{$item['postdate']}">
<table>
<table width="100%">
<tr>
<td align="left">Posted by:</td>
<td align="left">
Expand All @@ -766,7 +790,7 @@ function output_news_edit_widgets($item, $queues, $chosen_queue, $allow_submit)
<tr>
<td>News text:</td>
<td>
<textarea rows="10" name="form_text" cols="60">{$item['text']}</textarea>
$editor
</td>
</tr>
Expand Down Expand Up @@ -1476,12 +1500,16 @@ function body_attributes($action)
$action = 'unknown';
} // else if

$jsheaders = '';
if (isset($_REQUEST['fckeditor']))
$jsheaders .= '<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>';

?>


<html>
<head>
<title>IcculusNews</title>
<title>IcculusNews</title><?php echo "$jsheaders" ?>
</head>

<body <?php body_attributes($action); ?> >
Expand Down

0 comments on commit f61a630

Please sign in to comment.