Version .2-1
Copyright © 2007 mGallery2 Development Team
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation, with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license can be obtained from the Free Software foundation
Abstract
This manual documents how the the menalto Gallery2 bridge for PostNuke works. mGallery2 is a utility module that embeds the Gallery2 web application into Postnuke
Table of Contents
List of Figures
Table of Contents
To install mGallery2 version .02, you must be running the following:
PostNuke .764 - Download it at http://www.postnuke.com/
Gallery2 2.1.2 (or higher) installed and working - Download at http://gallery.menalto.com
Image Block module installed and activated in Gallery2
Image Frame module installed and activated in Gallery2
You may find that it works with earlier versions but if you want support it will be difficult for me to debug. We are currently working on updates to make it compatible with Postnuke .8
Use the gallery documentation to install Gallery2 standalone on your web site. Gallery can be installed anywhere on your website. Just make a note of the base directory - the physical location of the gallery files - and the URI of the Gallery2 web site - it's path from the web root.
For instance, on a UNIX system, if your web site's root is located
at /home/apache/htdocs and you install the Gallery2
files in /home/apache/htdocs/gallery2, your base
directory would be /home/apache/htdocs/gallery2 and
your Gallery2 URI would be /gallery2. The same
applies on a Windows system. If your web root is located at
d:\webroot\ and you install Gallery2 files in
d:\webroot\gallery2, your base directory is
d:\webroot\gallery2 and your Gallery2 URI is
/gallery2.
Once Gallery2 is installed, go into the site administration and click on the modules link in the sidebar. Look in the Blocks section of the modules admin and make sure the Image Block plugin is installed and active. Look in the Display section of the modules admin and make sure the ImageFrame module is installed and active.
Gallery 2.2.1 incorporates the Smarty templating engine and has several places in the code where it explicitly calls its own plugins. This causes some problems with Postnuke's own Smarty engine, so running Gallery 2.2.1 will require some code editing.
To correct the album select module's Smarty overlap, do the following:
In your Gallery2 installation folder, navigate to the
modules/albumselect folder
Open the Callbacks.inc file in an
editor. Save a copy of the file for safety
Go to line 136, which should read:
GalleryCoreApi::requireOnce('lib/smarty/plugins/modifier.escape.php');Add a line before this line that reads:
if(!function_exists("smarty_modifier_escape")) {Add a line after 136 that reads:
}
Save and exit the file
To correct the album select module's Smarty overlap, do the following:
In your Gallery2 installation folder, navigate to the
modules/core/classes folder
Open the GalleryTemplateAdapter.class
file in an editor. Save a copy of the file for safety.
Go to line 241, which should read:
GalleryCoreApi::requireOnce('lib/smarty/plugins/modifier.escape.php');Add a line before this line that reads:
if(!function_exists("smarty_modifier_escape")) {Add a line after 241 that reads:
}
Go to line 726, which should read:
GalleryCoreApi::requireOnce('lib/smarty/plugins/function.debug.php');Add a line before this line that reads:
if(!function_exists("smarty_function_debug")) {Add a line after 726 that reads:
}
Go to line 1014, which should read:
GalleryCoreApi::requireOnce('lib/smarty/plugins/modifier.escape.php');Add a line after this line that reads:
if(!function_exists("smarty_modifier_escape")) {Add a line after 1014 that reads:
}
Save and exit the file
This section will describe how to install the module into your Postnuke site. It will also cover adding the module to the standard Postnuke menu and how to set up user and Group synchronization.
The mGallery2 package consists of the module files, located in
the mGallery2 folder, and two core Postnuke files for PN764, one
located in the User/ folder and the other in the
Groups/ folder. To perform the mGallery2
install:
Copy the mGallery2 folder into your
Postnuke modules/ folder
Go to your Postnuke Administration Panel
Click on the system tab
Click on modules
Make sure All is selected in the drop-down list beside the alphabetical filter menu links
Click on the Regenerate link in the administration links
After Postnuke regenerates the modules, find mGallery2 in the list
Click on the M link above the modules table to make it easier to find. It should have a status of Uninitialized)
Click on Initialize in the module's actions
The status of the module should now be Inactive
Click on Activate in the module's actions
The module should now be installed.
Now that the module is installed, it will need to be configured in order to access your installed Gallery2. This is where you will use the Base Directory and Gallery2 URI that you noted during Gallery2 installation. To configure the module, click on the Admin link in the module's actions or click on the 3rd Party tab in your Postnuke Admin Panel and click the mGallery2 icon.
There are two sections in the module's administration panel. The first section, Main Module Configuration, sets up the parameters for communicating with Gallery2. The screenshot below shows this section. You will notice that there are two lines in red. Before the module is configured, they will say that modules are disabled in the Gallery2 core, but they ar inaccurate until the module is set up properly. Here is the screenshot:
The first field is Base Directory, which is the physical path to
the Gallery2 installation files. This is the path from the root of the
filesystem. On a UNIX machine, it might be something like
/webroot/htdocs/gallery2. On a Windows machine,
it might be something like
d:\webroot\gallery2.The second field is Gallery2
URI, which is the path from the web root to the Gallery2 files. Here's
an example. The web root is where your web server looks for documents.
Let's say you installed Postnuke into a folder called c:\web\postnuke
or /web/postnuke and you set your web root to this folder in apache.
You access your Postnuke site at this URI: /.
Now, let's say you install gallery2 into a folder called
c:\web\postnuke\g2\ or /web/postnuke/g2/ within
the Postnuke folder. The URI for Gallery2 would be
/g2. Let's say, on the other hand, that you
installed Gallery2 into a different folder altogether, like
d:\gallery2 or /apps/gallery2. In apache, you set
this folder up to map to /Gallery2. Now your URI
is /Gallery2.
Once you have these two fields set up correctly, click on the Update button at the bottom of the screen. If you have set Gallery up correctly, when the screen refreshes, the module status lines should both be in green as in the screenshot below:
If these lines are still red, it means you have either forgotten to install and activate the modules in Gallery2 or you have an incorrect Base directory, Gallery URI, or both. The mGallery2 module will still work without the two Gallery2 modules, but frames will not be available. mGallery2 will not work without a correct Base Directory and Gallery URI. The second section in the main module administration is the default parameters for the transform hook. The settings look like this.
These settings will take affect when no options are used in a transform hook tag. You can choose to show the title of the photo, the owner of the photo, the date of the photo (from EXIF data), or the number of views from within Gallery2. You can also choose to show the default full-sized image instead of a thumbnail and you can set the maximum size of the full-sized image or the thumbnail. The two dropdown boxes determine what frame will be used by default on albums and images. The link underneath the settings navigates to a contact sheet with all of the available frames displayed on a photo. All of these options are explained in more detail in the section The Transform Hook.
The standard Postnuke installation comes with a side block menu. It can be accessed in the Postnuke administration panel under Blocks/Main Menu. It's easy to add a link to your gallery in the Postnuke menu block. Follow these steps to do it:
Go to your Postnuke Administration Panel
Click on the System tab if you're not there already
Click on the Blocks icon
Look for the Main Menu block and click on its Edit option
In the Content section, look for or create an empty line
If you want it to appear after a specific item, check the "Insert blank after" check box for that item. Click the Update button. Edit the Main Menu again. You should see a new blank line where you wanted it.
Type anything you want in the Title and Description fields
In the URL field, type {mGallery2}
This tells Postnuke to create a URL to the mGallery2 module
Click the Update button
You should now see your gallery link in the menu. Click it to test.
If you want to create links to specific albums, just go to your gallery and click on the album. When you have the desired album in the browser, copy the URL from the browser's navigation bar and paste it into the menu item's URL field instead of {mGallery2}.
mGallery2 can synchronize users and groups between Postnuke and Gallery2 in several ways. The first time a logged-in user clicks on your Gallery2 link, a new user will be created in Gallery2 and mapped to that Postnuke userid. If you want all of your users to have Gallery2 userid mappings, you can do it manually through the module's administration menu or you can set up automatic user and group synchronization. If you want to get user automatic synchronization working, you must modify two core Postnuke files to enable the mGallery hooks to work correctly. To do so:
Make a copy of the core file
modules/User/admin.php
Copy User/admin.php into
modules/User
Make a copy of the core file
modules/Groups/pnadminapi.php
Copy Groups/pnadminapi.php into
modules/Groups
Go to your Postnuke Administration Panel
Click on the system tab if you're not there already
Click on the Modules icon
Find the User module
Click on the U link above the modules table to make it easier to find
Click on the Hooks action for the module
Check the checkbox next to Activate mgallery2 for this module
Click the Update button
Find the Groups module
Click on the G link above the modules table to make it easier to find
Click on the Hooks action for the module
Check the checkbox next to Activate mgallery2 for this module
Click the Update button
For small sites, automatic synchronization isn't necessary as users will be created when they enter the gallery, but for large or high-traffic sites, on-the-fly creation could cause some overhead. Automatic synchronization creates and deletes the user or group using hooks on the appropriate module, so the changes happen in Gallery2 at the same time the changes happen in Postnuke.
From thaughbear - The user/group synchronization uses PostNuke as the master and G2 as the slave. It works exactly as I want it to work. My PostNuke and Gallery2 users are both called Admin and these are the only admin users. If you want it to work any other way submit a feature request which I may or may not implement.
Table of Contents
There are three types of blocks in mGallery2. Two of them are used to display images and one is used to move the Gallery2 sidebar out of the embedded gallery and into Postnuke's block system. The block names are:
mGallery2/Random - Show a random image
mGallery2/Specific - Show a specific image
mGallery2/Sidebar - Show the Gallery2 sidebar
The Random and specific blocks are both used to show an image (or images) in a block. In future versions, these blocks will be combined into one block that can perform both functions, as well as many others (recent images, most viewed image, etc.
The random block is a sidebar (or center) block that has the ability to display an image or several images in your theme's block content. It is a standard Postnuke block that can be added through the Blocks administration menu. To add a block:
Go to your Postnuke administration panel
Click on the system tab if you're not already there
Click on the Bocks icon
Click on the New Block link in the Blocks Administration link menu
The standard block options configuration screen will appear
In the Title field, name the block anything you want - e.g. - Random Image
Select mGallery2/Random from the Block dropdown field
Select whichever position you want from the Position dropdown
Your theme must support blocks for whichever position you select. If the theme doesn't have right blocks and you select the right position, the block will not display unless you edit your theme to support the right block or choose a supported position.
Select whether or not you want the Block to be Collapsible. If the theme template supports it, this will show a clickable icon in the corner of the block that will allow the user to collapse the block. This defaults to Yes.
Select the Default State for the block
Select the Language of the block. The current translations are en-US and deu
Click the Update button
Now you will see specific options for the mGallery2/Random block
Show Title will display the title of the image in the block, if selected.
Show Owner will display the owner of the image in the block, if selected
Show Views will show the number of views in the block, if selected
Show Date will show the EXIF date of the image in the block, if selected
The Number of Images field determines how many images will be displayed in the block. There is no maximum, so put something sane in the field.
The Maximum Image Size (width) field will determine the maximum size, in pixels, of the image in the block
Select a frame for album objects in the Album Frame dropdown box
Select a frame for image objects in the Image Frame dropdown box
The last option is another standard Postnuke block option that really isn't relevant to the mGallery2. Just leave the Refresh time for block setting at its default One hour setting
Once again, click the Update button
The block is now available. If you put it in a position that can be seen from the administration template, you should see it now. Otherwise, go to home page or another page with block support for the position you chose. You should now see your block.
Using the Maximum Size parameter and square frames (Gallery 2.2.1+) you can create a grid of images in your block. Set the number of images to four and experiment with the Maximum size parameter until two images fit on a row. The square frame is necesary to keep the width uniform.
The specific block is a holdover from the original mGallery2 source and has not been touched since it was written. It allows you to show a specific image in a block, but no options are enabled for it. The block is hard-coded to display the title and the date of the image. This block uses the image path instead of the image id when specifying an image. The best way to find the image path is to go the image within Gallery2 and click Edit Photo. The path will be displayed on the General tab under the Name section. To add a specific image block:
Go to your Postnuke administration panel
Click on the system tab if you're not already there
Click on the Bocks icon
Click on the New Block link in the Blocks Administration link menu
The standard block options configuration screen will appear
In the Title field, name the block anything you want - e.g. - Dragon
Select mGallery2/Specific from the Block dropdown field
Select whichever position you want from the Position dropdown
Your theme must support blocks for whichever position you select. If the theme doesn't have right blocks and you select the right position, the block will not display unless you edit your theme to support the right block or choose a supported position.
Select whether or not you want the Block to be Collapsible. If the theme template supports it, this will show a clickable icon in the corner of the block that will allow the user to collapse the block. This defaults to Yes.
Select the Default State for the block
Select the Language of the block. The current translations are en-US and deu
Click the Update button
Now you will see specific options for the mGallery2/Specific block
Type in the image's path in the Image path field, for instance /album1/dragon.jpg
The last option is another standard Postnuke block option that really isn't relevant to the mGallery2. Just leave the Refresh time for block setting at its default One hour setting
Once again, click the Update button
The block is now available. If you put it in a position that can be seen from the administration template, you should see it now. Otherwise, go to the home page or another page with block support for the position you chose. You should now see your block.
This block and the Random block will evenually be integrated into a multi-block that can generate different types of blocks with all of the options enabled.
The Sidebar block, unlike the Random and Specific block, does not display images on your site. Instead, it is designed to take the embedded Gallery2 sidebar out of the modules's image display area and embed it into a block. The Gallery2 sidebar is a collection of links that allow administrators to manage images and albums and also lets regular users search the gallery, print photos to online printing companies, and view slideshows, among other things. The sidebar will only show when the mGallery2 module is active and it will only have content if the Sidebar Block setting is selected in mGallery2's administrative settings. If this setting is not selected, the title bar will show, but the block will be empty and the sidebar will be display within the embedded gallery page. To install:
Go to your Postnuke administration panel
Click on the system tab if you're not already there
Click on the Bocks icon
Click on the New Block link in the Blocks Administration link menu
The standard block options configuration screen will appear
In the Title field, name the block anything you want - e.g. - G2 Sidebar
Select mGallery2/Sidebar from the Block dropdown field
Select whichever position you want from the Position dropdown
Your theme must support blocks for whichever position you select. If the theme doesn't have right blocks and you select the right position, the block will not display unless you edit your theme to support the right block or choose a supported position.
Select whether or not you want the Block to be Collapsible. If the theme template supports it, this will show a clickable icon in the corner of the block that will allow the user to collapse the block. This defaults to Yes.
Select the Default State for the block
Select the Language of the block. The current translations are en-US and deu
Click the Update button
There are no specific options for the mGallery2/Sidebar block
The last option is another standard Postnuke block option that really isn't relevant to the mGallery2. Just leave the Refresh time for block setting at its default One hour setting
Once again, click the Update button.
The block is now available. If you put it in a position that can be seen from the administration template, you should see it now. Otherwise, go to the home page or another page with block support for the position you chose. You should now see your block.

Hopefully. I'll have some time to experiment with styling the block in the future. The contents of the block can be customized within the Gallery2 Site Admin. Just edit the G2 theme and pick the items you want in the sidebar.
Table of Contents
The mGallery2 transform hook is a tag-based transform hook similar to pn_bbcode. It uses tags that begin with [mg2 to insert gallery images into your site. When the transform hook encounters a tag, it replaces it inline with the HTML of an image block. The tag can be very simple, pointing to a single image, or complex, rendering multiple random images from a specific gallery.
The transform hook can be activated for any module. Since the hook inserts html that will display an image, you should only activate this hook for modules that display something, such as News. To activate the hook for a module, follow these steps:
Go to your Postnuke Administration Panel
Click on the system tab if you're not there already
Click on the Modules icon
Find the module you would like to hook
Use the alphabet links above the modules table to make it easier to find your module
Click on the Hooks action for the module
Check the checkbox next to Activate mgallery2 for this module
Click the Update button
To test the hook, go to the module you've hooked and add some content with an mGallery2 trasform hook tag. See the next sections below for more information on the syntax and options.
In order for the images to display correctly within the News module, or any other module, you will need to edit your HTML Options in Postnuke's general site settings. The following HTML options must be Allowed with attributes.
<div>
<h4> - this is used by the image title caption
<p> - this is used by the owner and date captions
The mGallery2 transform hook tag, in its most basic form is the prefix mg2, followed by a colon, followed by an image or album id. The tag is enclosed in brackets like so:
[mg2:imageId]This example inserts a block of HTML that is returned from the Gallery2 Image Block module and inserts it inline into your content. There are many options in the Image Block module and the transform hook tries to take advantage of them all. the next section will discuss the options and give examples of their use
The hook supports the following imageblock options:
This parameter is not specified in the tag. It follows the prefix (mg2:) and consists of an integer that is a valid image or album id in Gallery2.
[mg2:21]
This example will show the image with the gallery image id of 21. If it is an album, it will show the album highlight. Without arguments, this will show the image using the defaults defined in the mGallery2
This parameter takes a pipe-delimited list of options that determine what will be shown with the image. Options include title, owner, date, views, and fullSize. None of these options is required. The options will be described below after the example.
[mg2:41 show=owner|date]
This example will show the image with owner and date information pulled from Gallery2
This show option adds a caption to the image. The caption cannot be specified. It will read the title from Gallery2.
[mg2:11 show=title]
This show option adds a caption to the image with the image owner's name.
[mg2:10 show=owner]
This show option adds a caption to the image with the image's date information.
[mg:22 show=date]
Normally, the imageblock plugin, which the transform hook utilizes, returns the thumbnail for an image, but this show option tells Gallery2 to return a full-sized image. The size of the image can be controlled with the maxSize option.
[mg2:2 show=fullSize]
This parameter sets the maximum size in pixels of the longest side of the image. If it is used in conjunction with show=fullSize it will limit the size of the full-sized images returned. Without the show=fullSize option, it will limit the size of thumbnails.
[mg2:37 show=fullSize|views|owner|title maxSize=800]
This example renders a full-sized image with a maximum height or width of 800 pixels. It also includes captions with owner, title, and views.
[mg2:22 maxSize=50]
This example limits the height or width of the thumbnail image to 50 pixels.
This parameter determines the type of imageblock to show. The possible options are specificImage, randomImage, dailyImage, weeklyImage, monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum, viewedImage, randomAlbum, recentAlbum, viewedAlbum. Only one option is permitted.
This block type shows a specific image by image id. This is the default block type.
[mg2:22 type=specificImage]
This example shows the image with an id of 22.
[mg2:22]
Since specificImage is the default option, this also shows the image with an id of 22.
This block type will show a random image from the album specified in the album id. To choose an image from the entire gallery, specify the root gallery or an d of 0.
[mg2:47 type=randomImage]
This example will show a random image from the album with an id of 47.
[mg2:0 type=randomImage]
This example will show a random image from the entire gallery
This block type will show the daily image that is determined by Gallery2. This image changes daily. Use an itemId of 0 for this type.
[mg2:0 type=dailyImage]
This block type will show the weekly image that is determined by Gallery2. This image changes weekly. Use an itemId of 0 for this type.
[mg2:0 type=weeklyImage]
This block type will show the monthly image that is determined by Gallery2. This image changes monthly. Use an itemId of 0 for this type.
[mg2:0 type=monthlyImage]
This block type will show the highlighted photo of the daily album that is determined by Gallery2. This album changes daily.
[mg2:0 type=dailyAlbum]
This block type will show the highlighted photo of the weekly album that is determined by Gallery2. This album changes weekly.
[mg2:0 type=weeklyAlbum]
This block type will show the highlighted photo of the monthly album that is determined by Gallery2. This album changes monthly.
[mg2:0 type=monthlyAlbum]
This block type will show the most viewed image from an album identified by itemId. An itemID of 0 will choose from the entire gallery.
[mg2:24 type=viewdImage]
This example will show the most viewed image from the album with an id of 24
[mg2:0 type-viewedImage]
This example will show the most viewed image in the gallery.
This block type will show the highlighted photo from a random album from the gallery.
[mg2:0 type=randomAlbum]
This block type will show the highlighted photo from the most recent album in the gallery.
[mg2:0 type=recentAlbum]
This parameter selects a frame from the imageframe module that will be displayed around albums.
[mg2:22 aframe=dots]
This example will display the dots frame around the highlighted photo from the album with an id of 22. If 22 is an image, it will use the default item frame from the module's settings. To view the different frames, click on the frame samples page in mGallery2's module settings.
This parameter selects a frame from the imageframe module that will be displayed around images.
[mg2:4 iframe=shadow]
This example will display the shadow frame around the image with an id of 4. If 22 is an abum, it will use the default album frame from the module's settings. To view the different frames, click on the frame samples page in mGallery2's module settings.
This parameter can be used in place of the iframe and aframe parameters to specify thhttpe frame for albums and images.
[mg2:0 frame=gold type=randomAlbum]
This example will display the gold frame around the random album chosen by Gallery2 from the entire gallery.
[mg2:0 frame=flicking type=viewedImage]
This example will display the flicking frame around the most viewed image in the gallery.
This parameter selects the class that will be applied to the imageblock's div. The options for this parameter are a list of predefined divs:
left - float left
right - float right
center/centre - center the image
normal - no styling
[mg2:44 class=left show=owner|date|title]
This example will display the image with an id of 44 and float the block left. The block will have owner, date, and title captions.
This parameter specifies the number of images to display. There is no sanity checking on this parameter, so if you specify 100 images, you will get 100 images. Be warned! f you specify the n parameter for a specificImage type, only one instance of the image will be displayed.
[mg2:12 type=randomImage n=3 class=center]
This example will display three random images from the album
with an id of 12 and center the images. Without captions, the images
will display inline.
[mg2:12 type=randomImage n=3 class=center show=title]
This
example will display three random images from the album with an id of
12 and center the images. Since this example includes a title caption,
the images will display vertically.
All mg2 tags must specify an itemId. This itemId can refer to an image ID or an album ID. Image IDs are only used when the specificImage block type is selected. All other blocks use an album ID. If you try to use an image id with an album-type image block, mGallery2 will return an error instead of an image.
Table of Contents
G2Image is a TimyMCE plugin that adds an icon to the TinyMCE toolbar. The plugin allows a user to choose an image from a Gallery2 installation by browsing thumbnails. In this document, it will be set up to insert tags which will be transformed by the mGallery2 transform hook into image blocks. This chapter describes the steps that need to be taken to get g2Image working with TinyMCE within Scribite.
To get this combination working, you will need several components installed and working:
Postnuke .764 - download at http://www.postnuke.com/
mGallery .02+ - download at http://noc.postnuke.com/projects/mgallery2/
Scribite - download at http://noc.postnuke.com/projects/scribite/
Scribite configured to use TinyMCE and hooked to the News module
Download G2Image - http://g2image.steffensenfamily.com/index.php?title=Main_Page
You can find documentation to install each of these components at their respective web sites or within the downloaded archive. The installaton and configuration of G2Image will be described below.
The G2Image download archive contains two folders. The first is
tinymce_plugin, which is the one we're interested
in. The second is wordpress_plugin, which we will
ignore. Inside the tinymce_plugin folder is another
folder, g2image. This is the folder we will be
working with. To install:
Copy the g2image folder into your
modules/scribite/pnincludes/tiny_mce/plugins
folder
Open the g2image folder
Open the config.php file
Go to line 56, which should read:
$g2ic_default_alignment = 'none';
Change the word none to left
Go to line 63. There should be four lines here defining custom classes. All of them should be set to unused, like the one below:
$g2ic_custom_class_1 = 'not_used';
Edit each of the four lines to define the following custom classes:
$g2ic_custom_class_1 = 'left'; $g2ic_custom_class_2 = 'right'; $g2ic_custom_class_3 = 'center'; $g2ic_custom_class_4 = 'centre';
Go to line 98, which should read:
$g2ic_default_action = 'thumbnail_image';
Edit the line to read:
$g2ic_default_action = 'drupal_g2_filter';
Go to line 121, which should read:
$g2ic_embedded_mode = FALSE;
Change the value to TRUE
Go to line 143, which should read:
$g2ic_gallery2_uri = 'http://www.domain.com/gallery2/main.php';
Change the value to your your Gallery2 URI, including the main.php at the end
Go to line 159, which should read:
$g2ic_drupal_g2_filter = FALSE;
Change the value to TRUE
Go to line 163, which should read:
$g2ic_drupal_g2_filter_prefix = G2;
Change the value from G2 to mg2
Save the file
Because the Scribite module includes a version of TinyMCE with a
version number greater than 2.03, you need to copy the files in the
g2image/TinyMCE_version_2.0.3_files folder up to
the g2image folder, overwriting the ones that are
there.
If you or your provider have activated the open_basedir
restriction in PHP, G2Image will work, but you will see lots of errors.
The G2Image code, as downloaded, tries to figure out if it is in a
WordPress installation by searching for wp-config.php somewhere in the
directory tree from its current location. As it climbs up the tree, it
eventually tries to leave the web root and generates these errors. You
can get rid of this functionality by editing the file
modules/scribite/pnincludes/tiny_mce/plugins/g2image/init.php.
There is a section in the code labeled WPG2 Validation. This section
needs to be removed. simply delete lines 23 through 137 in the
file.
Before enabling the plugin in Scribite, Scribite needs to know where to add the plugin's icon to the TinyMCE toolbar. This requires more editing:
Open the file
modules/scribite/pntemplates/tinymce_editorheader.htm
Go to line 44, which should read:
theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
Add g2image at the end of the list, like this:
theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen,g2image",
Save the file
Now that scribite knows how to add the icon to the plugin, you must enable the plgin within Scribite. To do so:
Go to your Postnuke Administration Panel
Click on the 3rd party tab
Click on the Scribite icon
Click on the tiny_mce settings tab
Find g2image in the tiny_mce Plugins section
Check the checkbox for g2image
Click Save Configuration
To test, add a story in your News module. You should see the g2image icon on the right side of the lowest toolbar in TinyMCE. The screenshot below shows TinyMCE with the G2image icon.
mGallery2 is registered as a project in the NOC. Please use the NOC for all support requests.