• November 20, 2017, 02:55:43 AM
• Welcome, Guest. Please login or register.
 
News: Posting problems?
If for some reasons you can not create your own topics, please see the problem thread in the "Site news & updates" board.

Author Topic: How do I update TinyMCE  (Read 82 times)

agentexeider

  • Newbie
  • *
  • Posts: 9
  • Country: us
How do I update TinyMCE
« on: October 24, 2017, 03:35:31 PM »
I know this has been asked before but I couldn't find any instructions.

But how do I update TinyMCE?

Sheepcontrol

  • Administrator
  • Veteran
  • *****
  • Posts: 280
  • Country: de
  • Thanked: 49 times
Re: How do I update TinyMCE
« Reply #1 on: October 25, 2017, 08:27:22 PM »
What you could do (-untested-) is download TinyMCE @ https://www.tinymce.com/download/ and upload the new files to the js folder in your efiction folder on the webserver (do backup!).

Considering TinyMCE bundled with eFiction is like 9 years old, I have no idea if that will go smoothly regarding the configuration/settings delivered from eFiction.
I speak the worlds most widely used language: bad english

agentexeider

  • Newbie
  • *
  • Posts: 9
  • Country: us
Re: How do I update TinyMCE
« Reply #2 on: November 03, 2017, 05:00:59 AM »
my buddy told me he had to make changes to a php file. Though he for the life of him can't remember what file that is. Do you happen to know what php file he might be referring to?

I think probably because the file layout might be different so some spelling changes or something. But I'm not sure.

agentexeider

  • Newbie
  • *
  • Posts: 9
  • Country: us
Re: How do I update TinyMCE
« Reply #3 on: November 05, 2017, 05:54:58 AM »
Ok, I have an answer for how to update TinyMCE.

Step 1) Download and update your tinyMCE folder with the new up to date version.

Step 2) Find and open your Header.php file

Locate this code:

Code: [Select]
echo _DOCTYPE."<html><head>";
if(!isset($titleinfo)) $titleinfo = "$sitename :: $slogan";
if(isset($metaDesc)) echo "<meta name='description' content='$metaDesc'>";
echo "<title>$titleinfo</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset="._CHARSET."\">";
if(!isset($_GET['action']) || $_GET['action'] != "printable") {
echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."includes/javascript.js\"></script>
<link rel=\"alternate\" type=\"application/rss+xml\" title=\"$sitename RSS Feed\" href=\""._BASEDIR."rss.php\">";
if(!empty($tinyMCE)) {
echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR."tinymce/js/tinymce/tinymce.min.js\"></script>
<script language=\"javascript\" type=\"text/javascript\"><!--";
$tinymessage = dbquery("SELECT message_text FROM ".TABLEPREFIX."fanfiction_messages WHERE message_name = 'tinyMCE' LIMIT 1");
list($tinysettings) = dbrow($tinymessage);
if(!empty($tinysettings) && $current != "adminarea") {
echo $tinysettings;
}
else {
echo "
tinymce.init({
selector: 'textarea',
width: 700,
                        height: 500,
menubar: true,
                        theme: 'modern',
plugins: 'print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
  toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat',
  image_advtab: true,
  templates: [
    { title: 'Test template 1', content: 'Test 1' },
    { title: 'Test template 2', content: 'Test 2' }
  ],
content_css: [
  '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
  '//www.tinymce.com/css/codepen.min.css']
  });

Firstly, your tinymce base install directory reference needs to be changed. It will look like this
Code: [Select]
echo "<script language=\"javascript\" type=\"text/javascript\" src=\""._BASEDIR.[b]"tinymce/jscripts/tiny_mce/tiny_mce.js\[/b]">
you need to change it to the new path that looks like this
Code: [Select]
src=\""._BASEDIR."tinymce/js/tinymce/tinymce.min.js\"> Note the file name is tinymce DOT min DOT js, and note the underscores in the file name and the breadcrumb trail.

secondly you're going to need to reconfigure the display for the new TinyMCE editor. There are several ways to do this, different options or plugins you can add, even some premium options. Here is a base version with the tool bar enabled with all the plugins except the premium ones of course.

look below the install path for the tinymce.init section and paste this in there, again refer to the tinymce website to find what configuration you want, there is even a skin creator if you want to get fancy.

Code: [Select]
tinymce.init({
selector: 'textarea',
height: 500,
menubar: true,
                        theme: 'modern',
plugins: 'print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
  toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify  | numlist bullist outdent indent  | removeformat',
  image_advtab: true,
  templates: [
    { title: 'Test template 1', content: 'Test 1' },
    { title: 'Test template 2', content: 'Test 2' }
  ],
content_css: [
  '//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
  '//www.tinymce.com/css/codepen.min.css']
  });

past that you ight get some presentation problems, aligment errors, which I'm still working on trying to figure out how to fix.

-Agent

 

anything
anything