WP Photo Album Plus - Version 6.3.13

Version Description

Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 6.3.13
Comparing to
See all releases

Code changes from version 6.3.12 to 6.3.13

images/new.png ADDED
Binary file
js/wppa-admin-scripts.js CHANGED
@@ -164,6 +164,7 @@ function wppaInitSettings() {
164
  wppaCheckFontPreview();
165
  wppaCheckCheck( 'wppa_enable_video', 'wppa-video' );
166
  wppaCheckCheck( 'wppa_custom_fields', 'custfields' );
 
167
  wppaCheckSmWidgetLink();
168
 
169
  var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
@@ -303,12 +304,16 @@ function wppaFollow( id, clas ) {
303
  }
304
 
305
  function wppaCheckCheck( slug, clas ) {
 
 
306
  var on = document.getElementById( slug ).checked;
307
  if ( on ) {
308
  jQuery( '.'+clas ).css( 'display', '' );
 
309
  }
310
  else {
311
  jQuery( '.'+clas ).css( 'display', 'none' );
 
312
  }
313
  }
314
 
@@ -352,15 +357,28 @@ function wppaCheckFontPreview() {
352
  jQuery('#wm-type-preview').attr('src', tsrc);
353
  }
354
 
355
- /* Adjust visibility of selection radiobutton if fixed photo is chosen or not */
 
356
  function wppaCheckWidgetMethod() {
357
  var ph;
358
  var i;
359
  if (document.getElementById('wppa-wm').value=='4') {
360
  document.getElementById('wppa-wp').style.visibility='visible';
 
 
 
 
 
 
 
 
 
361
  }
362
  else {
363
  document.getElementById('wppa-wp').style.visibility='hidden';
 
 
 
364
  }
365
  if (document.getElementById('wppa-wm').value=='1') {
366
  ph=document.getElementsByName('wppa-widget-photo');
@@ -380,40 +398,6 @@ function wppaCheckWidgetMethod() {
380
  }
381
  }
382
 
383
- /* Displays or hides names and.or description dependant of subtitle chosen */
384
- function wppaCheckWidgetSubtitle() {
385
- var subtitle = document.getElementById('wppa-st').value;
386
- var stn, std;
387
- var i;
388
- stn = document.getElementsByTagName('h4');
389
- std = document.getElementsByTagName('h6');
390
- i = 0;
391
- switch (subtitle)
392
- {
393
- case 'none':
394
- while (i < stn.length) {
395
- stn[i].style.visibility = 'hidden';
396
- std[i].style.visibility = 'hidden';
397
- i++;
398
- }
399
- break;
400
- case 'name':
401
- while (i < stn.length) {
402
- stn[i].style.visibility = 'visible';
403
- std[i].style.visibility = 'hidden';
404
- i++;
405
- }
406
- break;
407
- case 'desc':
408
- while (i < stn.length) {
409
- stn[i].style.visibility = 'hidden';
410
- std[i].style.visibility = 'visible';
411
- i++;
412
- }
413
- break;
414
- }
415
- }
416
-
417
  /* Enables or disables the setting of full size horizontal alignment. Only when fullsize is unequal to column width */
418
  /* also no hor align if vertical align is ---default-- */
419
  /* Also show/hide initial colwidth for resp themem ( Table I-A1.1 ) */
@@ -1524,76 +1508,87 @@ function wppaMaintenanceProc(slug, intern) {
1524
  // Start
1525
  document.getElementById(slug+"_continue").value = 'yes';
1526
  document.getElementById(slug+"_button").value = 'Stop!';
1527
- // jQuery("#"+slug+"_status").html('Working');
1528
-
1529
- var xmlhttp = wppaGetXmlHttp();
1530
-
1531
- // Response on-unit
1532
- xmlhttp.onreadystatechange=function() {
1533
- if ( xmlhttp.readyState == 4 ) {
1534
- if ( xmlhttp.status = 200 ) {
1535
- var resp = xmlhttp.responseText; // sample: '<error>||<slug>||<status>||<togo>'
1536
- var resparr = resp.split("||");
1537
- var slug = resparr[1];
1538
- var error = false;
1539
-
1540
- // Check for unrecoverable error
1541
- if ( ! slug ) {
1542
- alert('The server returned unexpected output:\n'+xmlhttp.responseText+'\nIf the current procedure has a Skip One button, press it before retrying. Reloading page...');
1543
- wppaReload();
1544
- return; // give up;
1545
- }
1546
-
1547
- // Check for recoverable error
1548
- if ( resparr[0].length > 10 ) { // Was: resparr[0] != ''
1549
- alert('An error occurred:\n'+resparr[0]);
1550
- error = true;
1551
- }
1552
-
1553
- // Update status and togo
1554
- jQuery("#"+slug+"_status").html(resparr[2]);
1555
- jQuery("#"+slug+"_togo").html(resparr[3]);
1556
- jQuery("#"+slug+"_button").css('display', '');
1557
-
1558
- // Stop on error or on ready
1559
- if ( error || resparr[3] == '0' ) {
1560
- if ( resparr[4] == 'reload' ) {
1561
- alert('This page will now be reloaded to finish the operation. Please stay tuned...');
1562
- wppaReload();
1563
- return;
1564
- }
1565
- else {
1566
- setTimeout('wppaMaintenanceProc(\''+slug+'\', false)', 20); // fake extern to stop it
1567
- }
1568
- return;
1569
- }
1570
-
1571
- // Continue if not stopped by user
1572
- if ( document.getElementById(slug+"_continue").value == 'yes' ) {
1573
- setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 20);
1574
- return;
1575
- }
1576
-
1577
- // Stopped but not ready yet
1578
- jQuery("#"+slug+"_status").html('Pending');
1579
- }
1580
- else { // Status not 200
1581
- jQuery("#"+slug+"_status").html('Comm err '+xmlhttp.status);
1582
- setTimeout('wppaMaintenanceProc(\''+slug+'\', false)', 20); // fake extern to stop it
1583
- return;
1584
- }
1585
-
1586
- }
1587
- }
1588
-
1589
- // Compose ajax url
1590
- var data = 'action=wppa&wppa-action=maintenance&slug='+slug;
1591
- data += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1592
-
1593
- // Do the Ajax action
1594
- xmlhttp.open('POST',wppaAjaxUrl,true);
1595
- xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
1596
- xmlhttp.send(data);
 
 
 
 
 
 
 
 
 
 
 
1597
  }
1598
 
1599
  function wppaAjaxPopupWindow( slug ) {
164
  wppaCheckFontPreview();
165
  wppaCheckCheck( 'wppa_enable_video', 'wppa-video' );
166
  wppaCheckCheck( 'wppa_custom_fields', 'custfields' );
167
+ wppaCheckCheck( 'wppa_new_mod_label_is_text', 'nmtxt' );
168
  wppaCheckSmWidgetLink();
169
 
170
  var tab = new Array('O','I','II','III','IV','V','VI','VII','VIII','IX','X','XI','XII');
304
  }
305
 
306
  function wppaCheckCheck( slug, clas ) {
307
+ //wppaConsoleLog( 'CheckCheck slug = '+slug, 'force' );
308
+
309
  var on = document.getElementById( slug ).checked;
310
  if ( on ) {
311
  jQuery( '.'+clas ).css( 'display', '' );
312
+ jQuery( '.-'+clas ).css( 'display', 'none' );
313
  }
314
  else {
315
  jQuery( '.'+clas ).css( 'display', 'none' );
316
+ jQuery( '.-'+clas ).css( 'display', '' );
317
  }
318
  }
319
 
357
  jQuery('#wm-type-preview').attr('src', tsrc);
358
  }
359
 
360
+ /* Adjust visibility of selection radiobutton if fixed photo is chosen or not */
361
+ /* Also: hide/show order# stuff */
362
  function wppaCheckWidgetMethod() {
363
  var ph;
364
  var i;
365
  if (document.getElementById('wppa-wm').value=='4') {
366
  document.getElementById('wppa-wp').style.visibility='visible';
367
+ var per = jQuery('#wppa-wp').val();
368
+
369
+ if ( per == 'day-of-week' || per == 'day-of-month' || per == 'day-of-year' ) {
370
+ jQuery('.wppa-order').css('visibility', '');
371
+ }
372
+ else {
373
+ jQuery('.wppa-order').css('visibility', 'hidden');
374
+ }
375
+
376
  }
377
  else {
378
  document.getElementById('wppa-wp').style.visibility='hidden';
379
+ jQuery('.wppa-order').css('visibility', 'hidden');
380
+
381
+
382
  }
383
  if (document.getElementById('wppa-wm').value=='1') {
384
  ph=document.getElementsByName('wppa-widget-photo');
398
  }
399
  }
400
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  /* Enables or disables the setting of full size horizontal alignment. Only when fullsize is unequal to column width */
402
  /* also no hor align if vertical align is ---default-- */
403
  /* Also show/hide initial colwidth for resp themem ( Table I-A1.1 ) */
1508
  // Start
1509
  document.getElementById(slug+"_continue").value = 'yes';
1510
  document.getElementById(slug+"_button").value = 'Stop!';
1511
+ if ( jQuery("#"+slug+"_status").html() == '' ) {
1512
+ jQuery("#"+slug+"_status").html('Wait...');
1513
+ }
1514
+
1515
+ jQuery.ajax( { url: wppaAjaxUrl,
1516
+ data: 'action=wppa'+
1517
+ '&wppa-action=maintenance'+
1518
+ '&slug='+slug+
1519
+ '&wppa-nonce='+jQuery('#wppa-nonce').val(),
1520
+ async: true,
1521
+ type: 'POST',
1522
+ timeout: 300000,
1523
+ beforeSend: function( xhr ) {
1524
+
1525
+ },
1526
+ success: function( result, status, xhr ) {
1527
+
1528
+ // sample: '<error>||<slug>||<status>||<togo>'
1529
+ var resparr = result.split("||");
1530
+ var slug = resparr[1];
1531
+ var error = false;
1532
+
1533
+ // Check for unrecoverable error
1534
+ if ( ! slug ) {
1535
+ alert('The server returned unexpected output:\n'+result+'\nIf the current procedure has a Skip One button, press it before retrying. Reloading page...');
1536
+ wppaReload();
1537
+ return; // give up;
1538
+ }
1539
+
1540
+ // Check for recoverable error
1541
+ if ( resparr[0].length > 10 ) {
1542
+ alert('An error occurred:\n'+resparr[0]);
1543
+ error = true;
1544
+ }
1545
+
1546
+ // Update status and togo
1547
+ jQuery("#"+slug+"_status").html(resparr[2]);
1548
+ jQuery("#"+slug+"_togo").html(resparr[3]);
1549
+ jQuery("#"+slug+"_button").css('display', '');
1550
+
1551
+ // Stop on error or on ready
1552
+ if ( error || resparr[3] == '0' ) {
1553
+ if ( resparr[4] == 'reload' ) {
1554
+ alert('This page will now be reloaded to finish the operation. Please stay tuned...');
1555
+ wppaReload();
1556
+ return;
1557
+ }
1558
+ else {
1559
+ setTimeout('wppaMaintenanceProc(\''+slug+'\', false)', 20); // fake extern to stop it
1560
+ }
1561
+ return;
1562
+ }
1563
+
1564
+ // Continue if not stopped by user
1565
+ if ( document.getElementById(slug+"_continue").value == 'yes' ) {
1566
+ setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 20);
1567
+ return;
1568
+ }
1569
+
1570
+ // Stopped but not ready yet
1571
+ jQuery("#"+slug+"_status").html('Pending');
1572
+ },
1573
+
1574
+ error: function( xhr, status, error ) {
1575
+ wppaConsoleLog( 'wppaMaintenanceProc failed. Error = ' + error + ', status = ' + status, 'force' );
1576
+ jQuery("#"+slug+"_status").html('Server error');
1577
+ if ( confirm( 'Server error.\nDo you want to continue?' ) ) {
1578
+ if ( slug == 'wppa_remake' ) {
1579
+ wppaAjaxUpdateOptionValue('wppa_remake_skip_one', 0);
1580
+ }
1581
+ if ( slug == 'wppa_regen_thumbs') {
1582
+ wppaAjaxUpdateOptionValue('wppa_regen_thumbs_skip_one', 0);
1583
+ }
1584
+ setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 2000);
1585
+ }
1586
+ },
1587
+
1588
+ complete: function( xhr, status, newurl ) {
1589
+
1590
+ }
1591
+ } );
1592
  }
