WPG2 - WordPress / Gallery2 Integration
Version 2.0
Authors: WPG2 Development Team
Online Documentation: wpg2.galleryembedded.com
Support Forum: www.galleryembedded.com
I - REQUIREMENTS
- To use the "WPG2" plugin, you must have Gallery2 installed and properly configured:
- You must have Gallery2 2.1
- NOTE: This version WILL NOT WORK with Gallery2 version 2.0.x.
- Use WPG2 version 1.0 with G2Image version 1.3.5 if you need to use Gallery2 version 2.0.x.
- If you are using Gallery2 2.0.x, we highly recommend that you upgrade to Gallery2 2.1 and WPG2 2.0 because of Gallery2's greatly improved performance and WPG2's automated setup.
- You must also have the Gallery2 ImageBlock and ImageFrame modules installed and activated.
- The ImageBlock and ImageFrame modules do not come with the "minimum" Gallery2 installation and must be downloaded from the Gallery2 download page and installed separately.
- You must also have WordPress installed and properly configured:
- Requires version 2.0.2 or greater.
- Wordpress & Gallery2 may be on different subdomains.
- Wordpress & Gallery2 should be installed on the same Database.
- Only one WordPress Blog tied to one Gallery2 Gallery
- Unless you only have one identical user on multiple blogs, tying multiple blogs to one gallery will cause user errors because there is not a way to currently distinguish one blog's users from another blog's users within Gallery2.
- PHP memory limit of 16MB or better.
- Tested with IE 6.0 and Firefox 1.5.
II - INSTALLATION
Upgrading
- If you are upgrading from WPG2 version 1.0, delete all of the files in the /wordpress/wp-content/plugins/wp-gallery2/ directory.
- If you are upgrading from a pre-release version of WPG2 version 2.0, deactivate WPG2 on the WordPress Plugins Management Panel.
File Installation
- Unzip the files.
- FTP the file "wp-gallery2.php" to your WordPress root directory. This is the directory that contains wp-config.php. Under a default WordPress installation it is /wordpress/.
- FTP the contents of the "wp-content/plugins/wpg2/" directory to a new folder called /wpg2/ in your WordPress plugins directory, /wordpress/wp-content/plugins/.
- FTP the contents of the "wp-includes/js/tinymce/plugins/g2image/" directory to a new folder called /g2image/ in your TinyMCE plugins directory, /wordpress/wp-includes/js/tinymce/plugins/.
- After everything is installed, force a reload (for FireFox) or a refresh (for IE) at the "Write Post" and/or "Write Page" admin pages. This forces the TinyMCE javascript to reload and display the button.
- See Configuration, below, for activating and configuring the plugin.
More TinyMCE Considerations
- If you previously installed a modified WP 2.0 tiny_mce_gzip.php file for an earlier g2image version, you should use the tiny_mce_gzip.php included with WP 2.0.2 instead.
- All of the changes have been incorporated in the WPG2 plugin and the WP 2.0.2 version of tiny_mce_gzip.php
- If you do not replace the previous tiny_mce_gzip.php file, the program will function properly, but you will have two g2image buttons.
- If you are using the rich-text editor and you have any other plugins that affect the TinyMCE button layout, like the Advanced Editor Plugin, you need to check whether you'll need to add "g2image" to their button setup.
CSS for the alignment options
- If you want to use the built-in alignment options, you'll need to add these four classes to your CSS. You can also add up to four custom classes to your CSS and add to the Custom Classes options on the WPG2 Image Options admin tab. Custom classes will be available in the alignment selector.
- You'll need to customize these to fit into your site design. This is how they're implemented in the CSS for www.steffensenfamily.com:
.g2image_normal { margin: 4px; } .g2image_float_left { float: left; clear: left; margin: 4px; } .g2image_float_right { float: right; clear: right; margin: 4px; } .g2image_centered { display: block; margin-left: auto; margin-right: auto; text-align: center; }
- Note: The alignment classes only apply to WPG2ID/WPG2 tags and HTML thumbnails, not text links.
Language Support
- Version 2.0 shipped with support for English (en) and Chinese Traditional (zh_TW) for the WPG2 admin tabs and English (en), Chinese Traditional (zh_TW), Italian (it), and German (de, and de_DE) for the G2Image popup windows. Check the WPG2 support forum and the G2Image homepage for more translations.
- WPG2 Admin Tabs: If you use poEdit to translate /wpg2/locale/wpg2.pot into your language's wpg2-xx.po and wpg2-xx.mo files, you can use them by placing them in the /locale/ folder. They must have the same encoding and name as the WordPress locale file as set by WPLANG in wp-config.php.
- Example: The WordPress Traditional Chinese localization is encoded in UTF-8 and are named zh_TW.po and zh_TW.mo. The corresponding WPG2 localizations are also in UTF-8 and are named wpg2-zh_TW.po and wpg2-zh_TW.mo.
- G2Image Pop-Up Windows: If you translate /g2image/langs/en.js and en.php, you can use them by changing the language setting editor_plugin.js.
- The main G2Image popup window will automatically use the language defined wp-config.php as WPLANG.
- The WPG2 and WPG2ID popup windows in the rich-text editor require a change to /g2image/editor_plugin.js. Add your language to the second line with a preceding comma after the "de_DE". For example Russian (ru_RU) is added here:
tinyMCE.importPluginLanguagePack('g2image', 'en, zh_TW, it, de, de_DE, ru_RU');
- Please share your translations by posting them on the WPG2 support forum.
IV - CONFIGURATION
Activate WPG2
- Activate WPG2 on the WordPress Plugins Management Panel.
Validate WPG2
- You will now have a "WPG2" options tab on the main WordPress Admin Menu Bar.
- Select it. The first tab is a WPG2 submenu tab.
- Enter your Gallery2 URL in the "Auto Configuration of Embedded Paths - Gallery2 URL" text field and press the "Auto Configure" button. This should result in a valid setup.
- If you have any errors, follow the directions in the error message to resolve any issues.
- If you cannot get the auto configuration to work, enter the path information manually in the "Manually Configure/Adjust Embedded Paths" section. Guidance on each field is provided immediately below the field.
- This will happen in the rare case of using Gallery2 on a different subdomain on a clustered server arrangement where the computer hosting your site has a different IP address than the IP used in the HTTP request.
Verify User Account Setup
- Once WPG2 is validated, there will be a "Gallery2 Users" tab under the WordPress "Users" tab.
- Verify that all of the users who should have Gallery2 Admin privileges through the embedded page (wp-gallery2.php) are in the list of Gallery2 Admin Users.
- Verify that any other users who should be logged in as a Gallery2 user (but not admin) through the embedded page are in the list of WordPress users without Gallery2 admin accounts.
- Any Wordpress users who do not have a corresponding Gallery2 account will appear in the list of WordPress users without Gallery2 user accounts.
- These lists will only appear if there is one or more user in them.
- See the online documentation and the WPG2 support forum for more information.
V - OPERATION
- Images in blog posts: Use the G2Image popup by clicking the "G2Image" button (if using TinyMCE, the rich-text editor) or the "WPG2" quicktag. <wpg2id> tags provide the most flexibility because they will work if you move your images and/or albums around within the Gallery2 album structure.
- Single images in the sidebar - Use the following code:
<?php print g2_sidebarimageblock(); ?>
This will create a sidebar image block per the settings on the WPG2 Sidebar Options tab. - Sidebar grids (multiple images of one type):
- Use the following code:
<?php print g2_sidebargridblock(); ?>
This will create a sidebar image gridblock per the settings on the WPG2 Sidebar Block Options tab. - You can also use the following code:
<?php print g2_sidebargridblock('blocktype', number_of_images, blockmaximgsize, 'blocktitle'); ?>
This will create a sidebar image gridblock using the parameters defined in the fuction call, if present. If a given parameter is not included in the function call, the settings from the WPG2 Sidebar Block Options tab will be used for that parameter.- Valid options for 'blocktype' are
- 'randomImage'
- 'recentImage'
- 'randomAlbum'
- 'recentAlbum'
- number_of_images is an integer that defines the number of images that will be included in this particular image gridblock.
- blockmaximgsize is an integer that defines the maximimum number of pixels that a thumbnail will occupy in either width or height. This can be larger than the pixel size of your Gallery2 thumbnails, but it will not increase the size of the thumbnail in this case.
- 'blocktitle' is the title that you want shown as a <h2> heading in the image gridblock.
- Valid options for 'blocktype' are
- Use the following code:
- See the online documentation and the WPG2 support forum for more information.
VI - ABOUT THE LICENSE
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, in the LICENSE.HTML file.
If you have not received a copy of this file along with this program, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA