prettyPhoto

There isn't much talk about prettyPhoto except for the theme that is built with prettyPhoto as it's core. prettyPhoto can be added to just about any theme with minimal editing of the album.php file.

*Based upon default theme*

To get started go into your current theme folder and open up album.php

Find:
`


<?php while (next_image(false, $firstPageImages)): ?>



<?php endwhile; ?>

`

Replace that code with:
`


<?php while (next_image(false, $firstPageImages)): ?>



<?php<br />
$prettyPhoto = str_replace(".html", "", htmlspecialchars(getImageLinkURL())) . "\" rel=\"prettyPhoto[pp_gal]";

?>





<?php endwhile; ?>

`

Setting up prettyPhoto:
Copy prettyPhoto CSS, JS, and Images folders into your current theme folder. and add the following code before the closing head tag (``)

The code:
`/css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />

/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8">



var $j = jQuery.noConflict();

function setupClassicGalleryLightBox()

{

$j('#images a').each(function() {

$j(this).attr('href', '/albums' + $j(this).attr('href'));

$j(this).attr('title', '');

});

$j("a[rel^='prettyPhoto']").prettyPhoto({

allowresize: true,

overlay_gallery: false,

slideshow: 5000,

autoplay_slideshow: false,

theme: 'facebook',

opacity: 0.90,

show_title: false

});

}

$j(document).ready(

function()

{

setupClassicGalleryLightBox();

}

);

`

Upload the new album.php and prettyPhoto should be up and working. This is also degradable, so if your users do not use JS it will default to normal operations.

Comments

  • acrylian Administrator, Developer
    I admit I have no idea about what you are talking or what theme you are referring to actually.
  • @acrylian Sorry about that, it was late. The theme I was reffering to at the beginning are the Chili themes that already have prettyPhoto integrated. My intention was to provide the necessary code and changes so that users of zenphoto could easily adapt prettyPhoto to the default theme or to their own custom themes.

    prettyPhoto is a lightbox clone that is built around JQuery, which is the system that zenphoto uses. For more information on prettyPhoto you can check them out at: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

    Hope that clarifies things.
  • acrylian Administrator, Developer
    Thanks for the explaination. Seems this is not that different to the already included Colorbox script which even is a plugin.
  • @acrylian Colorbox doesn't work for me. I recoded my theme with the latest 1.4 default theme as a template and it doesn't work. My site is heavily based upon jquery, so unless Colorbox is initialized through jQuery.noConflict it simply wont run. I have used prettyPhoto for about a year and it is what I am comfortable in using and working with.
Sign In or Register to comment.