1593
 
1594
  function wppaAjaxPopupWindow( slug ) {
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&currency_code=USD&lc=US
4
  Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
- Version: 6.3.12
6
- Stable tag: 6.3.11
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -189,6 +189,26 @@ Oh, just Google on 'picture resizer' and you will find a bunch of free programs
189
 
190
  See for additional information: http://wppa.opajaap.nl/changelog/
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  = 6.3.12 =
193
 
194
  = Bug Fixes =
@@ -232,12 +252,12 @@ For related settings: See Table IX-D1.x.
232
 
233
  = Bug Fixes =
234
 
235
- * The Odd/Even toggle of background colors stopped working a few revs ago. Fixed.
236
  If you have unwanted background colors of album covers and/or thumbnail areas, change Table III-B1 ( make equal to III-B2 to get the previous results ).
237
 
238
  = New Features =
239
 
240
- * You can now import photos from 'outside' wp-content, even outside the wp install dir, on the same servers filesystem.
241
  In Table IX-B17 you can specify the highest root where to search for imporatble files from.
242
  The wppa source directories are not ment to import from, they are skipped by default; if you really want to import from those locations, tick Table IX-B18.
243
  * You can now add an 'Inverse' checkbox to the Multitag widget / box to invert the selection. Table IX-E10.1.
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&currency_code=USD&lc=US
4
  Tags: photo, album, gallery, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto
5
+ Version: 6.3.13
6
+ Stable tag: 6.3.13
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
189
 
190
  See for additional information: http://wppa.opajaap.nl/changelog/
191
 
192
+ = 6.3.13 =
193
+
194
+ = Bug Fixes =
195
+
196
+ * Rating did not work when lightbox keyname is other than wppa. Fixed.
197
+ * Files with unsanitized names are now correctly removed in Import dir to album.
198
+
199
+ = New Features =
200
+
201
+ * You can select various types of layout for the sub-album links on album covers. Table VI-C11.
202
+ * Additional checkbox on the Import Photos screen when the input is set to --- My Depot --- or a subfolder thereof: Remove from depot after failed import.
203
+ * Added to the photo of the day settings screen: Change every: day of the year is photo order#. Added offset to all 3 day of ... options.
204
+
205
+ = Other Changes =
206
+
207
+ * Changed the default settings of the photo of the day feature, so it always works when there are photos and nothing has been configured.
208
+ * Layout changes/fixes to the photo of the day preview images.
209
+ * If you do not like the textual New and Modified labels, you can now specify urls to custom images. Defaults to the old new.png. See Table IX-D1.5, 1.8 and 1.9
210
+ * jQueryfied ajax and improved errorhandling in maintenance operations ( Table VIII ).
211
+
212
  = 6.3.12 =
213
 
214
  = Bug Fixes =
252
 
253
  = Bug Fixes =
254
 
255
+ * The Odd/Even toggle of background colors stopped working a few revs ago. Fixed.
256
  If you have unwanted background colors of album covers and/or thumbnail areas, change Table III-B1 ( make equal to III-B2 to get the previous results ).
257
 
258
  = New Features =
259
 
260
+ * You can now import photos from 'outside' wp-content, even outside the wp install dir, on the same servers filesystem.
261
  In Table IX-B17 you can specify the highest root where to search for imporatble files from.
262
  The wppa source directories are not ment to import from, they are skipped by default; if you really want to import from those locations, tick Table IX-B18.
263
  * You can now add an 'Inverse' checkbox to the Multitag widget / box to invert the selection. Table IX-E10.1.
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 6.3.12
7
  *
8
  */
9
 
@@ -1438,25 +1438,40 @@ function wppa_the_album_title( $alb, $href_title, $onclick_title, $title, $targe
1438
  else {
1439
  $type = '';
1440
  }
 
 
 
1441
  if ( $type ) {
 
 
 
 
 
 
 
 
 
1442
 
1443
- wppa_out( ' <div' .
1444
- ' style="' .
1445
- 'display:inline;' .
1446
- 'box-sizing:border-box;' .
1447
- 'font-size:' . $fsize . 'px;' .
1448
- 'line-height:' . $fsize . 'px;' .
1449
- 'font-family:\'Arial Black\', Gadget, sans-serif;' .
1450
- 'border-radius:4px;' .
1451
- 'border-width:2px;' .
1452
- 'border-style:solid;' .
1453
- // 'padding:1px;' .
1454
- wppa_get_text_medal_color_style( $type, '2' ) .
1455
- '"' .
1456
- ' >' .
1457
- '&nbsp;' . __( wppa_opt( $type.'_label_text' ) ) . '&nbsp;' .
1458
- '</div>'
1459
- );
 
 
 
1460
  }
1461
  wppa_out( '</h2>' );
1462
  }
@@ -1475,10 +1490,33 @@ function wppa_albumcover_sublinks( $id, $width, $rsp ) {
1475
  function wppa_subalbumlinks_html( $id, $top = true ) {
1476
  global $wpdb;
1477
 
1478
- if ( wppa_opt( 'cover_sublinks' ) != 'none' ) {
1479
- $subs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."` WHERE `a_parent` = " . $id . " " . wppa_get_album_order( $id ), ARRAY_A );
1480
- if ( $subs ) {
1481
- if ( $top ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1482
  wppa_out( '<style scoped="scoped" >' .
1483
  'ul, li { margin:0; }' .
1484
  'ul {' .
@@ -1490,67 +1528,156 @@ global $wpdb;
1490
  '</style>'
1491
  );
1492
  }
1493
- wppa_out( '<ul style="clear:both;" >' );
1494
- foreach( $subs as $album ) {
1495
-
1496
- // What is the albums title linktype
1497
- $linktype = $album['cover_linktype'];
1498
- if ( ! $linktype ) $linktype = 'content'; // Default
1499
-
1500
- // What is the albums title linkpage
1501
- $linkpage = $album['cover_linkpage'];
1502
- if ( $linkpage == '-1' ) $linktype = 'none'; // for backward compatibility
1503
-
1504
- // Find the content 'View' link
1505
- $albumid = $album['id'];
1506
- $photocount = wppa_get_photo_count( $albumid, 'use_treecounts' );
1507
-
1508
- // Thumbnails and covers, show sub-album covers
1509
- // in case slideshow is requested on an empty album
1510
- if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
1511
- if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
1512
- $href_content = '';
1513
- $onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
1514
- wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
1515
- wppa_convert_to_pretty( $href_content ) . "' )";
1516
- }
1517
- else {
1518
- $href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
1519
- $onclick_content = '';
1520
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1521
  }
 
1522
 
1523
- // Slideshow
 
 
 
 
 
 
 
1524
  else {
1525
- if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
1526
- $href_content = '';
1527
- $onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
1528
- wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
1529
- wppa_convert_to_pretty( $href_content ) . "' )";
 
 
 
 
 
 
 
 
 
 
1530
  }
1531
  else {
1532
- $href_content = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
1533
- $onclick_content = '';
 
 
 
 
 
 
 
 
1534
  }
1535
- }
1536
-
1537
- wppa_out( '<li>' .
1538
- '<a' .
1539
- ( $href_content ? ' href="' . $href_content . '"' : '' ) .
1540
- ( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
1541
- '>' .
1542
- wppa_get_album_name( $album['id'] ) .
1543
- '</a>' .
1544
- '</li>'
1545
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1546
 
1547
- // Go deeper for grandchildren
1548
- if ( wppa_switch( 'cover_sublinks_recursive' ) ) {
1549
- wppa_subalbumlinks_html( $album['id'], false );
1550
- }
1551
  }
 
 
 
 
1552
  wppa_out( '</ul>' );
1553
  }
 
 
1554
  }
1555
  }
1556
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 6.3.13
7
  *
8
  */
9
 
1438
  else {
1439
  $type = '';
1440
  }
1441
+
1442
+ $do_image = ! wppa_switch( 'wppa_new_mod_label_is_text' );
1443
+
1444
  if ( $type ) {
1445
+ if ( $do_image ) {
1446
+ wppa_out( '<img' .
1447
+ ' src="' . wppa_opt($type.'_label_url') . '"' .
1448
+ ' title="' . __( 'New!' , 'wp-photo-album-plus') . '"' .
1449
+ ' class="wppa-albumnew"' .
1450
+ ' style="border:none;margin:0;padding:0;box-shadow:none;"' .
1451
+ ' alt="' . __( 'New', 'wp-photo-album-plus' ) . '"' .
1452
+ ' />'
1453
+ );
1454
 
1455
+ }
1456
+ else {
1457
+ wppa_out( ' <div' .
1458
+ ' style="' .
1459
+ 'display:inline;' .
1460
+ 'box-sizing:border-box;' .
1461
+ 'font-size:' . $fsize . 'px;' .
1462
+ 'line-height:' . $fsize . 'px;' .
1463
+ 'font-family:\'Arial Black\', Gadget, sans-serif;' .
1464
+ 'border-radius:4px;' .
1465
+ 'border-width:2px;' .
1466
+ 'border-style:solid;' .
1467
+ // 'padding:1px;' .
1468
+ wppa_get_text_medal_color_style( $type, '2' ) .
1469
+ '"' .
1470
+ ' >' .
1471
+ '&nbsp;' . __( wppa_opt( $type . '_label_text' ) ) . '&nbsp;' .
1472
+ '</div>'
1473
+ );
1474
+ }
1475
  }
1476
  wppa_out( '</h2>' );
1477
  }
