Error with TinyMCE in admin

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
spartanic
New Member
New Member
Posts: 6
Joined: Tue Feb 17, 2009 2:18 pm

Error with TinyMCE in admin

Post by spartanic »

In admin I get this error after I clicked on the static option under TinyMCE and hit submit. Now it looks like TinyMCE wont open under the admin. I tried this option since it wouldn't show up when u wanted to add articles:

Fatal error: Call to undefined function: file_put_contents() in /home/jdmex2/public_html/garage411/modules/TinyMCE/TinyMCE.module.php on line 604
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Error with TinyMCE in admin

Post by Silmarillion »

Hi Spartanic

Which version of PHP are you running?

regards sil.
spartanic
New Member
New Member
Posts: 6
Joined: Tue Feb 17, 2009 2:18 pm

Re: Error with TinyMCE in admin

Post by spartanic »

PHP 4.4.9. I do have the option of enabling PHP 5 but if I do so then I think it might screw up my other sites already on my host, although im not too sure if it will.
User avatar
Silmarillion
Dev Team Member
Dev Team Member
Posts: 483
Joined: Sun Jan 02, 2005 9:10 pm
Location: Denmark

Re: Error with TinyMCE in admin

Post by Silmarillion »

Hi again

i just realized that the function if php5-only. Sorry about that. The situation has been worked around in the upcoming release 1.5.3 of cmsms. If you want a quick solution add this to the file TinyMCE.module.php:

Code: Select all

if (!function_exists('file_put_contents')) {
    function file_put_contents($filename, $data) {
        $f = @fopen($filename, 'w');
        if (!$f) {
            return false;
        } else {
            $bytes = fwrite($f, $data);
            fclose($f);
            return $bytes;
        }
    }
}
just before the line

Code: Select all

class TinyMCE extends CMSModule {
That should fix it!

regards
Silmarillion
Post Reply

Return to “CMSMS Core”