Drupal,Gallery2, fckeditor and Image Chooser

bahnski

Joined: 2009-03-06
Posts: 7
Posted: Fri, 2009-03-06 19:15

My Installation:
Drupal 6.10
Drupal Modul Wysiwyg 6.x-1.0
Gallery2 2.3
FCKeditor 2.6.4
Gallery2 Image Chooser Version 3.0.3

In my Installation works the Gallery and the FCKeditor fine. My Problem is to get the Image Chooser working.

Here my pathes:
Drupal Main: http://192.168.1.10/drupaltest
Gallery: http://192.168.1.10/drupaltest/gallery2
Image Chooser Path: http://192.168.1.10/drupaltest/modules/wysiwyg/fckeditor/editor/plugins/g2image

The Config.php from the Image Chooser:

$g2ic_gallery2_path = "drupaltest/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_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = 'http://192.168.1.10/drupaltest/gallery2/main.php';
$g2ic_embed_uri = 'http://192.168.1.10/drupaltest/?q=gallery';
$g2ic_drupal_g2_filter = true;
$g2ic_drupal_g2_filter_prefix = 'G2';

Has anybody an Idea what I do wrong. Thankyou for your help

BAHNSKI
Christian

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2009-03-07 00:58

$g2ic_gallery2_path = "drupaltest/gallery2/";
is that the full system path to gallery2?

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Sat, 2009-03-07 13:42

No! Thats the first mistake!

My full system path to gallery2 is:
$g2ic_gallery2_path = "d:/WEBSITES/drupaltest/gallery2";

I changed ist, but the plugin won´t work!

Thanks for your help!
Christian

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2009-03-07 20:12
 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Sun, 2009-03-08 13:13

No, the G2Image is not showing up in my fck toolbar!
So I added this to fckeditor/fckconfig.js
FCKConfig.Plugins.Add( 'g2image' );

Nothing would change!
Here my current config!

Drupal 6.10
Drupal Modul Wysiwyg 6.x-1.0
Gallery2 2.3
FCKeditor 2.6.4
Gallery2 Image Chooser Version 3.0.3

In my Installation works the Gallery and the FCKeditor fine. My Problem is to get the Image Chooser working.

Here my pathes:
Drupal Main: http://192.168.1.10/drupaltest
Gallery: http://192.168.1.10/drupaltest/gallery2
Image Chooser Path: http://192.168.1.10/drupaltest/modules/wysiwyg/fckeditor/editor/plugins/g2image

The Config.php from the Image Chooser:

$g2ic_gallery2_path = "d:/WEBSITES/drupaltest/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_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = 'http://192.168.1.10/drupaltest/gallery2/main.php';
$g2ic_embed_uri = 'http://192.168.1.10/drupaltest/?q=gallery';
$g2ic_drupal_g2_filter = true;
$g2ic_drupal_g2_filter_prefix = 'G2';

I inserted into fckconfig.js
FCKConfig.Plugins.Add( 'g2image' );

Thanks for your help
Christian

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2009-03-08 14:13

You also need to add G2Image to your toolbars...