1490
  function wppa_subalbumlinks_html( $id, $top = true ) {
1491
  global $wpdb;
1492
 
1493
+ // Do they need us? Anything to display?
1494
+ if ( wppa_opt( 'cover_sublinks_display' ) == 'none' ) {
1495
+ return;
1496
+ }
1497
+
1498
+ // Display type
1499
+ $display_type = wppa_opt( 'cover_sublinks_display' );
1500
+
1501
+ // Link type
1502
+ $link_type = wppa_opt( 'cover_sublinks' );
1503
+
1504
+ // Init
1505
+ $is_list = ( $display_type == 'list' || $display_type == 'recursivelist' );
1506
+ $is_recursive = $display_type == 'recursivelist';
1507
+ $first = true;
1508
+
1509
+ // Get the children
1510
+ $subs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."` WHERE `a_parent` = " . $id . " " . wppa_get_album_order( $id ), ARRAY_A );
1511
+
1512
+ // Only if there are sub-albums
1513
+ if ( ! empty( $subs ) ) {
1514
+
1515
+ wppa_out( '<div>' );
1516
+
1517
+ // Local css
1518
+ if ( $top ) {
1519
+ if ( $is_list ) {
1520
  wppa_out( '<style scoped="scoped" >' .
1521
  'ul, li { margin:0; }' .
1522
  'ul {' .
1528
  '</style>'
1529
  );
1530
  }
1531
+ if ( $display_type == 'microthumbs' ) {
1532
+ wppa_out( '<style scoped="scoped" >' .
1533
+ 'img {' .
1534
+ 'max-width:100px;' .
1535
+ 'max-height:50px;' .
1536
+ 'padding:1px;' .
1537
+ 'margin:1px;' .
1538
+ 'background-color:' . wppa_opt( 'bgcolor_img' ) . ';' .
1539
+ 'float:left;' .
1540
+ '}' .
1541
+ '</style>'
1542
+ );
1543
+ }
1544
+ }
1545
+
1546
+ // Start list if required
1547
+ if ( $is_list ) {
1548
+ wppa_out( '<ul class="wppa-cover-sublink-list" style="clear:both;" >' );
1549
+ }
1550
+ else {
1551
+ wppa_out( '<div style="clear:both;" ></div>' );
1552
+ }
1553
+
1554
+ // Process the sub-albums
1555
+ foreach( $subs as $album ) {
1556
+
1557
+ // What is the albums title linktype
1558
+ $linktype = $album['cover_linktype'];
1559
+ if ( ! $linktype ) $linktype = 'content'; // Default
1560
+
1561
+ // What is the albums title linkpage
1562
+ $linkpage = $album['cover_linkpage'];
1563
+ if ( $linkpage == '-1' ) $linktype = 'none'; // for backward compatibility
1564
+
1565
+ // Find the content 'View' link
1566
+ $albumid = $album['id'];
1567
+ $photocount = wppa_get_photo_count( $albumid, 'use_treecounts' );
1568
+
1569
+ // Thumbnails and covers, show sub-album covers
1570
+ // in case slideshow is requested on an empty album
1571
+ if ( wppa_opt( 'cover_sublinks' ) == 'content' || ! $photocount ) {
1572
+ if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
1573
+ $href_content = '';
1574
+ $onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
1575
+ wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
1576
+ wppa_convert_to_pretty( $href_content ) . "' )";
1577
+ }
1578
+ else {
1579
+ $href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
1580
+ $onclick_content = '';
1581
  }
1582
+ }
1583
 
1584
+ // Slideshow
1585
+ else {
1586
+ if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
1587
+ $href_content = '';
1588
+ $onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
1589
+ wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
1590
+ wppa_convert_to_pretty( $href_content ) . "' )";
1591
+ }
1592
  else {
1593
+ $href_content = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
1594
+ $onclick_content = '';
1595
+ }
1596
+ }
1597
+
1598
+ // Do the output
1599
+ $title = esc_attr( __( 'View the album', 'wp-photo-album-plus' ) . ': ' . wppa_get_album_name( $album['id'] ) );
1600
+ switch( $display_type ) {
1601
+ case 'list':
1602
+ case 'recursivelist':
1603
+ if ( $link_type == 'none' ) {
1604
+ wppa_out( '<li>' .
1605
+ wppa_get_album_name( $album['id'] ) .
1606
+ '</li>'
1607
+ );
1608
  }
1609
  else {
1610
+ wppa_out( '<li>' .
1611
+ '<a' .
1612
+ ( $href_content ? ' href="' . $href_content . '"' : '' ) .
1613
+ ( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
1614
+ ' title="' . $title . '"' .
1615
+ ' >' .
1616
+ wppa_get_album_name( $album['id'] ) .
1617
+ '</a>' .
1618
+ '</li>'
1619
+ );
1620
  }
1621
+ break;
1622
+ case 'enum':
1623
+ if ( ! $first ) {
1624
+ wppa_out( ', ' );
1625
+ }
1626
+ if ( $link_type == 'none' ) {
1627
+ wppa_out( wppa_get_album_name( $album['id'] ) );
1628
+ }
1629
+ else {
1630
+ wppa_out( '<a' .
1631
+ ( $href_content ? ' href="' . $href_content . '"' : '' ) .
1632
+ ( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
1633
+ ' title="' . $title . '"' .
1634
+ ' >' .
1635
+ wppa_get_album_name( $album['id'] ) .
1636
+ '</a>'
1637
+ );
1638
+ }
1639
+ $first = false;
1640
+ break;
1641
+ case 'microthumbs':
1642
+ $coverphoto_id = wppa_get_coverphoto_id( $album['id'] );
1643
+ $src = wppa_fix_poster_ext( wppa_get_thumb_url( $coverphoto_id ), $coverphoto_id );
1644
+ if ( $link_type == 'none' ) {
1645
+ wppa_out( '<img' .
1646
+ ' class="wppa-cover-sublink-img"' .
1647
+ ' src="' . $src . '"' .
1648
+ ' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
1649
+ ' />'
1650
+ );
1651
+ }
1652
+ else {
1653
+ wppa_out( '<a' .
1654
+ ( $href_content ? ' href="' . $href_content . '"' : '' ) .
1655
+ ( $onclick_content ? ' onclick="' . $onclick_content . '"' : '' ) .
1656
+ ' title="' . $title . '"' .
1657
+ ' >' .
1658
+ '<img' .
1659
+ ' class="wppa-cover-sublink-img"' .
1660
+ ' src="' . $src . '"' .
1661
+ ' alt="' . wppa_get_album_name( $album['id'] ) . '"' .
1662
+ ' />' .
1663
+ '</a>'
1664
+ );
1665
+ }
1666
+ break;
1667
+ }
1668
 
1669
+ // Go deeper for grandchildren
1670
+ if ( $is_recursive ) {
1671
+ wppa_subalbumlinks_html( $album['id'], false );
 
1672
  }
1673
+ }
1674
+
1675
+ // End list
1676
+ if ( $is_list ) {
1677
  wppa_out( '</ul>' );
1678
  }
1679
+
1680
+ wppa_out( '</div>' );
1681
  }
1682
  }
1683
 
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 6.3.12
7
  *
8
  *
9
  */
@@ -1228,7 +1228,7 @@ global $wppa_locale;
1228
  }
1229
  }
1230
 
1231
- $tw = '<div style="float:left; padding:2px;" >' .
1232
  '<a' .
