Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.4.12 |
Comparing to | |
See all releases |
Code changes from version 6.4.11 to 6.4.12
- js/wppa.js +2 -2
- js/wppa.min.js +2 -2
- readme.txt +19 -2
- wppa-album-admin-autosave.php +3 -0
- wppa-album-covers.php +38 -25
- wppa-boxes-html.php +52 -11
- wppa-functions.php +177 -42
- wppa-photo-admin-autosave.php +21 -5
- wppa-session.php +8 -6
- wppa-settings-autosave.php +21 -1
- wppa-setup.php +3 -1
- wppa-styles.php +3 -1
- wppa.php +3 -3
js/wppa.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
-
var wppaJsVersion = '6.4.
|
6 |
|
7 |
// Important notice:
|
8 |
// All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
|
@@ -276,7 +276,7 @@ jQuery( document ).ready(function() {
|
|
276 |
jQuery( document ).ready( function( e ) {
|
277 |
|
278 |
// Are we allowed and capable to ajax?
|
279 |
-
if ( wppaAllowAjax && jQuery.ajax
|
280 |
wppaCanAjaxRender = true;
|
281 |
}
|
282 |
|
2 |
//
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
+
var wppaJsVersion = '6.4.12';
|
6 |
|
7 |
// Important notice:
|
8 |
// All external vars that may be given a value in wppa-non-admin.php must be declared here and not in other front-end js files!!
|
276 |
jQuery( document ).ready( function( e ) {
|
277 |
|
278 |
// Are we allowed and capable to ajax?
|
279 |
+
if ( wppaAllowAjax && jQuery.ajax ) {
|
280 |
wppaCanAjaxRender = true;
|
281 |
}
|
282 |
|
js/wppa.min.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
|
6 |
-
var wppaJsVersion='6.4.
|
7 |
-
_wppaTextDelay=wppaAnimationSpeed;if(wppaFadeInAfterFadeOut)_wppaTextDelay*=2;if(anyAutocol){jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}});}});jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax
|
8 |
if(typeof(history.pushState)!='undefined'){var i=1;while(i<=wppaMaxOccur){wppaStartHtml[i]=jQuery('#wppa-container-'+i).html();i++;}
|
9 |
wppaCanPushState=true;}});function wppaUpdateLightboxes(){if(typeof(wppaInitOverlay)=='function'){wppaInitOverlay();}
|
10 |
if(typeof(myLightbox)!='undefined'){if(typeof(myLightbox.updateImageList)=='function'){myLightbox.updateImageList();}}
|
3 |
// conatins common vars and functions
|
4 |
//
|
5 |
|
6 |
+
var wppaJsVersion='6.4.12';var wppaVersion='0';var wppaDebug;var wppaFullValign=[];var wppaFullHalign=[];var wppaFullFrameDelta=[];var wppaAnimationSpeed;var wppaImageDirectory;var wppaAutoColumnWidth=[];var wppaAutoColumnFrac=[];var wppaThumbnailAreaDelta;var wppaSlideShowTimeOut=2500;var wppaFadeInAfterFadeOut=false;var wppaTextFrameDelta=0;var wppaBoxDelta=0;var wppaPreambule;var wppaHideWhenEmpty=false;var wppaThumbnailPitch=[];var wppaFilmStripLength=[];var wppaFilmStripMargin=[];var wppaFilmStripAreaDelta=[];var wppaFilmShowGlue=false;var wppaIsMini=[];var wppaPortraitOnly=[];var wppaSlideShow;var wppaPhoto;var wppaOf;var wppaNextPhoto;var wppaPreviousPhoto;var wppaSlower;var wppaFaster;var wppaNextP;var wppaPrevP;var wppaAvgRating;var wppaMyRating;var wppaAvgRat;var wppaMyRat;var wppaDislikeMsg;var wppaMiniTreshold=300;var wppaStart='Start';var wppaStop='Stop';var wppaPleaseName;var wppaPleaseEmail;var wppaPleaseComment;var wppaRatingOnce=true;var wppaBGcolorNumbar='transparent';var wppaBcolorNumbar='transparent';var wppaBGcolorNumbarActive='transparent';var wppaBcolorNumbarActive='transparent';var wppaFontFamilyNumbar='';var wppaFontSizeNumbar='';var wppaFontColorNumbar='';var wppaFontWeightNumbar='';var wppaFontFamilyNumbarActive='';var wppaFontSizeNumbarActive='';var wppaFontColorNumbarActive='';var wppaFontWeightNumbarActive='';var wppaNumbarMax='10';var wppaAjaxUrl='';var wppaLang='';var wppaNextOnCallback=false;var wppaStarOpacity=0.2;var wppaSlideWrap=true;var wppaLightBox=[];var wppaEmailRequired='required';var wppaSlideBorderWidth=0;var wppaSlideInitRunning=[];var wppaAnimationType='fadeover';var wppaSlidePause=[];var wppaSlideBlank=[];var wppaRatingMax=5;var wppaRatingDisplayType='graphic';var wppaRatingPrec=2;var wppaFilmPageSize=[];var wppaAspectRatio=[];var wppaFullSize=[];var wppaStretch=false;var wppaThumbSpaceAuto=false;var wppaMinThumbSpace=4;var wppaMagnifierCursor='';var wppaArtMonkyLink='none';var wppaAutoOpenComments=false;var wppaUpdateAddressLine=false;var wppaFilmThumbTitle='';var wppaUploadUrl='';var wppaVoteForMe='';var wppaVotedForMe='';var wppaSlideSwipe=true;var wppaLightboxSingle=[];var wppaMaxCoverWidth=300;var wppaDownLoad='Download';var wppaSiteUrl='';var wppaWppaUrl='';var wppaIncludeUrl='';var wppaSlideToFullpopup=false;var wppaComAltSize=75;var wppaBumpViewCount=true;var wppaFotomoto=false;var wppaArtMonkeyButton=true;var wppaShortQargs=false;var wppaOvlHires=false;var wppaMasonryCols=[];var wppaVideoPlaying=[];var wppaAudioPlaying=[];var wppaSlideVideoStart=false;var wppaSlideAudioStart=false;var wppaAudioHeight=28;var wppaHis=0;var wppaStartHtml=[];var wppaCanAjaxRender=false;var wppaCanPushState=false;var wppaAllowAjax=true;var wppaMaxOccur=0;var wppaFirstOccur=0;var wppaUsePhotoNamesInUrls=false;var wppaShareHideWhenRunning=false;var wppaCommentRequiredAfterVote=true;var wppaTopMoc=0;var wppaColWidth=[];var wppaFotomotoHideWhenRunning=false;var wppaFotomotoMinWidth=400;var wppaPhotoView=[];var wppaBackgroundColorImage='';var wppaPopupLinkType='';var wppaPopupOnclick=[];var wppaThumbTargetBlank=false;var wppaRel='rel';var wppaStartSymbolUrl='';var wppaPauseSymbolUrl='';var wppaStopSymbolUrl='';var wppaStartPauseSymbolSize='64';var wppaStartPauseSymbolBradius='32';var wppaStopSymbolSize='48';var wppaStopSumbolBradius='24';var wppaEditPhotoWidth='960';var wppaThemeStyles='';var _wppaId=[];var _wppaAvg=[];var _wppaDisc=[];var _wppaMyr=[];var _wppaVRU=[];var _wppaLinkUrl=[];var _wppaLinkTitle=[];var _wppaLinkTarget=[];var _wppaCommentHtml=[];var _wppaIptcHtml=[];var _wppaExifHtml=[];var _wppaToTheSame=false;var _wppaSlides=[];var _wppaNames=[];var _wppaFullNames=[];var _wppaDsc=[];var _wppaOgDsc=[];var _wppaCurIdx=[];var _wppaNxtIdx=[];var _wppaTimeOut=[];var _wppaSSRuns=[];var _wppaFg=[];var _wppaTP=[];var _wppaIsBusy=[];var _wppaFirst=[];var _wppaVoteInProgress=false;var _wppaTextDelay;var _wppaUrl=[];var _wppaSkipRated=[];var _wppaLbTitle=[];var _wppaStateCount=0;var _wppaDidGoto=[];var _wppaShareUrl=[];var _wppaShareHtml=[];var _wppaFilmNoMove=[];var _wppaHiresUrl=[];var _wppaIsVideo=[];var _wppaVideoHtml=[];var _wppaAudioHtml=[];var _wppaVideoNatWidth=[];var _wppaVideoNatHeight=[];var __wppaOverruleRun=false;var wppaOvlUrls;var wppaOvlTitles;var wppaOvlIdx=0;var wppaOvlFirst=true;var wppaOvlKbHandler='';var wppaOvlSizeHandler='';var wppaOvlPadTop=5;var wppaOvlIsSingle;var wppaOvlRunning=false;var wppaOvlVideoHtmls;var wppaOvlAudioHtmls;var wppaOvlVideoNaturalWidths;var wppaOvlVideoNaturalHeights;var wppaOvlModeInitial='normal';var wppaOvlVideoPlaying=false;var wppaOvlAudioPlaying=false;var wppaOvlShowLegenda=true;var wppaOvlShowStartStop=true;var wppaOvlRadius=0;var wppaOvlBorderWidth=16;var wppaOvlLeftSymbolUrl;var wppaOvlRightSymbolUrl;var wppaLeftRightSymbolSize=32;var wppaLeftRightSymbolBradius=4;var wppaOvlTxtHeight=36;var wppaOvlOpacity=0.8;var wppaOvlOnclickType='none';var wppaOvlTheme='black';var wppaOvlAnimSpeed=300;var wppaOvlSlideSpeed=3000;var wppaVer4WindowWidth=800;var wppaVer4WindowHeight=600;var wppaOvlFontFamily='Helvetica';var wppaOvlFontSize='10';var wppaOvlFontColor='';var wppaOvlFontWeight='bold';var wppaOvlLineHeight='12';var wppaOvlShowCounter=true;var wppaOvlIsVideo=false;var wppaShowLegenda='';var wppaOvlFsPhotoId=0;var wppaPhotoId=0;var wppaOvlVideoStart=false;var wppaOvlAudioStart=false;var wppaLastIptc='';var wppaLastExif='';jQuery(document).ready(function(){var anyAutocol=false;for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);anyAutocol=true;}}
|
7 |
+
_wppaTextDelay=wppaAnimationSpeed;if(wppaFadeInAfterFadeOut)_wppaTextDelay*=2;if(anyAutocol){jQuery(window).resize(function(){for(mocc=1;mocc<=wppaTopMoc;mocc++){if(wppaAutoColumnWidth[mocc]){wppaColWidth[mocc]=0;_wppaDoAutocol(mocc);}}});}});jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax){wppaCanAjaxRender=true;}
|
8 |
if(typeof(history.pushState)!='undefined'){var i=1;while(i<=wppaMaxOccur){wppaStartHtml[i]=jQuery('#wppa-container-'+i).html();i++;}
|
9 |
wppaCanPushState=true;}});function wppaUpdateLightboxes(){if(typeof(wppaInitOverlay)=='function'){wppaInitOverlay();}
|
10 |
if(typeof(myLightbox)!='undefined'){if(typeof(myLightbox.updateImageList)=='function'){myLightbox.updateImageList();}}
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
-
Version: 6.4.
|
6 |
-
Stable tag: 6.4.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -180,6 +180,23 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
|
|
180 |
|
181 |
See for additional information: http://wppa.opajaap.nl/changelog/
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
= 6.4.11 =
|
184 |
|
185 |
= Bug Fixes =
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
|
5 |
+
Version: 6.4.12
|
6 |
+
Stable tag: 6.4.11
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
180 |
|
181 |
See for additional information: http://wppa.opajaap.nl/changelog/
|
182 |
|
183 |
+
= 6.4.12 =
|
184 |
+
|
185 |
+
= Bug Fixes =
|
186 |
+
|
187 |
+
* Removed redundant page loads when using Ajax.
|
188 |
+
|
189 |
+
= New Features =
|
190 |
+
|
191 |
+
* Front end audio / video upload implemented. Mind your server limitations! Settable in Table II-H1.1 and II-H1.2. It is strongly recommended to keep II-H3 (User upload Ajax) ticked.
|
192 |
+
|
193 |
+
= Other Changes =
|
194 |
+
|
195 |
+
* The accept argument in front-end upload as well as the selction button text reflect the settings II-H1.1,2 (User upload Video/Audio), II-H15 (Camera connect) and VII-B6 (Upload one only).
|
196 |
+
* Cosmetic changes to the photo admin page in case of video.
|
197 |
+
* Various performance improvements.
|
198 |
+
* Added inline style display:inline; for cover images to overrule the css of certain themes.
|
199 |
+
|
200 |
= 6.4.11 =
|
201 |
|
202 |
= Bug Fixes =
|
wppa-album-admin-autosave.php
CHANGED
@@ -497,6 +497,9 @@ function _wppa_admin() {
|
|
497 |
<td>
|
498 |
<?php
|
499 |
$lims = explode('/', $albuminfo['upload_limit']);
|
|
|
|
|
|
|
500 |
if ( current_user_can('administrator') ) { ?>
|
501 |
<input type="text" id="upload_limit_count" value="<?php echo($lims[0]) ?>" style="width: 50px" onchange="wppaAjaxUpdateAlbum(<?php echo $edit_id ?>, 'upload_limit_count', this)" />
|
502 |
<select onchange="wppaAjaxUpdateAlbum(<?php echo $edit_id ?>, 'upload_limit_time', this)" >
|
497 |
<td>
|
498 |
<?php
|
499 |
$lims = explode('/', $albuminfo['upload_limit']);
|
500 |
+
if ( ! is_array( $lims ) ) {
|
501 |
+
$lims = array( '0', '0' );
|
502 |
+
}
|
503 |
if ( current_user_can('administrator') ) { ?>
|
504 |
<input type="text" id="upload_limit_count" value="<?php echo($lims[0]) ?>" style="width: 50px" onchange="wppaAjaxUpdateAlbum(<?php echo $edit_id ?>, 'upload_limit_count', this)" />
|
505 |
<select onchange="wppaAjaxUpdateAlbum(<?php echo $edit_id ?>, 'upload_limit_time', this)" >
|
wppa-album-covers.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1068,7 +1068,7 @@ global $wpdb;
|
|
1068 |
wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $image['id'] ) . '" src="' .
|
1069 |
$src . '" width="' . $imgwidth . '" height="' . $imgheight . '" style="' .
|
1070 |
__wcs( 'wppa-img' ) . $imgattr . $imgattr_a['cursor'] . '" ' . $events .
|
1071 |
-
' ' . wppa_get_imgalt( $image['id'] ) . '
|
1072 |
);
|
1073 |
}
|
1074 |
}
|
@@ -1076,36 +1076,49 @@ global $wpdb;
|
|
1076 |
}
|
1077 |
|
1078 |
else { // Link is NOT lightbox
|
1079 |
-
$href = $photolink['url'] == '#' ? '' : 'href="' .
|
1080 |
-
|
1081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1082 |
if ( wppa_is_video( $image['id'] ) ) {
|
1083 |
-
|
1084 |
-
|
1085 |
-
'
|
1086 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1087 |
);
|
1088 |
}
|
1089 |
else {
|
1090 |
-
|
1091 |
-
|
1092 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1093 |
);
|
1094 |
}
|
1095 |
wppa_out( '</a> ' );
|
1096 |
}
|
1097 |
}
|
1098 |
|
1099 |
-
/*
|
1100 |
-
// No link
|
1101 |
-
else {
|
1102 |
-
wppa_out(
|
1103 |
-
'<img src="' . $src . '" ' . wppa_get_imgalt( $image['id'] ) . ' class="image wppa-img" width="' . $imgwidth .
|
1104 |
-
'" height="' . $imgheight . '" style="' . __wcs( 'wppa-img' ) . $imgattr . '" ' . $events . ' />'
|
1105 |
-
);
|
1106 |
-
}
|
1107 |
-
*/
|
1108 |
-
|
1109 |
// No link on coverphoto
|
1110 |
else {
|
1111 |
|
@@ -1149,8 +1162,8 @@ global $wpdb;
|
|
1149 |
static $cached_cover_photo_ids;
|
1150 |
|
1151 |
// no album, no coverphoto
|
1152 |
-
if ( ! $alb ) return false;
|
1153 |
-
|
1154 |
// Did we do this before?
|
1155 |
if ( isset( $cached_cover_photo_ids[$alb] ) ) {
|
1156 |
return $cached_cover_photo_ids[$alb];
|
@@ -1242,7 +1255,7 @@ static $cached_cover_photo_ids;
|
|
1242 |
if ( is_array( $temp ) ) foreach ( $temp as $item ) {
|
1243 |
$ids[] = $item['id'];
|
1244 |
}
|
1245 |
-
|
1246 |
$cached_cover_photo_ids[$alb] = $ids;
|
1247 |
return $ids;
|
1248 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
*/
|
9 |
|
1068 |
wppa( 'mocc' ) . '" title="' . wppa_zoom_in( $image['id'] ) . '" src="' .
|
1069 |
$src . '" width="' . $imgwidth . '" height="' . $imgheight . '" style="' .
|
1070 |
__wcs( 'wppa-img' ) . $imgattr . $imgattr_a['cursor'] . '" ' . $events .
|
1071 |
+
' ' . wppa_get_imgalt( $image['id'] ) . ' />'
|
1072 |
);
|
1073 |
}
|
1074 |
}
|
1076 |
}
|
1077 |
|
1078 |
else { // Link is NOT lightbox
|
1079 |
+
$href = $photolink['url'] == '#' ? '' : 'href="' . $photolink['url'] . '" ';
|
1080 |
+
|
1081 |
+
wppa_out(
|
1082 |
+
'<a ' .
|
1083 |
+
$href .
|
1084 |
+
' target="' . $photolink['target'] . '"' .
|
1085 |
+
' title="' . $photolink['title'] . '"' .
|
1086 |
+
' onclick="' . $photolink['onclick'] . '"' .
|
1087 |
+
' >' );
|
1088 |
+
|
1089 |
if ( wppa_is_video( $image['id'] ) ) {
|
1090 |
+
|
1091 |
+
wppa_out(
|
1092 |
+
'<video' .
|
1093 |
+
' preload="metadata" ' .
|
1094 |
+
' class="image wppa-img"' .
|
1095 |
+
' width="' . $imgwidth . '"' .
|
1096 |
+
' height="' . $imgheight . '"' .
|
1097 |
+
' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
|
1098 |
+
' ' . $events .
|
1099 |
+
' >' .
|
1100 |
+
wppa_get_video_body( $image['id'] ) .
|
1101 |
+
'</video>'
|
1102 |
);
|
1103 |
}
|
1104 |
else {
|
1105 |
+
|
1106 |
+
wppa_out(
|
1107 |
+
'<img' .
|
1108 |
+
' src="' . $src . '"' .
|
1109 |
+
' ' . wppa_get_imgalt( $image['id'] ) .
|
1110 |
+
' class="image wppa-img"' .
|
1111 |
+
' width="' . $imgwidth . '"' .
|
1112 |
+
' height="' . $imgheight . '"' .
|
1113 |
+
' style="' . __wcs( 'wppa-img' ) . $imgattr . '"' .
|
1114 |
+
' ' . $events .
|
1115 |
+
' />'
|
1116 |
);
|
1117 |
}
|
1118 |
wppa_out( '</a> ' );
|
1119 |
}
|
1120 |
}
|
1121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1122 |
// No link on coverphoto
|
1123 |
else {
|
1124 |
|
1162 |
static $cached_cover_photo_ids;
|
1163 |
|
1164 |
// no album, no coverphoto
|
1165 |
+
if ( ! $alb ) return false;
|
1166 |
+
|
1167 |
// Did we do this before?
|
1168 |
if ( isset( $cached_cover_photo_ids[$alb] ) ) {
|
1169 |
return $cached_cover_photo_ids[$alb];
|
1255 |
if ( is_array( $temp ) ) foreach ( $temp as $item ) {
|
1256 |
$ids[] = $item['id'];
|
1257 |
}
|
1258 |
+
|
1259 |
$cached_cover_photo_ids[$alb] = $ids;
|
1260 |
return $ids;
|
1261 |
}
|
wppa-boxes-html.php
CHANGED
@@ -3,8 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.4.
|
7 |
-
*
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -1792,6 +1791,8 @@ function wppa_user_upload_html( $alb, $width, $where = '', $mcr = false ) {
|
|
1792 |
}
|
1793 |
|
1794 |
function wppa_get_user_upload_html( $alb, $width, $where = '', $mcr = false ) {
|
|
|
|
|
1795 |
static $seqno;
|
1796 |
|
1797 |
// Init
|
@@ -1975,13 +1976,60 @@ static $seqno;
|
|
1975 |
$one_only = wppa_switch( 'upload_one_only' );
|
1976 |
$multiple = ! $one_only;
|
1977 |
$on_camera = wppa_switch( 'camera_connect' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1978 |
|
1979 |
$result .=
|
1980 |
|
1981 |
// The (hidden) functional button
|
1982 |
'<input' .
|
1983 |
' type="file"' .
|
1984 |
-
' accept="
|
1985 |
( $on_camera ? ' capture="capture"' : '' ) .
|
1986 |
( $multiple ? ' multiple="multiple"' : '' ) .
|
1987 |
' style="' .
|
@@ -2000,14 +2048,7 @@ static $seqno;
|
|
2000 |
' type="button"' .
|
2001 |
' style="width:100%;margin-top:8px;margin-bottom:8px;padding-left:0;padding-right:0;"' .
|
2002 |
' id="wppa-user-upload-' . $alb . '-' . $mocc . '-display"' .
|
2003 |
-
' value="' .
|
2004 |
-
( $one_only ? (
|
2005 |
-
$on_camera ? esc_attr( __( 'Select Photo / Camera', 'wp-photo-album-plus' ) ) : esc_attr( 'Select Photo', 'wp-photo-album-plus' )
|
2006 |
-
) : (
|
2007 |
-
$on_camera ? esc_attr( __( 'Select Photos / Camera', 'wp-photo-album-plus' ) ) : esc_attr( 'Select Photos', 'wp-photo-album-plus' )
|
2008 |
-
)
|
2009 |
-
) .
|
2010 |
-
'"' .
|
2011 |
' onclick="jQuery( \'#wppa-user-upload-' . $alb . '-' . $mocc . '\' ).click();"' .
|
2012 |
'/>';
|
2013 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.4.12
|
|
|
7 |
*
|
8 |
*/
|
9 |
|
1791 |
}
|
1792 |
|
1793 |
function wppa_get_user_upload_html( $alb, $width, $where = '', $mcr = false ) {
|
1794 |
+
global $wppa_supported_video_extensions;
|
1795 |
+
global $wppa_supported_audio_extensions;
|
1796 |
static $seqno;
|
1797 |
|
1798 |
// Init
|
1976 |
$one_only = wppa_switch( 'upload_one_only' );
|
1977 |
$multiple = ! $one_only;
|
1978 |
$on_camera = wppa_switch( 'camera_connect' );
|
1979 |
+
$may_video = wppa_switch( 'user_upload_video_on' );
|
1980 |
+
$may_audio = wppa_switch( 'user_upload_audio_on' );
|
1981 |
+
|
1982 |
+
$accept = '.jpg,.gif,.png';
|
1983 |
+
if ( $may_video ) {
|
1984 |
+
$accept .= ',.' . implode( ',.', $wppa_supported_video_extensions );
|
1985 |
+
}
|
1986 |
+
if ( $may_audio ) {
|
1987 |
+
$accept .= ',.' . implode( ',.', $wppa_supported_audio_extensions );
|
1988 |
+
}
|
1989 |
+
|
1990 |
+
if ( $one_only ) {
|
1991 |
+
if ( $on_camera ) {
|
1992 |
+
if ( $may_video ) {
|
1993 |
+
$value = esc_attr( __( 'Select Photo / Video / Camera', 'wp-photo-album-plus' ) );
|
1994 |
+
}
|
1995 |
+
else {
|
1996 |
+
$value = esc_attr( __( 'Select Photo / Camera', 'wp-photo-album-plus' ) );
|
1997 |
+
}
|
1998 |
+
}
|
1999 |
+
else {
|
2000 |
+
if ( $may_video ) {
|
2001 |
+
$value = esc_attr( __( 'Select Photo / Video', 'wp-photo-album-plus' ) );
|
2002 |
+
}
|
2003 |
+
else {
|
2004 |
+
$value = esc_attr( __( 'Select Photo', 'wp-photo-album-plus' ) );
|
2005 |
+
}
|
2006 |
+
}
|
2007 |
+
}
|
2008 |
+
else {
|
2009 |
+
if ( $on_camera ) {
|
2010 |
+
if ( $may_video ) {
|
2011 |
+
$value = esc_attr( __( 'Select Photos / Video / Camera', 'wp-photo-album-plus' ) );
|
2012 |
+
}
|
2013 |
+
else {
|
2014 |
+
$value = esc_attr( __( 'Select Photos / Camera', 'wp-photo-album-plus' ) );
|
2015 |
+
}
|
2016 |
+
}
|
2017 |
+
else {
|
2018 |
+
if ( $may_video ) {
|
2019 |
+
$value = esc_attr( __( 'Select Photos / Video', 'wp-photo-album-plus' ) );
|
2020 |
+
}
|
2021 |
+
else {
|
2022 |
+
$value = esc_attr( __( 'Select Photos', 'wp-photo-album-plus' ) );
|
2023 |
+
}
|
2024 |
+
}
|
2025 |
+
}
|
2026 |
|
2027 |
$result .=
|
2028 |
|
2029 |
// The (hidden) functional button
|
2030 |
'<input' .
|
2031 |
' type="file"' .
|
2032 |
+
' accept="' . $accept . '"' .
|
2033 |
( $on_camera ? ' capture="capture"' : '' ) .
|
2034 |
( $multiple ? ' multiple="multiple"' : '' ) .
|
2035 |
' style="' .
|
2048 |
' type="button"' .
|
2049 |
' style="width:100%;margin-top:8px;margin-bottom:8px;padding-left:0;padding-right:0;"' .
|
2050 |
' id="wppa-user-upload-' . $alb . '-' . $mocc . '-display"' .
|
2051 |
+
' value="' . $value . '"' .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2052 |
' onclick="jQuery( \'#wppa-user-upload-' . $alb . '-' . $mocc . '\' ).click();"' .
|
2053 |
'/>';
|
2054 |
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3868,6 +3868,11 @@ global $wpdb;
|
|
3868 |
|
3869 |
function wppa_is_photo_new( $id ) {
|
3870 |
|
|
|
|
|
|
|
|
|
|
|
3871 |
$thumb = wppa_cache_thumb( $id );
|
3872 |
|
3873 |
$birthtime = $thumb['timestamp'];
|
@@ -3879,6 +3884,11 @@ function wppa_is_photo_new( $id ) {
|
|
3879 |
|
3880 |
function wppa_is_photo_modified( $id ) {
|
3881 |
|
|
|
|
|
|
|
|
|
|
|
3882 |
$thumb = wppa_cache_thumb( $id );
|
3883 |
|
3884 |
$modtime = $thumb['modified'];
|
@@ -3892,6 +3902,12 @@ function wppa_is_album_new( $id ) {
|
|
3892 |
global $wpdb;
|
3893 |
global $wppa_children;
|
3894 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3895 |
$album = wppa_cache_album( $id );
|
3896 |
$birthtime = $album['timestamp'];
|
3897 |
$timnow = time();
|
@@ -3921,6 +3937,11 @@ function wppa_is_album_modified( $id ) {
|
|
3921 |
global $wpdb;
|
3922 |
global $wppa_children;
|
3923 |
|
|
|
|
|
|
|
|
|
|
|
3924 |
$album = wppa_cache_album( $id );
|
3925 |
$modtime = $album['modified'];
|
3926 |
$timnow = time();
|
@@ -4215,20 +4236,114 @@ static $done;
|
|
4215 |
// Subroutine to upload one file in the frontend
|
4216 |
function wppa_do_frontend_file_upload( $file, $alb ) {
|
4217 |
global $wpdb;
|
|
|
|
|
4218 |
|
4219 |
// Log upload attempt
|
4220 |
wppa_log( 'Upl', 'FE Upload attempt of file '.$file['name'].', size='.filesize($file['tmp_name']) );
|
4221 |
|
4222 |
$album = wppa_cache_album( $alb );
|
4223 |
|
|
|
4224 |
if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
|
4225 |
wppa_alert( __( 'Max uploads reached' , 'wp-photo-album-plus') );
|
4226 |
return false;
|
4227 |
}
|
|
|
|
|
4228 |
if ( $file['error'] != '0' ) {
|
4229 |
wppa_alert( __( 'Error during upload' , 'wp-photo-album-plus') );
|
4230 |
return false;
|
4231 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4232 |
$imgsize = getimagesize( $file['tmp_name'] );
|
4233 |
if ( !is_array( $imgsize ) ) {
|
4234 |
wppa_alert( __( 'Uploaded file is not an image' , 'wp-photo-album-plus') );
|
@@ -4275,7 +4390,17 @@ global $wpdb;
|
|
4275 |
$linktarget = '_self';
|
4276 |
$status = ( wppa_switch( 'upload_moderate' ) && ! current_user_can( 'wppa_admin' ) ) ? 'pending' : 'publish';
|
4277 |
$filename = wppa_sanitize_file_name( $file['name'] );
|
4278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4279 |
|
4280 |
if ( ! $id ) {
|
4281 |
wppa_alert( __( 'Could not insert photo into db.' , 'wp-photo-album-plus') );
|
@@ -4296,46 +4421,10 @@ global $wpdb;
|
|
4296 |
}
|
4297 |
|
4298 |
// Custom data
|
4299 |
-
|
4300 |
-
$custom_data = array( '', '', '', '', '', '', '', '', '', '' );
|
4301 |
-
for ( $i = '0'; $i < '10' ; $i++ ) {
|
4302 |
-
if ( isset( $_POST['wppa-user-custom-'.$i] ) ) {
|
4303 |
-
$custom_data[$i] = strip_tags( $_POST['wppa-user-custom-'.$i] );
|
4304 |
-
}
|
4305 |
-
}
|
4306 |
-
wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
|
4307 |
-
}
|
4308 |
-
|
4309 |
-
// Default tags
|
4310 |
-
wppa_set_default_tags( $id );
|
4311 |
-
|
4312 |
-
// Custom tags
|
4313 |
-
$tags = wppa_get_photo_item( $id, 'tags' );
|
4314 |
-
$oldt = $tags;
|
4315 |
-
for ( $i = '1'; $i < '4'; $i++ ) {
|
4316 |
-
if ( isset( $_POST['wppa-user-tags-'.$i] ) ) { // Existing tags
|
4317 |
-
$tags .= ','.implode( ',', $_POST['wppa-user-tags-'.$i] );
|
4318 |
-
}
|
4319 |
-
}
|
4320 |
-
if ( isset( $_POST['wppa-new-tags'] ) ) { // New tags
|
4321 |
-
$newt = $_POST['wppa-new-tags'];
|
4322 |
-
$tags .= ','.$newt;
|
4323 |
-
}
|
4324 |
-
else {
|
4325 |
-
$newt = '';
|
4326 |
-
}
|
4327 |
-
$tags = wppa_sanitize_tags( str_replace( array( '\'', '"' ), ',', wppa_filter_iptc( wppa_filter_exif( $tags, $id ), $id ) ) );
|
4328 |
-
if ( $tags != $oldt ) { // Added tag(s)
|
4329 |
-
wppa_update_photo( array( 'id' => $id, 'tags' => $tags ) );
|
4330 |
-
}
|
4331 |
-
|
4332 |
-
// Index
|
4333 |
-
wppa_index_add( 'photo', $id );
|
4334 |
|
4335 |
-
//
|
4336 |
-
|
4337 |
-
wppa_clear_taglist(); // Forces recreation
|
4338 |
-
}
|
4339 |
|
4340 |
// and add watermark ( optionally ) to fullsize image only
|
4341 |
wppa_add_watermark( $id );
|
@@ -4365,8 +4454,54 @@ global $wpdb;
|
|
4365 |
}
|
4366 |
return true;
|
4367 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4368 |
else {
|
4369 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4370 |
}
|
4371 |
}
|
4372 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
*/
|
9 |
|
3868 |
|
3869 |
function wppa_is_photo_new( $id ) {
|
3870 |
|
3871 |
+
// Feature enabled?
|
3872 |
+
if ( ! wppa_opt( 'max_photo_newtime' ) ) {
|
3873 |
+
return false;
|
3874 |
+
}
|
3875 |
+
|
3876 |
$thumb = wppa_cache_thumb( $id );
|
3877 |
|
3878 |
$birthtime = $thumb['timestamp'];
|
3884 |
|
3885 |
function wppa_is_photo_modified( $id ) {
|
3886 |
|
3887 |
+
// Feature enabled?
|
3888 |
+
if ( ! wppa_opt( 'max_photo_modtime' ) ) {
|
3889 |
+
return false;
|
3890 |
+
}
|
3891 |
+
|
3892 |
$thumb = wppa_cache_thumb( $id );
|
3893 |
|
3894 |
$modtime = $thumb['modified'];
|
3902 |
global $wpdb;
|
3903 |
global $wppa_children;
|
3904 |
|
3905 |
+
// Feature enabled?
|
3906 |
+
if ( ! wppa_opt( 'max_album_newtime' ) ) {
|
3907 |
+
return false;
|
3908 |
+
}
|
3909 |
+
|
3910 |
+
// See if album self is new
|
3911 |
$album = wppa_cache_album( $id );
|
3912 |
$birthtime = $album['timestamp'];
|
3913 |
$timnow = time();
|
3937 |
global $wpdb;
|
3938 |
global $wppa_children;
|
3939 |
|
3940 |
+
// Feature enabled ?
|
3941 |
+
if ( ! wppa_opt( 'max_album_modtime' ) ) {
|
3942 |
+
return false;
|
3943 |
+
}
|
3944 |
+
|
3945 |
$album = wppa_cache_album( $id );
|
3946 |
$modtime = $album['modified'];
|
3947 |
$timnow = time();
|
4236 |
// Subroutine to upload one file in the frontend
|
4237 |
function wppa_do_frontend_file_upload( $file, $alb ) {
|
4238 |
global $wpdb;
|
4239 |
+
global $wppa_supported_video_extensions;
|
4240 |
+
global $wppa_supported_audio_extensions;
|
4241 |
|
4242 |
// Log upload attempt
|
4243 |
wppa_log( 'Upl', 'FE Upload attempt of file '.$file['name'].', size='.filesize($file['tmp_name']) );
|
4244 |
|
4245 |
$album = wppa_cache_album( $alb );
|
4246 |
|
4247 |
+
// Legal here?
|
4248 |
if ( ! wppa_allow_uploads( $alb ) || ! wppa_allow_user_uploads() ) {
|
4249 |
wppa_alert( __( 'Max uploads reached' , 'wp-photo-album-plus') );
|
4250 |
return false;
|
4251 |
}
|
4252 |
+
|
4253 |
+
// No error during upload?
|
4254 |
if ( $file['error'] != '0' ) {
|
4255 |
wppa_alert( __( 'Error during upload' , 'wp-photo-album-plus') );
|
4256 |
return false;
|
4257 |
}
|
4258 |
+
|
4259 |
+
// Find the filename
|
4260 |
+
$filename = wppa_sanitize_file_name( $file['name'] );
|
4261 |
+
$filename = wppa_strip_ext( $filename );
|
4262 |
+
|
4263 |
+
// See if this filename with any extension already exists in this album
|
4264 |
+
$id = $wpdb->get_var( "SELECT `id` FROM `" . WPPA_PHOTOS . "` WHERE `filename` LIKE '" . $filename . ".%' AND `album` = " . $alb );
|
4265 |
+
|
4266 |
+
// Addition to an av item?
|
4267 |
+
if ( $id ) {
|
4268 |
+
$is_av = wppa_get_photo_item( $id, 'ext' ) == 'xxx';
|
4269 |
+
}
|
4270 |
+
else {
|
4271 |
+
$is_av = false;
|
4272 |
+
}
|
4273 |
+
|
4274 |
+
// see if audio / video and process
|
4275 |
+
if (
|
4276 |
+
// Video?
|
4277 |
+
( wppa_switch( 'enable_video' ) && wppa_switch( 'user_upload_video_on' ) && in_array( wppa_get_ext( $file['name'] ), $wppa_supported_video_extensions ) ) ||
|
4278 |
+
// Audio?
|
4279 |
+
( wppa_switch( 'enable_audio' ) && wppa_switch( 'user_upload_audio_on' ) && in_array( wppa_get_ext( $file['name'] ), $wppa_supported_audio_extensions ) )
|
4280 |
+
) {
|
4281 |
+
|
4282 |
+
$is_av = true;
|
4283 |
+
|
4284 |
+
// Find the name
|
4285 |
+
if ( wppa_get_post( 'user-name' ) ) {
|
4286 |
+
$name = wppa_get_post( 'user-name' );
|
4287 |
+
}
|
4288 |
+
else {
|
4289 |
+
$name = $file['name'];
|
4290 |
+
}
|
4291 |
+
$name = wppa_sanitize_photo_name( $name );
|
4292 |
+
|
4293 |
+
$filename .= '.xxx';
|
4294 |
+
|
4295 |
+
// update entry
|
4296 |
+
if ( $is_av ) {
|
4297 |
+
wppa_update_photo( array( 'id' => $id, 'ext' => 'xxx', 'filename' => $filename ) );
|
4298 |
+
}
|
4299 |
+
|
4300 |
+
// Add new entry
|
4301 |
+
if ( ! $id ) {
|
4302 |
+
|
4303 |
+
$id = wppa_create_photo_entry( array( 'album' => $alb,
|
4304 |
+
'filename' => $filename,
|
4305 |
+
'ext' => 'xxx',
|
4306 |
+
'name' => $name,
|
4307 |
+
'description' => balanceTags( wppa_get_post( 'user-desc' ), true )
|
4308 |
+
) );
|
4309 |
+
|
4310 |
+
if ( ! $id ) {
|
4311 |
+
wppa_alert( __( 'Could not insert media into db.' , 'wp-photo-album-plus') );
|
4312 |
+
return false;
|
4313 |
+
}
|
4314 |
+
}
|
4315 |
+
|
4316 |
+
// Housekeeping
|
4317 |
+
wppa_update_album( array( 'id' => $alb, 'modified' => time() ) );
|
4318 |
+
wppa_flush_treecounts( $alb );
|
4319 |
+
wppa_flush_upldr_cache( 'photoid', $id );
|
4320 |
+
|
4321 |
+
// Add video filetype
|
4322 |
+
$ext = wppa_get_ext( $file['name'] );
|
4323 |
+
$newpath = wppa_strip_ext( wppa_get_photo_path( $id ) ).'.'.$ext;
|
4324 |
+
|
4325 |
+
copy( $file['tmp_name'], $newpath );
|
4326 |
+
|
4327 |
+
// Repair name if not standard
|
4328 |
+
if ( ! wppa_get_post( 'user-name' ) ) {
|
4329 |
+
wppa_set_default_name( $id, $file['name'] );
|
4330 |
+
}
|
4331 |
+
|
4332 |
+
// tags
|
4333 |
+
wppa_fe_add_tags( $id );
|
4334 |
+
|
4335 |
+
// custom
|
4336 |
+
wppa_fe_add_custom( $id );
|
4337 |
+
|
4338 |
+
// Done!
|
4339 |
+
return true;
|
4340 |
+
|
4341 |
+
}
|
4342 |
+
|
4343 |
+
|
4344 |
+
|
4345 |
+
|
4346 |
+
// Not audio / video, continue
|
4347 |
$imgsize = getimagesize( $file['tmp_name'] );
|
4348 |
if ( !is_array( $imgsize ) ) {
|
4349 |
wppa_alert( __( 'Uploaded file is not an image' , 'wp-photo-album-plus') );
|
4390 |
$linktarget = '_self';
|
4391 |
$status = ( wppa_switch( 'upload_moderate' ) && ! current_user_can( 'wppa_admin' ) ) ? 'pending' : 'publish';
|
4392 |
$filename = wppa_sanitize_file_name( $file['name'] );
|
4393 |
+
|
4394 |
+
// Create new entry
|
4395 |
+
if ( ! $id ) {
|
4396 |
+
$id = wppa_create_photo_entry( array( 'album' => $alb, 'ext' => $ext, 'name' => $name, 'description' => $desc, 'status' => $status, 'filename' => $filename, ) );
|
4397 |
+
}
|
4398 |
+
|
4399 |
+
// Update av entry
|
4400 |
+
else {
|
4401 |
+
$filename = wppa_strip_ext( $filename ) . '.xxx';
|
4402 |
+
wppa_update_photo( array( 'id' => $id, 'ext' => 'xxx', 'filename' => $filename ) );
|
4403 |
+
}
|
4404 |
|
4405 |
if ( ! $id ) {
|
4406 |
wppa_alert( __( 'Could not insert photo into db.' , 'wp-photo-album-plus') );
|
4421 |
}
|
4422 |
|
4423 |
// Custom data
|
4424 |
+
wppa_fe_add_custom( $id );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4425 |
|
4426 |
+
// Add tags
|
4427 |
+
wppa_fe_add_tags( $id );
|
|
|
|
|
4428 |
|
4429 |
// and add watermark ( optionally ) to fullsize image only
|
4430 |
wppa_add_watermark( $id );
|
4454 |
}
|
4455 |
return true;
|
4456 |
}
|
4457 |
+
|
4458 |
+
return false;
|
4459 |
+
}
|
4460 |
+
|
4461 |
+
function wppa_fe_add_tags( $id ) {
|
4462 |
+
|
4463 |
+
// Default tags
|
4464 |
+
wppa_set_default_tags( $id );
|
4465 |
+
|
4466 |
+
// Custom tags
|
4467 |
+
$tags = wppa_get_photo_item( $id, 'tags' );
|
4468 |
+
$oldt = $tags;
|
4469 |
+
for ( $i = '1'; $i < '4'; $i++ ) {
|
4470 |
+
if ( isset( $_POST['wppa-user-tags-'.$i] ) ) { // Existing tags
|
4471 |
+
$tags .= ','.implode( ',', $_POST['wppa-user-tags-'.$i] );
|
4472 |
+
}
|
4473 |
+
}
|
4474 |
+
if ( isset( $_POST['wppa-new-tags'] ) ) { // New tags
|
4475 |
+
$newt = $_POST['wppa-new-tags'];
|
4476 |
+
$tags .= ','.$newt;
|
4477 |
+
}
|
4478 |
else {
|
4479 |
+
$newt = '';
|
4480 |
+
}
|
4481 |
+
$tags = wppa_sanitize_tags( str_replace( array( '\'', '"' ), ',', wppa_filter_iptc( wppa_filter_exif( $tags, $id ), $id ) ) );
|
4482 |
+
if ( $tags != $oldt ) { // Added tag(s)
|
4483 |
+
wppa_update_photo( array( 'id' => $id, 'tags' => $tags ) );
|
4484 |
+
}
|
4485 |
+
|
4486 |
+
// Index
|
4487 |
+
wppa_index_add( 'photo', $id );
|
4488 |
+
|
4489 |
+
// Tags
|
4490 |
+
if ( $tags ) {
|
4491 |
+
wppa_clear_taglist(); // Forces recreation
|
4492 |
+
}
|
4493 |
+
}
|
4494 |
+
|
4495 |
+
function wppa_fe_add_custom( $id ) {
|
4496 |
+
|
4497 |
+
if ( wppa_switch( 'fe_custom_fields' ) ) {
|
4498 |
+
$custom_data = array( '', '', '', '', '', '', '', '', '', '' );
|
4499 |
+
for ( $i = '0'; $i < '10' ; $i++ ) {
|
4500 |
+
if ( isset( $_POST['wppa-user-custom-'.$i] ) ) {
|
4501 |
+
$custom_data[$i] = strip_tags( $_POST['wppa-user-custom-'.$i] );
|
4502 |
+
}
|
4503 |
+
}
|
4504 |
+
wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
|
4505 |
}
|
4506 |
}
|
4507 |
|
wppa-photo-admin-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -357,7 +357,12 @@ global $wpdb;
|
|
357 |
<!-- Move -->
|
358 |
<tr >
|
359 |
<th >
|
360 |
-
<input
|
|
|
|
|
|
|
|
|
|
|
361 |
</th>
|
362 |
<td >
|
363 |
<select id="moveto-<?php echo $photo['id'] ?>" style="width:100%;" ><?php echo $album_select[$photo['album']] ?></select>
|
@@ -366,7 +371,10 @@ global $wpdb;
|
|
366 |
<!-- Copy -->
|
367 |
<tr >
|
368 |
<th >
|
369 |
-
<input type="button"
|
|
|
|
|
|
|
370 |
</th>
|
371 |
<td >
|
372 |
<select id="copyto-<?php echo( $photo['id'] ) ?>" style="width:100%;" ><?php echo $album_select[$photo['album']] ?></select>
|
@@ -378,7 +386,13 @@ global $wpdb;
|
|
378 |
<?php if ( ! wppa( 'front_edit' ) ) { ?>
|
379 |
<tr >
|
380 |
<th style="padding-top:0; padding-bottom:4px;">
|
381 |
-
<input
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
</th>
|
383 |
</tr>
|
384 |
<?php } ?>
|
@@ -628,7 +642,9 @@ global $wpdb;
|
|
628 |
</td>
|
629 |
<?php } ?>
|
630 |
<td>
|
631 |
-
|
|
|
|
|
632 |
</td>
|
633 |
</tr>
|
634 |
</table>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
*/
|
9 |
|
357 |
<!-- Move -->
|
358 |
<tr >
|
359 |
<th >
|
360 |
+
<input
|
361 |
+
type="button"
|
362 |
+
style=""
|
363 |
+
onclick="if( document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php esc_js( _e( 'Are you sure you want to move this photo?' , 'wp-photo-album-plus') ) ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'moveto', document.getElementById( 'moveto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to move the photo to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
|
364 |
+
value="<?php echo ( wppa_is_video( $photo['id'] ) ? esc_attr( __( 'Move video to' , 'wp-photo-album-plus') ) : esc_attr( __( 'Move photo to' , 'wp-photo-album-plus') ) ) ?>"
|
365 |
+
/>
|
366 |
</th>
|
367 |
<td >
|
368 |
<select id="moveto-<?php echo $photo['id'] ?>" style="width:100%;" ><?php echo $album_select[$photo['album']] ?></select>
|
371 |
<!-- Copy -->
|
372 |
<tr >
|
373 |
<th >
|
374 |
+
<input type="button"
|
375 |
+
style=""
|
376 |
+
onclick="if ( document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ).value != 0 ) { if ( confirm( '<?php esc_js( _e( 'Are you sure you want to copy this photo?' , 'wp-photo-album-plus') ) ?>' ) ) wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'copyto', document.getElementById( 'copyto-<?php echo( $photo['id'] ) ?>' ) ) } else { alert( '<?php echo esc_js( __( 'Please select an album to copy the photo to first.' , 'wp-photo-album-plus') ) ?>' ); return false;}"
|
377 |
+
value="<?php echo ( wppa_is_video( $photo['id'] ) ? esc_attr( __( 'Copy video to' , 'wp-photo-album-plus') ) : esc_attr( __( 'Copy photo to' , 'wp-photo-album-plus') ) ) ?>" />
|
378 |
</th>
|
379 |
<td >
|
380 |
<select id="copyto-<?php echo( $photo['id'] ) ?>" style="width:100%;" ><?php echo $album_select[$photo['album']] ?></select>
|
386 |
<?php if ( ! wppa( 'front_edit' ) ) { ?>
|
387 |
<tr >
|
388 |
<th style="padding-top:0; padding-bottom:4px;">
|
389 |
+
<input
|
390 |
+
type="button"
|
391 |
+
style="color:red;"
|
392 |
+
<?php $q = wppa_is_video() ? _e( 'Are you sure you want to delete this video?' , 'wp-photo-album-plus') : _e( 'Are you sure you want to delete this photo?' , 'wp-photo-album-plus') ?>
|
393 |
+
onclick="if ( confirm( '<?php $q ?>' ) ) wppaAjaxDeletePhoto( <?php echo $photo['id'] ?> )"
|
394 |
+
value="<?php echo ( wppa_is_video( $photo['id'] ) ? esc_attr( __( 'Delete video' , 'wp-photo-album-plus') ) : esc_attr( __( 'Delete photo' , 'wp-photo-album-plus') ) ) ?>"
|
395 |
+
/>
|
396 |
</th>
|
397 |
</tr>
|
398 |
<?php } ?>
|
642 |
</td>
|
643 |
<?php } ?>
|
644 |
<td>
|
645 |
+
<?php if ( ! wppa_is_video( $photo['id'] ) ) { ?>
|
646 |
+
<a style="cursor:pointer; font-weight:bold;" title="<?php _e( 'Remake thumbnail file' , 'wp-photo-album-plus') ?>" onclick="wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'remakethumb', this )"><?php _e( 'Remake' , 'wp-photo-album-plus') ?></a>
|
647 |
+
<?php } ?>
|
648 |
</td>
|
649 |
</tr>
|
650 |
</table>
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -175,11 +175,13 @@ static $last_query;
|
|
175 |
return true;
|
176 |
}
|
177 |
|
178 |
-
// No luck, maybe attemt to save a session that never started.
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
183 |
|
184 |
return false;
|
185 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
175 |
return true;
|
176 |
}
|
177 |
|
178 |
+
// No luck, maybe attemt to save a session that never started.
|
179 |
+
// Mostly robots that modify their own ip.
|
180 |
+
// Just ignore is the best way
|
181 |
+
// wppa_log('Dbg', 'Attempt to save a session that was not started. ip='.$_SERVER['REMOTE_ADDR']);
|
182 |
+
// $wppa_session = false;
|
183 |
+
// $last_query = false;
|
184 |
+
// wppa_session_start();
|
185 |
|
186 |
return false;
|
187 |
}
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -2519,6 +2519,26 @@ global $wppa_tags;
|
|
2519 |
$tags = 'access,upload';
|
2520 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
2521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2522 |
$name = __('User upload Photos login', 'wp-photo-album-plus');
|
2523 |
$desc = __('Frontend upload requires the user is logged in.', 'wp-photo-album-plus');
|
2524 |
$help = esc_js(__('If you uncheck this box, make sure you check the item Owners only in Table VII-D1.', 'wp-photo-album-plus'));
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
*/
|
9 |
|
2519 |
$tags = 'access,upload';
|
2520 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
2521 |
|
2522 |
+
$name = __('User upload Video', 'wp-photo-album-plus');
|
2523 |
+
$desc = __('Enable frontend upload of video.', 'wp-photo-album-plus');
|
2524 |
+
$help = esc_js(__('Requires Table II-H1 to be ticked.', 'wp-photo-album-plus'));
|
2525 |
+
$slug = 'wppa_user_upload_video_on';
|
2526 |
+
$onchange = '';
|
2527 |
+
$html = wppa_checkbox($slug, $onchange);
|
2528 |
+
$clas = '';
|
2529 |
+
$tags = 'access,upload,video';
|
2530 |
+
wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
|
2531 |
+
|
2532 |
+
$name = __('User upload Audio', 'wp-photo-album-plus');
|
2533 |
+
$desc = __('Enable frontend upload of audio.', 'wp-photo-album-plus');
|
2534 |
+
$help = esc_js(__('Requires Table II-H1 to be ticked.', 'wp-photo-album-plus'));
|
2535 |
+
$slug = 'wppa_user_upload_audio_on';
|
2536 |
+
$onchange = '';
|
2537 |
+
$html = wppa_checkbox($slug, $onchange);
|
2538 |
+
$clas = '';
|
2539 |
+
$tags = 'access,upload,audio';
|
2540 |
+
wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags);
|
2541 |
+
|
2542 |
$name = __('User upload Photos login', 'wp-photo-album-plus');
|
2543 |
$desc = __('Frontend upload requires the user is logged in.', 'wp-photo-album-plus');
|
2544 |
$help = esc_js(__('If you uncheck this box, make sure you check the item Owners only in Table VII-D1.', 'wp-photo-album-plus'));
|
wppa-setup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
-
* Version 6.4.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -827,6 +827,8 @@ Hide Camera info
|
|
827 |
|
828 |
// H Frontend upload
|
829 |
'wppa_user_upload_on' => 'no',
|
|
|
|
|
830 |
'wppa_user_upload_login' => 'yes',
|
831 |
'wppa_ajax_upload' => 'yes',
|
832 |
'wppa_copyright_on' => 'yes', // 19
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.4.12
|
7 |
*
|
8 |
*/
|
9 |
|
827 |
|
828 |
// H Frontend upload
|
829 |
'wppa_user_upload_on' => 'no',
|
830 |
+
'wppa_user_upload_video_on' => 'no',
|
831 |
+
'wppa_user_upload_audio_on' => 'no',
|
832 |
'wppa_user_upload_login' => 'yes',
|
833 |
'wppa_ajax_upload' => 'yes',
|
834 |
'wppa_copyright_on' => 'yes', // 19
|
wppa-styles.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
/* Various style computation routines
|
6 |
-
/* Version 6.
|
7 |
/*
|
8 |
*/
|
9 |
|
@@ -461,6 +461,8 @@ function wppa_get_imgstyle_a( $id, $file, $xmax_size, $xvalign = '', $type = ''
|
|
461 |
$result['cursor'] =
|
462 |
' cursor:url( ' .wppa_get_imgdir() . wppa_opt( 'magnifier' ) . ' ),pointer;';
|
463 |
}
|
|
|
|
|
464 |
break;
|
465 |
|
466 |
case 'thumb': // Normal
|
3 |
/* Package: wp-photo-album-plus
|
4 |
/*
|
5 |
/* Various style computation routines
|
6 |
+
/* Version 6.4.12
|
7 |
/*
|
8 |
*/
|
9 |
|
461 |
$result['cursor'] =
|
462 |
' cursor:url( ' .wppa_get_imgdir() . wppa_opt( 'magnifier' ) . ' ),pointer;';
|
463 |
}
|
464 |
+
|
465 |
+
$result['style'] .= 'display:inline;';
|
466 |
break;
|
467 |
|
468 |
case 'thumb': // Normal
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 6.4.
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
@@ -29,12 +29,12 @@ global $wpdb;
|
|
29 |
/* when new options are added and when the wppa_setup() routine
|
30 |
/* must be called right after update for any other reason.
|
31 |
*/
|
32 |
-
global $wppa_revno; $wppa_revno = '
|
33 |
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
-
global $wppa_api_version; $wppa_api_version = '6-4-
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 6.4.12
|
6 |
* Author: J.N. Breetvelt a.k.a. OpaJaap
|
7 |
* Author URI: http://wppa.opajaap.nl/
|
8 |
* Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
|
29 |
/* when new options are added and when the wppa_setup() routine
|
30 |
/* must be called right after update for any other reason.
|
31 |
*/
|
32 |
+
global $wppa_revno; $wppa_revno = '6412';
|
33 |
|
34 |
/* This is the api interface version number
|
35 |
/* It is incremented at any code change.
|
36 |
*/
|
37 |
+
global $wppa_api_version; $wppa_api_version = '6-4-12-005';
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|