How to start with WP Photo Album Plus

This site may temporary be out of order and/or you may see no photos for a while. I am always testing new features or investigating reported problems that require code modifications

This post demonstrates how to start with WP Photo-Album-Plus.

After installation of the plugin do the following:

In order to make sure that the directory …/wp-content/uploads exists, upload a simple image by using the ‘Add an image’ button on top of the edit area of the ‘Edit Post’ admin page if you did this not before.

There must be something in the upload directory

Then create at least one album and upload or import more then one photo to it.

If there is only one photo in an album, it is assumed that the album is not ment to contain photos, but to contain child albums only.

Therefor the photo will not be shown in the album, but will solely be used as a cover photo.

You can change the minimum number of photos, so you can have changing coverphotos for such albums.

For more info: see the Settings admin panel: Photocount treshold.

Now make a post or page with e.g. the title “Photo album”.
Enter in the text area simply the text: %%wppa%% and save the post or page.
View the page or post and you will see something like this:

How to start with WP Photo Album Plus

First album

This is the description of the first album. It has a € sign in the description.

Second album

Just another album
You can even have a link here!

Album # 4

This is album four. It has (') and (") quotes in its description as well as html.

You just created your first Photo album page (or post).
Try the links, view the thumbnail images and the slideshow.

There is much more to do! See the Tutorial (Menu tab above), but this is enough for now!


Bookmark and Share
Posted in Uncategorized | Comments Off

Version 4.3 IPTC and EXIF introduced

In version 4.3 IPTC and EXIF support in WPPA+ is introduced.

If you have WPPA+ version 4.3 or later, all available IPTC and EXIF data that is inside the photo file will be captured and imported into the WPPA+ system (db tables wppa_iptc and wppa_exif).
This is regardless of wheter the IPTC and/or EXIF boxes are enabled in Table II items 28 and 29.
Note that this feature is only configurable in the Auto Save version of the Settings page.

The capturing of this info is done either when uploading or importing photos to the wppa+ system.
If you want the IPTC and EXIF data to be imported from existing photos, you will have to update them using the wppa-depot and the update checkbox checked on the Import photos admin page. This will keep the original phot ids and will prevent the generation of duplicates. Also when updating you do not need to know the potos albums.

Once there is IPTC and/or EXIF data present, The Tables X and XI will show all the IPCT and EXIF tags that were actually found during upload/import.

You can edit the lables, you can even make them multilangual according to the qTranslate rules. Example (used on this site):

Exif tag E#9202 has description:
[:en]ApertureValue:[:nl]Diafragma:
to make sure the labels will display in the sites language.

You can also change the display status in the Tables on the settings page, so only the tags you want to show up in the IPTC and EXIF boxes will be displayed.

You can use the IPTC and EXIF data in the descriptions of photos very easy.

To embed a IPTC tag value into a description, use for example: 2#080 to display the photographers name.
To embed a EXIF tag value into a description, use for example: E#829A to display the exposure time.

The full text i use in the description of Jules Gobeils birds in this site is:

[:en]Title: 2#120.<br />photo by 2#080.
Exposure time: E#829A. Aperture: E#9202<br /><a href=”http://www.julesgobeil.com”>(www.julesgobeil.com)</a>[:nl]Titel: 2#120.<br />foto: 2#080.<br />Belichtingstijd: E#829A. Diafragma: E#9202<br /><a href=”http://www.julesgobeil.com”>(www.julesgobeil.com)</a>

Note 1: You need “Allow HTML” (Table IX-4) checked.
Note 2: As soon as you have figured out your standard description, you can put it in Table IX-12 so it will be there automaticly on new uploaded/imported photos.

Bookmark and Share
Posted in Uncategorized | Comments Off

Birds by Jules Gobeil

Jules Gobeil, who is a professional photographer uses WPPA+ for his website
Here a few examples of his work.

Bookmark and Share
Posted in Uncategorized | Comments Off

Combining WP and WPPA+ Search results

To produce a combined display of the normal wp search results and the wppa+ serach results do the following:

  1. Make sure your wppa+ revision number is 4-1-1-002 or later. You will find your full wppa+ revision number on the Photo ALbums -> Settings admin page in the header. Example:
     

    Database revision: 411. WP Charset: UTF-8. Current PHP version: 5.2.17. WPPA+ API Version: 4-1-1-002.

    The full wppa+ revision number is the number after
    WPPA+ API Version:

    If you are not up to date and did all automatic updates, see this page for instruction how to re-install wppa+.

  2. Find the file search.php in your theme directory, and bring it in a text editor.
  3. Locate the line:

    <?php if ( have_posts() ) : ?>

    and change it into the next 3 lines:

    <?php $have_photos = function_exists('wppa_have_photos') && wppa_have_photos('450'); ?>
    <?php $have_posts = have_posts(); ?>
    <?php if ( $have_posts || $have_photos ) : ?>

  4. The next action is to find the place where the posts are printed.
    If it is:

    <?php while ( have_posts() ) { : ?>

    change it into:

    <?php if ( $have_posts ) while ( have_posts() ) { : ?>

    and add after the the closing of the while loop:

    if ( $have_photos ) wppa_the_photos();

    (make sure this code is within <?php ?> tags)

    If it is:

    get_template_part( 'loop', 'search' );

    change it into:

    if ( $have_posts ) get_template_part( 'loop', 'search' );
    if ( $have_photos ) wppa_the_photos();

Notes:

  • The argument ’450′ in this call: wppa_have_photos('450'); is the column width you want the albums and photos to be displayed. If ommitted, the Column width as defined in Table I item 1 of the Settings page will be used.
    It is the same as in %%size=…%%.
  • It is required to have a page assigned to the search results (See Table IX item 2) that contains at least %%wppa%% in order to make the links from photos and albums work.
  • A working example (that is used in this site) for the theme twentyten is included in the plugin. See …/wp-content/plugins/wp-photo-album-plus/theme/search.php

Bookmark and Share
Posted in Uncategorized | Comments Off

The photo of the day in a post

The following code generates the photo of the day in a post:

%%wppa%%
%%photo=#potd%%
%%size=450%%
%%align=center%%


Bookmark and Share
Posted in Uncategorized | Comments Off

Test post for a slideshow problem

Hello World!
Average rating  1 2 3 4 5  You must login to vote
«   »

Bookmark and Share
Posted in Uncategorized | Comments Off

RSS Test 12 U

I think it will be ok before test #13.

This is how an Album Cover shows in the feed:

RSS Test 12 U Second album Child album

Child album

This is a child album
It's parent is "Second album"


And now: The Album contents:
RSS Test 12 U Second album Child album
HPIM0566 (Small).jpg
HPIM0566 (Small).jpg
Rating: 3.00
HPIM0563 (Small).jpg
HPIM0563 (Small).jpg
Rating: 3.33
Vliegenzwam
Vliegenzwam
Vliegenzwam te Maasbree
Rating: 3.92
HPIM1871.JPG
HPIM1871.JPG
In de tuin
Rating: 2.00
HPIM1870.JPG
HPIM1870.JPG
Rating: 1.86
HPIM1868.JPG
HPIM1868.JPG
Rating: 4.00
HPIM1867.JPG
HPIM1867.JPG
Rating: 3.33
HPIM1866.JPG
HPIM1866.JPG
Rating: 3.29
HPIM1865.JPG
HPIM1865.JPG
Rating: 2.20
HPIM0565 (Small).jpg
HPIM0565 (Small).jpg
Rating: 2.29
Afb005.jpg
Afb005.jpg
The brief photo descriptio
2128.jpg
2128.jpg
The brief photo description
More -->
2129.jpg
2129.jpg
The brief photo description
More -->
2130.jpg
2130.jpg
The brief photo description
More -->

And now: The Slideshow:
RSS Test 12 U Second album Child album
Hello World!
Average rating  1 2 3 4 5  You must login to vote
«   »

And a single picture:


That’s all folks!

I told you it would be ready before test #13, didn’t I?

Bookmark and Share
Posted in Uncategorized | Comments Off

Coming up: Version 3.0.0

Important changes have been made to the code. This is to reveal a conceptual inconsistency that had been in the code ever since i started this project when i adopted wppa (without +) approximately one year ago when it was clear that it was no longer supported by the original author.

To say it in simple words: The conversion of %%wppa%% to the html that does the work is done by a filter. The original filter leaned on two philosophies: one is to transform the content of a post or page in a way: Original text in -> [wppa program] -> modified text out.
The other is: while interpreting the %%wppa%% script, output the results directly to the browser. The remaining text was then outputted afterwards.

Some themes do a pre-interpretation of the php code. There is where it went wrong, the output was created twice, during the pre-interpretation (above the page) and also at the right location. This explains the problem as you can see here on the forum.

This is fixed now, the filter neatly processes the incoming text now and inserts the html in the content of the page or post.
The theme takes care of the output to the browser. The only php echo commands left in the theme-side code are errormessages, diagnostic messages and initializing javascript commands.

Although you should hardly see any differences (apart from a few enhancements and fixes), it is worthwile to upgrade to this version. A side-effect of all the effort i put in this conversion is: more stable and reliable code that executes aproximately 30% faster.

= New features in 3.0.0 =

  • You can link thumbnails to a different (selectable) page, either to a full-size photo on its own or in a slideshow/browseable mode.
  • You can link the photo of the day to a full-size photo on its own or in a slideshow/browseable mode or to the current photos album contents display (thumbnails).
  • You can set the thumbnail display type to — none —. This removes the ‘View .. photos’ link on album covers, while keeping the ‘View .. albums’ link.
  • When the Slideshow is disabled and there are more than the photocount treshold photos, the ‘Slideshow’-link is changed to ‘Browse photos’ with the corresponding action.
  • The front end (theme-part) is now seperately translatable. Only 43 words/small sentences need translation. A potfile is included (wppa_theme.pot).
  • There is a new script command: %%mphoto=…%%. This places the single photo on a background with caption, just like a single standard wp media photo.
    Example:
    %%wppa%% %%mphoto=1900%% %%size=250%% %%align=right%%

    A wood or heathland Ant, Formica fusca, holding a microchip

    There are no link options (yet), but the behaviour is as you would expect, the text wraps around the picture. You have the ususal control over size and alignment.

= Notes to programmers =

  • The theme file wppa_theme.php is no longer a file that is included for every wppa-occurrence, it is now included once and contains the
    function wppa_theme().
  • The globals $wppa_xxx are now grouped together in the array global $wppa;. The following rule applies: $wppa_name is now $wppa['name'].
  • The options previously retrieved with get_option(‘wppa_xxx’, ‘default’) are now grouped together in the array global $wppa_opt;. The following rule applies: get_option(‘wppa_optionname’, ‘default’) is now $wppa_opt['optionname'] which has its default set during plugin activation, only if there is no setting yet. So, you need not to worry about missing (default) settings.
  • If you use wppa_albums() in a template to invoke the wppa+ system, be aware that it does not echo anything. The function first clears $wppa['out'], then all the html is accumulated to $wppa['out'] which is finally returned. So use one of the following constructions:
    1. $my_text = $my_before;
      $my_text .= wppa_albums($arg, $arg, ...);
      $my_text .= $my_after;
      echo($my_text);
    2. echo($my_before);
      echo(wppa_albums($arg, $arg, ...));
      echo($my_after);
    3. echo($my_before);
      wppa_albums($arg, $arg, ...);
      echo($wppa['out']);
      echo($my_after);
    4. wppa_albums($arg, $arg, ...); /* This needs no longer to be at the place the ouput comes */
      echo($my_before);
      echo($wppa['out']);
      echo($my_after);
  • If you use more than one time wppa_albums($arg, $arg, …), make sure you echo or copy the result: either the returned value or $wppa['out'] (which is the same), as $wppa['out'] will be cleared at the start of each call.
  • The documentation of the WPPA+ API functions is not up-to-date yet. The most important thing to know is that all echoing versions of existing returning functions are removed as they are no longer needed; forbidden i should say. For detailed information see the source code: wppa_functions.php and wppa_theme.php are the only files of interest to api programmers.
  • If you want to insert something to the output stream use the new function wppa_output($text);.
  • The function wppa_sep() has been removed. The new function wppa_get_permalink($key) will return the link with the proper separator attached in all cases. The following rule applies to $key:
    If $key = ”, ’0′, ‘js’, or ommitted, the link to the current page/post is returned, the link to the page $key otherwise. ‘js’ is for javascript application where & will be used in stead of &amp and will return the current permalink with separator.


Bookmark and Share
Posted in Uncategorized | Comments Off

What’s new in 2.5.0

A rating system has been implemented.

Below the full size images there is an extra box (if you keep it enabled and you use the new default wppa_theme.php) that contains one or two rows of 5 yellow stars. Visitors can rate your photos from one to five stars.

The administrator can configure:

  • If a visitor must be logged in to vote, or not,
  • If a visitor can change his rating, or not,
  • If a visitor can issue multiple votes for the same photo and hence influencing the average rating.

Ratings can be cleared on an album basis and on a system wide basis.

To prevent from spamming votes, there is a time delay of two seconds after voting.


A TopTen Sidebar Widget has been added.

The topTen widget displays the top ranked pictures. The number to be displayed is configurable from 2 to 40. The size of the thumbnails can be set in the settings screen to get a one, two or three column display.
All three widgets (Photo of the day, Photo search and TopTen) are dynamic.


Increased link configurability

You can enter a custom url and title for the link from the Photo of the day.


There is a new module: Export.

This enables you to transfer entire treestructures of albums with photos from one WP installlation to another.
It is also usefull for backup purposes.

If your php version is at least 5.2.7, a zip-file will be created that contains all the required information and photos. If your php version is older, a bunch of files is created:

  • *.pmf being ‘photo meta file’, containing name and description of the photo and the album it belongs to.
  • *.amf being ‘album meta files’ that hold the album name and description.
  • *.jpg/*.png/*.gif being the pictures.

Because it is allowed for a photo to not have a name, and it is allowed for multiple photos to have the same name within an album, it is not possible to check for duplicate photos.

So, be carefull not to import transferred photos more than once or you will end up with duplicate pictures. The ‘Delete after successfull import’ boxes are checked, it is strongly recommended to keep that so.

A spinoff of this module is that you can now upload a zip-file that contains photos only that can be imported if your php version is at least 5.2.7.

The import of zip files is done in two passes, in the first pass you can select the zipfiles to be extracted, the second pass enables you to select the photos and albums you want to import.

WPPA+ version 2.5.0. has been released.


There is a new scripting tag

Version 2.5.0 Fix release 005 includes the following scripting tag:

%%slideonly=..%%

This tag is different from %%slide= in a sense that only the slideframe is shown without all supporting navigation bars.
The show always starts running, independantly from the setting in the Photo Albums -> Settings page.

Example: %%wppa%% %%slideonly=4%% %%size=300%% %%align=center%%


Automatic columns for cover lists

Version 2.5.0 Fix release 008 includes the possibility to display the albumlist (and the thumbnail list if configured as ‘As covers’) in two or three columns. You can specify the width of the display area (in pixels) from which onwards the covers will display in 2 or 3 columns.
See My Album! for the display in two columns.


Auto space thumbnail images

On the Photo Albums -> Settings page you can set the ‘Thumbnail frame’ sizes. These frames hold the thumbnail image and optional the name, description and the average rating if apliccable.
You should normally set the width of the thumbnail frame equal to the thumbnail size, the height big enough to hold the thumbnail image together with the name, description and rating, so this is dependant of the number of items you switched on and the fontsize.

There is also a thumbnail framesize spacing setting. This used to be the distance between adjacent thumbnail frames.

The problem exists that on different displays the thumbnails do not always fit neatly. Now there is an extra checkbox that (if checked) indicates that the spacing is interpreted as a minimum and the superfluous width will be equally distributed between all thumbnails in a row. Now the displays of thumbnails in a post or page with sidebars and without sidebars are both neatly positioned. Compare the next examples with My Album!
%%wppa%% %%album=3%% %%size=450%% gives:

What’s new in 2.5.0 Second album Child album
HPIM0566 (Small).jpg
HPIM0566 (Small).jpg
Rating: 3.00
HPIM0563 (Small).jpg
HPIM0563 (Small).jpg
Rating: 3.33
Vliegenzwam
Vliegenzwam
Vliegenzwam te Maasbree
Rating: 3.92
HPIM1871.JPG
HPIM1871.JPG
In de tuin
Rating: 2.00
HPIM1870.JPG
HPIM1870.JPG
Rating: 1.86
HPIM1868.JPG
HPIM1868.JPG
Rating: 4.00
HPIM1867.JPG
HPIM1867.JPG
Rating: 3.33
HPIM1866.JPG
HPIM1866.JPG
Rating: 3.29
HPIM1865.JPG
HPIM1865.JPG
Rating: 2.20
HPIM0565 (Small).jpg
HPIM0565 (Small).jpg
Rating: 2.29
Afb005.jpg
Afb005.jpg
The brief photo descriptio
2128.jpg
2128.jpg
The brief photo description
More -->
2129.jpg
2129.jpg
The brief photo description
More -->
2130.jpg
2130.jpg
The brief photo description
More -->

%%wppa%% %%album=4%% %%size=400%% %%align=right%% gives:
What’s new in 2.5.0 Album # 4

Turkey

Photos from a holliday in Turkey


Import from the WP Gallery

Last but not least you can now finally import existing photos from the wp gallery to wppa+.

On the Import Photos admin page, you can select the directory on the server where from the photos should be imported.
You can set it to either the (standard) users depot directory (e.g. wp-content/wppa-depot/admin) or any (sub)directory starting at wp-content/uploads. The photos in these directories will not initially be checked to be imported and will – to protect you against catastrophies – not be deleteable after succesfull import.

Bookmark and Share
Posted in Uncategorized | Comments Off