1233
  ' title="' . sprintf( __( 'Tweet %s on Twitter' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1234
  ' href="https://twitter.com/intent/tweet?text='.$tweet.'"' .
@@ -1248,7 +1248,7 @@ global $wppa_locale;
1248
 
1249
  // Google
1250
  if ( wppa_switch( 'share_google' ) ) {
1251
- $go = '<div style="float:left; padding:2px;" >' .
1252
  '<a' .
1253
  ' title="' . sprintf( __( 'Share %s on Google+' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1254
  ' href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"' .
@@ -1271,7 +1271,7 @@ global $wppa_locale;
1271
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
1272
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
1273
  if ( wppa_switch( 'share_pinterest' ) ) {
1274
- $pi = '<div style="float:left; padding:2px;" >' .
1275
  '<a' .
1276
  ' title="' . sprintf( __( 'Share %s on Pinterest' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1277
  ' href="http://pinterest.com/pin/create/button/?url=' . urlencode( $share_url ) .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 6.3.13
7
  *
8
  *
9
  */
1228
  }
1229
  }
1230
 
1231
+ $tw = '<div style="float:left; padding:0 2px;" >' .
1232
  '<a' .
1233
  ' title="' . sprintf( __( 'Tweet %s on Twitter' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1234
  ' href="https://twitter.com/intent/tweet?text='.$tweet.'"' .
1248
 
1249
  // Google
1250
  if ( wppa_switch( 'share_google' ) ) {
1251
+ $go = '<div style="float:left; padding:0 2px;" >' .
1252
  '<a' .
1253
  ' title="' . sprintf( __( 'Share %s on Google+' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1254
  ' href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"' .
1271
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
1272
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
1273
  if ( wppa_switch( 'share_pinterest' ) ) {
1274
+ $pi = '<div style="float:left; padding:0 2px;" >' .
1275
  '<a' .
1276
  ' title="' . sprintf( __( 'Share %s on Pinterest' , 'wp-photo-album-plus'), esc_attr( $photo_name ) ) . '"' .
1277
  ' href="http://pinterest.com/pin/create/button/?url=' . urlencode( $share_url ) .
wppa-common-functions.php CHANGED
@@ -727,7 +727,7 @@ global $wpdb;
727
 
728
  $thumb = wppa_cache_thumb( $id );
729
 
730
- $src_size = getimagesize( $file, $info );
731
 
732
  // If the given file is an image file, process it
733
  if ( $src_size ) {
@@ -1365,7 +1365,7 @@ static $labels;
1365
  function wppa_get_exif_datetime( $file ) {
1366
  // Check filetype
1367
  if ( ! function_exists( 'exif_imagetype' ) ) return false; // Exif functions absent
1368
- $image_type = exif_imagetype( $file );
1369
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1370
  // Get exif data
1371
  if ( ! function_exists( 'exif_read_data' ) ) return false; // Not supported by the server
@@ -1388,7 +1388,7 @@ global $wppa;
1388
  // Check filetype
1389
  if ( ! function_exists( 'exif_imagetype' ) ) return false;
1390
 
1391
- $image_type = exif_imagetype( $file );
1392
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1393
 
1394
  // Get exif data
@@ -1822,7 +1822,7 @@ global $wpdb;
1822
 
1823
  // Check filetype
1824
  if ( ! function_exists( 'exif_imagetype' ) ) return false;
1825
- $image_type = exif_imagetype( $picture_path );
1826
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1827
 
1828
  // get exif data
727
 
728
  $thumb = wppa_cache_thumb( $id );
729
 
730
+ $src_size = @getimagesize( $file, $info );
731
 
732
  // If the given file is an image file, process it
733
  if ( $src_size ) {
1365
  function wppa_get_exif_datetime( $file ) {
1366
  // Check filetype
1367
  if ( ! function_exists( 'exif_imagetype' ) ) return false; // Exif functions absent
1368
+ $image_type = @ exif_imagetype( $file );
1369
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1370
  // Get exif data
1371
  if ( ! function_exists( 'exif_read_data' ) ) return false; // Not supported by the server
1388
  // Check filetype
1389
  if ( ! function_exists( 'exif_imagetype' ) ) return false;
1390
 
1391
+ $image_type = @ exif_imagetype( $file );
1392
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1393
 
1394
  // Get exif data
1822
 
1823
  // Check filetype
1824
  if ( ! function_exists( 'exif_imagetype' ) ) return false;
1825
+ $image_type = @ exif_imagetype( $picture_path );
1826
  if ( $image_type != IMAGETYPE_JPEG ) return false; // Not supported image type
1827
 
1828
  // get exif data
wppa-non-admin.php CHANGED
@@ -354,7 +354,7 @@ global $wppa_session;
354
  wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).';
355
  </script>
356
  ';
357
- wp_nonce_field('wppa-check' , 'wppa-nonce', false, true); // Nonce field for Ajax bump view counter from lightbox
358
  echo '
359
  <script type="text/javascript">';
360
  if ( isset( $wppa_session['photo'] ) ) {
@@ -369,6 +369,7 @@ global $wppa_session;
369
  ';
370
  }
371
 
 
372
  wppa_dbg_q('print');
373
  if ( wppa( 'debug' ) ) {
374
  $plugins = get_option('active_plugins');
@@ -379,9 +380,17 @@ global $wppa_session;
379
  wppa_dbg_msg('End Active Plugins');
380
  }
381
 
 
 
 
 
 
382
  echo '
383
  <!-- Do user upload -->';
384
- wppa_user_upload(); // Do the upload if required and not yet done
 
 
 
385
  echo '
386
  <!-- Done user upload -->';
387
  }
354
  wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).';
355
  </script>
356
  ';
357
+
358
  echo '
359
  <script type="text/javascript">';
360
  if ( isset( $wppa_session['photo'] ) ) {
369
  ';
370
  }
371
 
372
+ // Debugging
373
  wppa_dbg_q('print');
374
  if ( wppa( 'debug' ) ) {
375
  $plugins = get_option('active_plugins');
380
  wppa_dbg_msg('End Active Plugins');
381
  }
382
 
383
+ echo '
384
+ <!-- Nonce for various wppa actions -->';
385
+ // Nonce field for Ajax bump view counter from lightbox, and rating
386
+ wp_nonce_field('wppa-check' , 'wppa-nonce', false, true);
387
+
388
  echo '
389
  <!-- Do user upload -->';
390
+ // Do the upload if required and not yet done
391
+ wppa_user_upload();
392
+
393
+ // Done
394
  echo '
395
  <!-- Done user upload -->';
396
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 6.3.12
7
  *
8
  */
9
 
@@ -824,8 +824,8 @@ global $wppa_tags;
824
  $desc = __('The size of the social media icons in the Share box', 'wp-photo-album-plus');
825
  $help = '';
826
  $slug = 'wppa_share_size';
827
- $opts = array('16 x 16', '32 x 32');
828
- $vals = array('16', '32');
829
  $html = wppa_select($slug, $opts, $vals);
830
  $clas = 'wppa_share';
831
  $tags = 'size,sm,slide';
@@ -5451,10 +5451,10 @@ global $wppa_tags;
5451
  }
5452
  {
5453
  $name = __('Album cover subalbums link', 'wp-photo-album-plus');
5454
- $desc = __('Select the linktype for sub-albums on parent album covers.', 'wp-photo-album-plus');
5455
  $help = '';
5456
  $slug1 = 'wppa_cover_sublinks';
5457
- $slug2 = 'wppa_cover_sublinks_recursive';
5458
  $slug3 = '';
5459
  $slug4 = '';
5460
  $slug = array($slug1, $slug2, $slug3, $slug4);
@@ -5468,8 +5468,23 @@ global $wppa_tags;
5468
  'content',
5469
  'slide',
5470
  );
 
5471
  $html1 = wppa_select($slug1, $opts, $vals, $onchange, $clas);
5472
- $html2 = '<span style="float:left">'.__('Recursive', 'wp-photo-album-plus').'</span>'.wppa_checkbox($slug2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5473
  $html3 = '';
5474
  $html4 = '';
5475
  $html = array($html1, $html2, $html3, $html4);
@@ -7039,6 +7054,17 @@ global $wppa_tags;
7039
  $tags = 'system';
7040
  wppa_setting($slug, '1.4', $name, $desc, $html, $help, $clas, $tags);
7041
 
 
 
 
 
 
 
 
 
 
 
 
7042
  $opts = array(
7043
  __('Red', 'wp-photo-album-plus'),
7044
  __('Orange', 'wp-photo-album-plus'),
@@ -7063,22 +7089,40 @@ global $wppa_tags;
7063
  $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus'));
7064
  $slug1 = 'wppa_new_label_text';
7065
  $slug2 = 'wppa_new_label_color';
7066
- $html1 = '<span style="float:left">'.__('Label text', 'wp-photo-album-plus').': </span>'.wppa_input($slug1, '100px');
7067
- $html2 = '<span style="float:left">'.__('Label color', 'wp-photo-album-plus').': </span>'.wppa_select($slug2, $opts, $vals);
7068
- $clas = '';
7069
  $tags = 'system';
7070
- wppa_setting($slug1, '1.5', $name, $desc, $html1.' '.$html2, $help, $clas, $tags);
7071
 
7072
  $name = __('Modified label', 'wp-photo-album-plus');
7073
  $desc = __('Specify the "Modified" indicator details.', 'wp-photo-album-plus');
7074
  $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus'));
7075
  $slug1 = 'wppa_mod_label_text';
7076
  $slug2 = 'wppa_mod_label_color';
7077
- $html1 = '<span style="float:left">'.__('Label text', 'wp-photo-album-plus').': </span>'.wppa_input($slug1, '100px');
7078
- $html2 = '<span style="float:left">'.__('Label color', 'wp-photo-album-plus').': </span>'.wppa_select($slug2, $opts, $vals);
7079
- $clas = '';
7080
  $tags = 'system';
7081
- wppa_setting($slug1, '1.6', $name, $desc, $html1.' '.$html2, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7082
 
7083
  $name = __('Limit LasTen New', 'wp-photo-album-plus');
7084
  $desc = __('Limits the LasTen photos to those that are \'New\', or newly modified.', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 6.3.13
7
  *
8
  */
9
 
824
  $desc = __('The size of the social media icons in the Share box', 'wp-photo-album-plus');
825
  $help = '';
826
  $slug = 'wppa_share_size';
827
+ $opts = array('16 x 16', '20 x 20', '32 x 32');
828
+ $vals = array('16', '20', '32');
829
  $html = wppa_select($slug, $opts, $vals);
830
  $clas = 'wppa_share';
831
  $tags = 'size,sm,slide';
5451
  }
5452
  {
5453
  $name = __('Album cover subalbums link', 'wp-photo-album-plus');
5454
+ $desc = __('Select the linktype and display type for sub-albums on parent album covers.', 'wp-photo-album-plus');
5455
  $help = '';
5456
  $slug1 = 'wppa_cover_sublinks';
5457
+ $slug2 = 'wppa_cover_sublinks_display';
5458
  $slug3 = '';
5459
  $slug4 = '';
5460
  $slug = array($slug1, $slug2, $slug3, $slug4);
5468
  'content',
5469
  'slide',
5470
  );
5471
+ $clas = '';
5472
  $html1 = wppa_select($slug1, $opts, $vals, $onchange, $clas);
5473
+ $opts = array(
5474
+ __('No display at all', 'wp-photo-album-plus'),
5475
+ __('A list with sub(sub) albums', 'wp-photo-album-plus'),
5476
+ __('A list of children only', 'wp-photo-album-plus'),
5477
+ __('An enumeration of names', 'wp-photo-album-plus'),
5478
+ __('Micro thumbnails', 'wp-photo-album-plus'),
5479
+ );
5480
+ $vals = array(
5481
+ 'none',
5482
+ 'recursivelist',
5483
+ 'list',
5484
+ 'enum',
5485
+ 'microthumbs',
5486
+ );
5487
+ $html2 = wppa_select($slug2, $opts, $vals, $onchange, $clas);
5488
  $html3 = '';
5489
  $html4 = '';
5490
  $html = array($html1, $html2, $html3, $html4);
7054
  $tags = 'system';
7055
  wppa_setting($slug, '1.4', $name, $desc, $html, $help, $clas, $tags);
7056
 
7057
+ $name = __('Use text labels', 'wp-photo-album-plus');
7058
+ $desc = __('Use editable text for the New and Modified labels', 'wp-photo-album-plus');
7059
+ $help = esc_js(__('If UNticked, you can specify the urls for custom images to be used.', 'wp-photo-album-plus'));
7060
+ $slug = 'wppa_new_mod_label_is_text';
7061
+ $onch = 'wppaCheckCheck(\''.$slug.'\',\'nmtxt\');';
7062
+ $html = wppa_checkbox($slug,$onch);
7063
+ $clas = '';
7064
+ $tags = 'system';
7065
+ wppa_setting($slug, '1.5', $name, $desc, $html, $help, $clas, $tags);
7066
+
7067
+
7068
  $opts = array(
7069
  __('Red', 'wp-photo-album-plus'),
7070
  __('Orange', 'wp-photo-album-plus'),
7089
  $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus'));
7090
  $slug1 = 'wppa_new_label_text';
7091
  $slug2 = 'wppa_new_label_color';
7092
+ $html1 = '<span style="float:left">'.__('Text', 'wp-photo-album-plus').': </span>'.wppa_input($slug1, '150px');
7093
+ $html2 = '<span style="float:left">'.__('Color', 'wp-photo-album-plus').': </span>'.wppa_select($slug2, $opts, $vals);
7094
+ $clas = 'nmtxt';
7095
  $tags = 'system';
7096
+ wppa_setting($slug1, '1.6', $name, $desc, $html1.' '.$html2, $help, $clas, $tags);
7097
 
7098
  $name = __('Modified label', 'wp-photo-album-plus');
7099
  $desc = __('Specify the "Modified" indicator details.', 'wp-photo-album-plus');
7100
  $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus'));
7101
  $slug1 = 'wppa_mod_label_text';
7102
  $slug2 = 'wppa_mod_label_color';
7103
+ $html1 = '<span style="float:left">'.__('Text', 'wp-photo-album-plus').': </span>'.wppa_input($slug1, '150px');
7104
+ $html2 = '<span style="float:left">'.__('Color', 'wp-photo-album-plus').': </span>'.wppa_select($slug2, $opts, $vals);
7105
+ $clas = 'nmtxt';
7106
  $tags = 'system';
7107
+ wppa_setting($slug1, '1.7', $name, $desc, $html1.' '.$html2, $help, $clas, $tags);
7108
+
7109
+ $name = __('New label', 'wp-photo-album-plus');
7110
+ $desc = __('Specify the "New" indicator url.', 'wp-photo-album-plus');
7111
+ $help = ' ';
7112
+ $slug = 'wppa_new_label_url';
7113
+ $html = wppa_input($slug, '300px');
7114
+ $clas = '-nmtxt';
7115
+ $tags = 'system';
7116
+ wppa_setting($slug, '1.8', $name, $desc, $html, $help, $clas, $tags);
7117
+
7118
+ $name = __('Modified label', 'wp-photo-album-plus');
7119
+ $desc = __('Specify the "Modified" indicator url.', 'wp-photo-album-plus');
7120
+ $help = ' ';
7121
+ $slug = 'wppa_mod_label_url';
7122
+ $html = wppa_input($slug, '300px');
7123
+ $clas = '-nmtxt';
7124
+ $tags = 'system';
7125
+ wppa_setting($slug, '1.9', $name, $desc, $html, $help, $clas, $tags);
7126
 
7127
  $name = __('Limit LasTen New', 'wp-photo-album-plus');
7128
  $desc = __('Limits the LasTen photos to those that are \'New\', or newly modified.', '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.3.12
7
  *
8
  */
9
 
@@ -1052,7 +1052,7 @@ Hide Camera info
1052
  'wppa_sswidget_blank' => 'no',
1053
  'wppa_sswidget_overrule' => 'no',
1054
 
1055
- 'wppa_widget_linktype' => 'album',
1056
  'wppa_widget_linkpage' => '0',
1057
  'wppa_potd_blank' => 'no',
1058
  'wppa_potdwidget_overrule' => 'no',
@@ -1123,7 +1123,7 @@ Hide Camera info
1123
  'wppa_widget_sm_linkpage_oc' => '1',
1124
 
1125
  'wppa_cover_sublinks' => 'none',
1126
- 'wppa_cover_sublinks_recursive' => 'yes',
1127
 
1128
  // Table VII: Security
1129
  // B
@@ -1264,12 +1264,15 @@ Hide Camera info
1264
  'wppa_max_photo_newtime' => '0', // 2
1265
  'wppa_max_album_modtime' => '0', // 1
1266
  'wppa_max_photo_modtime' => '0', // 2
 
1267
  'wppa_lasten_limit_new' => 'no',
1268
  'wppa_lasten_use_modified' => 'no',
1269
  'wppa_new_label_text' => __('NEW', 'wp-photo-album-plus'),
1270
  'wppa_new_label_color' => 'orange',
1271
  'wppa_mod_label_text' => __('MODIFIED', 'wp-photo-album-plus'),
1272
  'wppa_mod_label_color' => 'green',
 
 
1273
  'wppa_apply_newphoto_desc' => 'no', // 3
1274
  'wppa_newphoto_description' => $npd, // 4
1275
  'wppa_upload_limit_count' => '0', // 5a
@@ -1388,11 +1391,11 @@ Hide Camera info
1388
  'wppa_widget_linkurl' => __('Type your custom url here', 'wp-photo-album-plus'),
1389
  'wppa_widget_linktitle' => __('Type the title here', 'wp-photo-album-plus'),
1390
  'wppa_widget_subtitle' => 'none',
1391
- 'wppa_widget_album' => '0',
1392
  'wppa_widget_photo' => '',
1393
  'wppa_potd_align' => 'center',
1394
- 'wppa_widget_method' => '1',
1395
- 'wppa_widget_period' => '168',
1396
  'wppa_widget_width' => '200',
1397
  'wppa_potd_widget_width' => '200',
1398
  'wppa_widget_status_filter' => 'none',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 6.3.13
7
  *
8
  */
9
 
1052
  'wppa_sswidget_blank' => 'no',
1053
  'wppa_sswidget_overrule' => 'no',
1054
 
1055
+ 'wppa_widget_linktype' => 'single',
1056
  'wppa_widget_linkpage' => '0',
1057
  'wppa_potd_blank' => 'no',
1058
  'wppa_potdwidget_overrule' => 'no',
1123
  'wppa_widget_sm_linkpage_oc' => '1',
1124
 
1125
  'wppa_cover_sublinks' => 'none',
1126
+ 'wppa_cover_sublinks_display' => 'list',
1127
 
1128
  // Table VII: Security
1129
  // B
1264
  'wppa_max_photo_newtime' => '0', // 2
1265
  'wppa_max_album_modtime' => '0', // 1
1266
  'wppa_max_photo_modtime' => '0', // 2
1267
+ 'wppa_new_mod_label_is_text' => 'yes',
1268
  'wppa_lasten_limit_new' => 'no',
1269
  'wppa_lasten_use_modified' => 'no',
1270
  'wppa_new_label_text' => __('NEW', 'wp-photo-album-plus'),
1271
  'wppa_new_label_color' => 'orange',
1272
  'wppa_mod_label_text' => __('MODIFIED', 'wp-photo-album-plus'),
1273
  'wppa_mod_label_color' => 'green',
1274
+ 'wppa_new_label_url' => wppa_get_imgdir('new.png'),
1275
+ 'wppa_mod_label_url' => wppa_get_imgdir('new.png'),
1276
  'wppa_apply_newphoto_desc' => 'no', // 3
1277
  'wppa_newphoto_description' => $npd, // 4
1278
  'wppa_upload_limit_count' => '0', // 5a
1391
  'wppa_widget_linkurl' => __('Type your custom url here', 'wp-photo-album-plus'),
1392
  'wppa_widget_linktitle' => __('Type the title here', 'wp-photo-album-plus'),
1393
  'wppa_widget_subtitle' => 'none',
1394
+ 'wppa_widget_album' => 'all', // All albums
1395
  'wppa_widget_photo' => '',
1396
  'wppa_potd_align' => 'center',
1397
+ 'wppa_widget_method' => '4', // Change every
1398
+ 'wppa_widget_period' => '24', // Day
1399
  'wppa_widget_width' => '200',
1400
  'wppa_potd_widget_width' => '200',
1401
  'wppa_widget_status_filter' => 'none',
wppa-thumbnails.php CHANGED
@@ -5,7 +5,7 @@
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
- * Version 6.3.12
9
  *
10
  */
11
 
@@ -1802,6 +1802,12 @@ function wppa_get_medal_html_a( $args ) {
1802
  'L' => '24',
1803
  'XL' => '32'
1804
  );
 
 
 
 
 
 
1805
  $fsizes = array(
1806
  'S' => '9',
1807
  'M' => '10',
@@ -1838,6 +1844,7 @@ function wppa_get_medal_html_a( $args ) {
1838
  'bronze' => __('Bronze medal', 'wp-photo-album-plus'),
1839
  );
1840
  $size = $sizes[$args['size']];
 
1841
  $fsize = $fsizes[$args['size']];
1842
  $smarg = $smargs[$args['size']];
1843
  $lmarg = $lmargs[$args['size']];
@@ -1883,26 +1890,47 @@ function wppa_get_medal_html_a( $args ) {
1883
  $lstyle = $sstyle;
1884
  }
1885
 
 
 
1886
  // Yes there is one to display
1887
  if ( $type ) {
1888
- $result .= '<div' .
1889
- ' style="' . $lstyle .
1890
- 'position:absolute;' .
1891
- 'top:' . $ntop . 'px;' .
1892
- 'box-sizing:border-box;' .
1893
- 'float:' . ( $left ? 'left;' : 'right;' ) .
1894
- 'font-size:' . $fsize . 'px;' .
1895
- 'line-height:' . $fsize . 'px;' .
1896
- 'font-family:\'Arial Black\', Gadget, sans-serif;' .
1897
- 'border-radius:2px;' .
1898
- 'border-width:1px;' .
1899
- 'border-style:solid;' .
1900
- 'padding:1px;' .
1901
- wppa_get_text_medal_color_style( $type ) .
1902
- '"' .
1903
- ' >' .
1904
- '&nbsp;' . __( wppa_opt( $type.'_label_text' ) ) . '&nbsp;' .
1905
- '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1906
  }
1907
 
1908
  // Close container
5
  * Various funcions to display a thumbnail image
6
  * Contains all possible frontend thumbnail types
7
  *
8
+ * Version 6.3.13
9
  *
10
  */
11
 
1802
  'L' => '24',
1803
  'XL' => '32'
1804
  );
1805
+ $nsizes = array(
1806
+ 'S' => '14',
1807
+ 'M' => '16',
1808
+ 'L' => '20',
1809
+ 'XL' => '24'
1810
+ );
1811
  $fsizes = array(
1812
  'S' => '9',
1813
  'M' => '10',
1844
  'bronze' => __('Bronze medal', 'wp-photo-album-plus'),
1845
  );
1846
  $size = $sizes[$args['size']];
1847
+ $nsize = $nsizes[$args['size']];
1848
  $fsize = $fsizes[$args['size']];
1849
  $smarg = $smargs[$args['size']];
1850
  $lmarg = $lmargs[$args['size']];
1890
  $lstyle = $sstyle;
1891
  }
1892
 
1893
+ $do_image = ! wppa_switch( 'wppa_new_mod_label_is_text' );
1894
+
1895
  // Yes there is one to display
1896
  if ( $type ) {
1897
+ if ( $do_image ) {
1898
+ $result .= '<img' .
1899
+ ' src="' . wppa_opt($type.'_label_url') . '"' .
1900
+ ' title="' . esc_attr( __('New', 'wp-photo-album-plus') ) . '"' .
1901
+ ' alt="' . esc_attr( __('New', 'wp-photo-album-plus') ) . '"' .
1902
+ ' class="wppa-thumbnew"' .
1903
+ ' style="' . $lstyle .
1904
+ 'top:' . $ntop . 'px;' .
1905
+ 'position:absolute;' .
1906
+ 'border:none;' .
1907
+ 'margin:0;' .
1908
+ 'padding:0;' .
1909
+ 'box-shadow:none;' .
1910
+ 'height:' . $nsize . 'px;' .
1911
+ '"'.
1912
+ ' />';
1913
+ }
1914
+ else {
1915
+ $result .= '<div' .
1916
+ ' style="' . $lstyle .
1917
+ 'position:absolute;' .
1918
+ 'top:' . $ntop . 'px;' .
1919
+ 'box-sizing:border-box;' .
1920
+ 'float:' . ( $left ? 'left;' : 'right;' ) .
1921
+ 'font-size:' . $fsize . 'px;' .
1922
+ 'line-height:' . $fsize . 'px;' .
1923
+ 'font-family:\'Arial Black\', Gadget, sans-serif;' .
1924
+ 'border-radius:2px;' .
1925
+ 'border-width:1px;' .
1926
+ 'border-style:solid;' .
1927
+ 'padding:1px;' .
1928
+ wppa_get_text_medal_color_style( $type ) .
1929
+ '"' .
1930
+ ' >' .
1931
+ '&nbsp;' . __( wppa_opt( $type.'_label_text' ) ) . '&nbsp;' .
1932
+ '</div>';
1933
+ }
1934
  }
1935
 
1936
  // Close container
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload/import pages and functions
6
- * Version 6.3.12
7
  *
8
  */
9
 
@@ -416,13 +416,14 @@ global $wppa_session;
416
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
417
  }
418
  if ( isset( $_POST['del-after-p'] ) ) $delp = true; else $delp = false;
 
419
  if ( isset( $_POST['del-after-a'] ) ) $dela = true; else $dela = false;
420
  if ( isset( $_POST['del-after-z'] ) ) $delz = true; else $delz = false;
421
  if ( isset( $_POST['del-after-v'] ) ) $delv = true; else $delv = false;
422
  if ( isset( $_POST['del-after-u'] ) ) $delu = true; else $delu = false;
423
  if ( isset( $_POST['del-after-c'] ) ) $delc = true; else $delc = false;
424
 
425
- wppa_import_photos( $delp, $dela, $delz, $delv, $delu, $delc );
426
  }
427
 
428
  // Continue dirimport after timeout
@@ -711,6 +712,9 @@ global $wppa_session;
711
  <td>
712
  <input type="checkbox" id="del-after-p" name="del-after-p" checked="checked" /><b>&nbsp;&nbsp;<?php _e( 'Remove from depot after successful import.' , 'wp-photo-album-plus'); ?></b>
713
  </td>
 
 
 
714
  <?php } ?>
715
  <?php if ( $is_ngg ) { ?>
716
  <td>
@@ -1069,6 +1073,7 @@ global $wppa_session;
1069
  if ( jQuery( '#wppa-update' ).attr( 'checked' ) ) data += '&wppa-update=on'; //+jQuery( '#wppa-update' ).attr( 'value' );
1070
  if ( jQuery( '#wppa-nodups' ).attr( 'checked' ) ) data += '&wppa-nodups=on'; //+jQuery( '#wppa-nudups' ).attr( 'value' );
1071
  if ( jQuery( '#del-after-p' ).attr( 'checked' ) ) data += '&del-after-p=on';
 
1072
  if ( jQuery( '#del-after-v' ).attr( 'checked' ) ) data += '&del-after-v=on';
1073
  if ( jQuery( '#del-after-u' ).attr( 'checked' ) ) data += '&del-after-u=on';
1074
  data += '&wppa-import-submit=ajax';
@@ -1105,7 +1110,8 @@ global $wppa_session;
1105
  }
1106
  jQuery( '#name-'+elm.id ).html( '&nbsp;&nbsp;<b>'+resp+'</b>' );
1107
  elm.checked = '';
1108
- if ( jQuery( '#del-after-p' ).attr( 'checked' ) ) {
 
1109
  elm.disabled = 'disabled';
1110
  elm.title = '';
1111
  }
@@ -1443,7 +1449,7 @@ global $target;
1443
  }
1444
 
1445
  // Do the import photos
1446
- function wppa_import_photos( $delp = false, $dela = false, $delz = false, $delv = false, $delu = false, $delc = false ) {
1447
  global $wpdb;
1448
  global $warning_given;
1449
  global $wppa_supported_photo_extensions;
@@ -1683,6 +1689,9 @@ global $wppa_supported_audio_extensions;
1683
  if ( ! wppa( 'ajax' ) ) {
1684
  wppa_error_message('Failed to add poster for item '.$is_poster);
1685
  }
 
 
 
1686
  }
1687
  }
1688
 
@@ -1700,7 +1709,12 @@ global $wppa_supported_audio_extensions;
1700
  $pcount++;
1701
  $totpcount += $iret;
1702
  if ( $delp ) {
1703
- unlink( $file );
 
 
 
 
 
1704
  }
1705
  }
1706
  }
@@ -1719,6 +1733,9 @@ global $wppa_supported_audio_extensions;
1719
  if ( wppa_switch( 'void_dups' ) && wppa_file_is_in_album( $id, $alb ) ) {
1720
  wppa_warning_message( sprintf( __( 'Photo %s already exists in album %s. (1)' , 'wp-photo-album-plus'), $id, $alb ) );
1721
  wppa( 'ajax_import_files_error', __( 'Duplicate', 'wp-photo-album-plus') );
 
 
 
1722
  }
1723
  else {
1724
  $id = substr( $id, 0, strpos( $id, '.' ) );
@@ -1735,6 +1752,9 @@ global $wppa_supported_audio_extensions;
1735
  }
1736
  else {
1737
  wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . basename( $file ) . '.' );
 
 
 
1738
  }
1739
  }
1740
  }
@@ -2397,7 +2417,7 @@ global $wppa_session;
2397
  $photocount++;
2398
  }
2399
  if ( ! wppa_switch( 'keep_import_files' ) ) {
2400
- unlink( $photofile );
2401
  }
2402
  $wppa_session[$photofile] = true;
2403
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload/import pages and functions
6
+ * Version 6.3.13
7
  *
8
  */
9
 
416
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
417
  }
418
  if ( isset( $_POST['del-after-p'] ) ) $delp = true; else $delp = false;
419
+ if ( isset( $_POST['del-after-f'] ) ) $delf = true; else $delf = false;
420
  if ( isset( $_POST['del-after-a'] ) ) $dela = true; else $dela = false;
421
  if ( isset( $_POST['del-after-z'] ) ) $delz = true; else $delz = false;
422
  if ( isset( $_POST['del-after-v'] ) ) $delv = true; else $delv = false;
423
  if ( isset( $_POST['del-after-u'] ) ) $delu = true; else $delu = false;
424
  if ( isset( $_POST['del-after-c'] ) ) $delc = true; else $delc = false;
425
 
426
+ wppa_import_photos( $delp, $dela, $delz, $delv, $delu, $delc, $delf );
427
  }
428
 
429
  // Continue dirimport after timeout
712
  <td>
713
  <input type="checkbox" id="del-after-p" name="del-after-p" checked="checked" /><b>&nbsp;&nbsp;<?php _e( 'Remove from depot after successful import.' , 'wp-photo-album-plus'); ?></b>
714
  </td>
715
+ <td>
716
+ <input type="checkbox" id="del-after-f" name="del-after-f" /><b>&nbsp;&nbsp;<?php _e( 'Remove from depot after failed import.' , 'wp-photo-album-plus'); ?></b>
717
+ </td>
718
  <?php } ?>
719
  <?php if ( $is_ngg ) { ?>
720
  <td>
1073
  if ( jQuery( '#wppa-update' ).attr( 'checked' ) ) data += '&wppa-update=on'; //+jQuery( '#wppa-update' ).attr( 'value' );
1074
  if ( jQuery( '#wppa-nodups' ).attr( 'checked' ) ) data += '&wppa-nodups=on'; //+jQuery( '#wppa-nudups' ).attr( 'value' );
1075
  if ( jQuery( '#del-after-p' ).attr( 'checked' ) ) data += '&del-after-p=on';
1076
+ if ( jQuery( '#del-after-f' ).attr( 'checked' ) ) data += '&del-after-f=on';
1077
  if ( jQuery( '#del-after-v' ).attr( 'checked' ) ) data += '&del-after-v=on';
1078
  if ( jQuery( '#del-after-u' ).attr( 'checked' ) ) data += '&del-after-u=on';
1079
  data += '&wppa-import-submit=ajax';
1110
  }
1111
  jQuery( '#name-'+elm.id ).html( '&nbsp;&nbsp;<b>'+resp+'</b>' );
1112
  elm.checked = '';
1113
+ if ( jQuery( '#del-after-p' ).attr( 'checked' ) ||
1114
+ jQuery( '#del-after-f' ).attr( 'checked' ) ) {
1115
  elm.disabled = 'disabled';
1116
  elm.title = '';
1117
  }
1449
  }
1450
 
1451
  // Do the import photos
1452
+ function wppa_import_photos( $delp = false, $dela = false, $delz = false, $delv = false, $delu = false, $delc = false, $delf = false ) {
1453
  global $wpdb;
1454
  global $warning_given;
1455
  global $wppa_supported_photo_extensions;
1689
  if ( ! wppa( 'ajax' ) ) {
1690
  wppa_error_message('Failed to add poster for item '.$is_poster);
1691
  }
1692
+ if ( $delf ) {
1693
+ unlink( $file );
1694
+ }
1695
  }
1696
  }
