Make prettyPhoto a feature, add slideshow for albums.

This commit is contained in:
Thomas Willingham 2013-03-29 20:36:39 +00:00
parent fbb4dc69c6
commit 8741bb20e8
5 changed files with 30 additions and 7 deletions

View File

@ -22,6 +22,7 @@ function get_features() {
array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')), array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')),
array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')), array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')),
array('webpages', t('Web Pages'), t('Provide managed web pages on your channel')), array('webpages', t('Web Pages'), t('Provide managed web pages on your channel')),
array('prettyphoto', t('Enhanced Photo Albums'), t('Enable photo album with enhanced features')),
array('expert', t('Expert Mode'), t('Enable Expert Mode to provide advanced configuration options')), array('expert', t('Expert Mode'), t('Enable Expert Mode to provide advanced configuration options')),

View File

@ -835,7 +835,6 @@ function photos_content(&$a) {
$o .= '<div class="photos-upload-link" ><a href="' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album) . '" >' . t('Upload New Photos') . '</a></div>'; $o .= '<div class="photos-upload-link" ><a href="' . $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/upload/' . bin2hex($album) . '" >' . t('Upload New Photos') . '</a></div>';
} }
$tpl = get_markup_template('photo_album.tpl'); $tpl = get_markup_template('photo_album.tpl');
if(count($r)) if(count($r))
$twist = 'rotright'; $twist = 'rotright';
@ -856,15 +855,26 @@ function photos_content(&$a) {
$desc_e = $rr['desc']; $desc_e = $rr['desc'];
} }
if(feature_enabled($a->data['channel']['channel_id'],'prettyphoto')){
$imagelink = ($a->get_baseurl() . '/photo/' . $rr['resource_id'] . '.' . $ext );
$rel=("prettyPhoto[pp_gal]");
}
else {
$imagelink = ($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id']
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''));
$rel=("photo");
}
$o .= replace_macros($tpl,array( $o .= replace_macros($tpl,array(
'$id' => $rr['id'], '$id' => $rr['id'],
'$twist' => ' ' . $twist . rand(2,4), '$twist' => ' ' . $twist . rand(2,4),
'$photolink' => $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $rr['resource_id'] '$photolink' => $imagelink,
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''), '$rel' => $rel,
'$phototitle' => t('View Photo'), '$phototitle' => t('View Photo'),
'$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext, '$imgsrc' => $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['scale'] . '.' .$ext,
'$imgalt' => $imgalt_e, '$imgalt' => $imgalt_e,
'$desc'=> $desc_e '$desc'=> $desc_e,
)); ));
} }

View File

@ -1,5 +1,11 @@
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<div class="photo-album-image-wrapper" id="photo-album-image-wrapper-$id"> <div class="photo-album-image-wrapper" id="photo-album-image-wrapper-$id">
<a href="$photolink" class="photo-album-photo-link" id="photo-album-photo-link-$id" title="$phototitle"> <a href="$photolink" class="photo-album-photo-link" id="photo-album-photo-link-$id" title="$phototitle" rel="$rel">
<img src="$imgsrc" alt="$imgalt" title="$phototitle" class="photo-album-photo lframe resize$twist" id="photo-album-photo-$id" /> <img src="$imgsrc" alt="$imgalt" title="$phototitle" class="photo-album-photo lframe resize$twist" id="photo-album-photo-$id" />
<p class='caption'>$desc</p> <p class='caption'>$desc</p>
</a> </a>

View File

@ -8,5 +8,5 @@
<div class="page-author"><a class=="page-author-link" href="{{$auth_url}}">{{$author}}</a></div> <div class="page-author"><a class=="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
<div class="page-date">{{$date}}</div> <div class="page-date">{{$date}}</div>
<div class="page-body">{{$body}}</div> <div class="page-body">body</div>
</div> </div>

View File

@ -3,8 +3,14 @@
* DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
* *
*}} *}}
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<div class="photo-album-image-wrapper" id="photo-album-image-wrapper-{{$id}}"> <div class="photo-album-image-wrapper" id="photo-album-image-wrapper-{{$id}}">
<a href="{{$photolink}}" class="photo-album-photo-link" id="photo-album-photo-link-{{$id}}" title="{{$phototitle}}"> <a href="{{$photolink}}" class="photo-album-photo-link" id="photo-album-photo-link-{{$id}}" title="{{$phototitle}}" rel="{{$rel}}">
<img src="{{$imgsrc}}" alt="{{$imgalt}}" title="{{$phototitle}}" class="photo-album-photo lframe resize{{$twist}}" id="photo-album-photo-{{$id}}" /> <img src="{{$imgsrc}}" alt="{{$imgalt}}" title="{{$phototitle}}" class="photo-album-photo lframe resize{{$twist}}" id="photo-album-photo-{{$id}}" />
<p class='caption'>{{$desc}}</p> <p class='caption'>{{$desc}}</p>
</a> </a>