FCKConfig.ToolbarSets["Default"] = [
	['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
	['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
	['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
	'/',
	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
	['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
	['Link','Unlink','Anchor'],
	['Image','G2Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
	'/',
	['Style','FontFormat','FontName','FontSize'],
	['TextColor','BGColor'],
	['FitWindow','ShowBlocks','-','About']		// No comma for the last row.
] ;

You can find the default and simple toolbars in fckconfig.js, but some CMS like geeklog define their ToolbarSets elsewhere like myconfig.js
and you need to add g2image to any tollbar you would want it to show in.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Mon, 2009-03-09 16:58

Step by Step! Now I get the Icon! But now I get the error:

Parse error: syntax error, unexpected T_STRING in D:\WEBSITES\drupaltest\modules\wysiwyg\fckeditor\editor\plugins\g2image\config.php on line 86

Line 86 is the 1. comment line:
$g2ic_class_mode = 'img';

// Change this to change the default "How to Insert" option. Valid options are
// 'thumbnail_image', 'thumbnail_album', 'thumbnail_custom_url', 'thumbnail_only',
// 'link_image', 'link_album', 'drupal_g2_filter', 'thumbnail_lightbox',
// 'fullsize_image', and 'fullsize_only'.

$g2ic_default_action = 'thumbnail_image';

any Ideas
Thanks
Christian

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2009-03-09 22:55

You are probably missing a semi-colon or quote on the line above 86.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Wed, 2009-03-11 17:50

I removed all comments from the config.php file. I could not find any missing semi-colon or quote. Here is the complete config.php file:

<?php
$g2ic_gallery2_path = "D:\WEBSITES\drupaltest\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_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = 'http://192.168.1.10/drupaltest/gallery2/main.php';
$g2ic_embed_uri = 'http://192.168.1.10/drupaltest/?q=gallery';
$g2ic_drupal_g2_filter = true;
$g2ic_drupal_g2_filter_prefix = 'G2';
?>

thank you for your help
Christian

 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Wed, 2009-03-11 18:06

I found my mistake!
And the next 2 error i solved myself!

Thank you for your help!
Christian

 
abhisheknagar

Joined: 2009-03-26
Posts: 1
Posted: Thu, 2009-03-26 08:30

what were the next 2 mistakes my config.php looks exactly like your but still i dont see a G2 Button

 
bahnski

Joined: 2009-03-06
Posts: 7
Posted: Thu, 2009-03-26 17:12

Here my config.php from the path: drupaltest\modules\wysiwyg\fckeditor\editor\plugins\g2image

<?php
$g2ic_gallery2_path = "./drupaltest/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_default_action = 'thumbnail_image';
$g2ic_sortby = 'title_asc';
$g2ic_embedded_mode = TRUE;
$g2ic_use_full_path = FALSE;
$g2ic_gallery2_uri = 'http://yourdomain/drupaltest/gallery2/main.php';
$g2ic_embed_uri = 'http://yourdomain/drupaltest/?q=gallery';
$g2ic_drupal_g2_filter = false;
$g2ic_drupal_g2_filter_prefix = 'G2';
?>

The File drupaltest\modules\wysiwyg\fckeditor\fckconfig.js

FCKConfig.ToolbarSets["Default"] = [
['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
'/',
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['Image','G2Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
'/',
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
] ;

Thats all!

Christian

 
overlander

Joined: 2009-10-07
Posts: 4
Posted: Thu, 2009-10-08 10:30

Great help! Now in my case there was a little bit more searching/trying/editing necessary.

I had to edit the sites/all/modules/fckeditor/fckeditor.config.js file
because i use full drupal editor toolbar. See below.

The toolbar item is internally registered as 'G2Image',
Don't use 'g2image' in the toolbar config ... just a detail.

Don't mix it up with the directory 'g2image' - if in small letter, use small letter in adding
the plugin.

I found out with FireBug to trap where stuff went wrong.

But the remaining questions is WHY ON EARTH should there be 2 plugin directories for FCKedtor?

Plugin dir 1 : / sites / all / modules / fckeditor / plugins /
Plugin dir 2 : / sites / all / modules / fckeditor / fckeditor / editor / plugins /

I used the THE FIRST....while all info points to 2nd plugin directory.
I deleted g2image in the second, and all works on g2image in the first directory

Nice to know.

===============================================
FCKConfig.ToolbarSets["DrupalFull"] = [
['Source'],
['Cut','Copy','Paste','PasteText','PasteWord'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
//as of FCKeditor 2.5 you can use also 'Blockquote' button
//['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight'],
/*
* EXPERIMENTAL
* Uncomment the line below to enable linktonode and linktomenu buttons
* ATTENTION: Link to Content module must be installed first!
* Remember to load appropriate plugins with FCKConfig.Plugins.Add command a couple of lines above
*/
//['Link','Unlink','LinkToNode','LinkToMenu','Anchor'],
['Link','Unlink','Anchor'],
['G2Image','Image','Flash','Table','Rule','SpecialChar','DrupalBreak'],
//uncomment this line to enable the page break button
//remember to load appropriate plugin with FCKConfig.Plugins.Add command a couple of lines above
//['Image','Flash','Table','Rule','SpecialChar','DrupalBreak','DrupalPageBreak'],
'/',
['FontFormat','FontName','FontSize'],
['TextColor','BGColor']
] ;

 
MjrNuT

Joined: 2009-09-12
Posts: 11
Posted: Thu, 2009-10-22 19:16

I'll provide this link to assist as it worked for me using TinyMCE as its similar for configuration.

http://drupal.org/node/300305