1697
 
1709
  $pcount++;
1710
  $totpcount += $iret;
1711
  if ( $delp ) {
1712
+ unlink( $unsanitized_path_name );
1713
+ }
1714
+ }
1715
+ else {
1716
+ if ( $delf ) {
1717
+ unlink( $unsanitized_path_name );
1718
  }
1719
  }
1720
  }
1733
  if ( wppa_switch( 'void_dups' ) && wppa_file_is_in_album( $id, $alb ) ) {
1734
  wppa_warning_message( sprintf( __( 'Photo %s already exists in album %s. (1)' , 'wp-photo-album-plus'), $id, $alb ) );
1735
  wppa( 'ajax_import_files_error', __( 'Duplicate', 'wp-photo-album-plus') );
1736
+ if ( $delf ) {
1737
+ unlink( $file );
1738
+ }
1739
  }
1740
  else {
1741
  $id = substr( $id, 0, strpos( $id, '.' ) );
1752
  }
1753
  else {
1754
  wppa_error_message( __( 'Error inserting photo' , 'wp-photo-album-plus') . ' ' . basename( $file ) . '.' );
1755
+ if ( $delf ) {
1756
+ unlink( $unsanitized_path_name );
1757
+ }
1758
  }
1759
  }
1760
  }
2417
  $photocount++;
