G2Image/TinyMCE/Drupal 5

MarkDerrick - January 22, 2007 - 16:19

Has anyone been able to get G2Image to work within TinyMCE running under Drupal 5?
TinyMCE is working fine, but no matter what I try, I'm unable to get G2Image to work - the icon is not appearing in the TinyMCE toolbar at all.

I've now spent the best part of two days trying to sort this, and I'm running out of hair to pull out! :-)

Any suggestions?

Thanks.

same problem here

hatsch - January 22, 2007 - 17:59

tinymce works, also gallery integration works. but g2image won't show up in tinymce...

I thought I was winning...

MarkDerrick - January 22, 2007 - 20:28

At first Drupal was generating an error within the Gallery settings page, indicating that it couldn't find G2Image - so I edited the config file to point it in the right direction and the error went away. But still no sign of G2Image in the TinyMCE toolbar.

It seems that the config for TinyMCE is a lot simpler than it used to be, I remember having to tell it which modules to include in the tool bar, but that all seems to have gone now.

Mark

Edit This File..

pegmonkey - February 1, 2007 - 16:05

Probably in your /sites/all/modules/tinymce/themes/ directory.. edit one of these files tinymce_full.js or tinymce_simple.js or tinymce_compact.js

Put g2image in as a plugin and a button. You can place the button where you like. You'll get the idea once you look at the files. For example, I put mine in using.
plugins : "devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,
paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,g2image",

That last is all on one line..

and put the button in using

theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking,g2image",

I also had to do the same hack you did to point to the right g2image install directory.

Hope this helps.

That did it!

MarkDerrick - February 1, 2007 - 20:37

Excellent result! Thanks very much.
Followed your instructions and it works perefctly.

Thanks very much for your help.

Mark.

Button

bacchus101 - February 5, 2007 - 04:13

I got the button (finally!) after a few days of trying every sort of configuration possible but now I get this:

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions.

For WordPress users, either install the WPG2 plugin (located at http://wpg2.ozgreg.com/) or verify your Gallery2 path in the G2Image Popup Options admin panel.

For other platforms, please verify your Gallery2 path in config.php.

I was thinking of starting from scratch again (I have run through the entire thing maybe 10 times) but I run into the same issue each attempt:

How do you change the path that gallery2 is looking for g2image? I end up moving everything around to meet the path it says it should be installed and that might be a big part of my issue.

.......Help?

See if this helps..

pegmonkey - February 6, 2007 - 17:31

Recipe for G2image installation

MohamedMabrouk - April 2, 2007 - 11:33

My apologies if that's not the right place. I suffered for 3 days and benefited for couple of months from your Community so attempting here to pay back my dues. I am an absolute new-by so be warned and take what I write here critically.
It's all versions-sensitive and I used here the latest I know which are:
• Drupal 5.1
• tinymce-5.x-1.x-dev.tar.gz (Drupal module files)
• tinymce_2_1_0.zip (engine/application)
• tinymce_compressor_php_1_1_0.zip (not necessary)
• tinymce_spellchecker_php_1_0_3_1.zip (not necessary)
• gallery-5.x-1.x-dev.tar.gz (the Drupal module)
• gallery-2.2.1-typical.zip (the engine/application and which has more plugins added to it after installed to be ready for Drupal)
• g2image_v2.0.zip (engine and tinyMCE plugin (it has wordpress too but should be ignored))

Here's more about my setup:
• I have Apache 2.2.4 (with .htaccess and httpd.conf modified to allow clearn URLs, etc.), PHP 5.2.0 (+GD, ImageMagick extensions, etc.), and MySQL 4.1.22 (handled by phpMyAdmin 2.9.2) on Win XP.
• I installed drupal under http://localhost/drupal51 and NOT under the http://localhost directly.

I wanted G2image because I needed a wikipedia-like website where photo galleries are inserted first freely then embedded in collaborative articles. G2image (thanks Steven) provided the good combination of a professional (album-oriented) application which could serve as standalone photo website but also could make all the magnificent archives accessible to collaborative authors as well-credited visual materials.

I don't know exactly the problems in the TinyMCE forking? versions, but it's not amusing at all since documentation is lacking on which is which; sometimes a button configuration page appears allowing magificent choices and another that shows (in a hard to trace where did it come from) a Full/Compact/Simple choices with preset buttons that could be adjusted directly from the .js files.

I am providing my solution here for those with a button configuration page whichever TinyMCE version this come from! This said, I think TinyMCE is a bless and I thank all the teams that has produced it since I think it's one of the most important modules for most of Drupal's applications.

IMPORTANT NOTES:
1 - The installation of Gallery2 istelf was tricky for me since it was my first standalone embeddable application, so the standalone installation wasn't that clear in the install.txt and other files. I think you guys up there have to do make it clearer.

2 - Gallery2 seems to be a bit messy in its documentation for Drupal's TinyMCE. I don't know if it's TinyMCE or Gallery2 faults, but I think a single source of info could do this a big favour since it seemed to have been spread over at numerous places. I recommend dedicating Drupal's project page for this since the Forum is quite scattered and the matter is less important for others in Gallery2 and TinyMCE's sites (but I am just a newby, so it's up to you).

