Tinymce with TinyBrowser for Elgg 1.0

Various people have worked to extend the wysiwyg editor Tinymce for Elgg. First Lee Teague made Tinymce_adv adding many features to the default Tinymce text editor. Then Joey One Time  fixed some bugs with embedding media displaying in IE. The only thing left on my wishlist was a file browser/uploader allowing users to upload files to embed in their content through the text editor. I have been experimenting with Bryn Jones’s Flash based TinyBrowser, and I finally got it to work.

Once installed, when you click on an the icon in Tinymce to add an image or media to a post, a new icon appears:

Click on that icon, and you are presented with a gallery.

Selecting the upload tab allows you to browse your computer for a file to upload. It allows you to upload multiple files at the same time.

One the files have been uploaded, click the browse tab and select the image you wish to insert:

Click “Insert” and it is inserted into your text.

It installs the usual way. Upload it to the mod folder and activate within the admin interface. Note, this will overwrite any other mod/tinymce that you have installed.

TinyBrowser is a very slick file browser/uploader. My only misgiving is that I haven’t been able to figure out how to make it interact with the core file management in Elgg. Perhaps someone can take this further by configuring it to do so. Meanwhile, while not ideal, it works great!

Again, I have not tested this in Windows with IE. It build upon the works of others. Please leave feedback. I’ll try to help as I am able.

Download here.