2418
  }
2419
  if ( ! wppa_switch( 'keep_import_files' ) ) {
2420
+ @ unlink( $photofile );
2421
  }
2422
  $wppa_session[$photofile] = true;
2423
  }
wppa-widget-admin.php CHANGED
@@ -16,27 +16,32 @@ global $wpdb;
16
  $walbum = wppa_walbum_sanitize($_GET['walbum']);
17
  wppa_update_option('wppa_widget_album', $walbum);
18
  }
19
- if (isset($_POST['wppa-set-submit'])) {
20
- check_admin_referer( '$wppa_nonce', WPPA_NONCE );
 
 
21
 
22
  if (isset($_POST['wppa-widgettitle'])) wppa_update_option('wppa_widgettitle', $_POST['wppa-widgettitle']);
23
  if (isset($_POST['wppa-potd-align'])) wppa_update_option('wppa_potd_align', $_POST['wppa-potd-align']);
24
  if (isset($_POST['wppa-widget-albums'])) wppa_update_option('wppa_widget_album', wppa_walbum_sanitize($_POST['wppa-widget-albums']));
25
  if (isset($_POST['wppa-widget-photo'])) wppa_update_option('wppa_widget_photo', $_POST['wppa-widget-photo']);
26
  if (isset($_POST['wppa-widget-method'])) wppa_update_option('wppa_widget_method', $_POST['wppa-widget-method']);
27
- if (isset($_POST['wppa-widget-period'])) wppa_update_option('wppa_widget_period', $_POST['wppa-widget-period']);
28
  if (isset($_POST['wppa-widget-subtitle'])) wppa_update_option('wppa_widget_subtitle', $_POST['wppa-widget-subtitle']);
29
  if (isset($_POST['wppa-widget-linkpage'])) wppa_update_option('wppa_widget_linkpage', $_POST['wppa-widget-linkpage']);
30
  if (isset($_POST['wppa-widget-linkurl'])) wppa_update_option('wppa_widget_linkurl', $_POST['wppa-widget-linkurl']);
31
  if (isset($_POST['wppa-widget-linktitle'])) wppa_update_option('wppa_widget_linktitle', $_POST['wppa-widget-linktitle']);
32
  if (isset($_POST['wppa-widget-linktype'])) wppa_update_option('wppa_widget_linktype', $_POST['wppa-widget-linktype']);
33
  if (isset($_POST['wppa-widget-status-filter'])) wppa_update_option('wppa_widget_status_filter', $_POST['wppa-widget-status-filter']);
34
- if (wppa_check_numeric($_POST['wppa-potd-widget-width'], '100', __( 'Widget Photo Width.', 'wp-photo-album-plus' ))) {
35
- wppa_update_option('wppa_potd_widget_width', $_POST['wppa-potd-widget-width']);
36
- } else {
37
- $options_error = true;
 
 
 
38
  }
39
- if (!$options_error) wppa_update_message(__('Changes Saved. Don\'t forget to activate the widget!', 'wp-photo-album-plus'));
40
  }