FINALLY, THE RECIPE
1- Fixing Gallery2 (Drupal Module) Installation:
In (path-removed)\sites\all\modules\gallery\gallery_settings.inc add the correct path for the plugins, so instead of (path-removed)/includes/jscripts/tiny_mce/plugins/g2image you change to (path-removed)/tinymce/jscripts/tiny_mce/plugins/g2image. This should fix the Gallery2 settings status report in Drupal.
Note: the use of forward and backward slashes in the above paths are because of difference between Apache's settings and Windows.

2- G2image requires plugins (image block, etc. that will be reported in Gallery2 settings in Drupal admin). Make sure you use SiteAdmin after login to standalone Gallery2 to download all necessary plugins

3- download and install G2image as plugin under (path-removed)\sites\all\modules\tinymce\tinymce\jscripts\tiny_mce\plugins . Unzip only the Drupal related one and not the WordPress folder. Unfortunately, this is not enough for TinMCE to recongize it as a plugin as you will see if you check the TinyMCE settings in Drupal and find no G2 button appearing (Drupal's Modules installtion has spoilt us many newbies so it's time to toughen up and face the real coding world out there!)

4- In (path-removed)\sites\all\modules\tinymce directory edit the file plugin_reg.php to register the G2image as plugin. Add the following lines in order that suits you (editor menu line is chosen by the yellowed number, order in the line is chosen by your order in the file):

$plugins['g2image'] = array();
$plugins['g2image']['theme_advanced_buttons2'] = array('g2image');

This should be enough for G2 button now to appear in the TinyMCE's drupal settings. Check it on so that you can start seeing if it works. It SHOULD WORK now if config.php is ok.

5- Normally (path-removed)\sites\all\modules\tinymce\tinymce\jscripts\tiny_mce\plugins\g2image\config.php needs some fixing:

<?php
$g2ic_image_ext_regex
= '@(jpg|jpeg|png|gif|bmp|svg)$@i';
$g2ic_gallery2_path = "gallery2/";
$g2ic_language = 'en';
$g2ic_images_per_page = 15;
$g2ic_display_filenames = FALSE;
$g2ic_default_alignment = 'none';
$g2ic_custom_class_1 = 'not_used'; /* for additional classes definition in  css beyond the normal, float right and float left */
$g2ic_custom_class_2 = 'not_used';
$g2ic_custom_class_3 = 'not_used';
$g2ic_custom_class_4 = 'not_used';
$g2ic_custom_url = 'http://';
$g2ic_class_mode = 'img';
$g2ic_click_mode = 'one_click_insert';
$g2ic_click_mode_variable = TRUE;
$g2ic_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE; //very important
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = '/gallery2/';
$g2ic_embed_uri = '/drupal51/index.php?q=gallery'; /* since I had a non-root directory installation, I had to put it this way to fit under the domain name <a href="http://www.example.com/drupal/index.php?q=gallery" title="http://www.example.com/drupal/index.php?q=gallery" rel="nofollow">http://www.example.com/drupal/index.php?q=gallery</a> if rewrite-mode has been adjusted to clean urls and things went wrong you might like to come here to fix things */
$g2ic_drupal_g2_filter = FALSE;
$g2ic_drupal_g2_filter_prefix = G2;
?>

This is all I can think of now, and I won't be checking the thread here again soon, so I hope I have got this right and did it justice. I have to add that this is collected from many posts across many websites so I am only a compiler in that sense (and a newby at this)

Salaam!

Fatal Gallery2 Error:

spazio - April 7, 2007 - 11:16

