Topic: Finally! Replace Textile with TinyMCE
After a very very long time I finally managed to get TinyMCE to work and remove Textile (because I really hated it)! I have seen it a lot on the forum so here it is: a TinyMCE tutorial for a basic and 'save' texteditor!
Before starting please read post 4
Step 1: open _templates/footer.tpl and replace
</body></html>with
{literal}
<script type="text/javascript" src="{/literal}{$BASE_URL}{literal}js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
editor_selector : "mceEditor",
theme: "advanced",
plugins: "advhr,advimage,table,emotions,media,insertdatetime,directionality",
theme_advanced_toolbar_align: "left",
theme_advanced_toolbar_location: "top",
theme_advanced_buttons1: "bold,italic,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,fontsizeselect,separator,bullist,numlist,separator,link,unlink,separator,undo,redo",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
height: "500px",
width: "420px"
});
</script>
{/literal}
</body>Step 2: open _includes/function.escape.php and replace
$GLOBALS[$variable] = $db->real_escape_string(strip_tags($value));with
$GLOBALS[$variable] = $db->real_escape_string(strip_tags($value,'<a><strong><em><ul><p><li><ol><span>'));Step3: open _templates/publish-write.tpl and replace
id="description"with
id="description" class="mceEditor"And the final step: open page_verify.php and replace
$jobs['description'] = str_replace(array("\r\n", "\r", "\n"), "<br />", $jobs['description']);with
$jobs['description'] = str_replace(array("\r\n", "\r", "\n"), "", $jobs['description']);Might not be the best solution, but maybe someone can find the courage to clean it up (or tell me that this is a fine method
)
Let me know if you run into problems!
Last edited by evertsemeijn (2009-02-19 16:23:41)
:: Looking for a jobboard installation and/or custom design? ::