41
  wppa_initialize_runtime('force');
42
  ?>
@@ -48,8 +53,10 @@ global $wpdb;
48
  </div>
49
  <h2><?php _e('Photo of the Day Widget Settings', 'wp-photo-album-plus'); ?></h2>
50
 
51
- <form action="<?php echo(wppa_dbg_url(get_admin_url().'admin.php?page=wppa_photo_of_the_day')) ?>" method="post">
52
- <?php wp_nonce_field('$wppa_nonce', WPPA_NONCE); ?>
 
 
53
 
54
  <table class="form-table wppa-table wppa-photo-table">
55
  <tbody>
@@ -143,8 +150,20 @@ global $wpdb;
143
  <option value="3" <?php if ($method == '3') echo($sel); ?>><?php _e('Last upload', 'wp-photo-album-plus'); ?></option>
144
  <option value="4" <?php if ($method == '4') echo($sel); ?>><?php _e('Change every', 'wp-photo-album-plus'); ?></option>
145
  </select>
146
- <?php $period = wppa_opt( 'widget_period' ); ?>
147
- <select name="wppa-widget-period" id="wppa-wp" >
 
 
 
 
 
 
 
 
 
 
 
 
148
  <option value="0" <?php if ($period == '0') echo($sel); ?>><?php _e('pageview.', 'wp-photo-album-plus'); ?></option>
149
  <option value="1" <?php if ($period == '1') echo($sel); ?>><?php _e('hour.', 'wp-photo-album-plus'); ?></option>
150
  <option value="24" <?php if ($period == '24') echo($sel); ?>><?php _e('day.', 'wp-photo-album-plus'); ?></option>
@@ -152,8 +171,50 @@ global $wpdb;
152
  <option value="736" <?php if ($period == '736') echo($sel); ?>><?php _e('month.', 'wp-photo-album-plus'); ?></option>
153
  <option value="day-of-week" <?php if ($period == 'day-of-week') echo($sel); ?>><?php _e('day of week is order#', 'wp-photo-album-plus'); ?></option>
154
  <option value="day-of-month" <?php if ($period == 'day-of-month') echo($sel); ?>><?php _e('day of month is order#', 'wp-photo-album-plus'); ?></option>
 
155
  </select>
156
- <span class="description"><br/><?php _e('Select how the widget should display.', 'wp-photo-album-plus'); ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  </td>
158
  </tr>
159
  <?php
@@ -189,7 +250,7 @@ global $wpdb;
189
  </th>
190
  <td>
191
  <?php $subtit = wppa_opt( 'widget_subtitle' ) ?>
192
- <select name="wppa-widget-subtitle" id="wppa-st" onchange="wppaCheckWidgetSubtitle()" >
193
  <option value="none" <?php if ($subtit == 'none') echo($sel); ?>><?php _e('--- none ---', 'wp-photo-album-plus'); ?></option>
194
  <option value="name" <?php if ($subtit == 'name') echo($sel); ?>><?php _e('Photo Name', 'wp-photo-album-plus'); ?></option>
195
  <option value="desc" <?php if ($subtit == 'desc') echo($sel); ?>><?php _e('Description', 'wp-photo-album-plus'); ?></option>
@@ -205,15 +266,14 @@ global $wpdb;
205
  </p>
206
  <?php
207
  $alb = wppa_opt( 'widget_album' );
208
- $photos = wppa_get_widgetphotos( $alb );
 
209
  if ( empty( $photos ) ) {
210
  echo '<p>' . __('No photos yet in this album.', 'wp-photo-album-plus') . '</p>';
211
  }
212
  else {
213
  $curid = wppa_opt( 'widget_photo' );
214
- $wi = wppa_get_minisize() + 24;
215
- $hi = $wi + 48;
216
-
217
  // Process photos
218
  foreach ( $photos as $photo ) {
219
  $id = $photo['id'];
@@ -222,47 +282,67 @@ global $wpdb;
222
  echo '<div' .
223
  ' class="photoselect"' .
224
  ' style="' .
225
- 'width:' . wppa_opt( 'widget_width' ) . 'px;' .
226
- 'height:' . $hi . 'px;' .
227
- 'overflow:hidden;' .
228
  '" >';
229
-
230
- // The image if a video
231
- if ( wppa_is_video( $id ) ) {
232
- echo wppa_get_video_html( array( 'id' => $id,
233
- 'style' => 'width:' . wppa_opt( 'widget_width' ) . 'px;'
234
- ));
235
- }
236
-
237
- // The image if a photo
238
- else {
239
- echo '<img' .
240
- ' src=" '. wppa_fix_poster_ext( wppa_get_thumb_url( $id ), $id ) . '"' .
241
  ' style="' .
242
- 'width:' . wppa_opt( 'widget_width' ) . 'px;' .
243
- '"' .
244
- ' alt="' . $photo['name'] .'" />';
245
-
246
- // Audio ?
247
- if ( wppa_has_audio( $id ) ) {
248
- echo wppa_get_audio_html( array( 'id' => $id,
249
- 'style' => 'width:' . wppa_opt( 'widget_width' ) . 'px;' .
250
- 'position:relative;' .
251
- 'bottom:' . ( wppa_get_audio_control_height() + 4 ) .'px;'
252
- ));
253
- }
254
- } ?>
255
- <input type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php echo $id ?>" value="<?php echo $id ?>" <?php if ( $id == $curid ) echo 'checked="checked"'; ?>/>
256
- <div class="clear"></div>
257
- <h4 style="position: absolute; top:<?php echo( $wi - 12 ); ?>px; font-size:11px; overflow:hidden;"><?php echo __(stripslashes($photo['name'])) ?></h4>
258
- <h6 style="position: absolute; top:<?php echo( $wi + 6); ?>px; font-size:9px; line-height:10px;"><?php echo(__(stripslashes($photo['description']))); ?></h6>
259
- <h5 style="position: absolute; top:<?php echo( $wi + 24); ?>px; font-size:9px; line-height:10px;"><?php echo '(#'.$photo['p_order'].')' ?></h5>
260
- </div><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  }
262
  echo '<div class="clear"></div>';
263
  } ?>
264
  <script type="text/javascript">wppaCheckWidgetMethod();</script>
265
- <script type="text/javascript">wppaCheckWidgetSubtitle();</script>
266
  <br />
267
  <p>
268
  <input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wp-photo-album-plus'); ?>" />
16
  $walbum = wppa_walbum_sanitize($_GET['walbum']);
17
  wppa_update_option('wppa_widget_album', $walbum);
18
  }
19
+ if (isset($_REQUEST['wppa-set-submit'])) {
20
+ if ( ! wp_verify_nonce( $_REQUEST['wppa-update-check'], 'wppa-update-check' ) ) {
21
+ echo 'Trying:'.$_REQUEST['wppa-update-check'];
22
+ }
23
 
24
  if (isset($_POST['wppa-widgettitle'])) wppa_update_option('wppa_widgettitle', $_POST['wppa-widgettitle']);
25
  if (isset($_POST['wppa-potd-align'])) wppa_update_option('wppa_potd_align', $_POST['wppa-potd-align']);
26
  if (isset($_POST['wppa-widget-albums'])) wppa_update_option('wppa_widget_album', wppa_walbum_sanitize($_POST['wppa-widget-albums']));
27
  if (isset($_POST['wppa-widget-photo'])) wppa_update_option('wppa_widget_photo', $_POST['wppa-widget-photo']);
28
  if (isset($_POST['wppa-widget-method'])) wppa_update_option('wppa_widget_method', $_POST['wppa-widget-method']);
29
+ if (isset($_REQUEST['wppa-widget-period'])) wppa_update_option('wppa_widget_period', $_REQUEST['wppa-widget-period']);
30
  if (isset($_POST['wppa-widget-subtitle'])) wppa_update_option('wppa_widget_subtitle', $_POST['wppa-widget-subtitle']);
31
  if (isset($_POST['wppa-widget-linkpage'])) wppa_update_option('wppa_widget_linkpage', $_POST['wppa-widget-linkpage']);
32
  if (isset($_POST['wppa-widget-linkurl'])) wppa_update_option('wppa_widget_linkurl', $_POST['wppa-widget-linkurl']);
33
  if (isset($_POST['wppa-widget-linktitle'])) wppa_update_option('wppa_widget_linktitle', $_POST['wppa-widget-linktitle']);
34
  if (isset($_POST['wppa-widget-linktype'])) wppa_update_option('wppa_widget_linktype', $_POST['wppa-widget-linktype']);
35
  if (isset($_POST['wppa-widget-status-filter'])) wppa_update_option('wppa_widget_status_filter', $_POST['wppa-widget-status-filter']);
36
+ if (isset($_POST['wppa-potd-offset'])) wppa_update_option('wppa_potd_offset', $_POST['wppa-potd-offset']);
37
+ if ( isset($_POST['wppa-potd-widget-width']) ) {
38
+ if (wppa_check_numeric($_POST['wppa-potd-widget-width'], '100', __( 'Widget Photo Width.', 'wp-photo-album-plus' ))) {
39
+ wppa_update_option('wppa_potd_widget_width', $_POST['wppa-potd-widget-width']);
40
+ } else {
41
+ $options_error = true;
42
+ }
43
  }
44
+ if (!$options_error && isset($_POST['wppa-set-submit'])) wppa_update_message(__('Changes Saved. Don\'t forget to activate the widget!', 'wp-photo-album-plus'));
45
  }
46
  wppa_initialize_runtime('force');
47
  ?>
53
  </div>
54
  <h2><?php _e('Photo of the Day Widget Settings', 'wp-photo-album-plus'); ?></h2>
55
 
56
+ <?php $action_url = wppa_dbg_url(get_admin_url().'admin.php?page=wppa_photo_of_the_day') ?>
57
+
58
+ <form action="<?php echo $action_url ?>" method="post">
59
+ <?php echo wp_nonce_field('wppa-update-check', 'wppa-update-check'); ?>
60
 
61
  <table class="form-table wppa-table wppa-photo-table">
62
  <tbody>
150
  <option value="3" <?php if ($method == '3') echo($sel); ?>><?php _e('Last upload', 'wp-photo-album-plus'); ?></option>
151
  <option value="4" <?php if ($method == '4') echo($sel); ?>><?php _e('Change every', 'wp-photo-album-plus'); ?></option>
152
  </select>
153
+ <?php $period = wppa_opt( 'widget_period' );
154
+ $text = esc_attr(__('The page will now be reloaded', 'wp-photo-album-plus' ));
155
+ $onchange = esc_attr('alert(\''.$text.'\');wppaPotdChangePeriod()');
156
+ ?>
157
+ <script type="text/javascript" >
158
+ function wppaPotdChangePeriod() {
159
+ var url = '<?php echo $action_url ?>';
160
+ url += '&wppa-set-submit=1';
161
+ url += '&wppa-update-check='+jQuery('#wppa-update-check').val();
162
+ url += '&wppa-widget-period='+jQuery('#wppa-wp').val();
163
+ document.location.href = url;
164
+ }
165
+ </script>
166
+ <select name="wppa-widget-period" id="wppa-wp" onchange="<?php echo $onchange ?>" >
167
  <option value="0" <?php if ($period == '0') echo($sel); ?>><?php _e('pageview.', 'wp-photo-album-plus'); ?></option>