Fatal Gallery2 Error: Cannot activate the Gallery2 Embedded functions.
For WordPress users, either install the WPG2 plugin (located at http://wpg2.ozgreg.com/) or verify your Gallery2 path in the G2Image Popup Options admin panel.
For other platforms, please verify your Gallery2 path in config.php.

I got everything working and the button showing up, but unfortunately I receive the above.

Would appreciate any ideas. Below is my config.php. I tried many variations, but none seems to work. The embedded gallery is at http://asiapolis.perspektive89.com/gallery

<?php
$g2ic_image_ext_regex
= '@(jpg|jpeg|png|gif|bmp|svg)$@i';
$g2ic_gallery2_path = "/html/asiapolis/gallery2/";
$g2ic_language = 'en';
$g2ic_images_per_page = 15;
$g2ic_display_filenames = FALSE;
$g2ic_default_alignment = 'none';
$g2ic_custom_class_1 = 'not_used';
$g2ic_custom_class_2 = 'not_used';
$g2ic_custom_class_3 = 'not_used';
$g2ic_custom_class_4 = 'not_used';
$g2ic_custom_url = 'http://';
$g2ic_class_mode = 'img';
$g2ic_click_mode = 'one_click_insert';
$g2ic_click_mode_variable = TRUE;
$g2ic_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE; //very important
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = '/gallery2/';
$g2ic_embed_uri = 'http://asiapolis.perspektive89.com/index.php?q=gallery';
$g2ic_drupal_g2_filter = FALSE;
$g2ic_drupal_g2_filter_prefix = G2;
?>

Thanks for your help

try "gallery2/" instead of

MohamedMabrouk - April 14, 2007 - 00:28

try "gallery2/" instead of "/html/asiapolis/gallery2/" (or maybe "asiapolis/gallery2/" depending on which is your docroot). You might like to try with the line of embed_uri ('http://asiapolis.perspektive89.com/index.php?q=gallery' to become '/index.php?q=gallery')

I have seen your website and have a question. Do you think it's worth using Gallery2 in spite of the fact that it cannot use Taxonomy Categories to find its image?

Still can't get it working

nautiazn85 - April 22, 2007 - 19:22

So I tried your solution, and I can get as far as being able to see the "Gallery 2 Image plugin" under the TinyMCE configuration (step 4).

Additinally, Gallery says it set my configuration file correctly, and there are no failures.

But when I go and try to use TinyMCE, I still don't seen an icon for g2image.

My website is located at http://www.kairoschurch.org.

Here is my config.php, located in /modules/tinymce/tinymce/jscripts/tiny_mce/plugins/g2image/config.php:
$g2ic_image_ext_regex = '@(jpg|jpeg|png|gif|bmp|svg)$@i';
$g2ic_gallery2_path = "gallery2/";
$g2ic_language = 'en';
$g2ic_images_per_page = 15;
$g2ic_display_filenames = FALSE;
$g2ic_default_alignment = 'none';
$g2ic_custom_class_1 = 'not_used';
$g2ic_custom_class_2 = 'not_used';
$g2ic_custom_class_3 = 'not_used';
$g2ic_custom_class_4 = 'not_used';
$g2ic_custom_url = 'http://';
$g2ic_class_mode = 'img';
$g2ic_click_mode = 'one_click_insert';
$g2ic_click_mode_variable = TRUE;
$g2ic_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = '/gallery2/';
$g2ic_embed_uri = '/index.php?q=gallery';
$g2ic_drupal_g2_filter = FALSE;
$g2ic_drupal_g2_filter_prefix = G2;

Minh Nguyen
http://www.duskintodawn.com

By the way I was using the

nautiazn85 - April 23, 2007 - 00:57

By the way I was using the same file versions you were using MohamedMabrouk.

Minh Nguyen
http://www.duskintodawn.com

Evil!!!

nautiazn85 - April 23, 2007 - 01:59

So I figured it out. I'm currently on a MAC OS X and when I extract files it preserves the permissions. So when uploading everything was set to 600. Guess what... that means no read for anybody.

Why the developer decided to set everything to 600 I have no clue. A simple chmod of all of the files corrected my problems. Thanks!

Minh Nguyen
http://www.duskintodawn.com

By the way when I state the

nautiazn85 - April 23, 2007 - 02:04

By the way when I state the developer... i mean the g2image developer. Anyway any of you using unix based OSes.. care for the evil permissions.

Minh Nguyen
http://www.duskintodawn.com

Happy to know you've solved it

MohamedMabrouk - May 6, 2007 - 01:38

Minh, I checked your site and it's really cool. I am not at all familiar with theme customization and thought that Gallery2 is impossible to fit (for example, frames) properly in Drupal. Any tips that an absolute beginner like me can use?

Thanks

tinyMCE meant to be available for edit after page is created?

texmex - July 22, 2008 - 23:34

I have this set up working but I don't know if you are supposed to be able to use TinyMCE for editing a page that has already been 'made' through TinyMCE. In other words, I create some page through TinyMCE and it writes HTML and can use g2image and submit and everything is fine. When I go back to edit, TinyMCE is not available; is this the correct behavior? Is this a TinyMCE question or a question for this configuration?

It seems that TinyMCE should be able to read the HTML it writes so I would guess that the answer to my question is that something is wrong but I cannot be sure.

 
 

Drupal is a registered trademark of Dries Buytaert.