Page 1 of 1

Error with TinyMCE in admin

Posted: Tue Feb 17, 2009 2:21 pm
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

Re: Error with TinyMCE in admin

Posted: Tue Feb 17, 2009 2:36 pm
by Silmarillion
Hi Spartanic

Which version of PHP are you running?

regards sil.

Re: Error with TinyMCE in admin

Posted: Tue Feb 17, 2009 3:02 pm
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.

Re: Error with TinyMCE in admin

Posted: Tue Feb 17, 2009 3:19 pm
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