168
  <option value="1" <?php if ($period == '1') echo($sel); ?>><?php _e('hour.', 'wp-photo-album-plus'); ?></option>
169
  <option value="24" <?php if ($period == '24') echo($sel); ?>><?php _e('day.', 'wp-photo-album-plus'); ?></option>
171
  <option value="736" <?php if ($period == '736') echo($sel); ?>><?php _e('month.', 'wp-photo-album-plus'); ?></option>
172
  <option value="day-of-week" <?php if ($period == 'day-of-week') echo($sel); ?>><?php _e('day of week is order#', 'wp-photo-album-plus'); ?></option>
173
  <option value="day-of-month" <?php if ($period == 'day-of-month') echo($sel); ?>><?php _e('day of month is order#', 'wp-photo-album-plus'); ?></option>
174
+ <option value="day-of-year" <?php if ($period == 'day-of-year') echo($sel); ?>><?php _e('day of year is order#', 'wp-photo-album-plus'); ?></option>
175
  </select>
176
+ <span class="description"><br/><?php _e('Select how the widget should display.', 'wp-photo-album-plus'); ?></span>
177
+ <div class="wppa-order" >
178
+ <?php
179
+ if ( substr( wppa_opt( 'widget_period' ), 0, 7 ) == 'day-of-' ) {
180
+ switch( substr( wppa_opt( 'widget_period' ), 7 ) ) {
181
+ case 'week':
182
+ $n_days = '7';
183
+ $date_key = 'w';
184
+ break;
185
+ case 'month':
186
+ $n_days = '31';
187
+ $date_key = 'd';
188
+ break;
189
+ case 'year':
190
+ $n_days = '366';
191
+ $date_key = 'z';
192
+ break;
193
+ }
194
+ while ( get_option( 'wppa_potd_offset', '0' ) > $n_days ) update_option('wppa_potd_offset', get_option( 'wppa_potd_offset') - $n_days );
195
+ echo sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), date_i18n( $date_key ) ) . ' ';
196
+ echo '<select name="wppa-potd-offset" >';
197
+ $day = '0';
198
+ while ( $day < $n_days ) {
199
+ echo '<option value="'.$day.'" '.(get_option( 'wppa_potd_offset', '0' ) == $day ? 'selected="selected"' : '').' >'.$day.'</option>';
200
+ $day++;
201
+ }
202
+ echo '</select>';
203
+ $photo_order = date_i18n( $date_key ) - get_option( 'wppa_potd_offset', '0' );
204
+ while ( $photo_order < '1' ) {
205
+ $photo_order += $n_days;
206
+ }
207
+ echo '. '.sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
208
+ $photo = wppa_get_potd();
209
+ if ( $photo ) {
210
+ echo ' <img src="'.wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']).'" style="width:100px;" />';
211
+ }
212
+ else {
213
+ echo ' '.__('Not found.', 'wp-photo-album-plus');
214
+ }
215
+ }
216
+ ?>
217
+ </div>
218
  </td>
219
  </tr>
220
  <?php
250
  </th>
251
  <td>
252
  <?php $subtit = wppa_opt( 'widget_subtitle' ) ?>
253
+ <select name="wppa-widget-subtitle" id="wppa-st" >
254
  <option value="none" <?php if ($subtit == 'none') echo($sel); ?>><?php _e('--- none ---', 'wp-photo-album-plus'); ?></option>
255
  <option value="name" <?php if ($subtit == 'name') echo($sel); ?>><?php _e('Photo Name', 'wp-photo-album-plus'); ?></option>
256
  <option value="desc" <?php if ($subtit == 'desc') echo($sel); ?>><?php _e('Description', 'wp-photo-album-plus'); ?></option>
266
  </p>
267
  <?php
268
  $alb = wppa_opt( 'widget_album' );
269
+ $opt = wppa_is_int( $alb ) ? ' ' . wppa_get_photo_order( $alb ) . ' ' : '';
270
+ $photos = wppa_get_widgetphotos( $alb, $opt );
271
  if ( empty( $photos ) ) {
272
  echo '<p>' . __('No photos yet in this album.', 'wp-photo-album-plus') . '</p>';
273
  }
274
  else {
275
  $curid = wppa_opt( 'widget_photo' );
276
+
 
 
277
  // Process photos
278
  foreach ( $photos as $photo ) {
279
  $id = $photo['id'];
282
  echo '<div' .
283
  ' class="photoselect"' .
284
  ' style="' .
285
+ 'width:180px;' .
286
+ 'height:300px;' .
287
+ // 'overflow:auto;' .
288
  '" >';
289
+
290
+ // Open image container div
291
+ echo '<div' .
 
 
 
 
 
 
 
 
 
292
  ' style="' .
293
+ 'width:180px;' .
294
+ 'height:135px;' .
295
+ 'overflow:hidden;' .
296
+ 'text-align:center;' .
297
+ '" >';
298
+
299
+ // The image if a video
300
+ if ( wppa_is_video( $id ) ) {
301
+ echo wppa_get_video_html( array( 'id' => $id,
302
+ 'style' => 'width:180px;'
303
+ ));
304
+ }
305
+
306
+ // The image if a photo
307
+ else {
308
+ echo '<img' .
309
+ ' src=" '. wppa_fix_poster_ext( wppa_get_thumb_url( $id ), $id ) . '"' .
310
+ ' style="' .
311
+ 'max-width:180px;' .
312
+ 'max-height:135px;' .
313
+ 'margin:auto;' .
314
+ '"' .
315
+ ' alt="' . esc_attr( wppa_get_photo_name( $photo['id'] ) ) .'" />';
316
+
317
+ // Audio ?
318
+ if ( wppa_has_audio( $id ) ) {
319
+ echo wppa_get_audio_html( array( 'id' => $id,
320
+ 'style' => 'width:180px;' .
321
+ 'position:relative;' .
322
+ 'bottom:' . ( wppa_get_audio_control_height() + 4 ) .'px;'
323
+ ));
324
+ }
325
+ }
326
+
327
+ // Close image container div
328
+ echo '</div>'
329
+
330
+
331
+ ?>
332
+ <div style="clear:both;width:100%;margin:3px 0;" >
333
+ <div style="font-size:9px; line-height:10px;float:left;"><?php echo '(#'.$photo['p_order'].')' ?></div>
334
+ <input style="float:right;" type="radio" name="wppa-widget-photo" id="wppa-widget-photo<?php echo $id ?>" value="<?php echo $id ?>" <?php if ( $id == $curid ) echo 'checked="checked"'; ?>/>
335
+ </div>
336
+ <div style="clear:both;overflow:auto;height:150px" >
337
+ <div style="font-size:11px; overflow:hidden;"><?php echo wppa_get_photo_name($photo['id']) ?></div>
338
+ <div style="font-size:9px; line-height:10px;"><?php echo wppa_get_photo_desc($photo['id']) ?></div>
339
+ </div>
340
+ </div>
341
+ <?php
342
  }
343
  echo '<div class="clear"></div>';
344
  } ?>
345
  <script type="text/javascript">wppaCheckWidgetMethod();</script>
 
346
  <br />
347
  <p>
348
  <input type="submit" class="button-primary" name="wppa-set-submit" value="<?php _e('Save Changes', 'wp-photo-album-plus'); ?>" />
wppa-widget-functions.php CHANGED
@@ -41,7 +41,7 @@ global $wpdb;
41
  }
42
 
43
  // Is it a single album?
44
- if ( is_numeric( $alb ) ) {
45
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . " AND " . $statusclause . $option, $alb );
46
  }
47
 
@@ -286,8 +286,9 @@ global $wpdb;
286
  elseif ( $per == 'day-of-week' ) {
287
  $image = '';
288
  if ( $photos ) {
289
- $d = wppa_local_date( 'w' );
290
- if ( ! $d ) $d = '7';
 
291
  foreach ( $photos as $img ) {
292
  if ( $img['p_order'] == $d ) $image = $img;
293
  }
@@ -296,15 +297,27 @@ global $wpdb;
296
  elseif ( $per == 'day-of-month' ) {
297
  $image = '';
298
  if ( $photos ) {
299
- $d = wppa_local_date( 'd' );
300
- if ( substr( $d, '0', '1' ) == '0' ) $d = substr( $d,'1' );
 
 
 
 
 
 
 
 
 
 
 
 
301
  foreach ( $photos as $img ) {
302
  if ( $img['p_order'] == $d ) $image = $img;
303
  }
304
  }
305
  }
306
  else {
307
- $u = date( "U" ); // Seconds since 1-1-1970
308
  $u /= 3600; // hours since
309
  $u = floor( $u );
310
  $u /= $per;
@@ -312,6 +325,7 @@ global $wpdb;
312
  if ( $photos ) {
313
  $p = count( $photos );
314
  $idn = fmod( $u, $p );
 
315
  $image = $photos[$idn];
316
  }
317
  else {
41
  }
42
 
43
  // Is it a single album?
44
+ if ( wppa_is_int( $alb ) ) {
45
  $query = $wpdb->prepare( "SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s " . " AND " . $statusclause . $option, $alb );
46
  }
47
 
286
  elseif ( $per == 'day-of-week' ) {
287
  $image = '';
288
  if ( $photos ) {
289
+ $d = date_i18n( "w" );
290
+ $d -= get_option( 'wppa_potd_offset', '0' );
291
+ while ( $d < '1' ) $d += '7';
292
  foreach ( $photos as $img ) {
293
  if ( $img['p_order'] == $d ) $image = $img;
294
  }
297
  elseif ( $per == 'day-of-month' ) {
298
  $image = '';
299
  if ( $photos ) {
300
+ $d = strval(intval(date_i18n( "d" )));
301
+ $d -= get_option( 'wppa_potd_offset', '0' );
302
+ while ( $d < '1' ) $d += '31';
303
+ foreach ( $photos as $img ) {
304
+ if ( $img['p_order'] == $d ) $image = $img;
305
+ }
306
+ }
307
+ }
308
+ elseif ( $per == 'day-of-year' ) {
309
+ $image = '';
310
+ if ( $photos ) {
311
+ $d = strval(intval(date_i18n( "z" )));
312
+ $d -= get_option( 'wppa_potd_offset', '0' );
313
+ while ( $d < '1' ) $d += '366';
314
  foreach ( $photos as $img ) {
315
  if ( $img['p_order'] == $d ) $image = $img;
316
  }
317
  }
318
  }
319
  else {
320
+ $u = date_i18n( "U" ); // Seconds since 1-1-1970, local
321
  $u /= 3600; // hours since
322
  $u = floor( $u );
323
  $u /= $per;
325
  if ( $photos ) {
326
  $p = count( $photos );
327
  $idn = fmod( $u, $p );
328
+ $photos = wppa_get_widgetphotos( $album, "ORDER BY RAND(".$idn.")" ); // Added to randomize
329
  $image = $photos[$idn];
330
  }
331
  else {
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.3.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,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 = '6312';
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-3-12-000';
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.3.13
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 = '6313';
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-3-13-000';
38
 
39
  /* start timers */
40
  global $wppa_starttime; $wppa_starttime = microtime(true);