Gallery2 Plugin Overview

version 1.5

Allows including photos from your gallery2 installation in your posts and syncing of users and session info with gallery2.

Requirements

Documentation

Gallery2 Plugin Installation

Installation of the Gallery2 Plugin can be complicated based on how you have your b2evolution setup. However, If you have a fairly standard setup you should be able to install this plugin without modifying any source code files.

Installation

The installation of the gallery2 plugin requires a little more than simply copying the plugin directory to the plugins folder. Based on how you plan to use the gallery2 plugin you may be able to skip some steps.

  1. Unzip the zip file and copy the gallery2_plugin folder to your blogs/plugins folder.
  2. If you don't want to use single sign on with gallery2 you can skip this step.
    • Copy the gallery2_plugin/gallery folder to where you would like gallery to be located on your webserver. The gallery folder must be under your b2evolution blogs directory.
      Note: Users will access this location from now on to get single sign on.
    • Edit the gallery/main.php file so that the first include statement points to the b2evolution blogs/conf/_config.php
  3. Install the gallery2 plugin in the b2evolution admin interface. The gallery2_plugin will search for your gallery2 installation but it may likely complain about not being able to find it.
  4. If the gallery2_plugin found your gallery2 installation you can skip this step.
    • Open the settings for the gallery2 plugin.
    • Set the directory to your gallery2 installation. This can be a relative path from b2evolution to your gallery2 installation or an absolute path.
    • Set the gallery2 url to be the url to your gallery2 installation. This can be a relative or absolute url.
    • If you are using single sign on, check the single sign on check box and set the embedded path to the relative path from your b2evolution blogs directory to the gallery folder you uploaded in step 2.
    • Save the settings.
  5. Enable the gallery2 plugin.
    Note: If you use single sign on, when you enable the plugin your b2evolution users and gallery2 users will be synced. The first admin user in gallery2 will be synced with the first admin in b2evolution
  6. If you use single sign on, edit your gallery2 config.php and set mode.embed.only to true.
    Note: This will disable your previous gallery2 urls. Access your gallery via the gallery folder uploaded in step 2.

Gallery Plugin Settings

Single-Sign-On Notes and Gotchas

Inserting Gallery2 photos into posts

You can insert Gallery2 photos into posts using the "G2Image" button at the bottom of the compose window when writing a new post in the admin interface. Pressing the G2Image button will bring up a popup window with which you can select photos from your gallery. Simply select the photos you wish to insert by checking the check box in the upper-left corner of each photo and click the "Insert" button.

There are several methods with which you can insert photos. Under the "Insertion Options" you can select from the "How to Insert Image" drop down box one of the following options. Most are self explanatory. The default values for this and all of the options that appear in the G2Image window can be set in the Gallery2 Plugin Settings.

Using the Gallery2 image block widgets.

The Gallery2 Plugin provides the ability to add image block widgets in conjunction with the Image Block Plugin for Gallery2. These widgets can display random images, recent images, viewed images etc. from your Gallery2 gallery in your b2evolution blog's side bar or page top areas of your blog. It can be added any number of times with any number of combinations of options.

Widget Options

The Gallery2 Plugin widget allows you to select a number of options.

Using the widgets in b2evolution 1.9 - 1.10

The Gallery2 image block widgets are supported in versions of b2evolution older than 2.0. Widgets are supported by adding some code to your blog skin. It will be a call to the SkinTag() function in the Gallery2 Plugin which is called via the b2evolution plugins interface. It will look something like the following:

$Plugins->call_by_code('evo_gallery2_auth', array("block_start" => '<div class="bSideItem">',
                                                  "block_end" => '</div>',
                                                  "block_title_start" => "",
                                                  "block_title_end" => "",
                                                  "title" => "",
                                                  "blocks" => "randomImage",
                                                  "show_title" => 1,
                                                  "show_heading" => 1));

Supported options are:

blocks - An array containing blocks to show or a string containing a single
         block name
         valid values: randomImage, recentImage, viewedImage, randomAlbum,
                       recentAlbum, viewedAlbum, dailyImage, weeklyImage,
                       monthlyImage, dailyAlbum, weeklyAlbum, monthlyAlbum,
                       specificItem

show_title - Show the item title.

show_heading - Show the item heading.

show_date - Show the item date.

show_viewcount - show the item view count.

show_owner - show the item owner

itemid - Limit the item selection to the subtree of the gallery under the
         album with the given id; or the id of the item to display when
         used with specificItem block type

maxSize - Scale images to this maximum size. If used alone Gallery will
          locate the most-closely-sized image to the specified value - 
          larger images will be scaled down as necessary in your browser.
          If specified along with show=fullSize the full size image will
          always be used and scaled down as necessary.

exactSize - Just like g2_maxSize except that it will not substitute an
            image smaller than the size you request, so you'll get the
            closest match in size possible. Note that this may use a lot
            more bandwidth if a much larger image has to be scaled down in
            your browser.

link - Href for link on image; value of none for no link; default is link
       to item in the Gallery.

linkTarget - Add a link target 
             (for example, to open links in a new browser window)

Widget customization

In order to get the widget to display properly in the areas of your blog skin other than the sidebar you may need to customize the css stylesheet for your skin. You can do this by creating a css class called "widget_plugin_evo_gallery2_auth" and/or the css class called "one-image" modifying it's properties. You can also make any customizations you may need or wish to the display of the widget this way.

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.

Warranty

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.

Copyright (C) 2007 Ian Lewis (IanLewis@member.fsf.org)