Related Posts

  • No Related Post
  1. Matt Edminster’s avatar

    If this does in fact overwrite other tinymce files, is there any way to get the three plugins you’ve mentioned to work together?

    Reply

  2. Stan’s avatar

    Sounds great – does this interface with elgg’s file plugin – i.e. when you add a file via TinyMCE does it get added as a file entity and appear within the user’s file list?

    Reply

  3. Steve’s avatar

    @Stan As I said in the post:

    “My only misgiving is that I haven’t been able to figure out how to make it interact with the core file management in Elgg. Perhaps someone can take this further by configuring it to do so.”

    @Matt I’m not sure what you mean. Run all three at once? Different access to different editors by different users? No. I’d like to see that though. It is certainly beyond the scope of my know how. If overwriting is a problem, I suspect it could be done so that it doesn’t do so.

    Reply

  4. Graeme’s avatar

    Hi Steve,
    It works fine in IE7 – tested a number of times – good work.

    Reply

  5. Steve’s avatar

    Thanks Graham. Glad it works. WYSIWYG Plugins can be finicky.

    I really like TinyBrowser. I might try integrating it into other web apps I use.

    Reply

  6. SueM’s avatar

    This is great, just what we need. I have downloaded and installed the plugin. However when I click on the icon to add an image, I get the following error.

    Unable to create the ‘/useruploads/images/’ directory – please check your permissions.

    Please could you let me know in which directory the software tries to create the directory so I can change the file permissions accordingly.

    Many thanks

    Reply

  7. Steve’s avatar

    I just edited the file tinymce/tinymce/jscripts/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php with a potential fix for this.

    Please download again and let me know how it goes.

    Reply

  8. Emily Chang’s avatar

    Nice work, Steve. I was about to try this myself so I’m happy to see you did it!

    I just downloaded the zip and tried it. I’m getting the same error as SueM:

    Unable to create the ‘/useruploads/images/’ directory – please check your permissions.

    Do you know which directory needs permissions?

    Reply

  9. Wallth’s avatar

    Hiho, i downloaded the Plugin 5min ago. Deleted the old Tinymce and uploaded yours. But nothing happend. Tinymce works fine, but i cant see the tinybrowser. Any hints?

    Thanks :) )

    Reply

  10. Steve’s avatar

    @wallth delete your cache and reload.

    @ Emily The problem probably resides in:

    tinymce/tinymce/jscripts/tiny_mce/plugins/tinybrowser/fns_tinybrowser.php

    // *************************CREATE FOLDER**********************************
    function createfolder($dir,$perm) {
    if(mkdir($dir, $perm, true))
    {
    chmod($dir, $perm);

    I added true to if(mkdir($dir,$perm)

    Perhaps try taking it out.

    I’ll get in touch with TinyBrowser’s developer.

    Reply

  11. Vergelijk Mobiele Telefoon’s avatar

    Thanks for sharing this useful plugin! I have installed, which was quite easy and it really works ok! :-D

    Reply

  12. Traverse’s avatar

    Hello,
    I was just passing… I’m using TinyBrowser with TinyMCE with Expression Engine. I got the same message as Sue and Emily above, I edited config_tinybrowser.php around line 48 to be the correct paths to the upload directories I had already created. Make sure the permissions are set correctly and all seems fine now.

    Thanks

    Reply

  13. SueM’s avatar

    I resolved the problem with the message “Unable to create the ‘/useruploads/images/’ directory – please check your permissions.” by manually creating the directory on the server logged on as root and giving full rights to the directories recursively. Not ideal but it works.

    Reply

  14. Steve’s avatar

    As far as Elgg goes, there is a very cool new feature in the core trunk that may make this unnecessary–stay tuned!

    I’m trying to exercise restraint, but not sure if I can resist revealing it much longer!

    Reply

  15. Pavel M’s avatar

    Everything fine.
    But TinyBrowser uses only one directory for pictures for different users. :(

    Reply

  16. Steve’s avatar

    Yes, it works like the Joomla and many other software’s file handling.

    A better solution is about to be released:

    http://openedweb.com/blog/2008/10/23/new-elgg-text-area-media-tool/

    Reply

  17. Pavel M’s avatar

    Is it possible to test it? :)

    Reply

  18. Steve’s avatar

    You could grab the files from the their subversion repository. Here are some instructions:

    http://openedweb.com/blog/2008/10/17/elgg-and-subversion-svn/

    There have been a few file updates since I discovered it, but I doubt it is fully functional yet.

    Let me know if you need further assistance.

    Reply

  19. Pavel M’s avatar

    I don’t know where to find it. Trunk directory without blog mod.

    Reply

  20. Steve’s avatar

    Not sure I understand, but you’ll need to download the whole package and overwrite your existing installation. Then you need to run update.php by calling it up in your browser.

    Reply

  21. Pavel M’s avatar

    I made it but no any result :( I see only old version of the edit form of the blog.

    Reply

  22. Steve’s avatar

    Did you clear the cache and all that? I guess you could try another fresh install. that’s what made it appear out of nowhere for me.

    Best we bring this conversation over to the post:

    http://openedweb.com/blog/2008/10/23/new-elgg-text-area-media-tool/

    as this is not relevant to this post anymore.

    Reply

  23. Free4illustrator’s avatar

    I hope you will help me.
    actually i am just getting a broken rectangle type image and not the real one after uploading.

    Reply

  24. pete’s avatar

    Any update on the fix with TinyBrowser ?

    Reply

  25. Steve’s avatar

    @pete I was waiting for it to get out of beta, and I wasn’t sure anyone would be interested as it functions in a way inconsistent with Elgg’s ways of doing things.

    I’m really up to my neck at the moment, but I will try to get something up in a week or so. No promises. I have a major presentation with a companion website that has to be done in about a week.

    @4free Have you tried the fixes above? Have you checked to see if the files are in the directory in which they should be uploaded?

    Reply

  26. Quentin’s avatar

    Hi thanks for all your info
    I wonder if you manage ton inscert a youtube video with TinyMCE?
    I added the youtube plugin but it doesnt work. I have this after I posted the video:
    writeFlash({“wmode”:”transparent”,”src”:”http://www.youtube.com/v/ts51WKYhINI&rel=1″,”width”:”350″,”height”:”300″});

    Reply

  27. Ciaphas’s avatar

    is there any way that we can stop TinyMCE from stripping out in-line styles? I have been all over the Internet and I can not seem to find a way to do it. I think it might have something to do with Tidy-html; I can not find a reference to it in the mod/TinyMCE folder. If you could point me in the correct direction I would greatly appreciate it.

    Reply

    1. Matt Edminster’s avatar

      Nigel, you need to include the styles you want allowed to a line in the tinymce/views/default/input/longtext.php file. The line is called “extended_valid_elements”. Use the notation “tag[attribute|attribute|attribute]” e.g., “a[name|href|target|title]“

      Reply

      1. Matt Edminster’s avatar

        Sorry .. that was meant for Ciaphas.

        Reply

  28. Nigel Carr’s avatar

    Hi – Just downloaded your tinybrowser in Elgg 1.5 activated it and all works OK untill I try to download a file.

    The message The ‘/useruploads/images/’ directory has been successfully created appears – but when I try to download another popup with the massage ‘Status 406 error when uploading’ appears

    Any help to solve this is appreciated

    I am using Vista and elgg v1.5

    Thanks for your help

    Reply

    1. Steve’s avatar

      This was developed for Elgg 1.0. Elgg 1.5 is substantially different as several changes were made to tinymce and the handling of file uploads. Elgg 1.5 with the embed mod enabled does much of what this plugin did and handles the files better.

      Reply

  29. Nigel Carr’s avatar

    Dear Steve – thanks for your help – I will eneable the embed mod and try to find a way of reducing the image size default, whch was the main reason for using your plugin..

    Thanks again

    Reply

  30. scott’s avatar

    Hello,

    This looks like a good plugin. However, I cannot get the “upload” tab to work. When I click the Upload tab I get nothing, just a blank area. Therefor I cannot upload any images, the reason I installed this plugin. Any ideas?

    Thannks in advance.

    Reply

  31. Anu Jagadeesh’s avatar

    DO we have a latest version of the plugin working in elgg 1.6.1

    Reply