HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Tutorial: Advanced galleries

Written by Chris Graham, ocProducts
The ocPortal gallery system provides a number of advanced features – this tutorial will describe some of them.



Importing

Thumbnail: The interface to import to a gallery

The interface to import to a gallery

It is possible to fill a gallery with the images and videos contained within a ZIP or TAR file. This is a very useful feature to quickly fill a gallery; an example usage might be to put all images on a digital camera memory card into an archive file, and to upload the file.
When importing a gallery this way, no descriptions are added for the entries. However it is possible to add descriptions, and customise other details, simply by editing the entries individually.

There is an additional "import to gallery" feature that works on the premise that any image or video file located in the uploads/galleries directory should be pointed to by an entry in the system. Any such file that is not pointed to, is labelled as an 'orphaned file', and the import feature allows such files to be chosen selectively and imported into any gallery. This is useful because you can upload large file sets directly to uploads/galleries and then batch-add them.

If you have a CSV (spreadsheet) file named uploads/galleries/descriptions.csv, with the first column containing filenames, and the second column containing descriptions, then this will be checked when bulk importing files.
Also, EXIF data (in JPEG and TIFF files) will be checked for descriptions (PHP 4.2+ only).

The orphaned files importer will auto-select any orphaned files that are put in a directory of the same name as the gallery you are importing. This is useful if you have been organising your gallery images/videos into a directory structure before-hand, as it stops you having to manually re-select what-goes-where when you do the import. Note that the gallery structure is only one-level-deep, there is no support for subdirectory nesting; however, that is not required anyway as gallery names must be unique and thus there is no potential for directory name conflict.

Exporting

For members that have permission, gallery contents may be downloaded in a ZIP file archive, from a download link presented at the bottom of a gallery screen.

These ZIP files contain only the actual image and video files, and not any meta content such as descriptions.

Member Galleries – quick start


Thumbnail: Editing a gallery to be a member gallery container

Editing a gallery to be a member gallery container

Thumbnail: Making a personal gallery by adding an image

Making a personal gallery by adding an image

ocPortal supports members having their own galleries of images/videos.

To enable this:
  1. make sure members have permission to submit midrange entries to the site:galleries module, and also permission to have personal categories. It is up to you to decide whether you want to provide these permissions on just the site:galleries module (the permission tree editor will help with this), or globally.
  2. Make sure members have access to the Content Management zone.
  3. Add/edit a gallery (the root gallery will do, if you want personal galleries to be created directly underneath this) to have the 'Personal category container' option ticked. Make sure the gallery you add/edit also has image/video submission enabled (the properties of this gallery will be transferred to new personal galleries underneath it).
Now when members submit a new image, they will get the choice to create their personal gallery in the process, and further submissions can then also go into their personal gallery. If you want to add a quick link that members may use to submit images, add cms:cms_galleries:ad to a menu.

Members may have multiple personal galleries if you set multiple galleries to be 'Personal category container'.

Member Galleries – full explanation


Thumbnail: A personal gallery as displayed in the container gallery

A personal gallery as displayed in the container gallery

If a member is in a usergroup with special permission (permission to have personal categories), they may create their own galleries that are:
  1. displayed as belonging to them
  2. display their profile details
  3. and only addable-to (by default) by them

The personal gallery system is very sophisticated, and integrated with the hierarchical nature of the gallery system. Members may have personal galleries underneath any gallery in the hierarchy that is marked as a 'Personal category container'; this means that a member may have multiple personal galleries if there are multiple containers.

The settings of new personal galleries are based on:
  1. hard-coded defaults
  2. the settings of the container gallery
  3. the permissions of the container gallery
For example, if the container gallery does not allow videos, neither will personal galleries underneath it, unless edited after it's auto-creation to do so.

Thumbnail: The naming scheme that identifies personal galleries

The naming scheme that identifies personal galleries

Personal galleries, like personal news categories, may be created on demand, simply by choosing a personal gallery for the adding member that 'has the potential to exist' from the list of galleries to submit to: upon submitting, the gallery is automatically created. Personal galleries are given a codename corresponding to the owner, as shown in the screen-shot.



Thumbnail: Viewing an image in a member gallery

Viewing an image in a member gallery

An example of a complex gallery hierarchy is as follows:
  • (root)
    • Germany Holiday Photos 2004 (*)
      • Benjamin's Photos (+)
      • Harry's Photos (+)
    • School Photos
      • Secondary School (*)
        • Benjamin's Photos (+)
        • Harry's Photos (+)
        • Julie's Photos (+)
      • Primary School (*)
        • Benjamin's Photos (+)
        • Harry's Photos (+)

(*) denotes a personal gallery container
(+) denotes a personal gallery created upon adding by the owner

Personal galleries may only be submitted to by the owner of the personal gallery, unless the "Submit to categories belonging to other members" specific permission is assigned.

Limiting member galleries

There are permissions and configuration options relating to the gallery system that allow you to limit the number of entries that members may have in their own galleries.
ocPortal provides this functionality using a three-tiered system:
  • low limit on entries in member galleries
  • high limit on entries in member galleries
  • no limit on entries in member galleries
The 'low' and 'high' limits are configurable using configuration options, with separate settings for both images and videos.
The tier that a member resides in is based on usergroup permissions with two specific permissions which may be set for usergroups:
  • has high limit in member galleries
  • has no limit in member galleries



See also

Is this tutorial insufficient?

If you think this tutorial needs work (maybe we didn't explain things well enough?) please let us know.