Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.4.00 |
Comparing to | |
See all releases |
Code changes from version 6.3.18 to 6.4.00
- js/wppa-admin-scripts.js +124 -119
- js/wppa-slideshow.js +3 -3
- js/wppa-slideshow.min.js +3 -4
- readme.txt +19 -2
- wppa-ajax.php +54 -9
- wppa-album-covers.php +26 -26
- wppa-album-navigator-widget.php +10 -5
- wppa-boxes-html.php +20 -14
- wppa-breadcrumb.php +8 -4
- wppa-common-functions.php +7 -0
- wppa-encrypt.php +282 -0
- wppa-featen-widget.php +56 -14
- wppa-functions.php +20 -7
- wppa-htaccess.php +24 -13
- wppa-items.php +15 -7
- wppa-links.php +43 -25
- wppa-maintenance.php +45 -14
- wppa-non-admin.php +8 -3
- wppa-photo-admin-autosave.php +2 -1
- wppa-session.php +5 -1
- wppa-settings-autosave.php +69 -5
- wppa-setup.php +18 -2
- wppa-slideshow.php +2 -2
- wppa-statistics.php +12 -3
- wppa-thumbnails.php +73 -57
- wppa-topten-widget.php +28 -5
- wppa-upldr-widget.php +3 -3
- wppa-upload.php +1 -1
- wppa-users.php +2 -3
- wppa-utils.php +50 -6
- wppa-wpdb-insert.php +15 -9
- wppa-wpdb-update.php +7 -1
- wppa.php +4 -3
js/wppa-admin-scripts.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
-
/* Version 6.
|
5 |
-
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
8 |
var wppa_moveup_url = '#';
|
@@ -28,19 +28,19 @@ function wppaReUpload( event, photo, expectedName ) {
|
|
28 |
var form = document.getElementById('wppa-re-up-form-'+photo);
|
29 |
var fileSelect = document.getElementById('wppa-re-up-file-'+photo);
|
30 |
var button = document.getElementById('wppa-re-up-butn-'+photo);
|
31 |
-
|
32 |
// Remove default action
|
33 |
event.preventDefault();
|
34 |
-
|
35 |
// Get the selected file from the input.
|
36 |
var file = fileSelect.files[0];
|
37 |
-
|
38 |
// Check the file type.
|
39 |
if ( !file.type.match( 'image.*' ) ) {
|
40 |
alert( 'File is not an image file!' );
|
41 |
return;
|
42 |
}
|
43 |
-
|
44 |
// Check the file name
|
45 |
if ( file.name != expectedName ) {
|
46 |
if ( ! confirm( 'Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?' ) ) {
|
@@ -48,17 +48,17 @@ function wppaReUpload( event, photo, expectedName ) {
|
|
48 |
return;
|
49 |
}
|
50 |
}
|
51 |
-
|
52 |
// Update button text
|
53 |
button.value = 'Uploading...';
|
54 |
button.style.color = 'black';
|
55 |
-
|
56 |
// Create a new FormData object.
|
57 |
var formData = new FormData();
|
58 |
-
|
59 |
// Add the file to the request.
|
60 |
formData.append('photo', file, file.name);
|
61 |
-
|
62 |
// Set up the request.
|
63 |
var xhr = new XMLHttpRequest();
|
64 |
|
@@ -68,14 +68,14 @@ function wppaReUpload( event, photo, expectedName ) {
|
|
68 |
'&photo-id=' + photo +
|
69 |
'&item=file' +
|
70 |
'&wppa-nonce=' + document.getElementById('photo-nonce-'+photo).value;
|
71 |
-
|
72 |
xhr.open( 'POST', wppaAjaxUrl + queryString, true );
|
73 |
|
74 |
// Set up a handler for when the request finishes.
|
75 |
xhr.onload = function () {
|
76 |
-
|
77 |
if ( xhr.status === 200 ) {
|
78 |
-
|
79 |
var str = wppaTrim( xhr.responseText );
|
80 |
var ArrValues = str.split( "||" );
|
81 |
|
@@ -97,16 +97,16 @@ function wppaReUpload( event, photo, expectedName ) {
|
|
97 |
button.style.color = 'red';
|
98 |
break;
|
99 |
}
|
100 |
-
}
|
101 |
else {
|
102 |
alert('An error occurred!');
|
103 |
}
|
104 |
};
|
105 |
-
|
106 |
// Send the Data.
|
107 |
xhr.send( formData );
|
108 |
}
|
109 |
-
|
110 |
/* This functions does the init after loading settings page. do not put this code in the document.ready function!!! */
|
111 |
function wppaInitSettings() {
|
112 |
wppaCheckBreadcrumb();
|
@@ -166,10 +166,10 @@ function wppaInitSettings() {
|
|
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');
|
171 |
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K');
|
172 |
-
|
173 |
for (table=1; table<13; table++) {
|
174 |
var cookie = wppa_getCookie('table_'+table);
|
175 |
if (cookie == 'on') {
|
@@ -194,7 +194,7 @@ function wppaQuickSel() {
|
|
194 |
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','Z');
|
195 |
var tag;
|
196 |
var _cls;
|
197 |
-
|
198 |
// Open Tables and subtables
|
199 |
for ( table = 1; table < 13; table++ ) {
|
200 |
if ( table < 13 ) {
|
@@ -221,13 +221,13 @@ function wppaQuickSel() {
|
|
221 |
// wppaToggleSubTable('XI','Z');
|
222 |
// wppaToggleSubTable('VII','A');
|
223 |
}
|
224 |
-
|
225 |
// jQuery( '.subtableheader' ).css('display')=='none');
|
226 |
-
|
227 |
// Find tags
|
228 |
tag1 = jQuery("#wppa-quick-selbox-1").val();
|
229 |
tag2 = jQuery("#wppa-quick-selbox-2").val();
|
230 |
-
|
231 |
// Both empty? close all (sub)tables
|
232 |
if ( tag1 == '-' && tag2 == '-' ) {
|
233 |
jQuery( '._wppatag-' ).addClass( 'wppa-none' );
|
@@ -255,7 +255,7 @@ function wppaToggleTable(table) {
|
|
255 |
jQuery('#wppa_table_'+table).css('display', 'none');
|
256 |
wppa_tablecookieoff(table);
|
257 |
}
|
258 |
-
|
259 |
}
|
260 |
|
261 |
var wppaSubTabOn = new Array();
|
@@ -275,15 +275,15 @@ function wppaToggleSubTable(table,subtable) {
|
|
275 |
}
|
276 |
|
277 |
function wppaHideTable(table) {
|
278 |
-
jQuery('#wppa_table_'+table).css('display', 'none');
|
279 |
-
jQuery('#wppa_tableHide-'+table).css('display', 'none');
|
280 |
jQuery('#wppa_tableShow-'+table).css('display', 'inline');
|
281 |
wppa_tablecookieoff(table);
|
282 |
}
|
283 |
|
284 |
function wppaShowTable(table) {
|
285 |
-
jQuery('#wppa_table_'+table).css('display', 'block');
|
286 |
-
jQuery('#wppa_tableHide-'+table).css('display', 'inline');
|
287 |
jQuery('#wppa_tableShow-'+table).css('display', 'none');
|
288 |
wppa_tablecookieon(table);
|
289 |
}
|
@@ -317,7 +317,7 @@ function wppaCheckCheck( slug, clas ) {
|
|
317 |
}
|
318 |
}
|
319 |
|
320 |
-
// Check for concurrent lightbox and video.
|
321 |
// This is not possible because the controls can not be reached.
|
322 |
function wppaCheckSlideVideoControls() {
|
323 |
|
@@ -325,12 +325,12 @@ function wppaCheckSlideVideoControls() {
|
|
325 |
if ( link == 'none' ) {
|
326 |
return;
|
327 |
}
|
328 |
-
|
329 |
// var on = document.getElementById( 'wppa_start_slide_video' ).checked;
|
330 |
-
// if ( ! on ) {
|
331 |
// return;
|
332 |
// }
|
333 |
-
|
334 |
alert('Warning! '+
|
335 |
"\n"+
|
336 |
'You can not have video controls on a videoslide when there is a link on the slide.'+
|
@@ -357,35 +357,35 @@ function wppaCheckFontPreview() {
|
|
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');
|
385 |
i=0;
|
386 |
while (i<ph.length) {
|
387 |
ph[i].style.visibility='visible';
|
388 |
-
i++;
|
389 |
}
|
390 |
}
|
391 |
else {
|
@@ -505,7 +505,7 @@ function wppaCheckBreadcrumb() {
|
|
505 |
if (BcVal == 'txt') {
|
506 |
jQuery('.wppa_bc_txt').css('display', '');
|
507 |
jQuery('.wppa_bc_url').css('display', 'none');
|
508 |
-
|
509 |
jQuery('.wppa_bc_txt_html').css('display', '');
|
510 |
jQuery('.wppa_bc_url_html').css('display', 'none');
|
511 |
}
|
@@ -513,7 +513,7 @@ function wppaCheckBreadcrumb() {
|
|
513 |
if (BcVal == 'url') {
|
514 |
jQuery('.wppa_bc_txt').css('display', 'none');
|
515 |
jQuery('.wppa_bc_url').css('display', '');
|
516 |
-
|
517 |
jQuery('.wppa_bc_txt_html').css('display', 'none');
|
518 |
jQuery('.wppa_bc_url_html').css('display', '');
|
519 |
}
|
@@ -523,7 +523,7 @@ function wppaCheckBreadcrumb() {
|
|
523 |
}
|
524 |
}
|
525 |
}
|
526 |
-
else {
|
527 |
jQuery('.wppa_bc').css('display', 'none');
|
528 |
jQuery('.wppa_bc_txt').css('display', 'none');
|
529 |
jQuery('.wppa_bc_url').css('display', 'none');
|
@@ -586,16 +586,16 @@ function wppaCheckKeepSource() {
|
|
586 |
function wppaCheckCoverType() {
|
587 |
var Type = document.getElementById('wppa_cover_type').value;
|
588 |
var Pos = document.getElementById('wppa_coverphoto_pos').value;
|
589 |
-
|
590 |
if ( Type == 'imagefactory' || Type == 'imagefactory-mcr' ) {
|
591 |
jQuery('.wppa_imgfact_').css('display', '');
|
592 |
/* if ( Pos == 'left' || Pos == 'right' )
|
593 |
alert('To avoid layout problems: please set Cover photo position ( Table IV-D3 ) to \'top\' or \'bottom\'!');
|
594 |
*/ }
|
595 |
else jQuery('.wppa_imgfact_').css('display', 'none');
|
596 |
-
|
597 |
if ( Type == 'longdesc' ) {
|
598 |
-
/* if ( Pos == 'top' || Pos == 'bottom' )
|
599 |
alert('To avoid layout problems: please set Cover photo position ( Table IV-D3 ) to \'left\' or \'right\'!');
|
600 |
*/ }
|
601 |
}
|
@@ -620,13 +620,13 @@ function wppaCheckCustom() {
|
|
620 |
}
|
621 |
}
|
622 |
|
623 |
-
function wppaCheckWidgetLink() {
|
624 |
if (document.getElementById('wppa_wlp').value == '-1') {
|
625 |
-
jQuery('.wppa_wlu').css('display', '');
|
626 |
jQuery('.wppa_wlt').css('visibility', 'hidden');
|
627 |
}
|
628 |
else {
|
629 |
-
jQuery('.wppa_wlu').css('display', 'none');
|
630 |
jQuery('.wppa_wlt').css('visibility', 'visible');
|
631 |
}
|
632 |
}
|
@@ -640,7 +640,7 @@ function wppaCheckSmWidgetLink() {
|
|
640 |
}
|
641 |
}
|
642 |
|
643 |
-
function wppaCheckThumbLink() {
|
644 |
var lvalue = document.getElementById('wppa_thumb_linktype').value;
|
645 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
646 |
jQuery('.wppa_tlp').css('visibility', 'hidden');
|
@@ -653,10 +653,10 @@ function wppaCheckThumbLink() {
|
|
653 |
}
|
654 |
else {
|
655 |
jQuery('.wppa_tlb').css('visibility', 'visible');
|
656 |
-
}
|
657 |
}
|
658 |
|
659 |
-
function wppaCheckTopTenLink() {
|
660 |
var lvalue = document.getElementById('wppa_topten_widget_linktype').value;
|
661 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
662 |
jQuery('.wppa_ttlp').css('visibility', 'hidden');
|
@@ -688,7 +688,7 @@ function wppaCheckFeaTenLink() {
|
|
688 |
}
|
689 |
}
|
690 |
|
691 |
-
function wppaCheckLasTenLink() {
|
692 |
var lvalue = document.getElementById('wppa_lasten_widget_linktype').value;
|
693 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
694 |
jQuery('.wppa_ltlp').css('visibility', 'hidden');
|
@@ -814,7 +814,7 @@ function wppaCheckMTagLink() {
|
|
814 |
/* */
|
815 |
}
|
816 |
|
817 |
-
function wppaCheckMphotoLink() {
|
818 |
var lvalue = document.getElementById('wppa_mphoto_linktype').value;
|
819 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' ) {
|
820 |
jQuery('.wppa_mlp').css('visibility', 'hidden');
|
@@ -830,7 +830,7 @@ function wppaCheckMphotoLink() {
|
|
830 |
}
|
831 |
}
|
832 |
|
833 |
-
function wppaCheckSphotoLink() {
|
834 |
var lvalue = document.getElementById('wppa_sphoto_linktype').value;
|
835 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' ) {
|
836 |
jQuery('.wppa_slp').css('visibility', 'hidden');
|
@@ -992,7 +992,7 @@ function wppaAjaxDeletePhoto(photo, bef, aft) {
|
|
992 |
var after = '';
|
993 |
if ( bef ) before = bef;
|
994 |
if ( aft ) after = aft;
|
995 |
-
|
996 |
wppaFeAjaxLog('in');
|
997 |
|
998 |
var xmlhttp = wppaGetXmlHttp();
|
@@ -1024,7 +1024,7 @@ function wppaAjaxDeletePhoto(photo, bef, aft) {
|
|
1024 |
if (ArrValues[0] != '') {
|
1025 |
alert('The server returned unexpected output:\n'+ArrValues[0]);
|
1026 |
}
|
1027 |
-
|
1028 |
if ( ArrValues[1] == 0 ) document.getElementById('photostatus-'+photo).innerHTML = ArrValues[2]; // Error
|
1029 |
else {
|
1030 |
document.getElementById('photoitem-'+photo).innerHTML = before+ArrValues[2]+after; // OK
|
@@ -1034,7 +1034,7 @@ function wppaAjaxDeletePhoto(photo, bef, aft) {
|
|
1034 |
}
|
1035 |
else { // status != 200
|
1036 |
document.getElementById('photoitem-'+photo).innerHTML = before+'<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>'+after;
|
1037 |
-
}
|
1038 |
}
|
1039 |
}
|
1040 |
}
|
@@ -1047,7 +1047,7 @@ function wppaAjaxApplyWatermark(photo, file, pos) {
|
|
1047 |
|
1048 |
// Show spinner
|
1049 |
jQuery('#wppa-water-spin-'+photo).css({visibility:'visible'});
|
1050 |
-
|
1051 |
// Make the Ajax send data
|
1052 |
var data = 'action=wppa&wppa-action=watermark-photo&photo-id='+photo;
|
1053 |
data += '&wppa-nonce='+document.getElementById('photo-nonce-'+photo).value;
|
@@ -1078,12 +1078,12 @@ function wppaAjaxApplyWatermark(photo, file, pos) {
|
|
1078 |
}
|
1079 |
// Hide spinner
|
1080 |
jQuery('#wppa-water-spin-'+photo).css({visibility:'hidden'});
|
1081 |
-
|
1082 |
wppaFeAjaxLog('out');
|
1083 |
}
|
1084 |
else { // status != 200
|
1085 |
document.getElementById('photostatus-'+photo).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1086 |
-
}
|
1087 |
}
|
1088 |
}
|
1089 |
}
|
@@ -1122,7 +1122,7 @@ var isTmce = false;
|
|
1122 |
wppaPhotoUpdateMatrix[index][3] = elem.value;
|
1123 |
wppaPhotoUpdateMatrix[index][5] = refresh;
|
1124 |
|
1125 |
-
wppaAjaxUpdatePhotoMonitor();
|
1126 |
}
|
1127 |
|
1128 |
function wppaAjaxUpdatePhotoMonitor() {
|
@@ -1196,7 +1196,7 @@ function _wppaAjaxUpdatePhoto(photo, actionslug, value, refresh) {
|
|
1196 |
}
|
1197 |
// Hide spinner
|
1198 |
if ( actionslug == 'description' ) jQuery('#wppa-photo-spin-'+photo).css({visibility:'hidden'});
|
1199 |
-
// if ( actionslug == 'rotleft' || actionslug == 'rotright' )
|
1200 |
|
1201 |
// Update matrix
|
1202 |
var i = 0;
|
@@ -1211,16 +1211,16 @@ function _wppaAjaxUpdatePhoto(photo, actionslug, value, refresh) {
|
|
1211 |
wppaPhotoUpdateMatrix[index][2] = value;
|
1212 |
wppaPhotoUpdateMatrix[index][4] = false; // no more busy
|
1213 |
wppaPhotoUpdateMatrix[index][5] = false; // reset refresh
|
1214 |
-
|
1215 |
wppaFeAjaxLog('out');
|
1216 |
-
|
1217 |
wppaAjaxUpdatePhotoMonitor(); // check for more
|
1218 |
|
1219 |
if ( refresh ) wppaRefresh('photo_'+photo);
|
1220 |
}
|
1221 |
else { // status != 200
|
1222 |
document.getElementById('photostatus-'+photo).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1223 |
-
}
|
1224 |
}
|
1225 |
}
|
1226 |
}
|
@@ -1242,15 +1242,15 @@ var wppaAlbumUpdateMatrix = new Array();
|
|
1242 |
function wppaAjaxUpdateAlbum(album, actionslug, elem) {
|
1243 |
|
1244 |
var isTmce = jQuery( "#wppaalbumdesc:visible" ).length == 0;
|
1245 |
-
|
1246 |
jQuery( "#wppaalbumdesc-html" ).click();
|
1247 |
-
|
1248 |
// Links
|
1249 |
if ( actionslug == 'set_deftags' || actionslug == 'add_deftags' ) {
|
1250 |
_wppaAjaxUpdateAlbum( album, actionslug, elem.value, isTmce );
|
1251 |
return;
|
1252 |
}
|
1253 |
-
|
1254 |
var count = wppaAlbumUpdateMatrix.length;
|
1255 |
var i = 0;
|
1256 |
var found = false;
|
@@ -1270,7 +1270,7 @@ function wppaAjaxUpdateAlbum(album, actionslug, elem) {
|
|
1270 |
index = count;
|
1271 |
}
|
1272 |
wppaAlbumUpdateMatrix[index][3] = elem.value;
|
1273 |
-
|
1274 |
wppaAjaxUpdateAlbumMonitor( isTmce );
|
1275 |
}
|
1276 |
|
@@ -1293,12 +1293,12 @@ var _wppaRefreshAfter = false;
|
|
1293 |
function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce ) {
|
1294 |
|
1295 |
wppaAjaxAlbumCount++;
|
1296 |
-
|
1297 |
var xmlhttp = wppaGetXmlHttp();
|
1298 |
|
1299 |
// Show spinner
|
1300 |
if ( actionslug == 'description' ) jQuery('#wppa-album-spin').css({visibility:'visible'});
|
1301 |
-
|
1302 |
// Make the Ajax send data
|
1303 |
var data = 'action=wppa&wppa-action=update-album&album-id='+album+'&item='+actionslug;
|
1304 |
data += '&wppa-nonce='+document.getElementById('album-nonce-'+album).value;
|
@@ -1347,7 +1347,7 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce ) {
|
|
1347 |
document.getElementById('albumstatus-'+album).innerHTML = '<span style="color:red">'+ArrValues[2]+' ('+ArrValues[1]+')</span>';
|
1348 |
break;
|
1349 |
}
|
1350 |
-
|
1351 |
// Need refresh?
|
1352 |
if ( _wppaRefreshAfter ) {
|
1353 |
_wppaRefreshAfter = false;
|
@@ -1356,7 +1356,7 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce ) {
|
|
1356 |
|
1357 |
// Hide spinner
|
1358 |
if ( actionslug == 'description' ) jQuery('#wppa-album-spin').css({visibility:'hidden'});
|
1359 |
-
|
1360 |
// Update Matrix
|
1361 |
var i = 0;
|
1362 |
var index;
|
@@ -1369,19 +1369,19 @@ function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce ) {
|
|
1369 |
}
|
1370 |
wppaAlbumUpdateMatrix[index][2] = value;
|
1371 |
wppaAlbumUpdateMatrix[index][4] = false;
|
1372 |
-
|
1373 |
wppaAjaxUpdateAlbumMonitor( isTmce ); // Check for more to do
|
1374 |
-
|
1375 |
// Refresh for alt main_photo selections when cover type changed
|
1376 |
// if ( actionslug == 'cover_type' ) document.location = document.location;
|
1377 |
}
|
1378 |
else { // status != 200
|
1379 |
document.getElementById('albumstatus-'+album).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1380 |
-
}
|
1381 |
}
|
1382 |
}
|
1383 |
}
|
1384 |
-
|
1385 |
function wppaProcessFull(arg, n) {
|
1386 |
|
1387 |
if ( arg == 'full' ) {
|
@@ -1395,18 +1395,18 @@ function wppaProcessFull(arg, n) {
|
|
1395 |
jQuery('#notfull').css('display', '');
|
1396 |
}
|
1397 |
}
|
1398 |
-
|
1399 |
function wppaAjaxUpdateCommentStatus(photo, id, value) {
|
1400 |
-
|
1401 |
var xmlhttp = wppaGetXmlHttp();
|
1402 |
-
|
1403 |
// Make the Ajax url
|
1404 |
var url = wppaAjaxUrl+ '?action=wppa&wppa-action=update-comment-status'+
|
1405 |
'&wppa-photo-id='+photo+
|
1406 |
'&wppa-comment-id='+id+
|
1407 |
'&wppa-comment-status='+value+
|
1408 |
'&wppa-nonce='+document.getElementById('photo-nonce-'+photo).value;
|
1409 |
-
|
1410 |
xmlhttp.onreadystatechange=function() {
|
1411 |
if ( xmlhttp.readyState == 4 ) {
|
1412 |
if ( xmlhttp.status == 200 ) {
|
@@ -1428,13 +1428,13 @@ function wppaAjaxUpdateCommentStatus(photo, id, value) {
|
|
1428 |
}
|
1429 |
else { // status != 200
|
1430 |
jQuery('#photostatus-'+photo).html('<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>');
|
1431 |
-
}
|
1432 |
}
|
1433 |
}
|
1434 |
|
1435 |
// Do the Ajax action
|
1436 |
xmlhttp.open('GET',url,true);
|
1437 |
-
xmlhttp.send();
|
1438 |
}
|
1439 |
|
1440 |
function wppaAjaxUpdateOptionCheckBox(slug, elem) {
|
@@ -1458,7 +1458,7 @@ function wppaAjaxUpdateOptionCheckBox(slug, elem) {
|
|
1458 |
case 4:
|
1459 |
var str = wppaTrim(xmlhttp.responseText);
|
1460 |
var ArrValues = str.split("||");
|
1461 |
-
|
1462 |
if (ArrValues[0] != '') {
|
1463 |
alert('The server returned unexpected output:\n'+ArrValues[0]);
|
1464 |
}
|
@@ -1476,8 +1476,13 @@ function wppaAjaxUpdateOptionCheckBox(slug, elem) {
|
|
1476 |
default:
|
1477 |
document.getElementById('img_'+slug).src = wppaImageDirectory+'cross.png';
|
1478 |
document.getElementById('img_'+slug).title = 'Error #'+ArrValues[1]+', message: '+ArrValues[2]+', status: '+xmlhttp.status;
|
1479 |
-
|
1480 |
-
|
|
|
|
|
|
|
|
|
|
|
1481 |
}
|
1482 |
else {
|
1483 |
document.getElementById('img_'+slug).src = wppaImageDirectory+'cross.png';
|
@@ -1486,10 +1491,10 @@ function wppaAjaxUpdateOptionCheckBox(slug, elem) {
|
|
1486 |
wppaCheckInconsistencies();
|
1487 |
}
|
1488 |
}
|
1489 |
-
|
1490 |
// Do the Ajax action
|
1491 |
xmlhttp.open('GET',url,true);
|
1492 |
-
xmlhttp.send();
|
1493 |
}
|
1494 |
|
1495 |
function wppaMaintenanceProc(slug, intern) {
|
@@ -1512,7 +1517,7 @@ function wppaMaintenanceProc(slug, intern) {
|
|
1512 |
jQuery("#"+slug+"_status").html('Wait...');
|
1513 |
}
|
1514 |
|
1515 |
-
jQuery.ajax( { url: wppaAjaxUrl,
|
1516 |
data: 'action=wppa'+
|
1517 |
'&wppa-action=maintenance'+
|
1518 |
'&slug='+slug+
|
@@ -1521,28 +1526,28 @@ function wppaMaintenanceProc(slug, intern) {
|
|
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]);
|
@@ -1566,11 +1571,11 @@ function wppaMaintenanceProc(slug, intern) {
|
|
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');
|
@@ -1584,15 +1589,15 @@ function wppaMaintenanceProc(slug, intern) {
|
|
1584 |
setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 2000);
|
1585 |
}
|
1586 |
},
|
1587 |
-
|
1588 |
complete: function( xhr, status, newurl ) {
|
1589 |
-
|
1590 |
}
|
1591 |
} );
|
1592 |
}
|
1593 |
|
1594 |
function wppaAjaxPopupWindow( slug ) {
|
1595 |
-
|
1596 |
var name;
|
1597 |
switch ( slug ) {
|
1598 |
case 'wppa_list_index':
|
@@ -1618,7 +1623,7 @@ function wppaAjaxPopupWindow( slug ) {
|
|
1618 |
|
1619 |
wnd.document.write('<!DOCTYPE html>');
|
1620 |
wnd.document.write('<html>');
|
1621 |
-
wnd.document.write('<head>');
|
1622 |
// The following is one statement that fixes a bug in opera
|
1623 |
wnd.document.write( '<link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+'/wppa-admin-styles.css?ver='+wppaVersion+'" type="text/css" media="all" />'+
|
1624 |
'<style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style>'+
|
@@ -1628,14 +1633,14 @@ function wppaAjaxPopupWindow( slug ) {
|
|
1628 |
'<script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";</script>');
|
1629 |
wnd.document.write('</head>');
|
1630 |
wnd.document.write('<body>'); // onunload="window.opener.location.reload()">'); // This does not work in Opera
|
1631 |
-
|
1632 |
var xmlhttp = wppaGetXmlHttp();
|
1633 |
-
|
1634 |
// Make the Ajax send data
|
1635 |
var url = wppaAjaxUrl;
|
1636 |
var data = 'action=wppa&wppa-action=maintenancepopup&slug='+slug;
|
1637 |
data += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
|
1638 |
-
|
1639 |
// Do the Ajax action
|
1640 |
xmlhttp.open('POST', url, false); // Synchronously !!
|
1641 |
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
@@ -1703,12 +1708,12 @@ function wppaAjaxUpdateOptionValue(slug, elem) {
|
|
1703 |
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
1704 |
xmlhttp.send(data);
|
1705 |
}
|
1706 |
-
|
1707 |
function wppaEncode(xtext) {
|
1708 |
var text, result;
|
1709 |
-
|
1710 |
if (typeof(xtext)=='undefined') return;
|
1711 |
-
|
1712 |
text = xtext;
|
1713 |
result = text.replace(/#/g, '||HASH||');
|
1714 |
text = result;
|
@@ -1755,12 +1760,12 @@ function wppaPhotoStatusChange(id) {
|
|
1755 |
// Init
|
1756 |
jQuery('#psdesc-'+id).css({display: 'none'});
|
1757 |
elm = document.getElementById('status-'+id);
|
1758 |
-
|
1759 |
if ( elm.value == 'pending' || elm.value == 'scheduled' ) {
|
1760 |
jQuery('#photoitem-'+id).css({backgroundColor: '#ffebe8', borderColor: '#cc0000'});
|
1761 |
}
|
1762 |
if (elm.value=='publish') {
|
1763 |
-
jQuery('#photoitem-'+id).css({backgroundColor:'#ffffe0', borderColor:'#e6db55'});
|
1764 |
}
|
1765 |
if (elm.value=='featured') {
|
1766 |
jQuery('#photoitem-'+id).css({backgroundColor: '#e0ffe0', borderColor: '#55ee55'});
|
@@ -1777,15 +1782,15 @@ function wppaPhotoStatusChange(id) {
|
|
1777 |
}
|
1778 |
}
|
1779 |
if (elm.value=='gold') {
|
1780 |
-
jQuery('#photoitem-'+id).css({backgroundColor:'#eeeecc', borderColor:'#ddddbb'});
|
1781 |
}
|
1782 |
if (elm.value=='silver') {
|
1783 |
-
jQuery('#photoitem-'+id).css({backgroundColor:'#ffffff', borderColor:'#eeeeee'});
|
1784 |
}
|
1785 |
if (elm.value=='bronze') {
|
1786 |
-
jQuery('#photoitem-'+id).css({backgroundColor:'#ddddbb', borderColor:'#ccccaa'});
|
1787 |
}
|
1788 |
-
|
1789 |
if ( elm.value == 'scheduled' ) {
|
1790 |
jQuery( '.wppa-datetime-'+id ).css('display', ''); //prop( 'disabled', false );
|
1791 |
}
|
@@ -1798,7 +1803,7 @@ function wppaCheckLinkPageErr(slug) {
|
|
1798 |
var type = 'nil';
|
1799 |
if ( document.getElementById('wppa_'+slug+'_linktype') ) type = document.getElementById('wppa_'+slug+'_linktype').value;
|
1800 |
var page = document.getElementById('wppa_'+slug+'_linkpage').value;
|
1801 |
-
|
1802 |
if ( page == '0' && ( type == 'nil' || type == 'photo' || type == 'single' || type == 'album' || type == 'content' || type == 'slide' || type == 'plainpage' )) {
|
1803 |
jQuery('#'+slug+'-err').css({display:''});
|
1804 |
}
|
@@ -1854,7 +1859,7 @@ function wppaTrim (str, chr) {
|
|
1854 |
*/
|
1855 |
var wppaFeCount = 0;
|
1856 |
function wppaFeAjaxLog(key) {
|
1857 |
-
|
1858 |
if ( key == 'in' ) {
|
1859 |
if ( wppaFeCount == 0 ) {
|
1860 |
jQuery('#wppa-fe-exit').css('display', 'none');
|
@@ -1876,11 +1881,11 @@ function wppaFeAjaxLog(key) {
|
|
1876 |
}
|
1877 |
|
1878 |
function wppaArrayToEnum( arr, sep ) {
|
1879 |
-
|
1880 |
// Step 1. Sort Ascending Numeric
|
1881 |
temp = arr.sort(function(a, b){return a-b});
|
1882 |
-
|
1883 |
-
// Init
|
1884 |
var result = '';
|
1885 |
var lastitem = -1;
|
1886 |
var previtemp = -2;
|
@@ -1921,7 +1926,7 @@ function wppaArrayToEnum( arr, sep ) {
|
|
1921 |
if ( isrange ) { // Don't forget the last if it ends in a range
|
1922 |
result += '..' + lastitem;
|
1923 |
}
|
1924 |
-
|
1925 |
// ltrim .
|
1926 |
while ( result.substr(0,1) == '.') result = result.substr(1);
|
1927 |
|
@@ -1961,12 +1966,12 @@ var result = '';
|
|
1961 |
i++;
|
1962 |
}
|
1963 |
result = wppaArrayToEnum( parr, '.' );
|
1964 |
-
|
1965 |
return result;
|
1966 |
}
|
1967 |
|
1968 |
function wppaEditSearch( url, id ) {
|
1969 |
-
|
1970 |
var ss = jQuery( '#'+id ).val();
|
1971 |
if ( ss.length == 0 ) {
|
1972 |
alert('Please enter searchstring');
|
1 |
/* admin-scripts.js */
|
2 |
/* Package: wp-photo-album-plus
|
3 |
/*
|
4 |
+
/* Version 6.4.00
|
5 |
+
/* Various js routines used in admin pages
|
6 |
*/
|
7 |
|
8 |
var wppa_moveup_url = '#';
|
28 |
var form = document.getElementById('wppa-re-up-form-'+photo);
|
29 |
var fileSelect = document.getElementById('wppa-re-up-file-'+photo);
|
30 |
var button = document.getElementById('wppa-re-up-butn-'+photo);
|
31 |
+
|
32 |
// Remove default action
|
33 |
event.preventDefault();
|
34 |
+
|
35 |
// Get the selected file from the input.
|
36 |
var file = fileSelect.files[0];
|
37 |
+
|
38 |
// Check the file type.
|
39 |
if ( !file.type.match( 'image.*' ) ) {
|
40 |
alert( 'File is not an image file!' );
|
41 |
return;
|
42 |
}
|
43 |
+
|
44 |
// Check the file name
|
45 |
if ( file.name != expectedName ) {
|
46 |
if ( ! confirm( 'Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?' ) ) {
|
48 |
return;
|
49 |
}
|
50 |
}
|
51 |
+
|
52 |
// Update button text
|
53 |
button.value = 'Uploading...';
|
54 |
button.style.color = 'black';
|
55 |
+
|
56 |
// Create a new FormData object.
|
57 |
var formData = new FormData();
|
58 |
+
|
59 |
// Add the file to the request.
|
60 |
formData.append('photo', file, file.name);
|
61 |
+
|
62 |
// Set up the request.
|
63 |
var xhr = new XMLHttpRequest();
|
64 |
|
68 |
'&photo-id=' + photo +
|
69 |
'&item=file' +
|
70 |
'&wppa-nonce=' + document.getElementById('photo-nonce-'+photo).value;
|
71 |
+
|
72 |
xhr.open( 'POST', wppaAjaxUrl + queryString, true );
|
73 |
|
74 |
// Set up a handler for when the request finishes.
|
75 |
xhr.onload = function () {
|
76 |
+
|
77 |
if ( xhr.status === 200 ) {
|
78 |
+
|
79 |
var str = wppaTrim( xhr.responseText );
|
80 |
var ArrValues = str.split( "||" );
|
81 |
|
97 |
button.style.color = 'red';
|
98 |
break;
|
99 |
}
|
100 |
+
}
|
101 |
else {
|
102 |
alert('An error occurred!');
|
103 |
}
|
104 |
};
|
105 |
+
|
106 |
// Send the Data.
|
107 |
xhr.send( formData );
|
108 |
}
|
109 |
+
|
110 |
/* This functions does the init after loading settings page. do not put this code in the document.ready function!!! */
|
111 |
function wppaInitSettings() {
|
112 |
wppaCheckBreadcrumb();
|
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');
|
171 |
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K');
|
172 |
+
|
173 |
for (table=1; table<13; table++) {
|
174 |
var cookie = wppa_getCookie('table_'+table);
|
175 |
if (cookie == 'on') {
|
194 |
var sub = new Array('A','B','C','D','E','F','G','H','I','J','K','Z');
|
195 |
var tag;
|
196 |
var _cls;
|
197 |
+
|
198 |
// Open Tables and subtables
|
199 |
for ( table = 1; table < 13; table++ ) {
|
200 |
if ( table < 13 ) {
|
221 |
// wppaToggleSubTable('XI','Z');
|
222 |
// wppaToggleSubTable('VII','A');
|
223 |
}
|
224 |
+
|
225 |
// jQuery( '.subtableheader' ).css('display')=='none');
|
226 |
+
|
227 |
// Find tags
|
228 |
tag1 = jQuery("#wppa-quick-selbox-1").val();
|
229 |
tag2 = jQuery("#wppa-quick-selbox-2").val();
|
230 |
+
|
231 |
// Both empty? close all (sub)tables
|
232 |
if ( tag1 == '-' && tag2 == '-' ) {
|
233 |
jQuery( '._wppatag-' ).addClass( 'wppa-none' );
|
255 |
jQuery('#wppa_table_'+table).css('display', 'none');
|
256 |
wppa_tablecookieoff(table);
|
257 |
}
|
258 |
+
|
259 |
}
|
260 |
|
261 |
var wppaSubTabOn = new Array();
|
275 |
}
|
276 |
|
277 |
function wppaHideTable(table) {
|
278 |
+
jQuery('#wppa_table_'+table).css('display', 'none');
|
279 |
+
jQuery('#wppa_tableHide-'+table).css('display', 'none');
|
280 |
jQuery('#wppa_tableShow-'+table).css('display', 'inline');
|
281 |
wppa_tablecookieoff(table);
|
282 |
}
|
283 |
|
284 |
function wppaShowTable(table) {
|
285 |
+
jQuery('#wppa_table_'+table).css('display', 'block');
|
286 |
+
jQuery('#wppa_tableHide-'+table).css('display', 'inline');
|
287 |
jQuery('#wppa_tableShow-'+table).css('display', 'none');
|
288 |
wppa_tablecookieon(table);
|
289 |
}
|
317 |
}
|
318 |
}
|
319 |
|
320 |
+
// Check for concurrent lightbox and video.
|
321 |
// This is not possible because the controls can not be reached.
|
322 |
function wppaCheckSlideVideoControls() {
|
323 |
|
325 |
if ( link == 'none' ) {
|
326 |
return;
|
327 |
}
|
328 |
+
|
329 |
// var on = document.getElementById( 'wppa_start_slide_video' ).checked;
|
330 |
+
// if ( ! on ) {
|
331 |
// return;
|
332 |
// }
|
333 |
+
|
334 |
alert('Warning! '+
|
335 |
"\n"+
|
336 |
'You can not have video controls on a videoslide when there is a link on the slide.'+
|
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');
|
385 |
i=0;
|
386 |
while (i<ph.length) {
|
387 |
ph[i].style.visibility='visible';
|
388 |
+
i++;
|
389 |
}
|
390 |
}
|
391 |
else {
|
505 |
if (BcVal == 'txt') {
|
506 |
jQuery('.wppa_bc_txt').css('display', '');
|
507 |
jQuery('.wppa_bc_url').css('display', 'none');
|
508 |
+
|
509 |
jQuery('.wppa_bc_txt_html').css('display', '');
|
510 |
jQuery('.wppa_bc_url_html').css('display', 'none');
|
511 |
}
|
513 |
if (BcVal == 'url') {
|
514 |
jQuery('.wppa_bc_txt').css('display', 'none');
|
515 |
jQuery('.wppa_bc_url').css('display', '');
|
516 |
+
|
517 |
jQuery('.wppa_bc_txt_html').css('display', 'none');
|
518 |
jQuery('.wppa_bc_url_html').css('display', '');
|
519 |
}
|
523 |
}
|
524 |
}
|
525 |
}
|
526 |
+
else {
|
527 |
jQuery('.wppa_bc').css('display', 'none');
|
528 |
jQuery('.wppa_bc_txt').css('display', 'none');
|
529 |
jQuery('.wppa_bc_url').css('display', 'none');
|
586 |
function wppaCheckCoverType() {
|
587 |
var Type = document.getElementById('wppa_cover_type').value;
|
588 |
var Pos = document.getElementById('wppa_coverphoto_pos').value;
|
589 |
+
|
590 |
if ( Type == 'imagefactory' || Type == 'imagefactory-mcr' ) {
|
591 |
jQuery('.wppa_imgfact_').css('display', '');
|
592 |
/* if ( Pos == 'left' || Pos == 'right' )
|
593 |
alert('To avoid layout problems: please set Cover photo position ( Table IV-D3 ) to \'top\' or \'bottom\'!');
|
594 |
*/ }
|
595 |
else jQuery('.wppa_imgfact_').css('display', 'none');
|
596 |
+
|
597 |
if ( Type == 'longdesc' ) {
|
598 |
+
/* if ( Pos == 'top' || Pos == 'bottom' )
|
599 |
alert('To avoid layout problems: please set Cover photo position ( Table IV-D3 ) to \'left\' or \'right\'!');
|
600 |
*/ }
|
601 |
}
|
620 |
}
|
621 |
}
|
622 |
|
623 |
+
function wppaCheckWidgetLink() {
|
624 |
if (document.getElementById('wppa_wlp').value == '-1') {
|
625 |
+
jQuery('.wppa_wlu').css('display', '');
|
626 |
jQuery('.wppa_wlt').css('visibility', 'hidden');
|
627 |
}
|
628 |
else {
|
629 |
+
jQuery('.wppa_wlu').css('display', 'none');
|
630 |
jQuery('.wppa_wlt').css('visibility', 'visible');
|
631 |
}
|
632 |
}
|
640 |
}
|
641 |
}
|
642 |
|
643 |
+
function wppaCheckThumbLink() {
|
644 |
var lvalue = document.getElementById('wppa_thumb_linktype').value;
|
645 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
646 |
jQuery('.wppa_tlp').css('visibility', 'hidden');
|
653 |
}
|
654 |
else {
|
655 |
jQuery('.wppa_tlb').css('visibility', 'visible');
|
656 |
+
}
|
657 |
}
|
658 |
|
659 |
+
function wppaCheckTopTenLink() {
|
660 |
var lvalue = document.getElementById('wppa_topten_widget_linktype').value;
|
661 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
662 |
jQuery('.wppa_ttlp').css('visibility', 'hidden');
|
688 |
}
|
689 |
}
|
690 |
|
691 |
+
function wppaCheckLasTenLink() {
|
692 |
var lvalue = document.getElementById('wppa_lasten_widget_linktype').value;
|
693 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' || lvalue == 'fullpopup') {
|
694 |
jQuery('.wppa_ltlp').css('visibility', 'hidden');
|
814 |
/* */
|
815 |
}
|
816 |
|
817 |
+
function wppaCheckMphotoLink() {
|
818 |
var lvalue = document.getElementById('wppa_mphoto_linktype').value;
|
819 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' ) {
|
820 |
jQuery('.wppa_mlp').css('visibility', 'hidden');
|
830 |
}
|
831 |
}
|
832 |
|
833 |
+
function wppaCheckSphotoLink() {
|
834 |
var lvalue = document.getElementById('wppa_sphoto_linktype').value;
|
835 |
if (lvalue == 'none' || lvalue == 'file' || lvalue == 'lightbox' ) {
|
836 |
jQuery('.wppa_slp').css('visibility', 'hidden');
|
992 |
var after = '';
|
993 |
if ( bef ) before = bef;
|
994 |
if ( aft ) after = aft;
|
995 |
+
|
996 |
wppaFeAjaxLog('in');
|
997 |
|
998 |
var xmlhttp = wppaGetXmlHttp();
|
1024 |
if (ArrValues[0] != '') {
|
1025 |
alert('The server returned unexpected output:\n'+ArrValues[0]);
|
1026 |
}
|
1027 |
+
|
1028 |
if ( ArrValues[1] == 0 ) document.getElementById('photostatus-'+photo).innerHTML = ArrValues[2]; // Error
|
1029 |
else {
|
1030 |
document.getElementById('photoitem-'+photo).innerHTML = before+ArrValues[2]+after; // OK
|
1034 |
}
|
1035 |
else { // status != 200
|
1036 |
document.getElementById('photoitem-'+photo).innerHTML = before+'<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>'+after;
|
1037 |
+
}
|
1038 |
}
|
1039 |
}
|
1040 |
}
|
1047 |
|
1048 |
// Show spinner
|
1049 |
jQuery('#wppa-water-spin-'+photo).css({visibility:'visible'});
|
1050 |
+
|
1051 |
// Make the Ajax send data
|
1052 |
var data = 'action=wppa&wppa-action=watermark-photo&photo-id='+photo;
|
1053 |
data += '&wppa-nonce='+document.getElementById('photo-nonce-'+photo).value;
|
1078 |
}
|
1079 |
// Hide spinner
|
1080 |
jQuery('#wppa-water-spin-'+photo).css({visibility:'hidden'});
|
1081 |
+
|
1082 |
wppaFeAjaxLog('out');
|
1083 |
}
|
1084 |
else { // status != 200
|
1085 |
document.getElementById('photostatus-'+photo).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1086 |
+
}
|
1087 |
}
|
1088 |
}
|
1089 |
}
|
1122 |
wppaPhotoUpdateMatrix[index][3] = elem.value;
|
1123 |
wppaPhotoUpdateMatrix[index][5] = refresh;
|
1124 |
|
1125 |
+
wppaAjaxUpdatePhotoMonitor();
|
1126 |
}
|
1127 |
|
1128 |
function wppaAjaxUpdatePhotoMonitor() {
|
1196 |
}
|
1197 |
// Hide spinner
|
1198 |
if ( actionslug == 'description' ) jQuery('#wppa-photo-spin-'+photo).css({visibility:'hidden'});
|
1199 |
+
// if ( actionslug == 'rotleft' || actionslug == 'rotright' )
|
1200 |
|
1201 |
// Update matrix
|
1202 |
var i = 0;
|
1211 |
wppaPhotoUpdateMatrix[index][2] = value;
|
1212 |
wppaPhotoUpdateMatrix[index][4] = false; // no more busy
|
1213 |
wppaPhotoUpdateMatrix[index][5] = false; // reset refresh
|
1214 |
+
|
1215 |
wppaFeAjaxLog('out');
|
1216 |
+
|
1217 |
wppaAjaxUpdatePhotoMonitor(); // check for more
|
1218 |
|
1219 |
if ( refresh ) wppaRefresh('photo_'+photo);
|
1220 |
}
|
1221 |
else { // status != 200
|
1222 |
document.getElementById('photostatus-'+photo).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1223 |
+
}
|
1224 |
}
|
1225 |
}
|
1226 |
}
|
1242 |
function wppaAjaxUpdateAlbum(album, actionslug, elem) {
|
1243 |
|
1244 |
var isTmce = jQuery( "#wppaalbumdesc:visible" ).length == 0;
|
1245 |
+
|
1246 |
jQuery( "#wppaalbumdesc-html" ).click();
|
1247 |
+
|
1248 |
// Links
|
1249 |
if ( actionslug == 'set_deftags' || actionslug == 'add_deftags' ) {
|
1250 |
_wppaAjaxUpdateAlbum( album, actionslug, elem.value, isTmce );
|
1251 |
return;
|
1252 |
}
|
1253 |
+
|
1254 |
var count = wppaAlbumUpdateMatrix.length;
|
1255 |
var i = 0;
|
1256 |
var found = false;
|
1270 |
index = count;
|
1271 |
}
|
1272 |
wppaAlbumUpdateMatrix[index][3] = elem.value;
|
1273 |
+
|
1274 |
wppaAjaxUpdateAlbumMonitor( isTmce );
|
1275 |
}
|
1276 |
|
1293 |
function _wppaAjaxUpdateAlbum( album, actionslug, value, isTmce ) {
|
1294 |
|
1295 |
wppaAjaxAlbumCount++;
|
1296 |
+
|
1297 |
var xmlhttp = wppaGetXmlHttp();
|
1298 |
|
1299 |
// Show spinner
|
1300 |
if ( actionslug == 'description' ) jQuery('#wppa-album-spin').css({visibility:'visible'});
|
1301 |
+
|
1302 |
// Make the Ajax send data
|
1303 |
var data = 'action=wppa&wppa-action=update-album&album-id='+album+'&item='+actionslug;
|
1304 |
data += '&wppa-nonce='+document.getElementById('album-nonce-'+album).value;
|
1347 |
document.getElementById('albumstatus-'+album).innerHTML = '<span style="color:red">'+ArrValues[2]+' ('+ArrValues[1]+')</span>';
|
1348 |
break;
|
1349 |
}
|
1350 |
+
|
1351 |
// Need refresh?
|
1352 |
if ( _wppaRefreshAfter ) {
|
1353 |
_wppaRefreshAfter = false;
|
1356 |
|
1357 |
// Hide spinner
|
1358 |
if ( actionslug == 'description' ) jQuery('#wppa-album-spin').css({visibility:'hidden'});
|
1359 |
+
|
1360 |
// Update Matrix
|
1361 |
var i = 0;
|
1362 |
var index;
|
1369 |
}
|
1370 |
wppaAlbumUpdateMatrix[index][2] = value;
|
1371 |
wppaAlbumUpdateMatrix[index][4] = false;
|
1372 |
+
|
1373 |
wppaAjaxUpdateAlbumMonitor( isTmce ); // Check for more to do
|
1374 |
+
|
1375 |
// Refresh for alt main_photo selections when cover type changed
|
1376 |
// if ( actionslug == 'cover_type' ) document.location = document.location;
|
1377 |
}
|
1378 |
else { // status != 200
|
1379 |
document.getElementById('albumstatus-'+album).innerHTML = '<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>';
|
1380 |
+
}
|
1381 |
}
|
1382 |
}
|
1383 |
}
|
1384 |
+
|
1385 |
function wppaProcessFull(arg, n) {
|
1386 |
|
1387 |
if ( arg == 'full' ) {
|
1395 |
jQuery('#notfull').css('display', '');
|
1396 |
}
|
1397 |
}
|
1398 |
+
|
1399 |
function wppaAjaxUpdateCommentStatus(photo, id, value) {
|
1400 |
+
|
1401 |
var xmlhttp = wppaGetXmlHttp();
|
1402 |
+
|
1403 |
// Make the Ajax url
|
1404 |
var url = wppaAjaxUrl+ '?action=wppa&wppa-action=update-comment-status'+
|
1405 |
'&wppa-photo-id='+photo+
|
1406 |
'&wppa-comment-id='+id+
|
1407 |
'&wppa-comment-status='+value+
|
1408 |
'&wppa-nonce='+document.getElementById('photo-nonce-'+photo).value;
|
1409 |
+
|
1410 |
xmlhttp.onreadystatechange=function() {
|
1411 |
if ( xmlhttp.readyState == 4 ) {
|
1412 |
if ( xmlhttp.status == 200 ) {
|
1428 |
}
|
1429 |
else { // status != 200
|
1430 |
jQuery('#photostatus-'+photo).html('<span style="color:red;" >Comm error '+xmlhttp.status+': '+xmlhttp.statusText+'</span>');
|
1431 |
+
}
|
1432 |
}
|
1433 |
}
|
1434 |
|
1435 |
// Do the Ajax action
|
1436 |
xmlhttp.open('GET',url,true);
|
1437 |
+
xmlhttp.send();
|
1438 |
}
|
1439 |
|
1440 |
function wppaAjaxUpdateOptionCheckBox(slug, elem) {
|
1458 |
case 4:
|
1459 |
var str = wppaTrim(xmlhttp.responseText);
|
1460 |
var ArrValues = str.split("||");
|
1461 |
+
|
1462 |
if (ArrValues[0] != '') {
|
1463 |
alert('The server returned unexpected output:\n'+ArrValues[0]);
|
1464 |
}
|
1476 |
default:
|
1477 |
document.getElementById('img_'+slug).src = wppaImageDirectory+'cross.png';
|
1478 |
document.getElementById('img_'+slug).title = 'Error #'+ArrValues[1]+', message: '+ArrValues[2]+', status: '+xmlhttp.status;
|
1479 |
+
if ( ArrValues[3] != '' ) alert(ArrValues[3]);
|
1480 |
+
if ( _wppaRefreshAfter ) {
|
1481 |
+
_wppaRefreshAfter = false;
|
1482 |
+
document.location.reload(true);
|
1483 |
+
}
|
1484 |
+
}
|
1485 |
+
|
1486 |
}
|
1487 |
else {
|
1488 |
document.getElementById('img_'+slug).src = wppaImageDirectory+'cross.png';
|
1491 |
wppaCheckInconsistencies();
|
1492 |
}
|
1493 |
}
|
1494 |
+
|
1495 |
// Do the Ajax action
|
1496 |
xmlhttp.open('GET',url,true);
|
1497 |
+
xmlhttp.send();
|
1498 |
}
|
1499 |
|
1500 |
function wppaMaintenanceProc(slug, intern) {
|
1517 |
jQuery("#"+slug+"_status").html('Wait...');
|
1518 |
}
|
1519 |
|
1520 |
+
jQuery.ajax( { url: wppaAjaxUrl,
|
1521 |
data: 'action=wppa'+
|
1522 |
'&wppa-action=maintenance'+
|
1523 |
'&slug='+slug+
|
1526 |
type: 'POST',
|
1527 |
timeout: 300000,
|
1528 |
beforeSend: function( xhr ) {
|
1529 |
+
|
1530 |
},
|
1531 |
success: function( result, status, xhr ) {
|
1532 |
+
|
1533 |
// sample: '<error>||<slug>||<status>||<togo>'
|
1534 |
var resparr = result.split("||");
|
1535 |
var slug = resparr[1];
|
1536 |
var error = false;
|
1537 |
+
|
1538 |
// Check for unrecoverable error
|
1539 |
if ( ! slug ) {
|
1540 |
alert('The server returned unexpected output:\n'+result+'\nIf the current procedure has a Skip One button, press it before retrying. Reloading page...');
|
1541 |
wppaReload();
|
1542 |
return; // give up;
|
1543 |
}
|
1544 |
+
|
1545 |
// Check for recoverable error
|
1546 |
if ( resparr[0].length > 10 ) {
|
1547 |
alert('An error occurred:\n'+resparr[0]);
|
1548 |
error = true;
|
1549 |
}
|
1550 |
+
|
1551 |
// Update status and togo
|
1552 |
jQuery("#"+slug+"_status").html(resparr[2]);
|
1553 |
jQuery("#"+slug+"_togo").html(resparr[3]);
|
1571 |
setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 20);
|
1572 |
return;
|
1573 |
}
|
1574 |
+
|
1575 |
// Stopped but not ready yet
|
1576 |
jQuery("#"+slug+"_status").html('Pending');
|
1577 |
},
|
1578 |
+
|
1579 |
error: function( xhr, status, error ) {
|
1580 |
wppaConsoleLog( 'wppaMaintenanceProc failed. Error = ' + error + ', status = ' + status, 'force' );
|
1581 |
jQuery("#"+slug+"_status").html('Server error');
|
1589 |
setTimeout('wppaMaintenanceProc(\''+slug+'\', true)', 2000);
|
1590 |
}
|
1591 |
},
|
1592 |
+
|
1593 |
complete: function( xhr, status, newurl ) {
|
1594 |
+
|
1595 |
}
|
1596 |
} );
|
1597 |
}
|
1598 |
|
1599 |
function wppaAjaxPopupWindow( slug ) {
|
1600 |
+
|
1601 |
var name;
|
1602 |
switch ( slug ) {
|
1603 |
case 'wppa_list_index':
|
1623 |
|
1624 |
wnd.document.write('<!DOCTYPE html>');
|
1625 |
wnd.document.write('<html>');
|
1626 |
+
wnd.document.write('<head>');
|
1627 |
// The following is one statement that fixes a bug in opera
|
1628 |
wnd.document.write( '<link rel="stylesheet" id="wppa_style-css" href="'+wppaWppaUrl+'/wppa-admin-styles.css?ver='+wppaVersion+'" type="text/css" media="all" />'+
|
1629 |
'<style>body {font-family: sans-serif; font-size: 12px; line-height: 1.4em;}a {color: #21759B;}</style>'+
|
1633 |
'<script type="text/javascript">wppaAjaxUrl="'+wppaAjaxUrl+'";</script>');
|
1634 |
wnd.document.write('</head>');
|
1635 |
wnd.document.write('<body>'); // onunload="window.opener.location.reload()">'); // This does not work in Opera
|
1636 |
+
|
1637 |
var xmlhttp = wppaGetXmlHttp();
|
1638 |
+
|
1639 |
// Make the Ajax send data
|
1640 |
var url = wppaAjaxUrl;
|
1641 |
var data = 'action=wppa&wppa-action=maintenancepopup&slug='+slug;
|
1642 |
data += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
|
1643 |
+
|
1644 |
// Do the Ajax action
|
1645 |
xmlhttp.open('POST', url, false); // Synchronously !!
|
1646 |
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
1708 |
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
|
1709 |
xmlhttp.send(data);
|
1710 |
}
|
1711 |
+
|
1712 |
function wppaEncode(xtext) {
|
1713 |
var text, result;
|
1714 |
+
|
1715 |
if (typeof(xtext)=='undefined') return;
|
1716 |
+
|
1717 |
text = xtext;
|
1718 |
result = text.replace(/#/g, '||HASH||');
|
1719 |
text = result;
|
1760 |
// Init
|
1761 |
jQuery('#psdesc-'+id).css({display: 'none'});
|
1762 |
elm = document.getElementById('status-'+id);
|
1763 |
+
|
1764 |
if ( elm.value == 'pending' || elm.value == 'scheduled' ) {
|
1765 |
jQuery('#photoitem-'+id).css({backgroundColor: '#ffebe8', borderColor: '#cc0000'});
|
1766 |
}
|
1767 |
if (elm.value=='publish') {
|
1768 |
+
jQuery('#photoitem-'+id).css({backgroundColor:'#ffffe0', borderColor:'#e6db55'});
|
1769 |
}
|
1770 |
if (elm.value=='featured') {
|
1771 |
jQuery('#photoitem-'+id).css({backgroundColor: '#e0ffe0', borderColor: '#55ee55'});
|
1782 |
}
|
1783 |
}
|
1784 |
if (elm.value=='gold') {
|
1785 |
+
jQuery('#photoitem-'+id).css({backgroundColor:'#eeeecc', borderColor:'#ddddbb'});
|
1786 |
}
|
1787 |
if (elm.value=='silver') {
|
1788 |
+
jQuery('#photoitem-'+id).css({backgroundColor:'#ffffff', borderColor:'#eeeeee'});
|
1789 |
}
|
1790 |
if (elm.value=='bronze') {
|
1791 |
+
jQuery('#photoitem-'+id).css({backgroundColor:'#ddddbb', borderColor:'#ccccaa'});
|
1792 |
}
|
1793 |
+
|
1794 |
if ( elm.value == 'scheduled' ) {
|
1795 |
jQuery( '.wppa-datetime-'+id ).css('display', ''); //prop( 'disabled', false );
|
1796 |
}
|
1803 |
var type = 'nil';
|
1804 |
if ( document.getElementById('wppa_'+slug+'_linktype') ) type = document.getElementById('wppa_'+slug+'_linktype').value;
|
1805 |
var page = document.getElementById('wppa_'+slug+'_linkpage').value;
|
1806 |
+
|
1807 |
if ( page == '0' && ( type == 'nil' || type == 'photo' || type == 'single' || type == 'album' || type == 'content' || type == 'slide' || type == 'plainpage' )) {
|
1808 |
jQuery('#'+slug+'-err').css({display:''});
|
1809 |
}
|
1859 |
*/
|
1860 |
var wppaFeCount = 0;
|
1861 |
function wppaFeAjaxLog(key) {
|
1862 |
+
|
1863 |
if ( key == 'in' ) {
|
1864 |
if ( wppaFeCount == 0 ) {
|
1865 |
jQuery('#wppa-fe-exit').css('display', 'none');
|
1881 |
}
|
1882 |
|
1883 |
function wppaArrayToEnum( arr, sep ) {
|
1884 |
+
|
1885 |
// Step 1. Sort Ascending Numeric
|
1886 |
temp = arr.sort(function(a, b){return a-b});
|
1887 |
+
|
1888 |
+
// Init
|
1889 |
var result = '';
|
1890 |
var lastitem = -1;
|
1891 |
var previtemp = -2;
|
1926 |
if ( isrange ) { // Don't forget the last if it ends in a range
|
1927 |
result += '..' + lastitem;
|
1928 |
}
|
1929 |
+
|
1930 |
// ltrim .
|
1931 |
while ( result.substr(0,1) == '.') result = result.substr(1);
|
1932 |
|
1966 |
i++;
|
1967 |
}
|
1968 |
result = wppaArrayToEnum( parr, '.' );
|
1969 |
+
|
1970 |
return result;
|
1971 |
}
|
1972 |
|
1973 |
function wppaEditSearch( url, id ) {
|
1974 |
+
|
1975 |
var ss = jQuery( '#'+id ).val();
|
1976 |
if ( ss.length == 0 ) {
|
1977 |
alert('Please enter searchstring');
|
js/wppa-slideshow.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
// Contains slideshow modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
-
var wppaJsSlideshowVersion = '6.
|
7 |
|
8 |
// This is an entrypoint to load the slide data
|
9 |
function wppaStoreSlideInfo(
|
@@ -959,7 +959,7 @@ var result = '';
|
|
959 |
if ( wppaArtMonkeyButton ) {
|
960 |
if ( _wppaFullNames[mocc][_wppaCurIdx[mocc]] ) {
|
961 |
var label = _wppaFullNames[mocc][_wppaCurIdx[mocc]].split( '<img' );
|
962 |
-
result = '<input type="button" title="Download" style="cursor:pointer; margin-bottom:0px; max-width:'+( wppaGetContainerWidth( mocc )-24 )+'px;" class="wppa-download-button" onclick="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" value="'+wppaDownLoad+': '+label[0]+'" />';
|
963 |
if ( label[1] ) result += '<img'+label[1];
|
964 |
}
|
965 |
else {
|
@@ -967,7 +967,7 @@ var result = '';
|
|
967 |
}
|
968 |
}
|
969 |
else {
|
970 |
-
result = '<a title="Download" style="cursor:pointer;" onclick="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );">'+wppaDownLoad+': '+_wppaFullNames[mocc][_wppaCurIdx[mocc]]+'</a>';
|
971 |
}
|
972 |
break;
|
973 |
case 'none':
|
3 |
// Contains slideshow modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
+
var wppaJsSlideshowVersion = '6.4.00';
|
7 |
|
8 |
// This is an entrypoint to load the slide data
|
9 |
function wppaStoreSlideInfo(
|
959 |
if ( wppaArtMonkeyButton ) {
|
960 |
if ( _wppaFullNames[mocc][_wppaCurIdx[mocc]] ) {
|
961 |
var label = _wppaFullNames[mocc][_wppaCurIdx[mocc]].split( '<img' );
|
962 |
+
result = '<input type="button" title="Download" style="cursor:pointer; margin-bottom:0px; max-width:'+( wppaGetContainerWidth( mocc )-24 )+'px;" class="wppa-download-button" onclick="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" value="'+wppaDownLoad+': '+label[0]+'" />';
|
963 |
if ( label[1] ) result += '<img'+label[1];
|
964 |
}
|
965 |
else {
|
967 |
}
|
968 |
}
|
969 |
else {
|
970 |
+
result = '<a title="Download" style="cursor:pointer;" onclick="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );">'+wppaDownLoad+': '+_wppaFullNames[mocc][_wppaCurIdx[mocc]]+'</a>';
|
971 |
}
|
972 |
break;
|
973 |
case 'none':
|
js/wppa-slideshow.min.js
CHANGED
@@ -3,9 +3,8 @@
|
|
3 |
// Contains slideshow modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
6 |
-
var wppaJsSlideshowVersion = '6.3.18';
|
7 |
|
8 |
-
var wppaJsSlideshowVersion='6.
|
9 |
cursor='default';if(linkurl!=''){cursor='pointer';}
|
10 |
else if(wppaLightBox[mocc]!=''){cursor='url( '+wppaImageDirectory+wppaMagnifierCursor+' ),pointer';}
|
11 |
_wppaIsVideo[mocc][id]=(''!=videohtml);if(_wppaIsVideo[mocc][id]){_wppaSlides[mocc][id]=' alt="'+wppaTrimAlt(name)+'" class="theimg theimg-'+mocc+' big" ';if(wppaSlideVideoStart&&wppaLightBox[mocc]==''){_wppaSlides[mocc][id]+=' autoplay ';}}
|
@@ -90,9 +89,9 @@ if(margl<0)margl=0;jQuery('#'+imgid).css({marginLeft:'auto',marginRight:'auto'})
|
|
90 |
if(audios.length>0){var i=0;jQuery(audios[i]).css({width:imgw,left:(contw-imgw)/2});i++;}}
|
91 |
var bbbwidth=parseInt(framew/3);var leftmarg=bbbwidth*2;jQuery('#bbb-'+mocc+'-l').css({height:frameh,width:bbbwidth,left:0});jQuery('#bbb-'+mocc+'-r').css({height:frameh,width:bbbwidth,left:leftmarg});}
|
92 |
function wppaMakeNameHtml(mocc){var result='';if(_wppaCurIdx[mocc]<0)return'';if(wppaIsMini[mocc]||_wppaIsVideo[mocc][_wppaCurIdx[mocc]]){result=_wppaFullNames[mocc][_wppaCurIdx[mocc]];}
|
93 |
-
else switch(wppaArtMonkyLink){case'file':case'zip':if(wppaArtMonkeyButton){if(_wppaFullNames[mocc][_wppaCurIdx[mocc]]){var label=_wppaFullNames[mocc][_wppaCurIdx[mocc]].split('<img');result='<input type="button" title="Download" style="cursor:pointer; margin-bottom:0px; max-width:'+(wppaGetContainerWidth(mocc)-24)+'px;" class="wppa-download-button" onclick="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" value="'+wppaDownLoad+': '+label[0]+'" />';if(label[1])result+='<img'+label[1];}
|
94 |
else{result='';}}
|
95 |
-
else{result='<a title="Download" style="cursor:pointer;" onclick="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', '+_wppaId[mocc][_wppaCurIdx[mocc]]+' );">'+wppaDownLoad+': '+_wppaFullNames[mocc][_wppaCurIdx[mocc]]+'</a>';}
|
96 |
break;case'none':result=_wppaFullNames[mocc][_wppaCurIdx[mocc]];break;default:result='';}
|
97 |
return wppaRepairBrTags(result);}
|
98 |
function wppaMakeTheSlideHtml(mocc,bgfg,idx){var imgVideo=(_wppaIsVideo[mocc][idx])?'video':'img';var theHtml;var url;var theTitle='title';if(wppaLightBox[mocc]=='wppa')theTitle='data-lbtitle';var mmEvents=wppaLightBox[mocc]==''?' onpause="wppaVideoPlaying['+mocc+'] = false;" onplay="wppaVideoPlaying['+mocc+'] = true;"':'';if(_wppaLinkUrl[mocc][idx]!=''){if(wppaSlideToFullpopup){theHtml='<a onclick="wppaStopAudio();'+_wppaLinkUrl[mocc][idx]+'" target="'+_wppaLinkTarget[mocc][idx]+'" title="'+_wppaLinkTitle[mocc][idx]+'">'+'<'+imgVideo+mmEvents+' title="'+_wppaLinkTitle[mocc][idx]+'" id="theimg'+bgfg+'-'+mocc+'" '+_wppaSlides[mocc][idx]+'</a>';}
|
3 |
// Contains slideshow modules
|
4 |
// Dependancies: wppa.js and default wp jQuery library
|
5 |
//
|
|
|
6 |
|
7 |
+
var wppaJsSlideshowVersion='6.4.00';function wppaStoreSlideInfo(mocc,id,url,size,width,height,fullname,name,desc,photoid,avgrat,discount,myrat,rateurl,linkurl,linktitle,linktarget,iwtimeout,commenthtml,iptchtml,exifhtml,lbtitle,shareurl,smhtml,ogdsc,hiresurl,videohtml,audiohtml){var cursor;desc=wppaRepairScriptTags(desc);if(!_wppaSlides[mocc]||'0'==id){_wppaSlides[mocc]=[];_wppaNames[mocc]=[];_wppaFullNames[mocc]=[];_wppaDsc[mocc]=[];_wppaOgDsc[mocc]=[];_wppaCurIdx[mocc]=-1;_wppaNxtIdx[mocc]=0;if(parseInt(iwtimeout)>0)_wppaTimeOut[mocc]=parseInt(iwtimeout);else _wppaTimeOut[mocc]=wppaSlideShowTimeOut;_wppaSSRuns[mocc]=false;_wppaTP[mocc]=-2;_wppaFg[mocc]=0;_wppaIsBusy[mocc]=false;_wppaFirst[mocc]=true;_wppaId[mocc]=[];_wppaAvg[mocc]=[];_wppaDisc[mocc]=[];_wppaMyr[mocc]=[];_wppaVRU[mocc]=[];_wppaLinkUrl[mocc]=[];_wppaLinkTitle[mocc]=[];_wppaLinkTarget[mocc]=[];_wppaCommentHtml[mocc]=[];_wppaIptcHtml[mocc]=[];_wppaExifHtml[mocc]=[];_wppaUrl[mocc]=[];_wppaSkipRated[mocc]=false;_wppaLbTitle[mocc]=[];_wppaDidGoto[mocc]=false;wppaSlidePause[mocc]=false;_wppaShareUrl[mocc]=[];_wppaShareHtml[mocc]=[];_wppaFilmNoMove[mocc]=false;_wppaHiresUrl[mocc]=[];_wppaIsVideo[mocc]=[];_wppaVideoHtml[mocc]=[];_wppaAudioHtml[mocc]=[];_wppaVideoNatWidth[mocc]=[];_wppaVideoNatHeight[mocc]=[];wppaVideoPlaying[mocc]=false;wppaAudioPlaying[mocc]=false;}
|
8 |
cursor='default';if(linkurl!=''){cursor='pointer';}
|
9 |
else if(wppaLightBox[mocc]!=''){cursor='url( '+wppaImageDirectory+wppaMagnifierCursor+' ),pointer';}
|
10 |
_wppaIsVideo[mocc][id]=(''!=videohtml);if(_wppaIsVideo[mocc][id]){_wppaSlides[mocc][id]=' alt="'+wppaTrimAlt(name)+'" class="theimg theimg-'+mocc+' big" ';if(wppaSlideVideoStart&&wppaLightBox[mocc]==''){_wppaSlides[mocc][id]+=' autoplay ';}}
|
89 |
if(audios.length>0){var i=0;jQuery(audios[i]).css({width:imgw,left:(contw-imgw)/2});i++;}}
|
90 |
var bbbwidth=parseInt(framew/3);var leftmarg=bbbwidth*2;jQuery('#bbb-'+mocc+'-l').css({height:frameh,width:bbbwidth,left:0});jQuery('#bbb-'+mocc+'-r').css({height:frameh,width:bbbwidth,left:leftmarg});}
|
91 |
function wppaMakeNameHtml(mocc){var result='';if(_wppaCurIdx[mocc]<0)return'';if(wppaIsMini[mocc]||_wppaIsVideo[mocc][_wppaCurIdx[mocc]]){result=_wppaFullNames[mocc][_wppaCurIdx[mocc]];}
|
92 |
+
else switch(wppaArtMonkyLink){case'file':case'zip':if(wppaArtMonkeyButton){if(_wppaFullNames[mocc][_wppaCurIdx[mocc]]){var label=_wppaFullNames[mocc][_wppaCurIdx[mocc]].split('<img');result='<input type="button" title="Download" style="cursor:pointer; margin-bottom:0px; max-width:'+(wppaGetContainerWidth(mocc)-24)+'px;" class="wppa-download-button" onclick="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" value="'+wppaDownLoad+': '+label[0]+'" />';if(label[1])result+='<img'+label[1];}
|
93 |
else{result='';}}
|
94 |
+
else{result='<a title="Download" style="cursor:pointer;" onclick="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );" ontouchstart="wppaAjaxMakeOrigName( '+mocc+', \''+_wppaId[mocc][_wppaCurIdx[mocc]]+'\' );">'+wppaDownLoad+': '+_wppaFullNames[mocc][_wppaCurIdx[mocc]]+'</a>';}
|
95 |
break;case'none':result=_wppaFullNames[mocc][_wppaCurIdx[mocc]];break;default:result='';}
|
96 |
return wppaRepairBrTags(result);}
|
97 |
function wppaMakeTheSlideHtml(mocc,bgfg,idx){var imgVideo=(_wppaIsVideo[mocc][idx])?'video':'img';var theHtml;var url;var theTitle='title';if(wppaLightBox[mocc]=='wppa')theTitle='data-lbtitle';var mmEvents=wppaLightBox[mocc]==''?' onpause="wppaVideoPlaying['+mocc+'] = false;" onplay="wppaVideoPlaying['+mocc+'] = true;"':'';if(_wppaLinkUrl[mocc][idx]!=''){if(wppaSlideToFullpopup){theHtml='<a onclick="wppaStopAudio();'+_wppaLinkUrl[mocc][idx]+'" target="'+_wppaLinkTarget[mocc][idx]+'" title="'+_wppaLinkTitle[mocc][idx]+'">'+'<'+imgVideo+mmEvents+' title="'+_wppaLinkTitle[mocc][idx]+'" id="theimg'+bgfg+'-'+mocc+'" '+_wppaSlides[mocc][idx]+'</a>';}
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
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.
|
6 |
Stable tag: 6.3.18
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
@@ -189,12 +189,29 @@ 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.18 =
|
193 |
|
194 |
= Bug Fixes =
|
195 |
|
196 |
* Photo of the day selection result for Display method Change every ( any time period ), when the Use albums selection is - top rated photos - returned Not found. Fixed.
|
197 |
-
* Go to fullscreen mode by icon button in
|
198 |
* On the frontpage the links are no longer 'prettyfied' to avoid 404 errors due to improper redirection.
|
199 |
|
200 |
= Other Changes =
|
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.00
|
6 |
Stable tag: 6.3.18
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
189 |
|
190 |
See for additional information: http://wppa.opajaap.nl/changelog/
|
191 |
|
192 |
+
= 6.4.00 =
|
193 |
+
|
194 |
+
= New Features =
|
195 |
+
|
196 |
+
* Privacy phase one. In Table IV-A6.1 you can switch to encrypted urls. Photo and album identifiers in urls must be their encryption codes rather than their db table ids.
|
197 |
+
This prevents users from 'guessing' ids of photos or albums that they should not be able to see.
|
198 |
+
If Table IV-A6.2 is also ticked, unencrypted album and photo ids will be refused.
|
199 |
+
* Album navigator widget selection added: --- owner/public ---. This shows only the logged in users albums and public albums.
|
200 |
+
* Topten widget selection of albums: added --- owner/public ---. This shows only the photos from albums owned by the logged in user and from public albums.
|
201 |
+
* Featen widget selection of albums: added --- owner/public ---. This shows only the photos from albums owned by the logged in user and from public albums.
|
202 |
+
* Allow HTML tags in Custom data fields. Table IX-B1.1. If On: Only script and style tags are stripped, if off (default): All tags are stripped.
|
203 |
+
|
204 |
+
= Other Changes =
|
205 |
+
|
206 |
+
* Changed Table IV-A18: Enable photo html access to a choice of 'create .htaccess', 'remove .htaccess' (default) or 'do not change' to allow for a custom .htaccess file in ../uploads/wppa/ and ../wppa/thumbs/.
|
207 |
+
* Added w#rating to the photo description keywords, displaying the rating in float format.
|
208 |
+
|
209 |
= 6.3.18 =
|
210 |
|
211 |
= Bug Fixes =
|
212 |
|
213 |
* Photo of the day selection result for Display method Change every ( any time period ), when the Use albums selection is - top rated photos - returned Not found. Fixed.
|
214 |
+
* Go to fullscreen mode by icon button in lightbox did not work properly under certain circumstances. Fixed.
|
215 |
* On the frontpage the links are no longer 'prettyfied' to avoid 404 errors due to improper redirection.
|
216 |
|
217 |
= Other Changes =
|
wppa-ajax.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
-
* Version 6.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -141,7 +141,12 @@ global $wppa_session;
|
|
141 |
|
142 |
case 'front-edit':
|
143 |
if ( ! isset( $_REQUEST['photo-id'] ) ) die( 'Missing required argument' );
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
145 |
$ok = false;
|
146 |
if ( current_user_can( 'wppa_admin' ) ) $ok = true;
|
147 |
if ( wppa_get_user() == wppa_get_photo_owner( $photo ) && ( current_user_can( 'wppa_upload' ) || ( is_user_logged_in() && wppa_switch( 'upload_edit' ) ) ) ) $ok = true;
|
@@ -234,8 +239,14 @@ global $wppa_session;
|
|
234 |
|
235 |
case 'remove':
|
236 |
if ( isset( $_REQUEST['photo-id'] ) ) { // Remove photo
|
237 |
-
if ( (
|
238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
echo 'OK||'.__( 'Photo removed' , 'wp-photo-album-plus');
|
240 |
wppa_exit();
|
241 |
}
|
@@ -245,11 +256,17 @@ global $wppa_session;
|
|
245 |
wppa_exit();
|
246 |
}
|
247 |
if ( isset( $_REQUEST['photo-id'] ) ) { // Remove photo
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
if ( ! current_user_can( 'wppa_moderate' ) ) {
|
249 |
_e( 'Security check failure' , 'wp-photo-album-plus');
|
250 |
wppa_exit();
|
251 |
}
|
252 |
-
wppa_delete_photo( $
|
253 |
echo 'OK||'.__( 'Photo removed' , 'wp-photo-album-plus');
|
254 |
wppa_exit();
|
255 |
}
|
@@ -270,7 +287,7 @@ global $wppa_session;
|
|
270 |
}
|
271 |
|
272 |
// Validate args
|
273 |
-
$alb = $_REQUEST['album-id'];
|
274 |
|
275 |
$status = "`status` <> 'pending' AND `status` <> 'scheduled'";
|
276 |
if ( ! is_user_logged_in() ) $status .= " AND `status` <> 'private'";
|
@@ -355,7 +372,7 @@ global $wppa_session;
|
|
355 |
break;
|
356 |
|
357 |
case 'makeorigname':
|
358 |
-
$photo = $_REQUEST['photo-id'];
|
359 |
$from = $_REQUEST['from'];
|
360 |
if ( $from == 'fsname' ) {
|
361 |
$type = wppa_opt( 'art_monkey_link' );
|
@@ -467,7 +484,7 @@ global $wppa_session;
|
|
467 |
|
468 |
case 'rate':
|
469 |
// Get commandline args
|
470 |
-
$photo = $_REQUEST['wppa-rating-id'];
|
471 |
$rating = $_REQUEST['wppa-rating'];
|
472 |
$occur = $_REQUEST['wppa-occur'];
|
473 |
$index = $_REQUEST['wppa-index'];
|
@@ -1354,7 +1371,7 @@ global $wppa_session;
|
|
1354 |
else {
|
1355 |
$custom_data = array( '', '', '', '', '', '', '', '', '', '' );
|
1356 |
}
|
1357 |
-
$custom_data[$index] =
|
1358 |
$custom = serialize( $custom_data );
|
1359 |
wppa_update_photo( array( 'id' => $photo, 'custom' => $custom, 'modified' => time() ) );
|
1360 |
wppa_index_update( 'photo', $photo );
|
@@ -2121,6 +2138,34 @@ global $wppa_session;
|
|
2121 |
$value = str_replace( ' ', '', $value );
|
2122 |
break;
|
2123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2124 |
case 'wppa_enable_video':
|
2125 |
// if off: set all statusses of videos to pending
|
2126 |
break;
|
2 |
/* wppa-ajax.php
|
3 |
*
|
4 |
* Functions used in ajax requests
|
5 |
+
* Version 6.4.00
|
6 |
*
|
7 |
*/
|
8 |
|
141 |
|
142 |
case 'front-edit':
|
143 |
if ( ! isset( $_REQUEST['photo-id'] ) ) die( 'Missing required argument' );
|
144 |
+
if ( strlen( $_REQUEST['photo-id'] ) == 12 ) {
|
145 |
+
$photo = wppa_decrypt_photo( $_REQUEST['photo-id'] );
|
146 |
+
}
|
147 |
+
else {
|
148 |
+
$photo = $_REQUEST['photo-id'];
|
149 |
+
}
|
150 |
$ok = false;
|
151 |
if ( current_user_can( 'wppa_admin' ) ) $ok = true;
|
152 |
if ( wppa_get_user() == wppa_get_photo_owner( $photo ) && ( current_user_can( 'wppa_upload' ) || ( is_user_logged_in() && wppa_switch( 'upload_edit' ) ) ) ) $ok = true;
|
239 |
|
240 |
case 'remove':
|
241 |
if ( isset( $_REQUEST['photo-id'] ) ) { // Remove photo
|
242 |
+
if ( strlen( $_REQUEST['photo-id'] ) == 12 ) {
|
243 |
+
$photo = wppa_decrypt_photo( $_REQUEST['photo-id'] );
|
244 |
+
}
|
245 |
+
else {
|
246 |
+
$photo = $_REQUEST['photo-id'];
|
247 |
+
}
|
248 |
+
if ( ( wppa_user_is( 'administrator' ) ) || ( current_user_can( 'wppa_moderate' ) ) || ( wppa_get_user() == wppa_get_photo_owner( $photo ) && wppa_switch( 'upload_edit' ) ) ) { // Frontend delete?
|
249 |
+
wppa_delete_photo( $photo );
|
250 |
echo 'OK||'.__( 'Photo removed' , 'wp-photo-album-plus');
|
251 |
wppa_exit();
|
252 |
}
|
256 |
wppa_exit();
|
257 |
}
|
258 |
if ( isset( $_REQUEST['photo-id'] ) ) { // Remove photo
|
259 |
+
if ( strlen( $_REQUEST['photo-id'] ) == 12 ) {
|
260 |
+
$photo = wppa_decrypt_photo( $_REQUEST['photo-id'] );
|
261 |
+
}
|
262 |
+
else {
|
263 |
+
$photo = $_REQUEST['photo-id'];
|
264 |
+
}
|
265 |
if ( ! current_user_can( 'wppa_moderate' ) ) {
|
266 |
_e( 'Security check failure' , 'wp-photo-album-plus');
|
267 |
wppa_exit();
|
268 |
}
|
269 |
+
wppa_delete_photo( $photo );
|
270 |
echo 'OK||'.__( 'Photo removed' , 'wp-photo-album-plus');
|
271 |
wppa_exit();
|
272 |
}
|
287 |
}
|
288 |
|
289 |
// Validate args
|
290 |
+
$alb = wppa_decrypt_album( $_REQUEST['album-id'] );
|
291 |
|
292 |
$status = "`status` <> 'pending' AND `status` <> 'scheduled'";
|
293 |
if ( ! is_user_logged_in() ) $status .= " AND `status` <> 'private'";
|
372 |
break;
|
373 |
|
374 |
case 'makeorigname':
|
375 |
+
$photo = wppa_decrypt_photo( $_REQUEST['photo-id'] );
|
376 |
$from = $_REQUEST['from'];
|
377 |
if ( $from == 'fsname' ) {
|
378 |
$type = wppa_opt( 'art_monkey_link' );
|
484 |
|
485 |
case 'rate':
|
486 |
// Get commandline args
|
487 |
+
$photo = wppa_decrypt_photo( $_REQUEST['wppa-rating-id'] );
|
488 |
$rating = $_REQUEST['wppa-rating'];
|
489 |
$occur = $_REQUEST['wppa-occur'];
|
490 |
$index = $_REQUEST['wppa-index'];
|
1371 |
else {
|
1372 |
$custom_data = array( '', '', '', '', '', '', '', '', '', '' );
|
1373 |
}
|
1374 |
+
$custom_data[$index] = wppa_sanitize_custom_field( $value );
|
1375 |
$custom = serialize( $custom_data );
|
1376 |
wppa_update_photo( array( 'id' => $photo, 'custom' => $custom, 'modified' => time() ) );
|
1377 |
wppa_index_update( 'photo', $photo );
|
2138 |
$value = str_replace( ' ', '', $value );
|
2139 |
break;
|
2140 |
|
2141 |
+
case 'wppa_use_encrypted_links':
|
2142 |
+
if ( $value == 'yes' ) {
|
2143 |
+
$ca = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `crypt` = ''" );
|
2144 |
+
$cp = $wpdb->get_var( "SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `crypt` = ''" );
|
2145 |
+
if ( $ca + $cp ) {
|
2146 |
+
if ( $ca ) update_option ( 'wppa_crypt_albums_status', 'Required' );
|
2147 |
+
if ( $cp ) update_option ( 'wppa_crypt_photos_status', 'Required' );
|
2148 |
+
wppa( 'error', '4711' );
|
2149 |
+
$alert .= __( 'You must run Table VIII-A13 and VIII-A14 first before you can switch to encrypted urls.', 'wp-photo-album-plus' );
|
2150 |
+
}
|
2151 |
+
if ( wppa_switch( 'use_photo_names_in_urls' ) ) {
|
2152 |
+
$alert .= ' ' . __( 'Table IV-A3 will be switched off.', 'wp-photo-album-plus' );
|
2153 |
+
wppa_update_option( 'wppa_use_photo_names_in_urls', 'no' );
|
2154 |
+
}
|
2155 |
+
if ( wppa_switch( 'use_album_names_in_urls' ) ) {
|
2156 |
+
$alert .= ' ' . __( 'Table IV-A4 will be switched off.', 'wp-photo-album-plus' );
|
2157 |
+
wppa_update_option( 'wppa_use_album_names_in_urls', 'no' );
|
2158 |
+
}
|
2159 |
+
}
|
2160 |
+
break;
|
2161 |
+
|
2162 |
+
case 'wppa_use_photo_names_in_urls':
|
2163 |
+
case 'wppa_use_album_names_in_urls':
|
2164 |
+
if ( wppa_switch( 'use_encrypted_links' ) ) {
|
2165 |
+
wppa( 'error', '4711' );
|
2166 |
+
$alert .= __( 'Not allowed when cryptic links is active', 'wp-photo-album-plus' );
|
2167 |
+
}
|
2168 |
+
|
2169 |
case 'wppa_enable_video':
|
2170 |
// if off: set all statusses of videos to pending
|
2171 |
break;
|
wppa-album-covers.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -129,19 +129,19 @@ global $wpdb;
|
|
129 |
$title = $title_attr['title'];
|
130 |
|
131 |
// Find the slideshow link and onclick
|
132 |
-
$href_slideshow = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
|
133 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
134 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
135 |
-
wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
|
136 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
137 |
$href_slideshow = "#";
|
138 |
}
|
139 |
|
140 |
// Find the content 'View' link
|
141 |
-
$href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
|
142 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
143 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
144 |
-
wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
|
145 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
146 |
$href_content = "#";
|
147 |
}
|
@@ -462,19 +462,19 @@ global $wpdb;
|
|
462 |
}
|
463 |
|
464 |
// Find the slideshow link and onclick
|
465 |
-
$href_slideshow = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
|
466 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
467 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
468 |
-
wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
|
469 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
470 |
$href_slideshow = "#";
|
471 |
}
|
472 |
|
473 |
// Find the content 'View' link
|
474 |
-
$href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
|
475 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
476 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
477 |
-
wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
|
478 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
479 |
$href_content = "#";
|
480 |
}
|
@@ -648,19 +648,19 @@ global $wpdb;
|
|
648 |
$title = $title_attr['title'];
|
649 |
|
650 |
// Find the slideshow link and onclick
|
651 |
-
$href_slideshow = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
|
652 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
653 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
654 |
-
wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
|
655 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
656 |
$href_slideshow = "#";
|
657 |
}
|
658 |
|
659 |
// Find the content 'View' link
|
660 |
-
$href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
|
661 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
662 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
663 |
-
wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
|
664 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
665 |
$href_content = "#";
|
666 |
}
|
@@ -1263,18 +1263,18 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1263 |
case 'content':
|
1264 |
case 'thumbs':
|
1265 |
case 'albums':
|
1266 |
-
$href_title = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage, $linktype ) );
|
1267 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1268 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1269 |
-
wppa_get_album_url_ajax( $albumid, $linkpage, $linktype ) . "', '" . $href_title . "' )";
|
1270 |
$href_title = "#";
|
1271 |
}
|
1272 |
break;
|
1273 |
case 'slide':
|
1274 |
-
$href_title = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
|
1275 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1276 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1277 |
-
wppa_get_slideshow_url_ajax( $albumid, $linkpage, $linktype ) . "', '" . $href_title . "' )";
|
1278 |
$href_title = "#";
|
1279 |
}
|
1280 |
break;
|
@@ -1288,7 +1288,7 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1288 |
else { // No content on current page/post
|
1289 |
if ( $photocount > '0' ) { // coverphotos only
|
1290 |
if ( $coverphoto ) {
|
1291 |
-
$href_title = wppa_convert_to_pretty( wppa_get_image_page_url_by_id( $coverphoto ) );
|
1292 |
}
|
1293 |
else {
|
1294 |
$href_title = '#';
|
@@ -1296,7 +1296,7 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1296 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1297 |
if ( $coverphoto ) {
|
1298 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1299 |
-
wppa_get_image_url_ajax_by_id( $coverphoto ) . "', '" . $href_title . "' )";
|
1300 |
}
|
1301 |
else {
|
1302 |
$onclick_title = '';
|
@@ -1306,8 +1306,8 @@ function wppa_get_album_title_attr_a( $albumid, $linktype, $linkpage, $has_conte
|
|
1306 |
$title_title = _n( 'View the cover photo', 'View the cover photos' , $photocount, 'wp-photo-album-plus');
|
1307 |
}
|
1308 |
}
|
1309 |
-
$title_attr['href'] = $href_title;
|
1310 |
-
$title_attr['onclick'] = $onclick_title;
|
1311 |
$title_attr['title'] = $title_title;
|
1312 |
|
1313 |
return $title_attr;
|
@@ -1561,11 +1561,11 @@ global $wpdb;
|
|
1561 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
1562 |
$href_content = '';
|
1563 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1564 |
-
wppa_get_album_url_ajax( $albumid, $linkpage ) . "', '" .
|
1565 |
-
wppa_convert_to_pretty( $href_content ) . "' )";
|
1566 |
}
|
1567 |
else {
|
1568 |
-
$href_content = wppa_convert_to_pretty( wppa_get_album_url( $albumid, $linkpage ) );
|
1569 |
$onclick_content = '';
|
1570 |
}
|
1571 |
}
|
@@ -1575,11 +1575,11 @@ global $wpdb;
|
|
1575 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
1576 |
$href_content = '';
|
1577 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1578 |
-
wppa_get_slideshow_url_ajax( $albumid, $linkpage ) . "', '" .
|
1579 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
1580 |
}
|
1581 |
else {
|
1582 |
-
$href_content = wppa_convert_to_pretty( wppa_get_slideshow_url( $albumid, $linkpage ) );
|
1583 |
$onclick_content = '';
|
1584 |
}
|
1585 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for album covers
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
129 |
$title = $title_attr['title'];
|
130 |
|
131 |
// Find the slideshow link and onclick
|
132 |
+
$href_slideshow = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( $albumid, $linkpage ) ) );
|
133 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
134 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
135 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
136 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
137 |
$href_slideshow = "#";
|
138 |
}
|
139 |
|
140 |
// Find the content 'View' link
|
141 |
+
$href_content = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $albumid, $linkpage ) ) );
|
142 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
143 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
144 |
+
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
145 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
146 |
$href_content = "#";
|
147 |
}
|
462 |
}
|
463 |
|
464 |
// Find the slideshow link and onclick
|
465 |
+
$href_slideshow = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( $albumid, $linkpage ) ) );
|
466 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
467 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
468 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
469 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
470 |
$href_slideshow = "#";
|
471 |
}
|
472 |
|
473 |
// Find the content 'View' link
|
474 |
+
$href_content = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $albumid, $linkpage ) ) );
|
475 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
476 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
477 |
+
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
478 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
479 |
$href_content = "#";
|
480 |
}
|
648 |
$title = $title_attr['title'];
|
649 |
|
650 |
// Find the slideshow link and onclick
|
651 |
+
$href_slideshow = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( $albumid, $linkpage ) ) );
|
652 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
653 |
$onclick_slideshow = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
654 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
655 |
wppa_convert_to_pretty( $href_slideshow ) . "' )";
|
656 |
$href_slideshow = "#";
|
657 |
}
|
658 |
|
659 |
// Find the content 'View' link
|
660 |
+
$href_content = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $albumid, $linkpage ) ) );
|
661 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
662 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
663 |
+
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
664 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
665 |
$href_content = "#";
|
666 |
}
|
1263 |
case 'content':
|
1264 |
case 'thumbs':
|
1265 |
case 'albums':
|
1266 |
+
$href_title = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $albumid, $linkpage, $linktype ) ) );
|
1267 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1268 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1269 |
+
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage, $linktype ) ) . "', '" . $href_title . "' )";
|
1270 |
$href_title = "#";
|
1271 |
}
|
1272 |
break;
|
1273 |
case 'slide':
|
1274 |
+
$href_title = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( $albumid, $linkpage ) ) );
|
1275 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1276 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1277 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage, $linktype ) ) . "', '" . $href_title . "' )";
|
1278 |
$href_title = "#";
|
1279 |
}
|
1280 |
break;
|
1288 |
else { // No content on current page/post
|
1289 |
if ( $photocount > '0' ) { // coverphotos only
|
1290 |
if ( $coverphoto ) {
|
1291 |
+
$href_title = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_image_page_url_by_id( $coverphoto ) ) );
|
1292 |
}
|
1293 |
else {
|
1294 |
$href_title = '#';
|
1296 |
if ( wppa_switch( 'allow_ajax' ) ) {
|
1297 |
if ( $coverphoto ) {
|
1298 |
$onclick_title = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1299 |
+
wppa_encrypt_url( wppa_get_image_url_ajax_by_id( $coverphoto ) ) . "', '" . $href_title . "' )";
|
1300 |
}
|
1301 |
else {
|
1302 |
$onclick_title = '';
|
1306 |
$title_title = _n( 'View the cover photo', 'View the cover photos' , $photocount, 'wp-photo-album-plus');
|
1307 |
}
|
1308 |
}
|
1309 |
+
$title_attr['href'] = wppa_encrypt_url( $href_title );
|
1310 |
+
$title_attr['onclick'] = wppa_encrypt_url( $onclick_title );
|
1311 |
$title_attr['title'] = $title_title;
|
1312 |
|
1313 |
return $title_attr;
|
1561 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
1562 |
$href_content = '';
|
1563 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1564 |
+
wppa_encrypt_url( wppa_get_album_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
1565 |
+
wppa_convert_to_pretty( wppa_encrypt_url( $href_content ) ) . "' )";
|
1566 |
}
|
1567 |
else {
|
1568 |
+
$href_content = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $albumid, $linkpage ) ) );
|
1569 |
$onclick_content = '';
|
1570 |
}
|
1571 |
}
|
1575 |
if ( wppa_switch( 'allow_ajax' ) && ! $linkpage ) {
|
1576 |
$href_content = '';
|
1577 |
$onclick_content = "wppaDoAjaxRender( " . wppa( 'mocc' ) . ", '" .
|
1578 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( $albumid, $linkpage ) ) . "', '" .
|
1579 |
wppa_convert_to_pretty( $href_content ) . "' )";
|
1580 |
}
|
1581 |
else {
|
1582 |
+
$href_content = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( $albumid, $linkpage ) ) );
|
1583 |
$onclick_content = '';
|
1584 |
}
|
1585 |
}
|
wppa-album-navigator-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display album names linking to content
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
|
9 |
class AlbumNavigatorWidget extends WP_Widget {
|
@@ -49,6 +49,10 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
49 |
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '' );
|
50 |
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '' );
|
51 |
}
|
|
|
|
|
|
|
|
|
52 |
else {
|
53 |
$widget_content .= $this->do_album_navigator( $parent, $page, $skip, '' );
|
54 |
}
|
@@ -95,6 +99,7 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
95 |
<option value="all" <?php if ($parent == 'all') echo 'selected="selected"' ?>><?php _e('--- all albums ---', 'wp-photo-album-plus') ?></option>
|
96 |
<option value="0" <?php if ($parent == '0') echo 'selected="selected"' ?>><?php _e('--- all generic albums ---', 'wp-photo-album-plus') ?></option>
|
97 |
<option value="-1" <?php if ($parent == '-1') echo 'selected="selected"' ?>><?php _e('--- all separate albums ---', 'wp-photo-album-plus') ?></option>
|
|
|
98 |
<?php $albs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."` ORDER BY `name`", ARRAY_A);
|
99 |
if ( $albs ) foreach( $albs as $alb ) {
|
100 |
echo '<option value="'.$alb['id'].'" ';
|
@@ -122,7 +127,7 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
122 |
return $widgetid;
|
123 |
}
|
124 |
|
125 |
-
function do_album_navigator( $parent, $page, $skip, $propclass ) {
|
126 |
global $wpdb;
|
127 |
static $level;
|
128 |
static $ca;
|
@@ -147,7 +152,7 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
147 |
$w = $this->get_widget_id();
|
148 |
$p = $parent;
|
149 |
$result = '';
|
150 |
-
$albums = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_ALBUMS."` WHERE `a_parent` = %s ".wppa_get_album_order( max( '0', $parent ) ), $parent ), ARRAY_A );
|
151 |
wppa_dbg_q( 'Q-WidANav' );
|
152 |
if ( ! empty( $albums ) ) {
|
153 |
wppa_cache_album( 'add', $albums );
|
@@ -164,10 +169,10 @@ class AlbumNavigatorWidget extends WP_Widget {
|
|
164 |
else $result .= '
|
165 |
<div style="width:12px;float:left;" > '.( $a == $ca ? '»' : '').'</div>';
|
166 |
$result .= '
|
167 |
-
<a href="'.wppa_get_permalink( $page ).'&wppa-album='.$a.'&wppa-cover=0&wppa-occur=1'.$slide.'">'.wppa_get_album_name( $a ).'</a>
|
168 |
</li>';
|
169 |
$newpropclass = $propclass . ' p-'.$w.'-'.$p;
|
170 |
-
$result .= '<li class="anw-'.$w.'-'.$p.$propclass.'" style="list-style:none;" >' . $this->do_album_navigator( $a, $page, $skip, $newpropclass ) . '</li>';
|
171 |
}
|
172 |
}
|
173 |
$result .= '</ul>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display album names linking to content
|
6 |
+
* Version 6.4.00
|
7 |
*/
|
8 |
|
9 |
class AlbumNavigatorWidget extends WP_Widget {
|
49 |
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '' );
|
50 |
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '' );
|
51 |
}
|
52 |
+
elseif ( $parent == 'owner' ) {
|
53 |
+
$widget_content .= $this->do_album_navigator( '0', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
54 |
+
$widget_content .= $this->do_album_navigator( '-1', $page, $skip, '', " AND ( `owner` = '--- public ---' OR `owner` = '".wppa_get_user()."' ) " );
|
55 |
+
}
|
56 |
else {
|
57 |
$widget_content .= $this->do_album_navigator( $parent, $page, $skip, '' );
|
58 |
}
|
99 |
<option value="all" <?php if ($parent == 'all') echo 'selected="selected"' ?>><?php _e('--- all albums ---', 'wp-photo-album-plus') ?></option>
|
100 |
<option value="0" <?php if ($parent == '0') echo 'selected="selected"' ?>><?php _e('--- all generic albums ---', 'wp-photo-album-plus') ?></option>
|
101 |
<option value="-1" <?php if ($parent == '-1') echo 'selected="selected"' ?>><?php _e('--- all separate albums ---', 'wp-photo-album-plus') ?></option>
|
102 |
+
<option value="owner" <?php if ($parent == 'owner') echo 'selected="selected"' ?>><?php _e('--- owner/public ---', 'wp-photo-album-plus') ?></option>
|
103 |
<?php $albs = $wpdb->get_results( "SELECT * FROM `".WPPA_ALBUMS."` ORDER BY `name`", ARRAY_A);
|
104 |
if ( $albs ) foreach( $albs as $alb ) {
|
105 |
echo '<option value="'.$alb['id'].'" ';
|
127 |
return $widgetid;
|
128 |
}
|
129 |
|
130 |
+
function do_album_navigator( $parent, $page, $skip, $propclass, $extraclause = '' ) {
|
131 |
global $wpdb;
|
132 |
static $level;
|
133 |
static $ca;
|
152 |
$w = $this->get_widget_id();
|
153 |
$p = $parent;
|
154 |
$result = '';
|
155 |
+
$albums = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_ALBUMS."` WHERE `a_parent` = %s ".$extraclause.wppa_get_album_order( max( '0', $parent ) ), $parent ), ARRAY_A );
|
156 |
wppa_dbg_q( 'Q-WidANav' );
|
157 |
if ( ! empty( $albums ) ) {
|
158 |
wppa_cache_album( 'add', $albums );
|
169 |
else $result .= '
|
170 |
<div style="width:12px;float:left;" > '.( $a == $ca ? '»' : '').'</div>';
|
171 |
$result .= '
|
172 |
+
<a href="'.wppa_encrypt_url(wppa_get_permalink( $page ).'&wppa-album='.$a.'&wppa-cover=0&wppa-occur=1'.$slide).'">'.wppa_get_album_name( $a ).'</a>
|
173 |
</li>';
|
174 |
$newpropclass = $propclass . ' p-'.$w.'-'.$p;
|
175 |
+
$result .= '<li class="anw-'.$w.'-'.$p.$propclass.'" style="list-style:none;" >' . $this->do_album_navigator( $a, $page, $skip, $newpropclass, $extraclause ) . '</li>';
|
176 |
}
|
177 |
}
|
178 |
$result .= '</ul>';
|
wppa-boxes-html.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*
|
9 |
*/
|
@@ -891,6 +891,7 @@ function wppa_get_tagcloud_html( $seltags = '', $minsize = '8', $maxsize = '24'
|
|
891 |
foreach ( $tags as $tag ) {
|
892 |
if ( ! $seltags || in_array( $tag['tag'], $selarr ) ) {
|
893 |
$href = $hr . '&wppa-tag=' . str_replace( ' ', '%20', $tag['tag'] );
|
|
|
894 |
$title = sprintf( '%d photos - %s%%', $tag['count'], $tag['fraction'] * '100' );
|
895 |
$name = $tag['tag'];
|
896 |
$size = floor( $minsize + $tag['fraction'] * $factor );
|
@@ -958,7 +959,7 @@ function wppa_get_multitag_html( $nperline = '2', $seltags = '' ) {
|
|
958 |
<script type="text/javascript">
|
959 |
function wppaProcessMultiTagRequest() {
|
960 |
var any = false;
|
961 |
-
var url="'
|
962 |
|
963 |
$result .= '
|
964 |
if ( jQuery( "#inverse-'.wppa( 'mocc' ).'" ).attr( "checked" ) ) {
|
@@ -1147,6 +1148,7 @@ global $wppa_locale;
|
|
1147 |
$share_url = wppa_get_image_page_url_by_id( $id, wppa_switch( 'share_single_image' ) );
|
1148 |
$share_url = str_replace( '&', '&', $share_url );
|
1149 |
}
|
|
|
1150 |
|
1151 |
// The share title
|
1152 |
$photo_name = wppa_get_photo_name( $id );
|
@@ -2296,6 +2298,7 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
|
|
2296 |
if ( wppa( 'page' ) ) $returnurl .= '&wppa-page=' . wppa( 'page' );
|
2297 |
$returnurl = trim( $returnurl, '?' );
|
2298 |
|
|
|
2299 |
|
2300 |
$result = '
|
2301 |
<div style="clear:both;"></div>
|
@@ -2417,7 +2420,6 @@ function wppa_user_albumedit_html( $alb, $width, $where = '', $mcr = false ) {
|
|
2417 |
// Build the html for the comment box
|
2418 |
function wppa_comment_html( $id, $comment_allowed ) {
|
2419 |
global $wpdb;
|
2420 |
-
global $current_user;
|
2421 |
global $wppa_first_comment_html;
|
2422 |
|
2423 |
$result = '';
|
@@ -2432,7 +2434,7 @@ global $wppa_first_comment_html;
|
|
2432 |
if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
|
2433 |
if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
|
2434 |
elseif ( is_user_logged_in() ) {
|
2435 |
-
|
2436 |
wppa( 'comment_user', $current_user->display_name ); //user_login;
|
2437 |
wppa( 'comment_email', $current_user->user_email );
|
2438 |
}
|
@@ -2669,10 +2671,10 @@ global $wppa_first_comment_html;
|
|
2669 |
'<table id="wppacommenttable-'.wppa( 'mocc' ).'" style="margin:0;">' .
|
2670 |
'<tbody>' .
|
2671 |
'<tr valign="top" style="' . $vis . '">' .
|
2672 |
-
'<td class="wppa-box-text wppa-td" style="width:30%;
|
2673 |
__( 'Your name:', 'wp-photo-album-plus' ) .
|
2674 |
'</td>' .
|
2675 |
-
'<td class="wppa-box-text wppa-td" style="width:70%;
|
2676 |
'<input' .
|
2677 |
' type="text"' .
|
2678 |
' name="wppa-comname"' .
|
@@ -2684,10 +2686,10 @@ global $wppa_first_comment_html;
|
|
2684 |
|
2685 |
if ( wppa_switch( 'comment_email_required' ) ) {
|
2686 |
$result .= '<tr valign="top" style="'.$vis.'">' .
|
2687 |
-
'<td class="wppa-box-text wppa-td" style="width:30%;
|
2688 |
__( 'Your email:', 'wp-photo-album-plus' ) .
|
2689 |
'</td>' .
|
2690 |
-
'<td class="wppa-box-text wppa-td" style="width:70%;
|
2691 |
'<input' .
|
2692 |
' type="text"' .
|
2693 |
' name="wppa-comemail"' .
|
@@ -2700,7 +2702,7 @@ global $wppa_first_comment_html;
|
|
2700 |
}
|
2701 |
|
2702 |
$result .= '<tr valign="top" style="vertical-align:top;">' .
|
2703 |
-
'<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:30%;
|
2704 |
__( 'Your comment:', 'wp-photo-album-plus' ) . '<br />' . wppa( 'comment_user' ) . '<br />';
|
2705 |
if ( ( is_user_logged_in() && wppa_opt( 'comment_captcha' ) == 'all' ) ||
|
2706 |
( ! is_user_logged_in() && wppa_opt( 'comment_captcha' ) != 'none' ) ) {
|
@@ -2723,7 +2725,7 @@ global $wppa_first_comment_html;
|
|
2723 |
'<input type="button" name="commentbtn" onclick="wppaAjaxComment( '.wppa( 'mocc' ).', '.$id.' )" value="'.$btn.'" style="margin:0 4px 0 0;" />' .
|
2724 |
'<img id="wppa-comment-spin-'.wppa( 'mocc' ).'" src="'.wppa_get_imgdir().'wpspin.gif" style="display:none;" />' .
|
2725 |
'</td>' .
|
2726 |
-
'<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:70%;
|
2727 |
|
2728 |
if ( wppa_switch( 'comment_smiley_picker' ) ) {
|
2729 |
$result .= wppa_get_smiley_picker_html( 'wppa-comment-'.wppa( 'mocc' ) );
|
@@ -3491,11 +3493,13 @@ global $wpdb;
|
|
3491 |
|
3492 |
if ( is_object( $date ) ) {
|
3493 |
|
3494 |
-
$ajaxurl =
|
|
|
3495 |
'wppa-calendar=exifdtm&' .
|
3496 |
'wppa-caldate=' . $keys[$day] . '&' .
|
3497 |
$alb_arg .
|
3498 |
-
'wppa-occur=1'
|
|
|
3499 |
|
3500 |
if ( $autoall ) {
|
3501 |
$onclick = '';
|
@@ -3551,11 +3555,13 @@ global $wpdb;
|
|
3551 |
|
3552 |
$date = $keys[$day];
|
3553 |
|
3554 |
-
$ajaxurl =
|
|
|
3555 |
'wppa-calendar='.$calendar_type.'&' .
|
3556 |
'wppa-caldate=' . $keys[$day] . '&' .
|
3557 |
$alb_arg .
|
3558 |
-
'wppa-occur=1'
|
|
|
3559 |
|
3560 |
if ( $autoall ) {
|
3561 |
$onclick = '';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various wppa boxes
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*
|
9 |
*/
|
891 |
foreach ( $tags as $tag ) {
|
892 |
if ( ! $seltags || in_array( $tag['tag'], $selarr ) ) {
|
893 |
$href = $hr . '&wppa-tag=' . str_replace( ' ', '%20', $tag['tag'] );
|
894 |
+
$href = wppa_encrypt_url( $href );
|
895 |
$title = sprintf( '%d photos - %s%%', $tag['count'], $tag['fraction'] * '100' );
|
896 |
$name = $tag['tag'];
|
897 |
$size = floor( $minsize + $tag['fraction'] * $factor );
|
959 |
<script type="text/javascript">
|
960 |
function wppaProcessMultiTagRequest() {
|
961 |
var any = false;
|
962 |
+
var url="'.wppa_encrypt_url($hr).'";';
|
963 |
|
964 |
$result .= '
|
965 |
if ( jQuery( "#inverse-'.wppa( 'mocc' ).'" ).attr( "checked" ) ) {
|
1148 |
$share_url = wppa_get_image_page_url_by_id( $id, wppa_switch( 'share_single_image' ) );
|
1149 |
$share_url = str_replace( '&', '&', $share_url );
|
1150 |
}
|
1151 |
+
$share_url = wppa_encrypt_url( $share_url );
|
1152 |
|
1153 |
// The share title
|
1154 |
$photo_name = wppa_get_photo_name( $id );
|
2298 |
if ( wppa( 'page' ) ) $returnurl .= '&wppa-page=' . wppa( 'page' );
|
2299 |
$returnurl = trim( $returnurl, '?' );
|
2300 |
|
2301 |
+
$returnurl = wppa_encrypt_url( $returnurl );
|
2302 |
|
2303 |
$result = '
|
2304 |
<div style="clear:both;"></div>
|
2420 |
// Build the html for the comment box
|
2421 |
function wppa_comment_html( $id, $comment_allowed ) {
|
2422 |
global $wpdb;
|
|
|
2423 |
global $wppa_first_comment_html;
|
2424 |
|
2425 |
$result = '';
|
2434 |
if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
|
2435 |
if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
|
2436 |
elseif ( is_user_logged_in() ) {
|
2437 |
+
$current_user = wp_get_current_user();
|
2438 |
wppa( 'comment_user', $current_user->display_name ); //user_login;
|
2439 |
wppa( 'comment_email', $current_user->user_email );
|
2440 |
}
|
2671 |
'<table id="wppacommenttable-'.wppa( 'mocc' ).'" style="margin:0;">' .
|
2672 |
'<tbody>' .
|
2673 |
'<tr valign="top" style="' . $vis . '">' .
|
2674 |
+
'<td class="wppa-box-text wppa-td" style="width:30%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >' .
|
2675 |
__( 'Your name:', 'wp-photo-album-plus' ) .
|
2676 |
'</td>' .
|
2677 |
+
'<td class="wppa-box-text wppa-td" style="width:70%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >' .
|
2678 |
'<input' .
|
2679 |
' type="text"' .
|
2680 |
' name="wppa-comname"' .
|
2686 |
|
2687 |
if ( wppa_switch( 'comment_email_required' ) ) {
|
2688 |
$result .= '<tr valign="top" style="'.$vis.'">' .
|
2689 |
+
'<td class="wppa-box-text wppa-td" style="width:30%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >' .
|
2690 |
__( 'Your email:', 'wp-photo-album-plus' ) .
|
2691 |
'</td>' .
|
2692 |
+
'<td class="wppa-box-text wppa-td" style="width:70%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >' .
|
2693 |
'<input' .
|
2694 |
' type="text"' .
|
2695 |
' name="wppa-comemail"' .
|
2702 |
}
|
2703 |
|
2704 |
$result .= '<tr valign="top" style="vertical-align:top;">' .
|
2705 |
+
'<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:30%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >' .
|
2706 |
__( 'Your comment:', 'wp-photo-album-plus' ) . '<br />' . wppa( 'comment_user' ) . '<br />';
|
2707 |
if ( ( is_user_logged_in() && wppa_opt( 'comment_captcha' ) == 'all' ) ||
|
2708 |
( ! is_user_logged_in() && wppa_opt( 'comment_captcha' ) != 'none' ) ) {
|
2725 |
'<input type="button" name="commentbtn" onclick="wppaAjaxComment( '.wppa( 'mocc' ).', '.$id.' )" value="'.$btn.'" style="margin:0 4px 0 0;" />' .
|
2726 |
'<img id="wppa-comment-spin-'.wppa( 'mocc' ).'" src="'.wppa_get_imgdir().'wpspin.gif" style="display:none;" />' .
|
2727 |
'</td>' .
|
2728 |
+
'<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:70%;background-color:transparent;'.__wcs( 'wppa-box-text' ).__wcs( 'wppa-td' ).'" >';
|
2729 |
|
2730 |
if ( wppa_switch( 'comment_smiley_picker' ) ) {
|
2731 |
$result .= wppa_get_smiley_picker_html( 'wppa-comment-'.wppa( 'mocc' ) );
|
3493 |
|
3494 |
if ( is_object( $date ) ) {
|
3495 |
|
3496 |
+
$ajaxurl = wppa_encrypt_url(
|
3497 |
+
wppa_get_ajaxlink('', '1') .
|
3498 |
'wppa-calendar=exifdtm&' .
|
3499 |
'wppa-caldate=' . $keys[$day] . '&' .
|
3500 |
$alb_arg .
|
3501 |
+
'wppa-occur=1'
|
3502 |
+
);
|
3503 |
|
3504 |
if ( $autoall ) {
|
3505 |
$onclick = '';
|
3555 |
|
3556 |
$date = $keys[$day];
|
3557 |
|
3558 |
+
$ajaxurl = wppa_encrypt_url(
|
3559 |
+
wppa_get_ajaxlink('', '1') .
|
3560 |
'wppa-calendar='.$calendar_type.'&' .
|
3561 |
'wppa-caldate=' . $keys[$day] . '&' .
|
3562 |
$alb_arg .
|
3563 |
+
'wppa-occur=1'
|
3564 |
+
);
|
3565 |
|
3566 |
if ( $autoall ) {
|
3567 |
$onclick = '';
|
wppa-breadcrumb.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -477,7 +477,7 @@ global $wppa_session;
|
|
477 |
}
|
478 |
else {
|
479 |
$s = wppa( 'src' ) ? '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) ) : '';
|
480 |
-
$onclick = "wppaDoAjaxRender( ".wppa( 'mocc' ).", '".wppa_get_album_url_ajax( wppa( 'start_album' ), '0' )."&wppa-photos-only=1".$s."', '".wppa_convert_to_pretty( wppa_get_album_url( wppa( 'start_album' ), '0' ).'&wppa-photos-only=1'.$s )."' )";
|
481 |
$fs = wppa_opt( 'fontsize_nav' );
|
482 |
if ( $fs != '' ) $fs += 3; else $fs = '15'; // iconsize = fontsize+3, Default to 15
|
483 |
$imgs = 'height: '.$fs.'px; margin:0 0 -3px 0; padding:0; box-shadow:none;';
|
@@ -503,6 +503,10 @@ global $wppa_session;
|
|
503 |
function wppa_bcitem( $value = '', $href = '', $title = '', $class = '', $ajax = '' ) {
|
504 |
static $sep;
|
505 |
|
|
|
|
|
|
|
|
|
506 |
// Convert url to pretty
|
507 |
$href = wppa_convert_to_pretty( $href );
|
508 |
|
@@ -510,11 +514,11 @@ static $sep;
|
|
510 |
if ( ! $value ) return; // No content
|
511 |
if ( $href ) {
|
512 |
wppa_out( '<a' .
|
513 |
-
( $ajax && wppa_switch( 'allow_ajax' ) ?
|
514 |
' onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax . '\', \'' . $href . '\' );"' :
|
515 |
' href="' . $href . '"' ) .
|
516 |
' class="wppa-nav-text ' . $class . '"' .
|
517 |
-
' style="' . __wcs( 'wppa-nav-text' ).'"' .
|
518 |
' title="' . esc_attr( $title ) . '" >' .
|
519 |
$value .
|
520 |
'</a>' );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Functions for breadcrumbs
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
477 |
}
|
478 |
else {
|
479 |
$s = wppa( 'src' ) ? '&wppa-searchstring='.urlencode( wppa( 'searchstring' ) ) : '';
|
480 |
+
$onclick = "wppaDoAjaxRender( ".wppa( 'mocc' ).", '".wppa_encrypt_url(wppa_get_album_url_ajax( wppa( 'start_album' ), '0' )."&wppa-photos-only=1".$s)."', '".wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( wppa( 'start_album' ), '0' ).'&wppa-photos-only=1'.$s ) )."' )";
|
481 |
$fs = wppa_opt( 'fontsize_nav' );
|
482 |
if ( $fs != '' ) $fs += 3; else $fs = '15'; // iconsize = fontsize+3, Default to 15
|
483 |
$imgs = 'height: '.$fs.'px; margin:0 0 -3px 0; padding:0; box-shadow:none;';
|
503 |
function wppa_bcitem( $value = '', $href = '', $title = '', $class = '', $ajax = '' ) {
|
504 |
static $sep;
|
505 |
|
506 |
+
// Encrypt
|
507 |
+
$href = wppa_encrypt_url( $href );
|
508 |
+
$ajax = wppa_encrypt_url( $ajax );
|
509 |
+
|
510 |
// Convert url to pretty
|
511 |
$href = wppa_convert_to_pretty( $href );
|
512 |
|
514 |
if ( ! $value ) return; // No content
|
515 |
if ( $href ) {
|
516 |
wppa_out( '<a' .
|
517 |
+
( $ajax && wppa_switch( 'allow_ajax' ) ?
|
518 |
' onclick="wppaDoAjaxRender(' . wppa( 'mocc' ) . ', \'' . $ajax . '\', \'' . $href . '\' );"' :
|
519 |
' href="' . $href . '"' ) .
|
520 |
' class="wppa-nav-text ' . $class . '"' .
|
521 |
+
' style="cursor:pointer;' . __wcs( 'wppa-nav-text' ).'"' .
|
522 |
' title="' . esc_attr( $title ) . '" >' .
|
523 |
$value .
|
524 |
'</a>' );
|
wppa-common-functions.php
CHANGED
@@ -1906,6 +1906,7 @@ global $wpdb;
|
|
1906 |
'addselected' => false,
|
1907 |
'addseparate' => false,
|
1908 |
'addselbox' => false,
|
|
|
1909 |
'disableancestors' => false,
|
1910 |
'checkaccess' => false,
|
1911 |
'checkowner' => false,
|
@@ -2007,6 +2008,12 @@ global $wpdb;
|
|
2007 |
__( '--- generic ---' , 'wp-photo-album-plus' ) .
|
2008 |
'</option>';
|
2009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2010 |
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
2011 |
if ( $args['addblank'] ) $result .=
|
2012 |
'<option value="0"'.$selected.' >' .
|
1906 |
'addselected' => false,
|
1907 |
'addseparate' => false,
|
1908 |
'addselbox' => false,
|
1909 |
+
'addowner' => false,
|
1910 |
'disableancestors' => false,
|
1911 |
'checkaccess' => false,
|
1912 |
'checkowner' => false,
|
2008 |
__( '--- generic ---' , 'wp-photo-album-plus' ) .
|
2009 |
'</option>';
|
2010 |
|
2011 |
+
$selected = $args['selected'] == '-3' ? ' selected="selected"' : '';
|
2012 |
+
if ( $args['addowner'] ) $result .=
|
2013 |
+
'<option value="-3"'.$selected.' >' .
|
2014 |
+
__( '--- owner/public ---' , 'wp-photo-album-plus' ) .
|
2015 |
+
'</option>';
|
2016 |
+
|
2017 |
$selected = $args['selected'] == '0' ? ' selected="selected"' : '';
|
2018 |
if ( $args['addblank'] ) $result .=
|
2019 |
'<option value="0"'.$selected.' >' .
|
wppa-encrypt.php
ADDED
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* wppa-encrypt.php
|
3 |
+
* Package: wp-photo-album-plus
|
4 |
+
*
|
5 |
+
* Contains all ecryption/decryption logic
|
6 |
+
* Version 6.4.00
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
|
10 |
+
// Find a unique photo crypt
|
11 |
+
function wppa_get_unique_photo_crypt() {
|
12 |
+
|
13 |
+
$cr = wppa_get_unique_crypt( WPPA_PHOTOS );
|
14 |
+
|
15 |
+
return $cr;
|
16 |
+
}
|
17 |
+
|
18 |
+
// Find a unique album crypt
|
19 |
+
function wppa_get_unique_album_crypt() {
|
20 |
+
|
21 |
+
$cr = wppa_get_unique_crypt( WPPA_ALBUMS );
|
22 |
+
while ( $cr == get_option( 'wppa_album_crypt_0', '' ) ||
|
23 |
+
$cr == get_option( 'wppa_album_crypt_1', '' ) ||
|
24 |
+
$cr == get_option( 'wppa_album_crypt_2', '' ) ||
|
25 |
+
$cr == get_option( 'wppa_album_crypt_3', '' )
|
26 |
+
) {
|
27 |
+
$cr = wppa_get_unique_crypt( WPPA_ALBUMS );
|
28 |
+
}
|
29 |
+
|
30 |
+
return $cr;
|
31 |
+
}
|
32 |
+
|
33 |
+
// Find a unique crypt
|
34 |
+
function wppa_get_unique_crypt( $table ) {
|
35 |
+
global $wpdb;
|
36 |
+
|
37 |
+
$crypt = substr( md5( microtime() ), 0, 12 );
|
38 |
+
$dup = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . $table . "` WHERE `crypt` = %s", $crypt ) );
|
39 |
+
while ( $dup ) {
|
40 |
+
sleep( 1 );
|
41 |
+
$crypt = substr( md5( microtime() ), 0, 12 );
|
42 |
+
$dup = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . $table . "` WHERE `crypt` = %s", $crypt ) );
|
43 |
+
}
|
44 |
+
return $crypt;
|
45 |
+
}
|
46 |
+
|
47 |
+
// Convert photo id to crypt
|
48 |
+
function wppa_encrypt_photo( $id ) {
|
49 |
+
|
50 |
+
// Feature enabled?
|
51 |
+
if ( ! wppa_switch( 'use_encrypted_links' ) ) {
|
52 |
+
return $id;
|
53 |
+
}
|
54 |
+
|
55 |
+
// Yes
|
56 |
+
if ( strlen( $id ) < 12 ) {
|
57 |
+
$crypt = wppa_get_photo_item( $id, 'crypt' );
|
58 |
+
}
|
59 |
+
else {
|
60 |
+
$crypt = $id; // Already encrypted
|
61 |
+
}
|
62 |
+
|
63 |
+
return $crypt;
|
64 |
+
}
|
65 |
+
|
66 |
+
// Convert album id to crypt
|
67 |
+
function wppa_encrypt_album( $album ) {
|
68 |
+
|
69 |
+
// Feature enabled?
|
70 |
+
if ( ! wppa_switch( 'use_encrypted_links' ) ) {
|
71 |
+
return $album;
|
72 |
+
}
|
73 |
+
|
74 |
+
// Yes. Decompose possible album enumeration
|
75 |
+
$album_ids = explode( '.', $album );
|
76 |
+
$album_crypts = array();
|
77 |
+
$i = 0;
|
78 |
+
|
79 |
+
// Process all tokens
|
80 |
+
while ( $i < count( $album_ids ) ) {
|
81 |
+
$id = $album_ids[$i];
|
82 |
+
switch ( $id ) {
|
83 |
+
case '-3':
|
84 |
+
$crypt = get_option( 'wppa_album_crypt_3', false );
|
85 |
+
break;
|
86 |
+
case '-2':
|
87 |
+
$crypt = get_option( 'wppa_album_crypt_2', false );
|
88 |
+
break;
|
89 |
+
case '-1':
|
90 |
+
$crypt = get_option( 'wppa_album_crypt_1', false );
|
91 |
+
break;
|
92 |
+
case '0':
|
93 |
+
$crypt = get_option( 'wppa_album_crypt_0', false );
|
94 |
+
break;
|
95 |
+
case '':
|
96 |
+
$crypt = '';
|
97 |
+
break;
|
98 |
+
default:
|
99 |
+
if ( strlen( $id ) < 12 ) {
|
100 |
+
$crypt = wppa_get_album_item( $id, 'crypt' );
|
101 |
+
}
|
102 |
+
else {
|
103 |
+
$crypt = $id; // Already encrypted
|
104 |
+
}
|
105 |
+
}
|
106 |
+
$album_crypts[$i] = $crypt;
|
107 |
+
$i++;
|
108 |
+
}
|
109 |
+
|
110 |
+
// Compose result
|
111 |
+
$result = implode( '.', $album_crypts );
|
112 |
+
|
113 |
+
return $result;
|
114 |
+
}
|
115 |
+
|
116 |
+
// Convert photo crypt to id
|
117 |
+
function wppa_decrypt_photo( $photo ) {
|
118 |
+
global $wpdb;
|
119 |
+
|
120 |
+
// Feature enabled?
|
121 |
+
if ( ! wppa_switch( 'use_encrypted_links' ) ) {
|
122 |
+
return $photo;
|
123 |
+
}
|
124 |
+
|
125 |
+
// Already decrypted?
|
126 |
+
if ( strlen( $photo ) < 12 ) {
|
127 |
+
wppa_log( 'War', 'Decrypted photo id found: ' . $photo . ' url: '. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], true );
|
128 |
+
if ( wppa_switch( 'use_encrypted_links' ) ) {
|
129 |
+
wppa_dbg_msg( __( 'Invalid photo identifier:', 'wp-photo-album-plus') . ' ' . $photo, 'red', 'force' );
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
return $photo;
|
133 |
+
}
|
134 |
+
|
135 |
+
// Yes
|
136 |
+
$id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_PHOTOS . "` WHERE `crypt` = %s", $photo ) );
|
137 |
+
if ( ! $id ) {
|
138 |
+
wppa_dbg_msg( 'Invalid photo identifier: ' . $photo, 'red', 'force' );
|
139 |
+
}
|
140 |
+
|
141 |
+
return $id;
|
142 |
+
}
|
143 |
+
|
144 |
+
// Convert album crypt to id
|
145 |
+
function wppa_decrypt_album( $album ) {
|
146 |
+
global $wpdb;
|
147 |
+
|
148 |
+
$mes_given = false;
|
149 |
+
|
150 |
+
// Feature enabled?
|
151 |
+
if ( ! wppa_switch( 'use_encrypted_links' ) ) {
|
152 |
+
return $album;
|
153 |
+
}
|
154 |
+
|
155 |
+
// Yes. Decompose possible album enumeration
|
156 |
+
$album_crypts = explode( '.', $album );
|
157 |
+
$album_ids = array();
|
158 |
+
$i = 0;
|
159 |
+
|
160 |
+
// Process all tokens
|
161 |
+
while ( $i < count( $album_crypts ) ) {
|
162 |
+
$crypt = $album_crypts[$i];
|
163 |
+
if ( $crypt === '' ) {
|
164 |
+
$id = '';
|
165 |
+
}
|
166 |
+
elseif ( $crypt == get_option( 'wppa_album_crypt_0', false ) ) {
|
167 |
+
$id = '0';
|
168 |
+
}
|
169 |
+
elseif ( $crypt == get_option( 'wppa_album_crypt_1', false ) ) {
|
170 |
+
$id = '-1';
|
171 |
+
}
|
172 |
+
elseif ( $crypt == get_option( 'wppa_album_crypt_2', false ) ) {
|
173 |
+
$id = '-2';
|
174 |
+
}
|
175 |
+
elseif ( $crypt == get_option( 'wppa_album_crypt_2', false ) ) {
|
176 |
+
$id = '-3';
|
177 |
+
}
|
178 |
+
else {
|
179 |
+
|
180 |
+
// Already decrypted?
|
181 |
+
if ( strlen( $crypt ) < 12 ) {
|
182 |
+
if ( ! $mes_given ) {
|
183 |
+
wppa_log( 'War', 'Decrypted album id found: ' . $crypt . ' in albumspec: ' . $album . ' url: '. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], true );
|
184 |
+
$mes_given = true;
|
185 |
+
}
|
186 |
+
$id = $crypt;
|
187 |
+
if ( wppa_switch( 'use_encrypted_links' ) ) {
|
188 |
+
wppa_dbg_msg( __('Invalid album identifier:', 'wp-photo-album-plus') . ' ' . $id, 'red', 'force' );
|
189 |
+
return '-9';
|
190 |
+
}
|
191 |
+
}
|
192 |
+
else {
|
193 |
+
$id = $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `" . WPPA_ALBUMS . "` WHERE `crypt` = %s", $crypt ) );
|
194 |
+
if ( ! $id ) {
|
195 |
+
wppa_log( 'Err', 'Invalid album identifier: ' . $album, true );
|
196 |
+
$id = '-9';
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
+
$album_ids[$i] = $id;
|
201 |
+
$i++;
|
202 |
+
}
|
203 |
+
|
204 |
+
// Compose result
|
205 |
+
$result = implode( '.', $album_ids );
|
206 |
+
|
207 |
+
return $result;
|
208 |
+
}
|
209 |
+
|
210 |
+
// Encrypt a full url
|
211 |
+
function wppa_encrypt_url( $url ) {
|
212 |
+
|
213 |
+
// Feature enabled?
|
214 |
+
if ( ! wppa_switch( 'use_encrypted_links' ) ) {
|
215 |
+
return $url;
|
216 |
+
}
|
217 |
+
|
218 |
+
// Querystring present?
|
219 |
+
if ( strpos( $url, '?' ) === false ) {
|
220 |
+
return $url;
|
221 |
+
}
|
222 |
+
|
223 |
+
// Has it & 's ?
|
224 |
+
if ( strpos( $url, '&' ) === false ) {
|
225 |
+
$hasamp = false;
|
226 |
+
}
|
227 |
+
else {
|
228 |
+
$hasamp = true;
|
229 |
+
}
|
230 |
+
|
231 |
+
// Disassemble url
|
232 |
+
$temp = explode( '?', $url );
|
233 |
+
|
234 |
+
// Has it a querystring?
|
235 |
+
if ( count( $temp ) == '1' ) {
|
236 |
+
return $url;
|
237 |
+
}
|
238 |
+
|
239 |
+
// Disassemble querystring
|
240 |
+
$qarray = explode( '&', str_replace( '&', '&', $temp['1'] ) );
|
241 |
+
|
242 |
+
// Search and replace album and photo ids by crypts
|
243 |
+
$i = 0;
|
244 |
+
while ( $i < count( $qarray ) ) {
|
245 |
+
$item = $qarray[$i];
|
246 |
+
$t = explode( '=', $item );
|
247 |
+
if ( isset( $t['1'] ) ) {
|
248 |
+
switch ( $t['0'] ) {
|
249 |
+
case 'wppa-album':
|
250 |
+
case 'album':
|
251 |
+
if ( ! $t['1'] ) $t['1'] = '0';
|
252 |
+
$t['1'] = wppa_encrypt_album( $t['1'] );
|
253 |
+
if ( ! $t['1'] ) {
|
254 |
+
wppa_dbg_msg( 'Error: Illegal album specification: ' . $item . ' (wppa_encrypt_url)', 'red', 'force' );
|
255 |
+
exit;
|
256 |
+
}
|
257 |
+
break;
|
258 |
+
case 'wppa-photo':
|
259 |
+
case 'photo':
|
260 |
+
$t['1'] = wppa_encrypt_photo( $t['1'] );
|
261 |
+
if ( ! $t['1'] ) {
|
262 |
+
wppa_dbg_msg( 'Error: Illegal photo specification: ' . $item . ' (wppa_encrypt_url)', 'red', 'force' );
|
263 |
+
exit;
|
264 |
+
}
|
265 |
+
break;
|
266 |
+
}
|
267 |
+
}
|
268 |
+
$item = implode( '=', $t );
|
269 |
+
$qarray[$i] = $item;
|
270 |
+
$i++;
|
271 |
+
}
|
272 |
+
|
273 |
+
// Re-assemble url
|
274 |
+
$temp['1'] = implode( '&', $qarray );
|
275 |
+
$newurl = implode( '?', $temp );
|
276 |
+
if ( $hasamp ) {
|
277 |
+
$newurl = str_replace( '&', '&', $newurl );
|
278 |
+
}
|
279 |
+
|
280 |
+
return $newurl;
|
281 |
+
}
|
282 |
+
|
wppa-featen-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the featured photos
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -40,16 +40,58 @@ class FeaTenWidget extends WP_Widget {
|
|
40 |
$album = $instance['album'];
|
41 |
$generic = ( $album == '-2' );
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
$widget_content = "\n".'<!-- WPPA+ FeaTen Widget start -->';
|
@@ -71,7 +113,7 @@ class FeaTenWidget extends WP_Widget {
|
|
71 |
if ($image) {
|
72 |
$no_album = !$album;
|
73 |
if ($no_album) $tit = __( 'View the featured photos', 'wp-photo-album-plus' ); else $tit = esc_attr(__(stripslashes($image['description'])));
|
74 |
-
$link = wppa_get_imglnk_a('featen', $image['id'], '', $tit, '', $no_album);
|
75 |
$file = wppa_get_thumb_path($image['id']);
|
76 |
$imgstyle_a = wppa_get_imgstyle_a( $image['id'], $file, $maxw, 'center', 'ttthumb' );
|
77 |
$imgstyle = $imgstyle_a['style'];
|
@@ -85,7 +127,7 @@ class FeaTenWidget extends WP_Widget {
|
|
85 |
if ($link) $title = esc_attr(stripslashes($link['title']));
|
86 |
else $title = '';
|
87 |
|
88 |
-
$album = '0';
|
89 |
$display = 'thumbs';
|
90 |
|
91 |
$widget_content .= wppa_get_the_widget_thumb('featen', $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents);
|
@@ -137,7 +179,7 @@ class FeaTenWidget extends WP_Widget {
|
|
137 |
<p><label for="<?php echo $this->get_field_id('album'); ?>"><?php _e('Album:', 'wp-photo-album-plus'); ?></label>
|
138 |
<select class="widefat" id="<?php echo $this->get_field_id('album'); ?>" name="<?php echo $this->get_field_name('album'); ?>" >
|
139 |
|
140 |
-
<?php echo wppa_album_select_a(array('selected' => $album, 'addall' => true, 'path' => wppa_switch('wppa_hier_albsel')))
|
141 |
|
142 |
</select>
|
143 |
</p>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the featured photos
|
6 |
+
* Version 6.4.00
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
40 |
$album = $instance['album'];
|
41 |
$generic = ( $album == '-2' );
|
42 |
|
43 |
+
// wppa( 'start_album', $album );
|
44 |
+
|
45 |
+
// if ( $generic ) {
|
46 |
+
// $album = '0';
|
47 |
+
// $max += '1000';
|
48 |
+
// }
|
49 |
+
|
50 |
+
switch( $album ) {
|
51 |
+
// owner/public
|
52 |
+
case '-3':
|
53 |
+
$temp = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `status` = 'featured' ORDER BY RAND(".wppa_get_randseed().") DESC", ARRAY_A );
|
54 |
+
if ( $temp ) {
|
55 |
+
$c = '0';
|
56 |
+
$thumbs = array();
|
57 |
+
while ( $c < $max && $c < count( $temp ) ) {
|
58 |
+
$alb = wppa_get_photo_item( $temp[$c]['id'], 'album' );
|
59 |
+
$own = wppa_get_album_item( $alb, 'owner' );
|
60 |
+
if ( $own == '---public---' || $own == wppa_get_user() ) {
|
61 |
+
$thumbs[] = $temp[$c];
|
62 |
+
}
|
63 |
+
$c++;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
else {
|
67 |
+
$thumbs = false;
|
68 |
+
}
|
69 |
+
break;
|
70 |
+
// generic
|
71 |
+
case '-2':
|
72 |
+
$temp = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `status` = 'featured' ORDER BY RAND(".wppa_get_randseed().") DESC", ARRAY_A );
|
73 |
+
if ( $temp ) {
|
74 |
+
$c = '0';
|
75 |
+
$thumbs = array();
|
76 |
+
while ( $c < $max && $c < count( $temp ) ) {
|
77 |
+
$alb = wppa_get_photo_item( $temp[$c]['id'], 'album' );
|
78 |
+
if ( ! wppa_is_separate( $alb ) ) {
|
79 |
+
$thumbs[] = $temp[$c];
|
80 |
+
}
|
81 |
+
$c++;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
$thumbs = false;
|
86 |
+
}
|
87 |
+
break;
|
88 |
+
// all
|
89 |
+
case '0':
|
90 |
+
$thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `status` = 'featured' ORDER BY RAND(".wppa_get_randseed().") DESC LIMIT " . $max, ARRAY_A );
|
91 |
+
break;
|
92 |
+
// album spec
|
93 |
+
default:
|
94 |
+
$thumbs = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `status`= 'featured' AND `album` = %s ORDER BY RAND(".wppa_get_randseed().") DESC LIMIT " . $max, $album ), ARRAY_A );
|
95 |
}
|
96 |
|
97 |
$widget_content = "\n".'<!-- WPPA+ FeaTen Widget start -->';
|
113 |
if ($image) {
|
114 |
$no_album = !$album;
|
115 |
if ($no_album) $tit = __( 'View the featured photos', 'wp-photo-album-plus' ); else $tit = esc_attr(__(stripslashes($image['description'])));
|
116 |
+
$link = wppa_get_imglnk_a('featen', $image['id'], '', $tit, '', $no_album, $album);
|
117 |
$file = wppa_get_thumb_path($image['id']);
|
118 |
$imgstyle_a = wppa_get_imgstyle_a( $image['id'], $file, $maxw, 'center', 'ttthumb' );
|
119 |
$imgstyle = $imgstyle_a['style'];
|
127 |
if ($link) $title = esc_attr(stripslashes($link['title']));
|
128 |
else $title = '';
|
129 |
|
130 |
+
// $album = '0';
|
131 |
$display = 'thumbs';
|
132 |
|
133 |
$widget_content .= wppa_get_the_widget_thumb('featen', $image, $album, $display, $link, $title, $imgurl, $imgstyle_a, $imgevents);
|
179 |
<p><label for="<?php echo $this->get_field_id('album'); ?>"><?php _e('Album:', 'wp-photo-album-plus'); ?></label>
|
180 |
<select class="widefat" id="<?php echo $this->get_field_id('album'); ?>" name="<?php echo $this->get_field_name('album'); ?>" >
|
181 |
|
182 |
+
<?php echo wppa_album_select_a(array('selected' => $album, 'addall' => true, 'addowner' => true, 'path' => wppa_switch('wppa_hier_albsel'))) ?>
|
183 |
|
184 |
</select>
|
185 |
</p>
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -96,7 +96,12 @@ global $wppa_session;
|
|
96 |
|
97 |
// Process query string
|
98 |
wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
|
|
|
|
|
99 |
wppa( 'start_album', wppa_get_get( 'album' ) );
|
|
|
|
|
|
|
100 |
wppa( 'is_cover', wppa_get_get( 'cover' ) );
|
101 |
wppa( 'is_slide', wppa_get_get( 'slide' ) || ( wppa_get_get( 'album' ) !== false && wppa_get_get( 'photo' ) ) );
|
102 |
if ( wppa( 'is_slide' ) ) {
|
@@ -171,6 +176,10 @@ global $wppa_session;
|
|
171 |
wppa( 'calendar', strip_tags( wppa_get_get( 'calendar' ) ) );
|
172 |
wppa( 'caldate', strip_tags( wppa_get_get( 'caldate' ) ) );
|
173 |
wppa( 'is_inverse', wppa_get_get( 'inv' ) );
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
|
176 |
// 2. wppa_albums is called directly. Assume any arg. If not, no worry, system defaults are used == generic
|
@@ -1909,7 +1918,7 @@ static $user;
|
|
1909 |
<div style="float:right; margin-right:6px;" >' .
|
1910 |
'<a' .
|
1911 |
' style="color:green;"' .
|
1912 |
-
' onclick="_wppaStop( '.wppa( 'mocc' ).' );wppaEditPhoto( '.wppa( 'mocc' ).', '
|
1913 |
' >' .
|
1914 |
__( 'Edit' , 'wp-photo-album-plus') .
|
1915 |
'</a>' .
|
@@ -1921,7 +1930,7 @@ static $user;
|
|
1921 |
' onclick="' .
|
1922 |
'_wppaStop( ' . wppa( 'mocc' ) . ' );' .
|
1923 |
esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
|
1924 |
-
'wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', '
|
1925 |
'>' .
|
1926 |
__( 'Delete' , 'wp-photo-album-plus') .
|
1927 |
'</a>' .
|
@@ -1961,18 +1970,22 @@ static $user;
|
|
1961 |
$result .= $fullname."','";
|
1962 |
$result .= $name."','";
|
1963 |
$result .= $desc."','";
|
1964 |
-
$result .= $id."','";
|
|
|
1965 |
$result .= $avgrat."','";
|
1966 |
$result .= $distext."','";
|
1967 |
$result .= $myrat."','";
|
1968 |
$result .= $url."','";
|
|
|
1969 |
$result .= $linkurl."','".$linktitle."','".$linktarget."','";
|
|
|
1970 |
$result .= wppa( 'in_widget_timeout' )."','";
|
1971 |
$result .= $comment."','";
|
1972 |
$result .= $iptc."','";
|
1973 |
$result .= $exif."','";
|
1974 |
$result .= $lbtitle."','";
|
1975 |
$result .= $shareurl."','"; // Used for history.pushstate()
|
|
|
1976 |
$result .= $sharehtml."','"; // The content of the SM ( share ) box
|
1977 |
$result .= $ogdsc."','";
|
1978 |
$result .= $hiresurl."','";
|
@@ -2370,7 +2383,7 @@ global $wpdb;
|
|
2370 |
$result .= 'wppaPopUp( ' .
|
2371 |
wppa( 'mocc' ) .
|
2372 |
', this, ' .
|
2373 |
-
$id .
|
2374 |
', \'' .
|
2375 |
$name .
|
2376 |
'\', \'' .
|
@@ -4326,7 +4339,7 @@ function wppa_get_lbtitle( $type, $id ) {
|
|
4326 |
' title="' . __( 'Download' , 'wp-photo-album-plus') . '"' .
|
4327 |
' style="cursor:pointer; margin-bottom:0px; max-width:500px;"' .
|
4328 |
' class="wppa-download-button"' .
|
4329 |
-
' onclick="wppaAjaxMakeOrigName( ' . wppa( 'mocc' ) . ', ' . $id .' );"' .
|
4330 |
' value="' . __( 'Download' , 'wp-photo-album-plus') . ': ' .
|
4331 |
wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) .
|
4332 |
'"' .
|
@@ -4336,7 +4349,7 @@ function wppa_get_lbtitle( $type, $id ) {
|
|
4336 |
$result .= '<a' .
|
4337 |
' title="' . __( 'Download' , 'wp-photo-album-plus') . '"' .
|
4338 |
' style="cursor:pointer;"' .
|
4339 |
-
' onclick="wppaAjaxMakeOrigName( '.wppa( 'mocc' ).', '
|
4340 |
' >' .
|
4341 |
__( 'Download' , 'wp-photo-album-plus') . ': ' .
|
4342 |
wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) .
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
96 |
|
97 |
// Process query string
|
98 |
wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
|
99 |
+
|
100 |
+
// Test validity of album arg
|
101 |
wppa( 'start_album', wppa_get_get( 'album' ) );
|
102 |
+
// if ( wppa( 'start_album' ) == '-9' ) exit;
|
103 |
+
// echo 'sa='.wppa( 'start_album' ).'<br />';
|
104 |
+
|
105 |
wppa( 'is_cover', wppa_get_get( 'cover' ) );
|
106 |
wppa( 'is_slide', wppa_get_get( 'slide' ) || ( wppa_get_get( 'album' ) !== false && wppa_get_get( 'photo' ) ) );
|
107 |
if ( wppa( 'is_slide' ) ) {
|
176 |
wppa( 'calendar', strip_tags( wppa_get_get( 'calendar' ) ) );
|
177 |
wppa( 'caldate', strip_tags( wppa_get_get( 'caldate' ) ) );
|
178 |
wppa( 'is_inverse', wppa_get_get( 'inv' ) );
|
179 |
+
|
180 |
+
// if ( ! isset( $_REQUEST['album'] ) && ! isset( $_REQUEST['wppa-album'] ) ) {
|
181 |
+
// wppa_dbg_msg( 'No album spec' . ( wppa_is_virtual() ? ' on virtual album' : ' on real album (0)' ) , 'red', 'force' );
|
182 |
+
// }
|
183 |
}
|
184 |
|
185 |
// 2. wppa_albums is called directly. Assume any arg. If not, no worry, system defaults are used == generic
|
1918 |
<div style="float:right; margin-right:6px;" >' .
|
1919 |
'<a' .
|
1920 |
' style="color:green;"' .
|
1921 |
+
' onclick="_wppaStop( '.wppa( 'mocc' ).' );wppaEditPhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').' ); return false;"' .
|
1922 |
' >' .
|
1923 |
__( 'Edit' , 'wp-photo-album-plus') .
|
1924 |
'</a>' .
|
1930 |
' onclick="' .
|
1931 |
'_wppaStop( ' . wppa( 'mocc' ) . ' );' .
|
1932 |
esc_attr( 'if ( confirm( "' . __( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus') . '" ) ) ' .
|
1933 |
+
'wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', '.esc_js('\''.wppa_encrypt_photo($thumb['id']).'\'').', true ); return false;' ).'"' .
|
1934 |
'>' .
|
1935 |
__( 'Delete' , 'wp-photo-album-plus') .
|
1936 |
'</a>' .
|
1970 |
$result .= $fullname."','";
|
1971 |
$result .= $name."','";
|
1972 |
$result .= $desc."','";
|
1973 |
+
$result .= wppa_encrypt_photo( $id )."','";
|
1974 |
+
wppa_dbg_msg('id='.$id, 'red');
|
1975 |
$result .= $avgrat."','";
|
1976 |
$result .= $distext."','";
|
1977 |
$result .= $myrat."','";
|
1978 |
$result .= $url."','";
|
1979 |
+
//wppa_dbg_msg('url='.$url, 'red');
|
1980 |
$result .= $linkurl."','".$linktitle."','".$linktarget."','";
|
1981 |
+
//wppa_dbg_msg('linkurl='.$linkurl, 'red');
|
1982 |
$result .= wppa( 'in_widget_timeout' )."','";
|
1983 |
$result .= $comment."','";
|
1984 |
$result .= $iptc."','";
|
1985 |
$result .= $exif."','";
|
1986 |
$result .= $lbtitle."','";
|
1987 |
$result .= $shareurl."','"; // Used for history.pushstate()
|
1988 |
+
//wppa_dbg_msg('shareurl='.$shareurl, 'red');
|
1989 |
$result .= $sharehtml."','"; // The content of the SM ( share ) box
|
1990 |
$result .= $ogdsc."','";
|
1991 |
$result .= $hiresurl."','";
|
2383 |
$result .= 'wppaPopUp( ' .
|
2384 |
wppa( 'mocc' ) .
|
2385 |
', this, ' .
|
2386 |
+
'\''.wppa_encrypt_photo($id) .'\''.
|
2387 |
', \'' .
|
2388 |
$name .
|
2389 |
'\', \'' .
|
4339 |
' title="' . __( 'Download' , 'wp-photo-album-plus') . '"' .
|
4340 |
' style="cursor:pointer; margin-bottom:0px; max-width:500px;"' .
|
4341 |
' class="wppa-download-button"' .
|
4342 |
+
' onclick="wppaAjaxMakeOrigName( ' . wppa( 'mocc' ) . ', \'' . wppa_encrypt_photo($id) .'\' );"' .
|
4343 |
' value="' . __( 'Download' , 'wp-photo-album-plus') . ': ' .
|
4344 |
wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) .
|
4345 |
'"' .
|
4349 |
$result .= '<a' .
|
4350 |
' title="' . __( 'Download' , 'wp-photo-album-plus') . '"' .
|
4351 |
' style="cursor:pointer;"' .
|
4352 |
+
' onclick="wppaAjaxMakeOrigName( '.wppa( 'mocc' ).', \''.wppa_encrypt_photo($id).'\' );"' .
|
4353 |
' >' .
|
4354 |
__( 'Download' , 'wp-photo-album-plus') . ': ' .
|
4355 |
wppa_get_photo_name( $id, wppa_switch( 'ovl_add_owner' ), false, false, wppa_switch( 'ovl_'.$type.'_name' ) ) .
|
wppa-htaccess.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -20,23 +20,34 @@ function wppa_create_wppa_htaccess() {
|
|
20 |
}
|
21 |
function wppa_create_wppa_htaccess_( $filename ) {
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
if ( $file ) {
|
26 |
|
27 |
// Make it
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
// Destroy it
|
36 |
-
|
37 |
-
fclose( $file );
|
38 |
@ unlink( $filename );
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
}
|
42 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various funcions
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
20 |
}
|
21 |
function wppa_create_wppa_htaccess_( $filename ) {
|
22 |
|
23 |
+
switch ( wppa_opt( 'cre_uploads_htaccess' ) ) {
|
|
|
|
|
24 |
|
25 |
// Make it
|
26 |
+
case 'grant':
|
27 |
+
$file = fopen( $filename, 'wb' );
|
28 |
+
if ( $file ) {
|
29 |
+
fwrite( $file, '<IfModule mod_rewrite.c>' );
|
30 |
+
fwrite( $file, "\n" . 'RewriteEngine Off' );
|
31 |
+
fwrite( $file, "\n" . '</IfModule>' );
|
32 |
+
fwrite( $file, "\n" . 'Order Allow,Deny' );
|
33 |
+
fwrite( $file, "\n" . 'Allow from all' );
|
34 |
+
fclose( $file );
|
35 |
+
}
|
36 |
+
break;
|
37 |
|
38 |
// Destroy it
|
39 |
+
case 'remove':
|
|
|
40 |
@ unlink( $filename );
|
41 |
+
break;
|
42 |
+
|
43 |
+
// Leave unchanged
|
44 |
+
case 'custom':
|
45 |
+
break;
|
46 |
+
|
47 |
+
// Unimplemented
|
48 |
+
default:
|
49 |
+
wppa_log( 'Err', 'Unimplemented choice for wppa_cre_uploads_htaccess ' . wppa_opt( 'cre_uploads_htaccess' ) );
|
50 |
+
break;
|
51 |
}
|
52 |
}
|
53 |
|
wppa-items.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -80,7 +80,7 @@ static $album_cache_2;
|
|
80 |
}
|
81 |
else {
|
82 |
wppa_dbg_msg( 'Album '.$id.' does not exist (cache album)', 'red' );
|
83 |
-
wppa_log( 'dbg', 'Album '.$id.' does not exist (cache album)' );
|
84 |
return false;
|
85 |
}
|
86 |
}
|
@@ -289,6 +289,7 @@ function wppa_get_photo_desc( $id, $do_shortcodes = false, $do_geo = false ) {
|
|
289 |
$desc = str_replace( 'w#hrurl', esc_attr( wppa_get_hires_url( $id ) ), $desc );
|
290 |
$desc = str_replace( 'w#tnurl', wppa_get_tnres_url( $id ), $desc );
|
291 |
$desc = str_replace( 'w#pl', wppa_get_source_pl( $id ), $desc );
|
|
|
292 |
|
293 |
// Art monkey sizes
|
294 |
if ( strpos( $desc, 'w#amx' ) !== false || strpos( $desc, 'w#amy' ) !== false || strpos( $desc, 'w#amfs' ) !== false ) {
|
@@ -370,19 +371,23 @@ function wppa_get_album_name( $id, $extended = false ) {
|
|
370 |
|
371 |
if ( $extended ) {
|
372 |
if ( $id == '0' ) {
|
373 |
-
$name =
|
374 |
return $name;
|
375 |
}
|
376 |
if ( $id == '-1' ) {
|
377 |
-
$name =
|
378 |
return $name;
|
379 |
}
|
380 |
if ( $id == '-2' ) {
|
381 |
-
$name =
|
|
|
|
|
|
|
|
|
382 |
return $name;
|
383 |
}
|
384 |
if ( $id == '-9' ) {
|
385 |
-
$name =
|
386 |
return $name;
|
387 |
}
|
388 |
if ( $extended == 'raw' ) {
|
@@ -392,9 +397,12 @@ function wppa_get_album_name( $id, $extended = false ) {
|
|
392 |
}
|
393 |
else {
|
394 |
if ( $id == '-2' ) {
|
395 |
-
$name =
|
396 |
return $name;
|
397 |
}
|
|
|
|
|
|
|
398 |
}
|
399 |
|
400 |
if ( ! $id ) return '';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains functions to retrieve album and photo items
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
80 |
}
|
81 |
else {
|
82 |
wppa_dbg_msg( 'Album '.$id.' does not exist (cache album)', 'red' );
|
83 |
+
wppa_log( 'dbg', 'Album '.$id.' does not exist (cache album)', true );
|
84 |
return false;
|
85 |
}
|
86 |
}
|
289 |
$desc = str_replace( 'w#hrurl', esc_attr( wppa_get_hires_url( $id ) ), $desc );
|
290 |
$desc = str_replace( 'w#tnurl', wppa_get_tnres_url( $id ), $desc );
|
291 |
$desc = str_replace( 'w#pl', wppa_get_source_pl( $id ), $desc );
|
292 |
+
$desc = str_replace( 'w#rating', wppa_get_rating_by_id( $id, 'nolabel' ), $desc );
|
293 |
|
294 |
// Art monkey sizes
|
295 |
if ( strpos( $desc, 'w#amx' ) !== false || strpos( $desc, 'w#amy' ) !== false || strpos( $desc, 'w#amfs' ) !== false ) {
|
371 |
|
372 |
if ( $extended ) {
|
373 |
if ( $id == '0' ) {
|
374 |
+
$name = __( '--- none ---', 'wp-photo-album-plus' );
|
375 |
return $name;
|
376 |
}
|
377 |
if ( $id == '-1' ) {
|
378 |
+
$name = __( '--- separate ---', 'wp-photo-album-plus' );
|
379 |
return $name;
|
380 |
}
|
381 |
if ( $id == '-2' ) {
|
382 |
+
$name = __( '--- all ---', 'wp-photo-album-plus' );
|
383 |
+
return $name;
|
384 |
+
}
|
385 |
+
if ( $id == '-3' ) {
|
386 |
+
$name = __( '--- owner/public ---', 'wp-photo-album-plus' );
|
387 |
return $name;
|
388 |
}
|
389 |
if ( $id == '-9' ) {
|
390 |
+
$name = __( '--- deleted ---', 'wp-photo-album-plus' );
|
391 |
return $name;
|
392 |
}
|
393 |
if ( $extended == 'raw' ) {
|
397 |
}
|
398 |
else {
|
399 |
if ( $id == '-2' ) {
|
400 |
+
$name = __( 'All Albums', 'wp-photo-album-plus' );
|
401 |
return $name;
|
402 |
}
|
403 |
+
if ( $id == '-3' ) {
|
404 |
+
$name = __( 'My and public albums', 'wp-photo-album-plus' );
|
405 |
+
}
|
406 |
}
|
407 |
|
408 |
if ( ! $id ) return '';
|
wppa-links.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -171,7 +171,7 @@ function wppa_get_image_page_url_by_id( $id, $single = false, $alb = false ) {
|
|
171 |
$result = wppa_get_permalink().'wppa-album='.$alb.'&wppa-photo='.$thumb['id'].'&wppa-cover=0&wppa-'.$w.'occur='.$occur;
|
172 |
if ( $single ) $result .= '&wppa-single=1';
|
173 |
|
174 |
-
return $result;
|
175 |
}
|
176 |
|
177 |
// get page url of current album image, ajax version
|
@@ -184,7 +184,7 @@ function wppa_get_image_url_ajax_by_id($id) {
|
|
184 |
$occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
|
185 |
$w = wppa_in_widget() ? 'w' : '';
|
186 |
|
187 |
-
return wppa_get_ajaxlink().'wppa-album='.$thumb['album'].'&wppa-photo='.$thumb['id'].'&wppa-cover=0&wppa-'.$w.'occur='.$occur;
|
188 |
}
|
189 |
|
190 |
// get link to album by id or in loop
|
@@ -209,7 +209,7 @@ function wppa_get_album_url( $id, $pag = '', $type = 'content', $occur = '0' ) {
|
|
209 |
}
|
210 |
}
|
211 |
else $link = '';
|
212 |
-
return $link;
|
213 |
}
|
214 |
|
215 |
// get link to album by id or in loop ajax version
|
@@ -228,7 +228,7 @@ function wppa_get_album_url_ajax( $id, $pag = '', $type = 'content' ) {
|
|
228 |
}
|
229 |
}
|
230 |
else $link = '';
|
231 |
-
return $link;
|
232 |
}
|
233 |
|
234 |
// get link to slideshow (in loop)
|
@@ -249,7 +249,7 @@ function wppa_get_slideshow_url($id, $page = '', $pid = '') {
|
|
249 |
$link = '';
|
250 |
}
|
251 |
|
252 |
-
return $link;
|
253 |
}
|
254 |
|
255 |
// get link to slideshow (in loop) ajax version
|
@@ -274,7 +274,7 @@ function wppa_get_slideshow_url_ajax($id, $page = '') {
|
|
274 |
$link = '';
|
275 |
}
|
276 |
|
277 |
-
return $link;
|
278 |
}
|
279 |
|
280 |
// Pretty links decode
|
@@ -838,7 +838,7 @@ function wppa_get_slide_callback_url( $id ) {
|
|
838 |
// if ( wppa( 'is_owner' ) ) $url .= 'wppa-owner=' . wppa( 'is_owner' ) . '&';
|
839 |
if ( wppa( 'is_upldr' ) ) $url .= 'wppa-upldr=' . wppa( 'is_upldr' ) . '&';
|
840 |
|
841 |
-
return $url;
|
842 |
}
|
843 |
|
844 |
function wppa_get_thumb_callback_url() {
|
@@ -860,7 +860,7 @@ function wppa_get_thumb_callback_url() {
|
|
860 |
|
861 |
$url = substr($url, 0, strlen($url) - 5); // remove last '&'
|
862 |
|
863 |
-
return $url;
|
864 |
}
|
865 |
|
866 |
function wppa_get_upldr_link( $user ) {
|
@@ -985,6 +985,10 @@ function wppa_page_links( $npages = '1', $curpage = '1', $slide = false ) {
|
|
985 |
$link_url = wppa_trim_wppa_( $link_url );
|
986 |
$ajax_url = wppa_trim_wppa_( $ajax_url );
|
987 |
|
|
|
|
|
|
|
|
|
988 |
// Adjust display range
|
989 |
$from = 1;
|
990 |
$to = $npages;
|
@@ -1181,7 +1185,7 @@ global $wpdb;
|
|
1181 |
if ( $page == '0' ) $page = '-1';
|
1182 |
if ( wppa_switch( 'coverimg_blank' ) ) $result['target'] = '_blank';
|
1183 |
if ( $type == 'slideshowstartatimage' ) {
|
1184 |
-
$result['url'] = wppa_get_slideshow_url( $album, $page, $id);
|
1185 |
$result['is_url'] = true;
|
1186 |
$result['is_lightbox'] = false;
|
1187 |
return $result;
|
@@ -1203,7 +1207,7 @@ global $wpdb;
|
|
1203 |
return $result;
|
1204 |
}
|
1205 |
if ( $type == 'thumbs' ) {
|
1206 |
-
$result['url'] = wppa_get_ss_to_tn_link( $page, $id );
|
1207 |
$result['title'] = __('View thumbnails', 'wp-photo-album-plus');
|
1208 |
$result['is_url'] = true;
|
1209 |
$result['is_lightbox'] = false;
|
@@ -1246,6 +1250,19 @@ global $wpdb;
|
|
1246 |
|
1247 |
// if ( wppa( 'is_upldr' ) ) $album = '0'; // probeersel upldr parent
|
1248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1249 |
if ( $id ) {
|
1250 |
$photo_name = wppa_get_photo_name( $id );
|
1251 |
}
|
@@ -1318,13 +1335,13 @@ global $wpdb;
|
|
1318 |
break;
|
1319 |
case '0':
|
1320 |
if ( $noalb ) {
|
1321 |
-
$result['url'] = wppa_get_permalink() . 'wppa-album=0&wppa-cover=0';
|
1322 |
$result['title'] = ''; // $album_name;
|
1323 |
$result['is_url'] = true;
|
1324 |
$result['is_lightbox'] = false;
|
1325 |
}
|
1326 |
else {
|
1327 |
-
$result['url'] = wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-cover=0';
|
1328 |
$result['title'] = $album_name;
|
1329 |
$result['is_url'] = true;
|
1330 |
$result['is_lightbox'] = false;
|
@@ -1332,13 +1349,13 @@ global $wpdb;
|
|
1332 |
break;
|
1333 |
default:
|
1334 |
if ( $noalb ) {
|
1335 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-album=0&wppa-cover=0';
|
1336 |
$result['title'] = ''; //$album_name;//'a++';
|
1337 |
$result['is_url'] = true;
|
1338 |
$result['is_lightbox'] = false;
|
1339 |
}
|
1340 |
else {
|
1341 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-cover=0';
|
1342 |
$result['title'] = $album_name;//'a++';
|
1343 |
$result['is_url'] = true;
|
1344 |
$result['is_lightbox'] = false;
|
@@ -1354,13 +1371,13 @@ global $wpdb;
|
|
1354 |
return false;
|
1355 |
break;
|
1356 |
case '0':
|
1357 |
-
$result['url'] = wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-cover=0';
|
1358 |
$result['title'] = $album_name;
|
1359 |
$result['is_url'] = true;
|
1360 |
$result['is_lightbox'] = false;
|
1361 |
break;
|
1362 |
default:
|
1363 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-cover=0';
|
1364 |
$result['title'] = $album_name;//'a++';
|
1365 |
$result['is_url'] = true;
|
1366 |
$result['is_lightbox'] = false;
|
@@ -1381,13 +1398,13 @@ global $wpdb;
|
|
1381 |
break;
|
1382 |
case '0':
|
1383 |
if ( $noalb ) {
|
1384 |
-
$result['url'] = wppa_get_permalink() . 'wppa-album=0&wppa-photo=' . $id . $si;
|
1385 |
$result['title'] = $title;
|
1386 |
$result['is_url'] = true;
|
1387 |
$result['is_lightbox'] = false;
|
1388 |
}
|
1389 |
else {
|
1390 |
-
$result['url'] = wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-photo=' . $id . $si;
|
1391 |
$result['title'] = $title;
|
1392 |
$result['is_url'] = true;
|
1393 |
$result['is_lightbox'] = false;
|
@@ -1395,13 +1412,13 @@ global $wpdb;
|
|
1395 |
break;
|
1396 |
default:
|
1397 |
if ( $noalb ) {
|
1398 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-album=0&wppa-photo=' . $id . $si;
|
1399 |
$result['title'] = $title;
|
1400 |
$result['is_url'] = true;
|
1401 |
$result['is_lightbox'] = false;
|
1402 |
}
|
1403 |
else {
|
1404 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-photo=' . $id . $si;
|
1405 |
$result['title'] = $title;
|
1406 |
$result['is_url'] = true;
|
1407 |
$result['is_lightbox'] = false;
|
@@ -1415,13 +1432,13 @@ global $wpdb;
|
|
1415 |
return false;
|
1416 |
break;
|
1417 |
case '0':
|
1418 |
-
$result['url'] = wppa_get_permalink() . 'wppa-photo=' . $id;
|
1419 |
$result['title'] = $title;
|
1420 |
$result['is_url'] = true;
|
1421 |
$result['is_lightbox'] = false;
|
1422 |
break;
|
1423 |
default:
|
1424 |
-
$result['url'] = wppa_get_permalink( $page ) . 'wppa-photo=' . $id;
|
1425 |
$result['title'] = $title;
|
1426 |
$result['is_url'] = true;
|
1427 |
$result['is_lightbox'] = false;
|
@@ -1473,7 +1490,7 @@ global $wpdb;
|
|
1473 |
}
|
1474 |
break;
|
1475 |
case 'slide': // for album widget
|
1476 |
-
$result['url'] = wppa_get_permalink( wppa_opt( 'album_widget_linkpage' ) ) . 'wppa-album=' . $album . '&slide';
|
1477 |
$result['title'] = '';
|
1478 |
$result['is_url'] = true;
|
1479 |
$result['is_lightbox'] = false;
|
@@ -1570,6 +1587,7 @@ global $wpdb;
|
|
1570 |
$w = wppa_in_widget() ? 'w' : '';
|
1571 |
}
|
1572 |
$result['url'] .= '&wppa-' . $w . 'occur=' . $occur;
|
|
|
1573 |
$result['url'] = wppa_convert_to_pretty( $result['url'] );
|
1574 |
|
1575 |
if ( $result['title'] == '' ) $result['title'] = $tit; // If still nothing, try arg
|
@@ -1670,7 +1688,7 @@ global $thumbs_ids;
|
|
1670 |
// Make sure the clicked photos thumb is highligted
|
1671 |
$thumbhref .='&wppa-hilite='.$id;
|
1672 |
|
1673 |
-
$thumbhref = wppa_convert_to_pretty( wppa_trim_wppa_( $thumbhref ) );
|
1674 |
|
1675 |
return $thumbhref;
|
1676 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Frontend links
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
171 |
$result = wppa_get_permalink().'wppa-album='.$alb.'&wppa-photo='.$thumb['id'].'&wppa-cover=0&wppa-'.$w.'occur='.$occur;
|
172 |
if ( $single ) $result .= '&wppa-single=1';
|
173 |
|
174 |
+
return wppa_encrypt_url( $result );
|
175 |
}
|
176 |
|
177 |
// get page url of current album image, ajax version
|
184 |
$occur = wppa_in_widget() ? wppa( 'widget_occur' ) : wppa( 'occur' );
|
185 |
$w = wppa_in_widget() ? 'w' : '';
|
186 |
|
187 |
+
return wppa_encrypt_url( wppa_get_ajaxlink().'wppa-album='.$thumb['album'].'&wppa-photo='.$thumb['id'].'&wppa-cover=0&wppa-'.$w.'occur='.$occur );
|
188 |
}
|
189 |
|
190 |
// get link to album by id or in loop
|
209 |
}
|
210 |
}
|
211 |
else $link = '';
|
212 |
+
return wppa_encrypt_url( $link );
|
213 |
}
|
214 |
|
215 |
// get link to album by id or in loop ajax version
|
228 |
}
|
229 |
}
|
230 |
else $link = '';
|
231 |
+
return wppa_encrypt_url( $link );
|
232 |
}
|
233 |
|
234 |
// get link to slideshow (in loop)
|
249 |
$link = '';
|
250 |
}
|
251 |
|
252 |
+
return wppa_encrypt_url( $link );
|
253 |
}
|
254 |
|
255 |
// get link to slideshow (in loop) ajax version
|
274 |
$link = '';
|
275 |
}
|
276 |
|
277 |
+
return wppa_encrypt_url( $link );
|
278 |
}
|
279 |
|
280 |
// Pretty links decode
|
838 |
// if ( wppa( 'is_owner' ) ) $url .= 'wppa-owner=' . wppa( 'is_owner' ) . '&';
|
839 |
if ( wppa( 'is_upldr' ) ) $url .= 'wppa-upldr=' . wppa( 'is_upldr' ) . '&';
|
840 |
|
841 |
+
return wppa_encrypt_url( $url );
|
842 |
}
|
843 |
|
844 |
function wppa_get_thumb_callback_url() {
|
860 |
|
861 |
$url = substr($url, 0, strlen($url) - 5); // remove last '&'
|
862 |
|
863 |
+
return wppa_encrypt_url( $url );
|
864 |
}
|
865 |
|
866 |
function wppa_get_upldr_link( $user ) {
|
985 |
$link_url = wppa_trim_wppa_( $link_url );
|
986 |
$ajax_url = wppa_trim_wppa_( $ajax_url );
|
987 |
|
988 |
+
// Encrypt
|
989 |
+
$link_url = wppa_encrypt_url( $link_url );
|
990 |
+
$ajax_url = wppa_encrypt_url( $ajax_url );
|
991 |
+
|
992 |
// Adjust display range
|
993 |
$from = 1;
|
994 |
$to = $npages;
|
1185 |
if ( $page == '0' ) $page = '-1';
|
1186 |
if ( wppa_switch( 'coverimg_blank' ) ) $result['target'] = '_blank';
|
1187 |
if ( $type == 'slideshowstartatimage' ) {
|
1188 |
+
$result['url'] = wppa_encrypt_url( wppa_get_slideshow_url( $album, $page, $id) );
|
1189 |
$result['is_url'] = true;
|
1190 |
$result['is_lightbox'] = false;
|
1191 |
return $result;
|
1207 |
return $result;
|
1208 |
}
|
1209 |
if ( $type == 'thumbs' ) {
|
1210 |
+
$result['url'] = wppa_encrypt_url( wppa_get_ss_to_tn_link( $page, $id ) );
|
1211 |
$result['title'] = __('View thumbnails', 'wp-photo-album-plus');
|
1212 |
$result['is_url'] = true;
|
1213 |
$result['is_lightbox'] = false;
|
1250 |
|
1251 |
// if ( wppa( 'is_upldr' ) ) $album = '0'; // probeersel upldr parent
|
1252 |
|
1253 |
+
// owner/public?
|
1254 |
+
if ( $album == '-3' ) {
|
1255 |
+
$temp = $wpdb->get_results( "SELECT `id` FROM `" . WPPA_ALBUMS . "` WHERE `owner` = '" . wppa_get_user() . "' OR `owner` = '--- public ---' ORDER BY `id`", ARRAY_A );
|
1256 |
+
$album = '';
|
1257 |
+
if ( $temp ) {
|
1258 |
+
foreach( $temp as $t ) {
|
1259 |
+
$album .= '.' . $t['id'];
|
1260 |
+
}
|
1261 |
+
$album = ltrim( $album, '.' );
|
1262 |
+
}
|
1263 |
+
$album = wppa_compress_enum( $album );
|
1264 |
+
}
|
1265 |
+
|
1266 |
if ( $id ) {
|
1267 |
$photo_name = wppa_get_photo_name( $id );
|
1268 |
}
|
1335 |
break;
|
1336 |
case '0':
|
1337 |
if ( $noalb ) {
|
1338 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=0&wppa-cover=0' );
|
1339 |
$result['title'] = ''; // $album_name;
|
1340 |
$result['is_url'] = true;
|
1341 |
$result['is_lightbox'] = false;
|
1342 |
}
|
1343 |
else {
|
1344 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-cover=0' );
|
1345 |
$result['title'] = $album_name;
|
1346 |
$result['is_url'] = true;
|
1347 |
$result['is_lightbox'] = false;
|
1349 |
break;
|
1350 |
default:
|
1351 |
if ( $noalb ) {
|
1352 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=0&wppa-cover=0' );
|
1353 |
$result['title'] = ''; //$album_name;//'a++';
|
1354 |
$result['is_url'] = true;
|
1355 |
$result['is_lightbox'] = false;
|
1356 |
}
|
1357 |
else {
|
1358 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-cover=0' );
|
1359 |
$result['title'] = $album_name;//'a++';
|
1360 |
$result['is_url'] = true;
|
1361 |
$result['is_lightbox'] = false;
|
1371 |
return false;
|
1372 |
break;
|
1373 |
case '0':
|
1374 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-cover=0' );
|
1375 |
$result['title'] = $album_name;
|
1376 |
$result['is_url'] = true;
|
1377 |
$result['is_lightbox'] = false;
|
1378 |
break;
|
1379 |
default:
|
1380 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-cover=0' );
|
1381 |
$result['title'] = $album_name;//'a++';
|
1382 |
$result['is_url'] = true;
|
1383 |
$result['is_lightbox'] = false;
|
1398 |
break;
|
1399 |
case '0':
|
1400 |
if ( $noalb ) {
|
1401 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=0&wppa-photo=' . $id . $si );
|
1402 |
$result['title'] = $title;
|
1403 |
$result['is_url'] = true;
|
1404 |
$result['is_lightbox'] = false;
|
1405 |
}
|
1406 |
else {
|
1407 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-album=' . $album . '&wppa-photo=' . $id . $si );
|
1408 |
$result['title'] = $title;
|
1409 |
$result['is_url'] = true;
|
1410 |
$result['is_lightbox'] = false;
|
1412 |
break;
|
1413 |
default:
|
1414 |
if ( $noalb ) {
|
1415 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=0&wppa-photo=' . $id . $si );
|
1416 |
$result['title'] = $title;
|
1417 |
$result['is_url'] = true;
|
1418 |
$result['is_lightbox'] = false;
|
1419 |
}
|
1420 |
else {
|
1421 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-album=' . $album . '&wppa-photo=' . $id . $si );
|
1422 |
$result['title'] = $title;
|
1423 |
$result['is_url'] = true;
|
1424 |
$result['is_lightbox'] = false;
|
1432 |
return false;
|
1433 |
break;
|
1434 |
case '0':
|
1435 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink() . 'wppa-photo=' . $id );
|
1436 |
$result['title'] = $title;
|
1437 |
$result['is_url'] = true;
|
1438 |
$result['is_lightbox'] = false;
|
1439 |
break;
|
1440 |
default:
|
1441 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( $page ) . 'wppa-photo=' . $id );
|
1442 |
$result['title'] = $title;
|
1443 |
$result['is_url'] = true;
|
1444 |
$result['is_lightbox'] = false;
|
1490 |
}
|
1491 |
break;
|
1492 |
case 'slide': // for album widget
|
1493 |
+
$result['url'] = wppa_encrypt_url( wppa_get_permalink( wppa_opt( 'album_widget_linkpage' ) ) . 'wppa-album=' . $album . '&slide' );
|
1494 |
$result['title'] = '';
|
1495 |
$result['is_url'] = true;
|
1496 |
$result['is_lightbox'] = false;
|
1587 |
$w = wppa_in_widget() ? 'w' : '';
|
1588 |
}
|
1589 |
$result['url'] .= '&wppa-' . $w . 'occur=' . $occur;
|
1590 |
+
$result['url'] = wppa_encrypt_url( $result['url'] );
|
1591 |
$result['url'] = wppa_convert_to_pretty( $result['url'] );
|
1592 |
|
1593 |
if ( $result['title'] == '' ) $result['title'] = $tit; // If still nothing, try arg
|
1688 |
// Make sure the clicked photos thumb is highligted
|
1689 |
$thumbhref .='&wppa-hilite='.$id;
|
1690 |
|
1691 |
+
$thumbhref = wppa_convert_to_pretty( wppa_trim_wppa_( wppa_encrypt_url( $thumbhref ) ) );
|
1692 |
|
1693 |
return $thumbhref;
|
1694 |
}
|
wppa-maintenance.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -52,6 +52,9 @@ global $wppa_supported_audio_extensions;
|
|
52 |
'wppa_sanitize_tags',
|
53 |
'wppa_sanitize_cats',
|
54 |
'wppa_test_proc',
|
|
|
|
|
|
|
55 |
|
56 |
);
|
57 |
foreach ( array_keys( $all_slugs ) as $key ) {
|
@@ -136,6 +139,13 @@ global $wppa_supported_audio_extensions;
|
|
136 |
wppa_exit();
|
137 |
}
|
138 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
}
|
141 |
wppa_save_session();
|
@@ -148,6 +158,7 @@ global $wppa_supported_audio_extensions;
|
|
148 |
case 'wppa_remake_index_albums':
|
149 |
case 'wppa_remove_empty_albums':
|
150 |
case 'wppa_sanitize_cats':
|
|
|
151 |
|
152 |
// Process albums
|
153 |
$table = WPPA_ALBUMS;
|
@@ -183,6 +194,11 @@ global $wppa_supported_audio_extensions;
|
|
183 |
}
|
184 |
break;
|
185 |
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
187 |
// Test for timeout / ready
|
188 |
$lastid = $id;
|
@@ -217,6 +233,7 @@ global $wppa_supported_audio_extensions;
|
|
217 |
case 'wppa_edit_tag':
|
218 |
case 'wppa_sync_cloud':
|
219 |
case 'wppa_sanitize_tags':
|
|
|
220 |
case 'wppa_test_proc':
|
221 |
|
222 |
// Process photos
|
@@ -543,6 +560,10 @@ global $wppa_supported_audio_extensions;
|
|
543 |
}
|
544 |
break;
|
545 |
|
|
|
|
|
|
|
|
|
546 |
case 'wppa_test_proc':
|
547 |
$tags = '';
|
548 |
$albid = $photo['album'];
|
@@ -851,36 +872,46 @@ global $wpdb;
|
|
851 |
<thead>
|
852 |
<tr>
|
853 |
<th>Id</th>
|
854 |
-
|
855 |
<th>IP</th>
|
856 |
<th>Started</th>
|
857 |
<th>Count</th>
|
858 |
<th>Data</th>
|
|
|
859 |
</tr>
|
860 |
-
<tr><td colspan="
|
861 |
</thead>
|
862 |
-
<tbody>';
|
863 |
foreach ( $sessions as $session ) {
|
864 |
$data = unserialize( $session['data'] );
|
865 |
$result .= '
|
866 |
<tr>
|
867 |
<td>'.$session['id'].'</td>
|
868 |
-
|
869 |
<td>'.$session['ip'].'</td>
|
870 |
<td style="width:150px;" >'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), $session['timestamp']).'</td>
|
871 |
<td>'.$session['count'].'</td>' .
|
872 |
-
'<td style="border-bottom:1px solid gray;" >';
|
873 |
foreach ( array_keys( $data ) as $key ) {
|
874 |
-
if (
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
|
|
|
|
881 |
}
|
882 |
}
|
883 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
884 |
</tr>';
|
885 |
}
|
886 |
$result .= '
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains (not yet, but in the future maybe) all the maintenance routines
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
52 |
'wppa_sanitize_tags',
|
53 |
'wppa_sanitize_cats',
|
54 |
'wppa_test_proc',
|
55 |
+
'wppa_crypt_photos',
|
56 |
+
'wppa_crypt_albums',
|
57 |
+
|
58 |
|
59 |
);
|
60 |
foreach ( array_keys( $all_slugs ) as $key ) {
|
139 |
wppa_exit();
|
140 |
}
|
141 |
break;
|
142 |
+
case 'wppa_crypt_albums':
|
143 |
+
update_option( 'wppa_album_crypt_0', wppa_get_unique_photo_crypt() );
|
144 |
+
update_option( 'wppa_album_crypt_1', wppa_get_unique_photo_crypt() );
|
145 |
+
update_option( 'wppa_album_crypt_2', wppa_get_unique_photo_crypt() );
|
146 |
+
update_option( 'wppa_album_crypt_3', wppa_get_unique_photo_crypt() );
|
147 |
+
break;
|
148 |
+
|
149 |
|
150 |
}
|
151 |
wppa_save_session();
|
158 |
case 'wppa_remake_index_albums':
|
159 |
case 'wppa_remove_empty_albums':
|
160 |
case 'wppa_sanitize_cats':
|
161 |
+
case 'wppa_crypt_albums':
|
162 |
|
163 |
// Process albums
|
164 |
$table = WPPA_ALBUMS;
|
194 |
}
|
195 |
break;
|
196 |
|
197 |
+
case 'wppa_crypt_albums':
|
198 |
+
wppa_update_album( array( 'id' => $album['id'], 'crypt' => wppa_get_unique_album_crypt() ) );
|
199 |
+
break;
|
200 |
+
|
201 |
+
|
202 |
}
|
203 |
// Test for timeout / ready
|
204 |
$lastid = $id;
|
233 |
case 'wppa_edit_tag':
|
234 |
case 'wppa_sync_cloud':
|
235 |
case 'wppa_sanitize_tags':
|
236 |
+
case 'wppa_crypt_photos':
|
237 |
case 'wppa_test_proc':
|
238 |
|
239 |
// Process photos
|
560 |
}
|
561 |
break;
|
562 |
|
563 |
+
case 'wppa_crypt_photos':
|
564 |
+
wppa_update_photo( array( 'id' => $photo['id'], 'crypt' => wppa_get_unique_photo_crypt() ) );
|
565 |
+
break;
|
566 |
+
|
567 |
case 'wppa_test_proc':
|
568 |
$tags = '';
|
569 |
$albid = $photo['album'];
|
872 |
<thead>
|
873 |
<tr>
|
874 |
<th>Id</th>
|
875 |
+
|
876 |
<th>IP</th>
|
877 |
<th>Started</th>
|
878 |
<th>Count</th>
|
879 |
<th>Data</th>
|
880 |
+
<th>Uris</th>
|
881 |
</tr>
|
882 |
+
<tr><td colspan="7"><hr /></td></tr>
|
883 |
</thead>
|
884 |
+
<tbody style="overflow:auto;" >';
|
885 |
foreach ( $sessions as $session ) {
|
886 |
$data = unserialize( $session['data'] );
|
887 |
$result .= '
|
888 |
<tr>
|
889 |
<td>'.$session['id'].'</td>
|
890 |
+
|
891 |
<td>'.$session['ip'].'</td>
|
892 |
<td style="width:150px;" >'.wppa_local_date(get_option('date_format', "F j, Y,").' '.get_option('time_format', "g:i a"), $session['timestamp']).'</td>
|
893 |
<td>'.$session['count'].'</td>' .
|
894 |
+
'<td style="border-bottom:1px solid gray;max-width:300px;" >';
|
895 |
foreach ( array_keys( $data ) as $key ) {
|
896 |
+
if ( $key != 'uris' ) {
|
897 |
+
if ( is_array( $data[$key] ) ) {
|
898 |
+
$result .= '['.$key.'] => Array('.
|
899 |
+
implode( ',', array_keys($data[$key]) ) .
|
900 |
+
')<br />';
|
901 |
+
}
|
902 |
+
else {
|
903 |
+
$result .= '['.$key.'] => '.$data[$key].'<br />';
|
904 |
+
}
|
905 |
}
|
906 |
}
|
907 |
+
$result .= '
|
908 |
+
</td>
|
909 |
+
<td style="border-bottom:1px solid gray;" >';
|
910 |
+
foreach ( $data['uris'] as $uri ) {
|
911 |
+
$result .= $uri.'<br />';
|
912 |
+
}
|
913 |
+
$result .= '
|
914 |
+
</td>
|
915 |
</tr>';
|
916 |
}
|
917 |
$result .= '
|
wppa-non-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -106,9 +106,14 @@ global $wpdb;
|
|
106 |
// To make sure we are on a page that contains at least %%wppa%% we check for Get var 'wppa-album'.
|
107 |
// This also narrows the selection of featured photos to those that exist in the current album.
|
108 |
$done = array();
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
if ( wppa_switch( 'meta_page' ) ) {
|
111 |
-
$album = wppa_get_get( 'album' );
|
112 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `album` = %s AND `status` = 'featured'", $album ), ARRAY_A );
|
113 |
wppa_dbg_q( 'Q-meta1' );
|
114 |
wppa_cache_photo( 'add', $photos );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
106 |
// To make sure we are on a page that contains at least %%wppa%% we check for Get var 'wppa-album'.
|
107 |
// This also narrows the selection of featured photos to those that exist in the current album.
|
108 |
$done = array();
|
109 |
+
$album = '';
|
110 |
+
if ( isset( $_REQUEST['album'] ) ) $album = $_REQUEST['album'];
|
111 |
+
elseif ( isset( $_REQUEST['wppa-album'] ) ) $album = $_REQUEST['wppa-album'];
|
112 |
+
$album = strip_tags( $album );
|
113 |
+
if ( strlen( $album == 12 ) ) $album = wppa_get_get( 'album' );
|
114 |
+
|
115 |
+
if ( $album ) {
|
116 |
if ( wppa_switch( 'meta_page' ) ) {
|
|
|
117 |
$photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `album` = %s AND `status` = 'featured'", $album ), ARRAY_A );
|
118 |
wppa_dbg_q( 'Q-meta1' );
|
119 |
wppa_cache_photo( 'add', $photos );
|
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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -176,6 +176,7 @@ global $wpdb;
|
|
176 |
<th>
|
177 |
<label ><?php echo 'ID = '.$photo['id'].'. '.__( 'Preview:' , 'wp-photo-album-plus'); ?></label>
|
178 |
<br />
|
|
|
179 |
<?php echo sprintf( __( 'Album: %d<br />(%s)' , 'wp-photo-album-plus'), $photo['album'], wppa_get_album_name( $photo['album'] ) ) ?>
|
180 |
<br /><br />
|
181 |
<?php if ( ! $is_video ) { ?>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* edit and delete photos
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
176 |
<th>
|
177 |
<label ><?php echo 'ID = '.$photo['id'].'. '.__( 'Preview:' , 'wp-photo-album-plus'); ?></label>
|
178 |
<br />
|
179 |
+
<?php echo __( 'Crypt' ) . ': ' . $photo['crypt'] . '<br/>' ?>
|
180 |
<?php echo sprintf( __( 'Album: %d<br />(%s)' , 'wp-photo-album-plus'), $photo['album'], wppa_get_album_name( $photo['album'] ) ) ?>
|
181 |
<br /><br />
|
182 |
<?php if ( ! $is_video ) { ?>
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -125,6 +125,7 @@ global $wppa_session;
|
|
125 |
'ajax' => '0',
|
126 |
'user' => '',
|
127 |
'id' => $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `".WPPA_SESSION."` WHERE `session` = %s LIMIT 1", wppa_get_session_id() ) ),
|
|
|
128 |
|
129 |
);
|
130 |
|
@@ -132,6 +133,9 @@ global $wppa_session;
|
|
132 |
ksort( $wppa_session );
|
133 |
|
134 |
$wppa_session['page']++;
|
|
|
|
|
|
|
135 |
|
136 |
wppa_save_session();
|
137 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
125 |
'ajax' => '0',
|
126 |
'user' => '',
|
127 |
'id' => $wpdb->get_var( $wpdb->prepare( "SELECT `id` FROM `".WPPA_SESSION."` WHERE `session` = %s LIMIT 1", wppa_get_session_id() ) ),
|
128 |
+
'uris' => array(),
|
129 |
|
130 |
);
|
131 |
|
133 |
ksort( $wppa_session );
|
134 |
|
135 |
$wppa_session['page']++;
|
136 |
+
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
|
137 |
+
$wppa_session['uris'][] = date_i18n("g:i") . ' ' . $_SERVER['REQUEST_URI'] . ( isset( $_SERVER['HTTP_REFERER'] ) ? ', Referrer: ' . $_SERVER['HTTP_REFERER'] : '' );
|
138 |
+
}
|
139 |
|
140 |
wppa_save_session();
|
141 |
|
wppa-settings-autosave.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3298,6 +3298,25 @@ global $wppa_tags;
|
|
3298 |
$tags = 'link,system';
|
3299 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
3300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3301 |
$name = __('Update addressline', 'wp-photo-album-plus');
|
3302 |
$desc = __('Update the addressline after an ajax action or next slide.', 'wp-photo-album-plus');
|
3303 |
$help = esc_js(__('If checked, refreshing the page will show the current content and the browsers back and forth arrows will browse the history on the page.', 'wp-photo-album-plus'));
|
@@ -3409,9 +3428,18 @@ global $wppa_tags;
|
|
3409 |
|
3410 |
$name = __('Enable photo html access', 'wp-photo-album-plus');
|
3411 |
$desc = __('Creates an .htaccess file in .../uploads/wppa/', 'wp-photo-album-plus');
|
3412 |
-
$help = esc_js(__('If
|
|
|
3413 |
$slug = 'wppa_cre_uploads_htaccess';
|
3414 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3415 |
$clas = '';
|
3416 |
$tags = 'system,access';
|
3417 |
wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
|
@@ -3582,8 +3610,8 @@ global $wppa_tags;
|
|
3582 |
$desc = __('Slideshow timeout.', 'wp-photo-album-plus');
|
3583 |
$help = esc_js(__('Select the time a single slide will be visible when the slideshow is started.', 'wp-photo-album-plus'));
|
3584 |
$slug = 'wppa_slideshow_timeout';
|
3585 |
-
$options = array(
|
3586 |
-
$values = array('1000', '1500', '2500', '4000', '6000');
|
3587 |
$html = wppa_select($slug, $options, $values);
|
3588 |
$clas = 'wppa_ss';
|
3589 |
$tags = 'slide';
|
@@ -6400,6 +6428,33 @@ global $wppa_tags;
|
|
6400 |
$tags = 'system';
|
6401 |
wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags);
|
6402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6403 |
wppa_setting_subheader('B', '4', __('Clearing and other irreverseable actions', 'wp-photo-album-plus'));
|
6404 |
|
6405 |
$name = __('Clear ratings', 'wp-photo-album-plus');
|
@@ -6924,6 +6979,15 @@ global $wppa_tags;
|
|
6924 |
$tags = 'system';
|
6925 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
6926 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6927 |
$name = __('Check tag balance', 'wp-photo-album-plus');
|
6928 |
$desc = __('Check if the HTML tags are properly closed: "balanced".', 'wp-photo-album-plus');
|
6929 |
$help = esc_js(__('If the HTML tags in an album or a photo description are not in balance, the description is not updated, an errormessage is displayed', 'wp-photo-album-plus'));
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* manage all options
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
3298 |
$tags = 'link,system';
|
3299 |
wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags);
|
3300 |
|
3301 |
+
$name = __('Enable encrypted links', 'wp-photo-album-plus');
|
3302 |
+
$desc = __('Encrypt album and photo ids in links.', 'wp-photo-album-plus');
|
3303 |
+
$help = '';
|
3304 |
+
$slug = 'wppa_use_encrypted_links';
|
3305 |
+
$onch = 'alert(\''.__('The page will be reloaded.', 'wp-photo-album-plus').'\');wppaRefreshAfter();';
|
3306 |
+
$html = wppa_checkbox($slug, $onch);
|
3307 |
+
$clas = '';
|
3308 |
+
$tags = 'link,system';
|
3309 |
+
wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags);
|
3310 |
+
|
3311 |
+
$name = __('Refuse unencrypted', 'wp-photo-album-plus');
|
3312 |
+
$desc = __('When encrypted is enabled, refuse unencrypted urls.', 'wp-photo-album-plus');
|
3313 |
+
$help = '';
|
3314 |
+
$slug = 'wppa_refuse_unencrypted';
|
3315 |
+
$html = wppa_checkbox($slug);
|
3316 |
+
$clas = '';
|
3317 |
+
$tags = 'link,system';
|
3318 |
+
wppa_setting($slug, '6.2', $name, $desc, $html, $help, $clas, $tags);
|
3319 |
+
|
3320 |
$name = __('Update addressline', 'wp-photo-album-plus');
|
3321 |
$desc = __('Update the addressline after an ajax action or next slide.', 'wp-photo-album-plus');
|
3322 |
$help = esc_js(__('If checked, refreshing the page will show the current content and the browsers back and forth arrows will browse the history on the page.', 'wp-photo-album-plus'));
|
3428 |
|
3429 |
$name = __('Enable photo html access', 'wp-photo-album-plus');
|
3430 |
$desc = __('Creates an .htaccess file in .../uploads/wppa/', 'wp-photo-album-plus');
|
3431 |
+
$help = esc_js(__('If set to create .htaccess: assures http access to your wppa photo files, despite other .htaccess settings that may protect these files.', 'wp-photo-album-plus'));
|
3432 |
+
$help .= '\n'.esc_js(__('If set to remove .htaccess: remove any .htaccess file from ../wp-content/uploads/wppa/ and ../wp-content/uploads/wppa/thumbs', 'wp-photo-album-plus') );
|
3433 |
$slug = 'wppa_cre_uploads_htaccess';
|
3434 |
+
$opts = array( __('create .htaccess', 'wp-photo-album-plus'),
|
3435 |
+
__('remove .htaccess', 'wp-photo-album-plus'),
|
3436 |
+
__('do not change', 'wp-photo-album-plus'),
|
3437 |
+
);
|
3438 |
+
$vals = array( 'grant',
|
3439 |
+
'remove',
|
3440 |
+
'custom',
|
3441 |
+
);
|
3442 |
+
$html = wppa_select($slug, $opts, $vals);
|
3443 |
$clas = '';
|
3444 |
$tags = 'system,access';
|
3445 |
wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags);
|
3610 |
$desc = __('Slideshow timeout.', 'wp-photo-album-plus');
|
3611 |
$help = esc_js(__('Select the time a single slide will be visible when the slideshow is started.', 'wp-photo-album-plus'));
|
3612 |
$slug = 'wppa_slideshow_timeout';
|
3613 |
+
$options = array( '1 s.', '1.5 s.', '2.5 s.', '4 s.', '6 s.', '8 s.', '10 s.', '12 s.', '15 s.' );
|
3614 |
+
$values = array('1000', '1500', '2500', '4000', '6000', '8000', '10000', '12000', '15000' );
|
3615 |
$html = wppa_select($slug, $options, $values);
|
3616 |
$clas = 'wppa_ss';
|
3617 |
$tags = 'slide';
|
6428 |
$tags = 'system';
|
6429 |
wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags);
|
6430 |
|
6431 |
+
$name = __('Renew album crypt', 'wp-photo-album-plus');
|
6432 |
+
$desc = __('Renew album encrcryption codes.', 'wp-photo-album-plus');
|
6433 |
+
$help = '';
|
6434 |
+
$slug2 = 'wppa_crypt_albums';
|
6435 |
+
$html1 = '';
|
6436 |
+
$html2 = wppa_maintenance_button( $slug2 );
|
6437 |
+
$html3 = wppa_status_field( $slug2 );
|
6438 |
+
$html4 = wppa_togo_field( $slug2 );
|
6439 |
+
$html = array($html1, $html2, $html3, $html4);
|
6440 |
+
$clas = '';
|
6441 |
+
$tags = 'system';
|
6442 |
+
wppa_setting(false, '13', $name, $desc, $html, $help, $clas, $tags);
|
6443 |
+
|
6444 |
+
$name = __('Renew photo crypt', 'wp-photo-album-plus');
|
6445 |
+
$desc = __('Renew photo encrcryption codes.', 'wp-photo-album-plus');
|
6446 |
+
$help = '';
|
6447 |
+
$slug2 = 'wppa_crypt_photos';
|
6448 |
+
$html1 = '';
|
6449 |
+
$html2 = wppa_maintenance_button( $slug2 );
|
6450 |
+
$html3 = wppa_status_field( $slug2 );
|
6451 |
+
$html4 = wppa_togo_field( $slug2 );
|
6452 |
+
$html = array($html1, $html2, $html3, $html4);
|
6453 |
+
$clas = '';
|
6454 |
+
$tags = 'system';
|
6455 |
+
wppa_setting(false, '14', $name, $desc, $html, $help, $clas, $tags);
|
6456 |
+
|
6457 |
+
|
6458 |
wppa_setting_subheader('B', '4', __('Clearing and other irreverseable actions', 'wp-photo-album-plus'));
|
6459 |
|
6460 |
$name = __('Clear ratings', 'wp-photo-album-plus');
|
6979 |
$tags = 'system';
|
6980 |
wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags);
|
6981 |
|
6982 |
+
$name = __('Allow HTML custom', 'wp-photo-album-plus');
|
6983 |
+
$desc = __('Allow HTML in custom photo datafields.', 'wp-photo-album-plus');
|
6984 |
+
$help = esc_js(__('If checked: html is allowed. WARNING: No checks on syntax, it is your own responsability to close tags properly!', 'wp-photo-album-plus'));
|
6985 |
+
$slug = 'wppa_allow_html_custom';
|
6986 |
+
$html = wppa_checkbox($slug);
|
6987 |
+
$clas = '';
|
6988 |
+
$tags = 'system';
|
6989 |
+
wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags);
|
6990 |
+
|
6991 |
$name = __('Check tag balance', 'wp-photo-album-plus');
|
6992 |
$desc = __('Check if the HTML tags are properly closed: "balanced".', 'wp-photo-album-plus');
|
6993 |
$help = esc_js(__('If the HTML tags in an album or a photo description are not in balance, the description is not updated, an errormessage is displayed', '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.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -62,6 +62,7 @@ global $silent;
|
|
62 |
views bigint(20) NOT NULL default '0',
|
63 |
cats tinytext NOT NULL,
|
64 |
scheduledtm tinytext NOT NULL,
|
|
|
65 |
PRIMARY KEY (id)
|
66 |
) DEFAULT CHARACTER SET utf8;";
|
67 |
|
@@ -97,6 +98,7 @@ global $silent;
|
|
97 |
scheduledtm tinytext NOT NULL,
|
98 |
custom longtext NOT NULL,
|
99 |
stereo smallint NOT NULL default '0',
|
|
|
100 |
PRIMARY KEY (id),
|
101 |
KEY albumkey (album)
|
102 |
) DEFAULT CHARACTER SET utf8;";
|
@@ -383,6 +385,15 @@ global $silent;
|
|
383 |
wppa_remove_setting( 'wppa_stop_symbol_url' );
|
384 |
}
|
385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
}
|
387 |
|
388 |
// Set Defaults
|
@@ -901,6 +912,8 @@ Hide Camera info
|
|
901 |
'wppa_use_album_names_in_urls' => 'no',
|
902 |
'wppa_use_short_qargs' => 'yes',
|
903 |
'wppa_use_pretty_links' => 'yes',
|
|
|
|
|
904 |
'wppa_update_addressline' => 'yes',
|
905 |
'wppa_render_shortcode_always' => 'no',
|
906 |
'wppa_track_viewcounts' => 'yes',
|
@@ -912,7 +925,7 @@ Hide Camera info
|
|
912 |
'wppa_custom_style' => '',
|
913 |
'wppa_use_custom_style_file' => 'no',
|
914 |
'wppa_use_custom_theme_file' => 'no',
|
915 |
-
'wppa_cre_uploads_htaccess' => '
|
916 |
'wppa_debug_trace_on' => 'no',
|
917 |
'wppa_lazy_or_htmlcomp' => 'no',
|
918 |
'wppa_relative_urls' => 'no',
|
@@ -1202,6 +1215,8 @@ Hide Camera info
|
|
1202 |
'wppa_remake_skip_one' => '',
|
1203 |
'wppa_errorlog_purge' => '',
|
1204 |
'wppa_comp_sizes' => '',
|
|
|
|
|
1205 |
|
1206 |
// B Irreversable
|
1207 |
'wppa_rating_clear' => 'no',
|
@@ -1240,6 +1255,7 @@ Hide Camera info
|
|
1240 |
// Table IX: Miscellaneous
|
1241 |
// A System
|
1242 |
'wppa_html' => 'yes', // 1
|
|
|
1243 |
'wppa_check_balance' => 'no', // 2
|
1244 |
'wppa_allow_debug' => 'no', // 3
|
1245 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the setup stuff
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
62 |
views bigint(20) NOT NULL default '0',
|
63 |
cats tinytext NOT NULL,
|
64 |
scheduledtm tinytext NOT NULL,
|
65 |
+
crypt tinytext NOT NULL,
|
66 |
PRIMARY KEY (id)
|
67 |
) DEFAULT CHARACTER SET utf8;";
|
68 |
|
98 |
scheduledtm tinytext NOT NULL,
|
99 |
custom longtext NOT NULL,
|
100 |
stereo smallint NOT NULL default '0',
|
101 |
+
crypt tinytext NOT NULL,
|
102 |
PRIMARY KEY (id),
|
103 |
KEY albumkey (album)
|
104 |
) DEFAULT CHARACTER SET utf8;";
|
385 |
wppa_remove_setting( 'wppa_stop_symbol_url' );
|
386 |
}
|
387 |
|
388 |
+
if ( $old_rev <= '6319' ) {
|
389 |
+
if ( get_option( 'wppa_cre_uploads_htaccess', 'no' ) == 'no' ) {
|
390 |
+
update_option( 'wppa_cre_uploads_htaccess', 'remove' );
|
391 |
+
}
|
392 |
+
if ( get_option( 'wppa_cre_uploads_htaccess', 'no' ) == 'yes' ) {
|
393 |
+
update_option( 'wppa_cre_uploads_htaccess', 'grant' );
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
}
|
398 |
|
399 |
// Set Defaults
|
912 |
'wppa_use_album_names_in_urls' => 'no',
|
913 |
'wppa_use_short_qargs' => 'yes',
|
914 |
'wppa_use_pretty_links' => 'yes',
|
915 |
+
'wppa_use_encrypted_links' => 'no',
|
916 |
+
'wppa_refuse_unencrypted' => 'no',
|
917 |
'wppa_update_addressline' => 'yes',
|
918 |
'wppa_render_shortcode_always' => 'no',
|
919 |
'wppa_track_viewcounts' => 'yes',
|
925 |
'wppa_custom_style' => '',
|
926 |
'wppa_use_custom_style_file' => 'no',
|
927 |
'wppa_use_custom_theme_file' => 'no',
|
928 |
+
'wppa_cre_uploads_htaccess' => 'remove',
|
929 |
'wppa_debug_trace_on' => 'no',
|
930 |
'wppa_lazy_or_htmlcomp' => 'no',
|
931 |
'wppa_relative_urls' => 'no',
|
1215 |
'wppa_remake_skip_one' => '',
|
1216 |
'wppa_errorlog_purge' => '',
|
1217 |
'wppa_comp_sizes' => '',
|
1218 |
+
'wppa_crypt_photos' => '',
|
1219 |
+
'wppa_crypt_albums' => '',
|
1220 |
|
1221 |
// B Irreversable
|
1222 |
'wppa_rating_clear' => 'no',
|
1255 |
// Table IX: Miscellaneous
|
1256 |
// A System
|
1257 |
'wppa_html' => 'yes', // 1
|
1258 |
+
'wppa_allow_html_custom' => 'no',
|
1259 |
'wppa_check_balance' => 'no', // 2
|
1260 |
'wppa_allow_debug' => 'no', // 3
|
1261 |
|
wppa-slideshow.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -722,7 +722,7 @@ function wppa_slide_rating_range( $opt ) {
|
|
722 |
}
|
723 |
else for ( $i = '1'; $i <= '10'; $i++ ) $r[$i] = $i;
|
724 |
|
725 |
-
$style = ' style="height:'.$fs.'px; margin:0 0 -3px 0; padding:0; box-shadow:none; display:inline;"';
|
726 |
$icon = 'star.png';
|
727 |
|
728 |
// Display avg rating
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
722 |
}
|
723 |
else for ( $i = '1'; $i <= '10'; $i++ ) $r[$i] = $i;
|
724 |
|
725 |
+
$style = ' style="height:'.$fs.'px; margin:0 0 -3px 0; padding:0; box-shadow:none; display:inline;background-color:transparent;"';
|
726 |
$icon = 'star.png';
|
727 |
|
728 |
// Display avg rating
|
wppa-statistics.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
-
* Version 6.
|
8 |
*
|
9 |
*/
|
10 |
|
@@ -157,9 +157,18 @@ global $wppa_session;
|
|
157 |
if ( ! wppa_switch('wppa_track_viewcounts') ) return;
|
158 |
|
159 |
if ( $type != 'album' && $type != 'photo' ) die ( 'Illegal $type in wppa_bump_viewcount: '.$type);
|
160 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
-
if (
|
163 |
|
164 |
if ( ! isset($wppa_session[$type]) ) $wppa_session[$type] = array();
|
165 |
if ( ! isset($wppa_session[$type][$id] ) ) { // This one not done yest
|
4 |
*
|
5 |
* Functions for counts etc
|
6 |
* Common use front and admin
|
7 |
+
* Version 6.4.00
|
8 |
*
|
9 |
*/
|
10 |
|
157 |
if ( ! wppa_switch('wppa_track_viewcounts') ) return;
|
158 |
|
159 |
if ( $type != 'album' && $type != 'photo' ) die ( 'Illegal $type in wppa_bump_viewcount: '.$type);
|
160 |
+
if ( $type == 'album' ) {
|
161 |
+
if ( strlen( $id ) == 12 ) {
|
162 |
+
$id = wppa_decrypt_album( $id );
|
163 |
+
}
|
164 |
+
}
|
165 |
+
else {
|
166 |
+
if ( strlen( $id ) == 12 ) {
|
167 |
+
$id = wppa_decrypt_photo( $id );
|
168 |
+
}
|
169 |
+
}
|
170 |
|
171 |
+
if ( $id < '1' ) return; // Not a wppa image
|
172 |
|
173 |
if ( ! isset($wppa_session[$type]) ) $wppa_session[$type] = array();
|
174 |
if ( ! isset($wppa_session[$type][$id] ) ) { // This one not done yest
|
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.
|
9 |
*
|
10 |
*/
|
11 |
|
@@ -28,6 +28,9 @@ global $wpdb;
|
|
28 |
// Initialize
|
29 |
$result = '';
|
30 |
|
|
|
|
|
|
|
31 |
// Get the photo info
|
32 |
$thumb = wppa_cache_thumb( $id );
|
33 |
|
@@ -46,10 +49,10 @@ global $wpdb;
|
|
46 |
|
47 |
// Get class depending of comment alt display
|
48 |
if ( $com_alt ) {
|
49 |
-
$class = 'thumbnail-frame-comalt thumbnail-frame-comalt-'.wppa( 'mocc' ).' thumbnail-frame-photo-'.$
|
50 |
}
|
51 |
else {
|
52 |
-
$class = 'thumbnail-frame thumbnail-frame-'.wppa( 'mocc' ).' thumbnail-frame-photo-'.$
|
53 |
}
|
54 |
|
55 |
// If no image to display, die gracefully
|
@@ -122,7 +125,7 @@ global $wpdb;
|
|
122 |
|
123 |
// Open the thumbframe
|
124 |
$result .= '<div' .
|
125 |
-
' id="thumbnail_frame_'.$
|
126 |
' class="'.$class.'"' .
|
127 |
' style="'.$framestyle.'"' .
|
128 |
' >';
|
@@ -200,16 +203,16 @@ global $wpdb;
|
|
200 |
{ // Ajax possible
|
201 |
|
202 |
// The a img ajax
|
203 |
-
$p = wppa( 'calendar') ? '' : '&wppa-photo=' . $
|
204 |
$onclick = 'wppaDoAjaxRender( ' .
|
205 |
wppa( 'mocc' ) . ', \'' .
|
206 |
-
wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ) .
|
207 |
-
'&wppa-photo=' . $
|
208 |
'\', \'' .
|
209 |
-
wppa_convert_to_pretty( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) .
|
210 |
'\' )';
|
211 |
|
212 |
-
$result .= '<a style="position:static;" class="thumb-img" id="x-'.$
|
213 |
|
214 |
// Video?
|
215 |
if ( $is_video ) {
|
@@ -237,7 +240,7 @@ global $wpdb;
|
|
237 |
else {
|
238 |
$result .= '<img' .
|
239 |
' onclick="' . $onclick . '"' .
|
240 |
-
' id="i-' . $
|
241 |
' src="' . $imgurl . '"' .
|
242 |
' ' . $imgalt .
|
243 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -256,7 +259,7 @@ global $wpdb;
|
|
256 |
else {
|
257 |
|
258 |
// The a img non ajax
|
259 |
-
$result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$
|
260 |
if ( $is_video ) {
|
261 |
$result .= wppa_get_video_html( array(
|
262 |
'id' => $id,
|
@@ -265,7 +268,7 @@ global $wpdb;
|
|
265 |
'controls' => wppa_switch( 'thumb_video' ),
|
266 |
'margin_top' => '0',
|
267 |
'margin_bottom' => '0',
|
268 |
-
'tagid' => 'i-'.$
|
269 |
'cursor' => 'cursor:pointer;',
|
270 |
'events' => $events,
|
271 |
'title' => $title,
|
@@ -278,7 +281,7 @@ global $wpdb;
|
|
278 |
}
|
279 |
else {
|
280 |
$result .= '<img' .
|
281 |
-
' id="i-' . $
|
282 |
' src="' . $imgurl . '" ' . $imgalt .
|
283 |
( $title ? ' title="' . $title . '"' : '' ) .
|
284 |
' width="' . $imgwidth . '"' .
|
@@ -305,7 +308,7 @@ global $wpdb;
|
|
305 |
( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
|
306 |
' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
|
307 |
' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
|
308 |
-
' class="thumb-img" id="x-'.$
|
309 |
if ( $is_video ) {
|
310 |
$result .= wppa_get_video_html( array(
|
311 |
'id' => $id,
|
@@ -314,7 +317,7 @@ global $wpdb;
|
|
314 |
'controls' => wppa_switch( 'thumb_video' ),
|
315 |
'margin_top' => '0',
|
316 |
'margin_bottom' => '0',
|
317 |
-
'tagid' => 'i-'.$
|
318 |
'cursor' => $cursor,
|
319 |
'events' => $events,
|
320 |
'title' => wppa_zoom_in( $id ),
|
@@ -328,7 +331,7 @@ global $wpdb;
|
|
328 |
else {
|
329 |
$title = wppa_zoom_in( $id );
|
330 |
$result .= '<img' .
|
331 |
-
' id="i-' . $
|
332 |
' src="' . $imgurl . '"' .
|
333 |
' ' . $imgalt .
|
334 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -344,7 +347,7 @@ global $wpdb;
|
|
344 |
}
|
345 |
else { // is onclick
|
346 |
// The div img
|
347 |
-
$result .= '<div onclick="'.$link['url'].'" class="thumb-img" id="x-'.$
|
348 |
if ( $is_video ) {
|
349 |
$result .= wppa_get_video_html( array(
|
350 |
'id' => $id,
|
@@ -353,7 +356,7 @@ global $wpdb;
|
|
353 |
'controls' => wppa_switch( 'thumb_video' ),
|
354 |
'margin_top' => '0',
|
355 |
'margin_bottom' => '0',
|
356 |
-
'tagid' => 'i-'.$
|
357 |
'cursor' => 'cursor:pointer;',
|
358 |
'events' => $events,
|
359 |
'title' => $title,
|
@@ -366,7 +369,7 @@ global $wpdb;
|
|
366 |
}
|
367 |
else {
|
368 |
$result .= '<img' .
|
369 |
-
' id="i-' . $
|
370 |
' src="' . $imgurl . '"' .
|
371 |
' ' . $imgalt .
|
372 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -386,7 +389,7 @@ global $wpdb;
|
|
386 |
}
|
387 |
else { // no link
|
388 |
if ( wppa_switch( 'use_thumb_popup' ) ) {
|
389 |
-
$result .= '<div id="x-'.$
|
390 |
if ( $is_video ) {
|
391 |
$result .= wppa_get_video_html( array(
|
392 |
'id' => $id,
|
@@ -395,7 +398,7 @@ global $wpdb;
|
|
395 |
'controls' => false,
|
396 |
'margin_top' => '0',
|
397 |
'margin_bottom' => '0',
|
398 |
-
'tagid' => 'i-'.$
|
399 |
'cursor' => '',
|
400 |
'events' => $events,
|
401 |
'title' => $title,
|
@@ -530,7 +533,7 @@ global $wpdb;
|
|
530 |
$mylast = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM `'.WPPA_RATING.'` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $id, wppa_get_user() ), ARRAY_A );
|
531 |
$buttext = $mylast ? __( wppa_opt( 'voted_button_text' ) , 'wp-photo-album-plus') : __( wppa_opt( 'vote_button_text' ) , 'wp-photo-album-plus');
|
532 |
$result .= '<input' .
|
533 |
-
' id="wppa-vote-button-' . wppa( 'mocc' ) . '-' . $
|
534 |
' class="wppa-vote-button-thumb"' .
|
535 |
' style="margin:0;"' .
|
536 |
' type="button"' .
|
@@ -585,14 +588,14 @@ global $wpdb;
|
|
585 |
' >' .
|
586 |
'<a' .
|
587 |
' style="color:red;cursor:pointer;"' .
|
588 |
-
' onclick="'.esc_attr( 'if ( confirm( "'.__( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus').'" ) ) wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', '.$
|
589 |
' >' .
|
590 |
__( 'Delete' , 'wp-photo-album-plus') .
|
591 |
'</a>' .
|
592 |
' ' .
|
593 |
'<a' .
|
594 |
' style="color:green;cursor:pointer;"' .
|
595 |
-
' onclick="wppaEditPhoto( '.wppa( 'mocc' ).', '.$
|
596 |
' >' .
|
597 |
__( 'Edit' , 'wp-photo-album-plus') .
|
598 |
'</a>' .
|
@@ -667,6 +670,9 @@ global $thlinkmsggiven;
|
|
667 |
// Init
|
668 |
$result = '';
|
669 |
|
|
|
|
|
|
|
670 |
// Get the photo info
|
671 |
$thumb = wppa_cache_thumb( $id );
|
672 |
|
@@ -719,7 +725,7 @@ global $thlinkmsggiven;
|
|
719 |
wppa_step_covercount( 'thumb' );
|
720 |
|
721 |
$result .= "\n" . '<div' .
|
722 |
-
' id="thumb-' . $
|
723 |
' class="thumb wppa-box wppa-cover-box wppa-cover-box-' . $mcr . wppa( 'mocc' ) . ' wppa-' . wppa( 'alt' ) . '"' .
|
724 |
' style="' . $style . '"' .
|
725 |
' >';
|
@@ -790,6 +796,9 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
|
|
790 |
return '';
|
791 |
}
|
792 |
|
|
|
|
|
|
|
793 |
if ( wppa_in_widget() ) {
|
794 |
$photoframestyle = 'style="text-align:center;"';
|
795 |
}
|
@@ -798,7 +807,7 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
|
|
798 |
}
|
799 |
|
800 |
$result .= '<div'.
|
801 |
-
' id="thumbphoto_frame_' . $
|
802 |
' class="thumbphoto-frame"' .
|
803 |
' ' . $photoframestyle .
|
804 |
'>';
|
@@ -821,7 +830,7 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
|
|
821 |
'controls' => false,
|
822 |
// 'margin_top' => '0',
|
823 |
// 'margin_bottom' => '0',
|
824 |
-
'tagid' => 'i-'.$
|
825 |
// 'cursor' => '',
|
826 |
'events' => $events,
|
827 |
'title' => $title,
|
@@ -860,7 +869,7 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
|
|
860 |
'controls' => false,
|
861 |
// 'margin_top' => '0',
|
862 |
// 'margin_bottom' => '0',
|
863 |
-
'tagid' => 'i-'.$
|
864 |
// 'cursor' => '',
|
865 |
'events' => $events,
|
866 |
'title' => $title,
|
@@ -893,7 +902,7 @@ function wppa_the_thumbascoverphoto( $id, $src, $photo_left, $link, $imgattr_a,
|
|
893 |
'controls' => false,
|
894 |
// 'margin_top' => '0',
|
895 |
// 'margin_bottom' => '0',
|
896 |
-
'tagid' => 'i-'.$
|
897 |
// 'cursor' => '',
|
898 |
'events' => $events,
|
899 |
'title' => $title,
|
@@ -938,6 +947,10 @@ global $wpdb;
|
|
938 |
die( 'Please check your configuration' );
|
939 |
}
|
940 |
$result = '';
|
|
|
|
|
|
|
|
|
941 |
$cont_width = wppa_get_container_width();
|
942 |
$count_cols = ceil( $cont_width / wppa_opt( 'thumbsize' ) );
|
943 |
|
@@ -1066,7 +1079,7 @@ global $wpdb;
|
|
1066 |
$is_ie_or_chrome = strpos( $_SERVER["HTTP_USER_AGENT"], 'Trident' ) || strpos( $_SERVER["HTTP_USER_AGENT"], 'Chrome' );
|
1067 |
$result .= '
|
1068 |
<div' .
|
1069 |
-
' id="thumbnail_frame_masonry_' . $
|
1070 |
( $is_ie_or_chrome && wppa_opt( 'thumbtype' ) == 'masonry-h' ? ' class="wppa-mas-h-' . wppa( 'mocc' ) . '"' : '' ) .
|
1071 |
' style="' .
|
1072 |
$frame_h .
|
@@ -1103,13 +1116,13 @@ global $wpdb;
|
|
1103 |
{ // Ajax possible
|
1104 |
|
1105 |
// The a img ajax
|
1106 |
-
$p = wppa( 'calendar') ? '' : '&wppa-photo=' . $
|
1107 |
$onclick = 'wppaDoAjaxRender( ' .
|
1108 |
wppa( 'mocc' ) . ', \'' .
|
1109 |
-
wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ) .
|
1110 |
-
'&wppa-photo=' . $
|
1111 |
'\', \'' .
|
1112 |
-
wppa_convert_to_pretty( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) .
|
1113 |
'\' )';
|
1114 |
// old $onclick = "wppaDoAjaxRender( ".wppa( 'mocc' ).", '".wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ).'&wppa-photo='.$id."', '".wppa_convert_to_pretty( wppa_get_slideshow_url( wppa( 'start_album' ), '0' )."&wppa-photo=".$id )."' )";
|
1115 |
$result .= '<a style="position:static;" class="thumb-img" id="x-'.$id.'-'.wppa( 'mocc' ).'">';
|
@@ -1122,7 +1135,7 @@ global $wpdb;
|
|
1122 |
'controls' => false,
|
1123 |
'margin_top' => '0',
|
1124 |
'margin_bottom' => '0',
|
1125 |
-
'tagid' => 'i-'.$
|
1126 |
'cursor' => 'cursor:pointer;',
|
1127 |
'events' => $events,
|
1128 |
'title' => $title,
|
@@ -1137,7 +1150,7 @@ global $wpdb;
|
|
1137 |
else {
|
1138 |
$result .= '<img' .
|
1139 |
' onclick="' . $onclick . '"' .
|
1140 |
-
' id="i-' . $
|
1141 |
' src="' . $imgurl . '"' .
|
1142 |
' ' . $imgalt .
|
1143 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1149,7 +1162,7 @@ global $wpdb;
|
|
1149 |
}
|
1150 |
else { // non ajax
|
1151 |
// The a img non ajax
|
1152 |
-
$result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$
|
1153 |
if ( $is_video ) {
|
1154 |
// $result .= '<video preload="metadata" id="i-'.$id.'-'.wppa( 'mocc' ).'" '.$imgalt.' title="'.$title.'" width="'.$imgwidth.'" height="'.$imgheight.'" style="'.$imgstyle.' cursor:pointer;" '.$events.' >'.wppa_get_video_body( $id ).'</video>';
|
1155 |
$result .= wppa_get_video_html( array(
|
@@ -1159,7 +1172,7 @@ global $wpdb;
|
|
1159 |
'controls' => false,
|
1160 |
'margin_top' => '0',
|
1161 |
'margin_bottom' => '0',
|
1162 |
-
'tagid' => 'i-'.$
|
1163 |
'cursor' => 'cursor:pointer;',
|
1164 |
'events' => $events,
|
1165 |
'title' => $title,
|
@@ -1173,7 +1186,7 @@ global $wpdb;
|
|
1173 |
}
|
1174 |
else {
|
1175 |
$result .= '<img' .
|
1176 |
-
' id="i-' . $
|
1177 |
' src="' . $imgurl . '"' .
|
1178 |
' ' . $imgalt .
|
1179 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1199,7 +1212,7 @@ global $wpdb;
|
|
1199 |
' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
|
1200 |
( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
|
1201 |
' class="thumb-img"' .
|
1202 |
-
' id="x-' . $
|
1203 |
|
1204 |
// The image
|
1205 |
$title = wppa_zoom_in( $id );
|
@@ -1211,7 +1224,7 @@ global $wpdb;
|
|
1211 |
'controls' => false,
|
1212 |
'margin_top' => '0',
|
1213 |
'margin_bottom' => '0',
|
1214 |
-
'tagid' => 'i-'.$
|
1215 |
'cursor' => $cursor,
|
1216 |
'events' => $events,
|
1217 |
'title' => $title,
|
@@ -1227,7 +1240,7 @@ global $wpdb;
|
|
1227 |
// Image
|
1228 |
else {
|
1229 |
$result .= '<img' .
|
1230 |
-
' id="i-' . $
|
1231 |
' src="' . $imgurl . '"' .
|
1232 |
' ' . $imgalt .
|
1233 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1253,7 +1266,7 @@ global $wpdb;
|
|
1253 |
'controls' => false,
|
1254 |
'margin_top' => '0',
|
1255 |
'margin_bottom' => '0',
|
1256 |
-
'tagid' => 'i-'.$
|
1257 |
'cursor' => 'cursor:pointer;',
|
1258 |
'events' => $events,
|
1259 |
'title' => $title,
|
@@ -1269,7 +1282,7 @@ global $wpdb;
|
|
1269 |
// Image
|
1270 |
else {
|
1271 |
$result .= '<img' .
|
1272 |
-
' id="i-' . $
|
1273 |
' src="' . $imgurl . '"' .
|
1274 |
' ' . $imgalt .
|
1275 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1297,7 +1310,7 @@ global $wpdb;
|
|
1297 |
'controls' => false,
|
1298 |
'margin_top' => '0',
|
1299 |
'margin_bottom' => '0',
|
1300 |
-
'tagid' => 'i-'.$
|
1301 |
'cursor' => '',
|
1302 |
'events' => $events,
|
1303 |
'title' => $title,
|
@@ -1311,7 +1324,7 @@ global $wpdb;
|
|
1311 |
}
|
1312 |
else {
|
1313 |
$result .= '<img' .
|
1314 |
-
' id="i-'.$
|
1315 |
' src="' . $imgurl . '"' .
|
1316 |
' ' . $imgalt .
|
1317 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1333,7 +1346,7 @@ global $wpdb;
|
|
1333 |
'controls' => false,
|
1334 |
'margin_top' => '0',
|
1335 |
'margin_bottom' => '0',
|
1336 |
-
'tagid' => 'i-'.$
|
1337 |
'cursor' => '',
|
1338 |
'events' => $events,
|
1339 |
'title' => $title,
|
@@ -1347,7 +1360,7 @@ global $wpdb;
|
|
1347 |
}
|
1348 |
else {
|
1349 |
$result .= '<img' .
|
1350 |
-
' id="i-'.$
|
1351 |
' src="' . $imgurl . '"' .
|
1352 |
' ' . $imgalt .
|
1353 |
( $title ? ' title="' . $title . '"' : '' ) .
|
@@ -1373,7 +1386,7 @@ global $wpdb;
|
|
1373 |
// }
|
1374 |
$result .= wppa_get_audio_html( array(
|
1375 |
'id' => $id,
|
1376 |
-
'tagid' => 'a-'.$
|
1377 |
// 'width' => $imgwidth,
|
1378 |
// 'height' => wppa_get_audio_control_height(),
|
1379 |
'style' => 'width:100%;position:absolute;bottom:0;margin:0;padding:'.(wppa_opt('tn_margin')/2).'px;left:0;border:none;z-index:10;'
|
@@ -1441,6 +1454,9 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1441 |
// Get the id
|
1442 |
$id = $image ? $image['id'] : '0';
|
1443 |
|
|
|
|
|
|
|
1444 |
// Fix url if audio
|
1445 |
if ( wppa_has_audio( $id ) ) {
|
1446 |
$imgurl = wppa_fix_poster_ext( $imgurl, $id );
|
@@ -1480,7 +1496,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1480 |
'controls' => false,
|
1481 |
'margin_top' => $imgstyle_a['margin-top'],
|
1482 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1483 |
-
'tagid' => 'i-' . $
|
1484 |
'cursor' => 'cursor:pointer;',
|
1485 |
'events' => $imgevents,
|
1486 |
'title' => $title,
|
@@ -1488,7 +1504,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1488 |
}
|
1489 |
else {
|
1490 |
$result .= '<img' .
|
1491 |
-
' id="i-' . $
|
1492 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1493 |
' src="' . $imgurl . '"' .
|
1494 |
' width="' . $imgstyle_a['width'] . '"' .
|
@@ -1527,7 +1543,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1527 |
'controls' => false,
|
1528 |
'margin_top' => $imgstyle_a['margin-top'],
|
1529 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1530 |
-
'tagid' => 'i-' . $
|
1531 |
'cursor' => $imgstyle_a['cursor'],
|
1532 |
'events' => $imgevents,
|
1533 |
'title' => $title
|
@@ -1535,7 +1551,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1535 |
}
|
1536 |
else {
|
1537 |
$result .= '<img' .
|
1538 |
-
' id="i-' . $
|
1539 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1540 |
' src="' . $imgurl . '"' .
|
1541 |
' width="' . $imgstyle_a['width'] . '"' .
|
@@ -1562,7 +1578,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1562 |
'controls' => false,
|
1563 |
'margin_top' => $imgstyle_a['margin-top'],
|
1564 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1565 |
-
'tagid' => 'i-' . $
|
1566 |
'cursor' => 'cursor:pointer;',
|
1567 |
'events' => $imgevents,
|
1568 |
'title' => $title,
|
@@ -1571,7 +1587,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1571 |
}
|
1572 |
else {
|
1573 |
$result .= '<img' .
|
1574 |
-
' id="i-' . $
|
1575 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1576 |
' src="' . $imgurl . '"' .
|
1577 |
' width="' . $imgstyle_a['width'] . '"' .
|
@@ -1604,7 +1620,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1604 |
'controls' => false,
|
1605 |
'margin_top' => $imgstyle_a['margin-top'],
|
1606 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1607 |
-
'tagid' => 'i-' . $
|
1608 |
'cursor' => 'cursor:pointer;',
|
1609 |
'events' => $imgevents,
|
1610 |
'title' => $title
|
@@ -1612,7 +1628,7 @@ function wppa_get_the_widget_thumb( $type, $image, $album, $display, $link, $tit
|
|
1612 |
}
|
1613 |
else {
|
1614 |
$result .= '<img' .
|
1615 |
-
' id="i-' . $
|
1616 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1617 |
' src="' . $imgurl . '"' .
|
1618 |
' width="' . $imgstyle_a['width'] . '"' .
|
5 |
* Various funcions to display a thumbnail image
|
6 |
* Contains all possible frontend thumbnail types
|
7 |
*
|
8 |
+
* Version 6.4.00
|
9 |
*
|
10 |
*/
|
11 |
|
28 |
// Initialize
|
29 |
$result = '';
|
30 |
|
31 |
+
// Encrypted photo id
|
32 |
+
$xid = wppa_encrypt_photo( $id );
|
33 |
+
|
34 |
// Get the photo info
|
35 |
$thumb = wppa_cache_thumb( $id );
|
36 |
|
49 |
|
50 |
// Get class depending of comment alt display
|
51 |
if ( $com_alt ) {
|
52 |
+
$class = 'thumbnail-frame-comalt thumbnail-frame-comalt-'.wppa( 'mocc' ).' thumbnail-frame-photo-'.$xid;
|
53 |
}
|
54 |
else {
|
55 |
+
$class = 'thumbnail-frame thumbnail-frame-'.wppa( 'mocc' ).' thumbnail-frame-photo-'.$xid;
|
56 |
}
|
57 |
|
58 |
// If no image to display, die gracefully
|
125 |
|
126 |
// Open the thumbframe
|
127 |
$result .= '<div' .
|
128 |
+
' id="thumbnail_frame_'.$xid.'_'.wppa( 'mocc' ).'"' .
|
129 |
' class="'.$class.'"' .
|
130 |
' style="'.$framestyle.'"' .
|
131 |
' >';
|
203 |
{ // Ajax possible
|
204 |
|
205 |
// The a img ajax
|
206 |
+
$p = wppa( 'calendar') ? '' : '&wppa-photo=' . $xid;
|
207 |
$onclick = 'wppaDoAjaxRender( ' .
|
208 |
wppa( 'mocc' ) . ', \'' .
|
209 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ) ) .
|
210 |
+
'&wppa-photo=' . $xid .
|
211 |
'\', \'' .
|
212 |
+
wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) ) .
|
213 |
'\' )';
|
214 |
|
215 |
+
$result .= '<a style="position:static;" class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
216 |
|
217 |
// Video?
|
218 |
if ( $is_video ) {
|
240 |
else {
|
241 |
$result .= '<img' .
|
242 |
' onclick="' . $onclick . '"' .
|
243 |
+
' id="i-' . $xid . '-'.wppa( 'mocc' ) . '"' .
|
244 |
' src="' . $imgurl . '"' .
|
245 |
' ' . $imgalt .
|
246 |
( $title ? ' title="' . $title . '"' : '' ) .
|
259 |
else {
|
260 |
|
261 |
// The a img non ajax
|
262 |
+
$result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
263 |
if ( $is_video ) {
|
264 |
$result .= wppa_get_video_html( array(
|
265 |
'id' => $id,
|
268 |
'controls' => wppa_switch( 'thumb_video' ),
|
269 |
'margin_top' => '0',
|
270 |
'margin_bottom' => '0',
|
271 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
272 |
'cursor' => 'cursor:pointer;',
|
273 |
'events' => $events,
|
274 |
'title' => $title,
|
281 |
}
|
282 |
else {
|
283 |
$result .= '<img' .
|
284 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
285 |
' src="' . $imgurl . '" ' . $imgalt .
|
286 |
( $title ? ' title="' . $title . '"' : '' ) .
|
287 |
' width="' . $imgwidth . '"' .
|
308 |
( $has_audio ? ' data-audiohtml="' . esc_attr( wppa_get_audio_body( $id ) ) . '"' : '' ) .
|
309 |
' ' . wppa( 'rel' ) . '="'.wppa_opt( 'lightbox_name' ).'[occ'.wppa( 'mocc' ).']"' .
|
310 |
' ' . wppa( 'lbtitle' ) . '="'.$title.'" ' .
|
311 |
+
' class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
312 |
if ( $is_video ) {
|
313 |
$result .= wppa_get_video_html( array(
|
314 |
'id' => $id,
|
317 |
'controls' => wppa_switch( 'thumb_video' ),
|
318 |
'margin_top' => '0',
|
319 |
'margin_bottom' => '0',
|
320 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
321 |
'cursor' => $cursor,
|
322 |
'events' => $events,
|
323 |
'title' => wppa_zoom_in( $id ),
|
331 |
else {
|
332 |
$title = wppa_zoom_in( $id );
|
333 |
$result .= '<img' .
|
334 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
335 |
' src="' . $imgurl . '"' .
|
336 |
' ' . $imgalt .
|
337 |
( $title ? ' title="' . $title . '"' : '' ) .
|
347 |
}
|
348 |
else { // is onclick
|
349 |
// The div img
|
350 |
+
$result .= '<div onclick="'.$link['url'].'" class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
351 |
if ( $is_video ) {
|
352 |
$result .= wppa_get_video_html( array(
|
353 |
'id' => $id,
|
356 |
'controls' => wppa_switch( 'thumb_video' ),
|
357 |
'margin_top' => '0',
|
358 |
'margin_bottom' => '0',
|
359 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
360 |
'cursor' => 'cursor:pointer;',
|
361 |
'events' => $events,
|
362 |
'title' => $title,
|
369 |
}
|
370 |
else {
|
371 |
$result .= '<img' .
|
372 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
373 |
' src="' . $imgurl . '"' .
|
374 |
' ' . $imgalt .
|
375 |
( $title ? ' title="' . $title . '"' : '' ) .
|
389 |
}
|
390 |
else { // no link
|
391 |
if ( wppa_switch( 'use_thumb_popup' ) ) {
|
392 |
+
$result .= '<div id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
393 |
if ( $is_video ) {
|
394 |
$result .= wppa_get_video_html( array(
|
395 |
'id' => $id,
|
398 |
'controls' => false,
|
399 |
'margin_top' => '0',
|
400 |
'margin_bottom' => '0',
|
401 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
402 |
'cursor' => '',
|
403 |
'events' => $events,
|
404 |
'title' => $title,
|
533 |
$mylast = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM `'.WPPA_RATING.'` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $id, wppa_get_user() ), ARRAY_A );
|
534 |
$buttext = $mylast ? __( wppa_opt( 'voted_button_text' ) , 'wp-photo-album-plus') : __( wppa_opt( 'vote_button_text' ) , 'wp-photo-album-plus');
|
535 |
$result .= '<input' .
|
536 |
+
' id="wppa-vote-button-' . wppa( 'mocc' ) . '-' . $xid . '"' .
|
537 |
' class="wppa-vote-button-thumb"' .
|
538 |
' style="margin:0;"' .
|
539 |
' type="button"' .
|
588 |
' >' .
|
589 |
'<a' .
|
590 |
' style="color:red;cursor:pointer;"' .
|
591 |
+
' onclick="'.esc_attr( 'if ( confirm( "'.__( 'Are you sure you want to remove this photo?' , 'wp-photo-album-plus').'" ) ) wppaAjaxRemovePhoto( '.wppa( 'mocc' ).', \''.$xid.'\', false ); return false;' ).'"' .
|
592 |
' >' .
|
593 |
__( 'Delete' , 'wp-photo-album-plus') .
|
594 |
'</a>' .
|
595 |
' ' .
|
596 |
'<a' .
|
597 |
' style="color:green;cursor:pointer;"' .
|
598 |
+
' onclick="wppaEditPhoto( '.wppa( 'mocc' ).', \''.$xid.'\' ); return false;"' .
|
599 |
' >' .
|
600 |
__( 'Edit' , 'wp-photo-album-plus') .
|
601 |
'</a>' .
|
670 |
// Init
|
671 |
$result = '';
|
672 |
|
673 |
+
// Encrypted photo id
|
674 |
+
$xid = wppa_encrypt_photo( $id );
|
675 |
+
|
676 |
// Get the photo info
|
677 |
$thumb = wppa_cache_thumb( $id );
|
678 |
|
725 |
wppa_step_covercount( 'thumb' );
|
726 |
|
727 |
$result .= "\n" . '<div' .
|
728 |
+
' id="thumb-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
729 |
' class="thumb wppa-box wppa-cover-box wppa-cover-box-' . $mcr . wppa( 'mocc' ) . ' wppa-' . wppa( 'alt' ) . '"' .
|
730 |
' style="' . $style . '"' .
|
731 |
' >';
|
796 |
return '';
|
797 |
}
|
798 |
|
799 |
+
// Encrypted photo id
|
800 |
+
$xid = wppa_encrypt_photo( $id );
|
801 |
+
|
802 |
if ( wppa_in_widget() ) {
|
803 |
$photoframestyle = 'style="text-align:center;"';
|
804 |
}
|
807 |
}
|
808 |
|
809 |
$result .= '<div'.
|
810 |
+
' id="thumbphoto_frame_' . $xid . '_' . wppa( 'mocc' ) . '"' .
|
811 |
' class="thumbphoto-frame"' .
|
812 |
' ' . $photoframestyle .
|
813 |
'>';
|
830 |
'controls' => false,
|
831 |
// 'margin_top' => '0',
|
832 |
// 'margin_bottom' => '0',
|
833 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
834 |
// 'cursor' => '',
|
835 |
'events' => $events,
|
836 |
'title' => $title,
|
869 |
'controls' => false,
|
870 |
// 'margin_top' => '0',
|
871 |
// 'margin_bottom' => '0',
|
872 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
873 |
// 'cursor' => '',
|
874 |
'events' => $events,
|
875 |
'title' => $title,
|
902 |
'controls' => false,
|
903 |
// 'margin_top' => '0',
|
904 |
// 'margin_bottom' => '0',
|
905 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
906 |
// 'cursor' => '',
|
907 |
'events' => $events,
|
908 |
'title' => $title,
|
947 |
die( 'Please check your configuration' );
|
948 |
}
|
949 |
$result = '';
|
950 |
+
|
951 |
+
// Encrypted photo id
|
952 |
+
$xid = wppa_encrypt_photo( $id );
|
953 |
+
|
954 |
$cont_width = wppa_get_container_width();
|
955 |
$count_cols = ceil( $cont_width / wppa_opt( 'thumbsize' ) );
|
956 |
|
1079 |
$is_ie_or_chrome = strpos( $_SERVER["HTTP_USER_AGENT"], 'Trident' ) || strpos( $_SERVER["HTTP_USER_AGENT"], 'Chrome' );
|
1080 |
$result .= '
|
1081 |
<div' .
|
1082 |
+
' id="thumbnail_frame_masonry_' . $xid . '_' . wppa( 'mocc' ) . '"' .
|
1083 |
( $is_ie_or_chrome && wppa_opt( 'thumbtype' ) == 'masonry-h' ? ' class="wppa-mas-h-' . wppa( 'mocc' ) . '"' : '' ) .
|
1084 |
' style="' .
|
1085 |
$frame_h .
|
1116 |
{ // Ajax possible
|
1117 |
|
1118 |
// The a img ajax
|
1119 |
+
$p = wppa( 'calendar') ? '' : '&wppa-photo=' . $xid;
|
1120 |
$onclick = 'wppaDoAjaxRender( ' .
|
1121 |
wppa( 'mocc' ) . ', \'' .
|
1122 |
+
wppa_encrypt_url( wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ) ) .
|
1123 |
+
'&wppa-photo=' . $xid .
|
1124 |
'\', \'' .
|
1125 |
+
wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_slideshow_url( wppa( 'start_album' ), '0' ) . $p ) ) .
|
1126 |
'\' )';
|
1127 |
// old $onclick = "wppaDoAjaxRender( ".wppa( 'mocc' ).", '".wppa_get_slideshow_url_ajax( wppa( 'start_album' ), '0' ).'&wppa-photo='.$id."', '".wppa_convert_to_pretty( wppa_get_slideshow_url( wppa( 'start_album' ), '0' )."&wppa-photo=".$id )."' )";
|
1128 |
$result .= '<a style="position:static;" class="thumb-img" id="x-'.$id.'-'.wppa( 'mocc' ).'">';
|
1135 |
'controls' => false,
|
1136 |
'margin_top' => '0',
|
1137 |
'margin_bottom' => '0',
|
1138 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1139 |
'cursor' => 'cursor:pointer;',
|
1140 |
'events' => $events,
|
1141 |
'title' => $title,
|
1150 |
else {
|
1151 |
$result .= '<img' .
|
1152 |
' onclick="' . $onclick . '"' .
|
1153 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1154 |
' src="' . $imgurl . '"' .
|
1155 |
' ' . $imgalt .
|
1156 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1162 |
}
|
1163 |
else { // non ajax
|
1164 |
// The a img non ajax
|
1165 |
+
$result .= '<a style="position:static;" href="'.$link['url'].'" target="'.$link['target'].'" class="thumb-img" id="x-'.$xid.'-'.wppa( 'mocc' ).'">';
|
1166 |
if ( $is_video ) {
|
1167 |
// $result .= '<video preload="metadata" id="i-'.$id.'-'.wppa( 'mocc' ).'" '.$imgalt.' title="'.$title.'" width="'.$imgwidth.'" height="'.$imgheight.'" style="'.$imgstyle.' cursor:pointer;" '.$events.' >'.wppa_get_video_body( $id ).'</video>';
|
1168 |
$result .= wppa_get_video_html( array(
|
1172 |
'controls' => false,
|
1173 |
'margin_top' => '0',
|
1174 |
'margin_bottom' => '0',
|
1175 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1176 |
'cursor' => 'cursor:pointer;',
|
1177 |
'events' => $events,
|
1178 |
'title' => $title,
|
1186 |
}
|
1187 |
else {
|
1188 |
$result .= '<img' .
|
1189 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1190 |
' src="' . $imgurl . '"' .
|
1191 |
' ' . $imgalt .
|
1192 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1212 |
' ' . wppa( 'rel' ) . '="' . wppa_opt( 'lightbox_name' ) . '[occ'.wppa( 'mocc' ) . ']"' .
|
1213 |
( $title ? ' ' . wppa( 'lbtitle' ) . '="' . $title . '"' : '' ) .
|
1214 |
' class="thumb-img"' .
|
1215 |
+
' id="x-' . $xid . '-' . wppa( 'mocc' ) . '">';
|
1216 |
|
1217 |
// The image
|
1218 |
$title = wppa_zoom_in( $id );
|
1224 |
'controls' => false,
|
1225 |
'margin_top' => '0',
|
1226 |
'margin_bottom' => '0',
|
1227 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1228 |
'cursor' => $cursor,
|
1229 |
'events' => $events,
|
1230 |
'title' => $title,
|
1240 |
// Image
|
1241 |
else {
|
1242 |
$result .= '<img' .
|
1243 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1244 |
' src="' . $imgurl . '"' .
|
1245 |
' ' . $imgalt .
|
1246 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1266 |
'controls' => false,
|
1267 |
'margin_top' => '0',
|
1268 |
'margin_bottom' => '0',
|
1269 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1270 |
'cursor' => 'cursor:pointer;',
|
1271 |
'events' => $events,
|
1272 |
'title' => $title,
|
1282 |
// Image
|
1283 |
else {
|
1284 |
$result .= '<img' .
|
1285 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1286 |
' src="' . $imgurl . '"' .
|
1287 |
' ' . $imgalt .
|
1288 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1310 |
'controls' => false,
|
1311 |
'margin_top' => '0',
|
1312 |
'margin_bottom' => '0',
|
1313 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1314 |
'cursor' => '',
|
1315 |
'events' => $events,
|
1316 |
'title' => $title,
|
1324 |
}
|
1325 |
else {
|
1326 |
$result .= '<img' .
|
1327 |
+
' id="i-'.$xid.'-'.wppa( 'mocc' ).'"' .
|
1328 |
' src="' . $imgurl . '"' .
|
1329 |
' ' . $imgalt .
|
1330 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1346 |
'controls' => false,
|
1347 |
'margin_top' => '0',
|
1348 |
'margin_bottom' => '0',
|
1349 |
+
'tagid' => 'i-'.$xid.'-'.wppa( 'mocc' ),
|
1350 |
'cursor' => '',
|
1351 |
'events' => $events,
|
1352 |
'title' => $title,
|
1360 |
}
|
1361 |
else {
|
1362 |
$result .= '<img' .
|
1363 |
+
' id="i-'.$xid.'-'.wppa( 'mocc' ).'"' .
|
1364 |
' src="' . $imgurl . '"' .
|
1365 |
' ' . $imgalt .
|
1366 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1386 |
// }
|
1387 |
$result .= wppa_get_audio_html( array(
|
1388 |
'id' => $id,
|
1389 |
+
'tagid' => 'a-'.$xid.'-'.wppa( 'mocc' ),
|
1390 |
// 'width' => $imgwidth,
|
1391 |
// 'height' => wppa_get_audio_control_height(),
|
1392 |
'style' => 'width:100%;position:absolute;bottom:0;margin:0;padding:'.(wppa_opt('tn_margin')/2).'px;left:0;border:none;z-index:10;'
|
1454 |
// Get the id
|
1455 |
$id = $image ? $image['id'] : '0';
|
1456 |
|
1457 |
+
// Encrypted photo id
|
1458 |
+
$xid = wppa_encrypt_photo( $id );
|
1459 |
+
|
1460 |
// Fix url if audio
|
1461 |
if ( wppa_has_audio( $id ) ) {
|
1462 |
$imgurl = wppa_fix_poster_ext( $imgurl, $id );
|
1496 |
'controls' => false,
|
1497 |
'margin_top' => $imgstyle_a['margin-top'],
|
1498 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1499 |
+
'tagid' => 'i-' . $xid . '-' . wppa( 'mocc' ),
|
1500 |
'cursor' => 'cursor:pointer;',
|
1501 |
'events' => $imgevents,
|
1502 |
'title' => $title,
|
1504 |
}
|
1505 |
else {
|
1506 |
$result .= '<img' .
|
1507 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1508 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1509 |
' src="' . $imgurl . '"' .
|
1510 |
' width="' . $imgstyle_a['width'] . '"' .
|
1543 |
'controls' => false,
|
1544 |
'margin_top' => $imgstyle_a['margin-top'],
|
1545 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1546 |
+
'tagid' => 'i-' . $xid . '-' . wppa( 'mocc' ),
|
1547 |
'cursor' => $imgstyle_a['cursor'],
|
1548 |
'events' => $imgevents,
|
1549 |
'title' => $title
|
1551 |
}
|
1552 |
else {
|
1553 |
$result .= '<img' .
|
1554 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1555 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1556 |
' src="' . $imgurl . '"' .
|
1557 |
' width="' . $imgstyle_a['width'] . '"' .
|
1578 |
'controls' => false,
|
1579 |
'margin_top' => $imgstyle_a['margin-top'],
|
1580 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1581 |
+
'tagid' => 'i-' . $xid . '-' . wppa( 'mocc' ),
|
1582 |
'cursor' => 'cursor:pointer;',
|
1583 |
'events' => $imgevents,
|
1584 |
'title' => $title,
|
1587 |
}
|
1588 |
else {
|
1589 |
$result .= '<img' .
|
1590 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1591 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1592 |
' src="' . $imgurl . '"' .
|
1593 |
' width="' . $imgstyle_a['width'] . '"' .
|
1620 |
'controls' => false,
|
1621 |
'margin_top' => $imgstyle_a['margin-top'],
|
1622 |
'margin_bottom' => $imgstyle_a['margin-bottom'],
|
1623 |
+
'tagid' => 'i-' . $xid . '-' . wppa( 'mocc' ),
|
1624 |
'cursor' => 'cursor:pointer;',
|
1625 |
'events' => $imgevents,
|
1626 |
'title' => $title
|
1628 |
}
|
1629 |
else {
|
1630 |
$result .= '<img' .
|
1631 |
+
' id="i-' . $xid . '-' . wppa( 'mocc' ) . '"' .
|
1632 |
( $title ? ' title="' . $title . '"' : '' ) .
|
1633 |
' src="' . $imgurl . '"' .
|
1634 |
' width="' . $imgstyle_a['width'] . '"' .
|
wppa-topten-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the top rated photos
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
|
9 |
class TopTenWidget extends WP_Widget {
|
@@ -68,16 +68,39 @@ class TopTenWidget extends WP_Widget {
|
|
68 |
$showowner = $instance['showowner'] == 'yes';
|
69 |
$showalbum = $instance['showalbum'] == 'yes';
|
70 |
|
|
|
71 |
if ( $album ) {
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
if ( $includesubs ) {
|
74 |
$albenum = wppa_alb_to_enum_children( $album );
|
75 |
$albenum = wppa_expand_enum( $albenum );
|
76 |
$album = str_replace( '.', ',', $albenum );
|
77 |
}
|
|
|
|
|
78 |
$thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `album` IN (".$album.") ORDER BY " . $sortby . " LIMIT " . $max, ARRAY_A );
|
79 |
-
|
80 |
}
|
|
|
|
|
81 |
else {
|
82 |
$thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` ORDER BY " . $sortby . " LIMIT " . $max, ARRAY_A );
|
83 |
}
|
@@ -125,7 +148,7 @@ class TopTenWidget extends WP_Widget {
|
|
125 |
|
126 |
// Display (album) ?
|
127 |
if ( $showalbum ) {
|
128 |
-
$href = wppa_convert_to_pretty( wppa_get_album_url( $image['album'], $albumlinkpage, 'content', '1' ) );
|
129 |
$widget_content .= '<div>(<a href="' . $href . '" >' . wppa_get_album_name( $image['album'] ) . '</a>)</div>';
|
130 |
}
|
131 |
|
@@ -273,7 +296,7 @@ class TopTenWidget extends WP_Widget {
|
|
273 |
<p><label for="<?php echo $this->get_field_id('album'); ?>"><?php _e('Album:', 'wp-photo-album-plus'); ?></label>
|
274 |
<select class="widefat" id="<?php echo $this->get_field_id('album'); ?>" name="<?php echo $this->get_field_name('album'); ?>" >
|
275 |
|
276 |
-
<?php echo wppa_album_select_a(array('selected' => $album, 'addall' => true, 'path' => wppa_switch('wppa_hier_albsel')))
|
277 |
|
278 |
</select>
|
279 |
</p>
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the top rated photos
|
6 |
+
* Version 6.4.00
|
7 |
*/
|
8 |
|
9 |
class TopTenWidget extends WP_Widget {
|
68 |
$showowner = $instance['showowner'] == 'yes';
|
69 |
$showalbum = $instance['showalbum'] == 'yes';
|
70 |
|
71 |
+
// Album specified?
|
72 |
if ( $album ) {
|
73 |
+
|
74 |
+
// All albums ?
|
75 |
+
if ( $album == '-2' ) {
|
76 |
+
$album = '0';
|
77 |
+
}
|
78 |
+
|
79 |
+
// Albums of owner is current logged in user or public?
|
80 |
+
if ( $album == '-3' ) {
|
81 |
+
$temp = $wpdb->get_results( "SELECT `id` FROM `".WPPA_ALBUMS."` WHERE `owner` = '--- public ---' OR `owner` = '" . wppa_get_user() . "' ORDER BY `id`", ARRAY_A );
|
82 |
+
$album = '';
|
83 |
+
if ( $temp ) {
|
84 |
+
foreach( $temp as $t ) {
|
85 |
+
$album .= '.' . $t['id'];
|
86 |
+
}
|
87 |
+
$album = ltrim( $album, '.' );
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
// Including subalbums?
|
92 |
if ( $includesubs ) {
|
93 |
$albenum = wppa_alb_to_enum_children( $album );
|
94 |
$albenum = wppa_expand_enum( $albenum );
|
95 |
$album = str_replace( '.', ',', $albenum );
|
96 |
}
|
97 |
+
|
98 |
+
// Doit
|
99 |
$thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` WHERE `album` IN (".$album.") ORDER BY " . $sortby . " LIMIT " . $max, ARRAY_A );
|
100 |
+
|
101 |
}
|
102 |
+
|
103 |
+
// No album specified
|
104 |
else {
|
105 |
$thumbs = $wpdb->get_results( "SELECT * FROM `".WPPA_PHOTOS."` ORDER BY " . $sortby . " LIMIT " . $max, ARRAY_A );
|
106 |
}
|
148 |
|
149 |
// Display (album) ?
|
150 |
if ( $showalbum ) {
|
151 |
+
$href = wppa_convert_to_pretty( wppa_encrypt_url( wppa_get_album_url( $image['album'], $albumlinkpage, 'content', '1' ) ) );
|
152 |
$widget_content .= '<div>(<a href="' . $href . '" >' . wppa_get_album_name( $image['album'] ) . '</a>)</div>';
|
153 |
}
|
154 |
|
296 |
<p><label for="<?php echo $this->get_field_id('album'); ?>"><?php _e('Album:', 'wp-photo-album-plus'); ?></label>
|
297 |
<select class="widefat" id="<?php echo $this->get_field_id('album'); ?>" name="<?php echo $this->get_field_name('album'); ?>" >
|
298 |
|
299 |
+
<?php echo wppa_album_select_a(array('selected' => $album, 'addall' => true, 'addowner' => true, 'path' => wppa_switch('wppa_hier_albsel'))) ?>
|
300 |
|
301 |
</select>
|
302 |
</p>
|
wppa-upldr-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display a list of users linking to their photos
|
6 |
-
* Version 6.
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
@@ -121,14 +121,14 @@ class UpldrWidget extends WP_Widget {
|
|
121 |
if ( $myline ) {
|
122 |
$user = $myline;
|
123 |
$widget_content .= '<tr class="wppa-user" >
|
124 |
-
<td style="padding: 0 3px;" ><a href="'.wppa_get_upldr_link($user['login']).$a.'" title="'.__('Photos uploaded by', 'wp-photo-album-plus').' '.$user['name'].'" ><b>'.$user['name'].'</b></a></td>
|
125 |
<td style="padding: 0 3px;" ><b>'.$user['count'].'</b></td>
|
126 |
<td style="padding: 0 3px;" ><b>'.wppa_get_time_since($user['date']).'</b></td>
|
127 |
</tr>';
|
128 |
}
|
129 |
foreach ( $workarr as $user ) {
|
130 |
$widget_content .= '<tr class="wppa-user" >
|
131 |
-
<td style="padding: 0 3px;" ><a href="'.wppa_get_upldr_link($user['login']).$a.'" title="'.__('Photos uploaded by', 'wp-photo-album-plus').' '.$user['name'].'" >'.$user['name'].'</a></td>
|
132 |
<td style="padding: 0 3px;" >'.$user['count'].'</td>
|
133 |
<td style="padding: 0 3px;" >'.wppa_get_time_since($user['date']).'</td>
|
134 |
</tr>';
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display a list of users linking to their photos
|
6 |
+
* Version 6.4.00
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
|
121 |
if ( $myline ) {
|
122 |
$user = $myline;
|
123 |
$widget_content .= '<tr class="wppa-user" >
|
124 |
+
<td style="padding: 0 3px;" ><a href="'.wppa_encrypt_url(wppa_get_upldr_link($user['login']).$a).'" title="'.__('Photos uploaded by', 'wp-photo-album-plus').' '.$user['name'].'" ><b>'.$user['name'].'</b></a></td>
|
125 |
<td style="padding: 0 3px;" ><b>'.$user['count'].'</b></td>
|
126 |
<td style="padding: 0 3px;" ><b>'.wppa_get_time_since($user['date']).'</b></td>
|
127 |
</tr>';
|
128 |
}
|
129 |
foreach ( $workarr as $user ) {
|
130 |
$widget_content .= '<tr class="wppa-user" >
|
131 |
+
<td style="padding: 0 3px;" ><a href="'.wppa_encrypt_url(wppa_get_upldr_link($user['login']).$a).'" title="'.__('Photos uploaded by', 'wp-photo-album-plus').' '.$user['name'].'" >'.$user['name'].'</a></td>
|
132 |
<td style="padding: 0 3px;" >'.$user['count'].'</td>
|
133 |
<td style="padding: 0 3px;" >'.wppa_get_time_since($user['date']).'</td>
|
134 |
</tr>';
|
wppa-upload.php
CHANGED
@@ -2053,7 +2053,7 @@ global $wppa_supported_audio_extensions;
|
|
2053 |
foreach( $photos as $photo ) {
|
2054 |
$cust_data = $photo['custom'] ? unserialize( $photo['custom'] ) : array( '', '', '', '', '', '', '', '', '', '' );
|
2055 |
foreach( array_keys( $pointers ) as $p ) {
|
2056 |
-
$cust_data[$p] = $data_arr[$pointers[$p]];
|
2057 |
}
|
2058 |
wppa_update_photo( array( 'id' => $photo['id'], 'custom' => serialize( $cust_data ) ) );
|
2059 |
$photos_processed_csv ++;
|
2053 |
foreach( $photos as $photo ) {
|
2054 |
$cust_data = $photo['custom'] ? unserialize( $photo['custom'] ) : array( '', '', '', '', '', '', '', '', '', '' );
|
2055 |
foreach( array_keys( $pointers ) as $p ) {
|
2056 |
+
$cust_data[$p] = wppa_sanitize_custom_field( $data_arr[$pointers[$p]] );
|
2057 |
}
|
2058 |
wppa_update_photo( array( 'id' => $photo['id'], 'custom' => serialize( $cust_data ) ) );
|
2059 |
$photos_processed_csv ++;
|
wppa-users.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -38,10 +38,9 @@ global $wpdb;
|
|
38 |
// If logged in, return userdata as specified in $type
|
39 |
// If logged out, return IP
|
40 |
function wppa_get_user( $type = 'login' ) {
|
41 |
-
global $current_user;
|
42 |
|
43 |
if ( is_user_logged_in() ) {
|
44 |
-
|
45 |
switch ( $type ) {
|
46 |
case 'login':
|
47 |
return $current_user->user_login;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains user and capabilities related routines
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
38 |
// If logged in, return userdata as specified in $type
|
39 |
// If logged out, return IP
|
40 |
function wppa_get_user( $type = 'login' ) {
|
|
|
41 |
|
42 |
if ( is_user_logged_in() ) {
|
43 |
+
$current_user = wp_get_current_user();
|
44 |
switch ( $type ) {
|
45 |
case 'login':
|
46 |
return $current_user->user_login;
|
wppa-utils.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -750,7 +750,7 @@ global $wppa_opt;
|
|
750 |
'wppa_ovl_anim',
|
751 |
'wppa_ovl_slide',
|
752 |
'wppa_relative_urls',
|
753 |
-
|
754 |
|
755 |
);
|
756 |
if ( in_array( $option, $init_js_critical ) ) {
|
@@ -1243,7 +1243,11 @@ function wppa_vfy_arg($arg, $txt = false) {
|
|
1243 |
}
|
1244 |
else {
|
1245 |
$reason = ( defined('WP_DEBUG') && WP_DEBUG ) ? ': '.$arg.' is not numeric.' : '';
|
1246 |
-
|
|
|
|
|
|
|
|
|
1247 |
}
|
1248 |
}
|
1249 |
}
|
@@ -1584,6 +1588,12 @@ function wppa_series_to_array($xtxt) {
|
|
1584 |
wppa_stx_err('Illegal character(s): "'.$t.'" found. '.$txt);
|
1585 |
return false;
|
1586 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1587 |
$temp = explode('.', $txt);
|
1588 |
$tempcopy = $temp;
|
1589 |
|
@@ -1641,6 +1651,7 @@ function wppa_is_enum( $var ) {
|
|
1641 |
}
|
1642 |
|
1643 |
function wppa_log( $xtype, $msg, $trace = false ) {
|
|
|
1644 |
|
1645 |
// Sanitize type
|
1646 |
$t = strtolower( substr( $xtype, 0, 1 ) );
|
@@ -1660,6 +1671,9 @@ function wppa_log( $xtype, $msg, $trace = false ) {
|
|
1660 |
case 'u':
|
1661 |
$type = 'Upl';
|
1662 |
break;
|
|
|
|
|
|
|
1663 |
default:
|
1664 |
$type = 'Misc';
|
1665 |
}
|
@@ -1706,6 +1720,13 @@ function wppa_log( $xtype, $msg, $trace = false ) {
|
|
1706 |
$trace = ob_get_contents();
|
1707 |
ob_end_clean();
|
1708 |
@ fwrite( $file, $trace."\n" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1709 |
}
|
1710 |
@ fclose( $file );
|
1711 |
}
|
@@ -2605,13 +2626,20 @@ static $wppa_get_get_cache;
|
|
2605 |
|
2606 |
// Post processing needed?
|
2607 |
if ( $index == 'photo' && ( ! wppa_is_int( $result ) ) ) {
|
|
|
|
|
|
|
|
|
|
|
2608 |
$result = wppa_get_photo_id_by_name( $result, wppa_get_album_id_by_name( wppa_get_get( 'album' ) ) );
|
2609 |
-
|
2610 |
-
// $result = wppa_get_photo_id_by_name( $result ); // in any album?
|
2611 |
-
// }
|
2612 |
if ( ! $result ) return false; // Non existing photo, treat as not set
|
2613 |
}
|
2614 |
if ( $index == 'album' ) {
|
|
|
|
|
|
|
|
|
2615 |
if ( ! wppa_is_int( $result ) ) {
|
2616 |
$temp = wppa_get_album_id_by_name( $result );
|
2617 |
if ( wppa_is_int( $temp ) && $temp > '0' ) {
|
@@ -2629,16 +2657,21 @@ static $wppa_get_get_cache;
|
|
2629 |
}
|
2630 |
|
2631 |
function wppa_get_post( $index, $default = false ) {
|
|
|
2632 |
if ( isset( $_POST['wppa-'.$index] ) ) { // New syntax first
|
2633 |
$result = $_POST['wppa-'.$index];
|
2634 |
if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #291' );
|
2635 |
if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #292' );
|
|
|
|
|
2636 |
return $result;
|
2637 |
}
|
2638 |
if ( isset( $_POST[$index] ) ) { // Old syntax
|
2639 |
$result = $_POST[$index];
|
2640 |
if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #391' );
|
2641 |
if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #392' );
|
|
|
|
|
2642 |
return $result;
|
2643 |
}
|
2644 |
return $default;
|
@@ -2952,4 +2985,15 @@ global $wppa;
|
|
2952 |
function wppa_exit() {
|
2953 |
wppa_session_end();
|
2954 |
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2955 |
}
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level utility routines
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
750 |
'wppa_ovl_anim',
|
751 |
'wppa_ovl_slide',
|
752 |
'wppa_relative_urls',
|
753 |
+
|
754 |
|
755 |
);
|
756 |
if ( in_array( $option, $init_js_critical ) ) {
|
1243 |
}
|
1244 |
else {
|
1245 |
$reason = ( defined('WP_DEBUG') && WP_DEBUG ) ? ': '.$arg.' is not numeric.' : '';
|
1246 |
+
$value = $_REQUEST[$arg];
|
1247 |
+
if ( $arg == 'photo-id' ) {
|
1248 |
+
$value = wppa_decrypt_photo( $value );
|
1249 |
+
}
|
1250 |
+
if ( ! is_numeric($value) ) wp_die('Security check failue'.$reason);
|
1251 |
}
|
1252 |
}
|
1253 |
}
|
1588 |
wppa_stx_err('Illegal character(s): "'.$t.'" found. '.$txt);
|
1589 |
return false;
|
1590 |
}
|
1591 |
+
|
1592 |
+
// Trim leading '0.'
|
1593 |
+
if ( substr( $txt, 0, 2 ) == '0.' ) {
|
1594 |
+
$txt = substr( $txt, 2 );
|
1595 |
+
}
|
1596 |
+
|
1597 |
$temp = explode('.', $txt);
|
1598 |
$tempcopy = $temp;
|
1599 |
|
1651 |
}
|
1652 |
|
1653 |
function wppa_log( $xtype, $msg, $trace = false ) {
|
1654 |
+
global $wppa_session;
|
1655 |
|
1656 |
// Sanitize type
|
1657 |
$t = strtolower( substr( $xtype, 0, 1 ) );
|
1671 |
case 'u':
|
1672 |
$type = 'Upl';
|
1673 |
break;
|
1674 |
+
case 'w':
|
1675 |
+
$type = 'War';
|
1676 |
+
break;
|
1677 |
default:
|
1678 |
$type = 'Misc';
|
1679 |
}
|
1720 |
$trace = ob_get_contents();
|
1721 |
ob_end_clean();
|
1722 |
@ fwrite( $file, $trace."\n" );
|
1723 |
+
|
1724 |
+
// Add uri history
|
1725 |
+
@ fwrite( $file, 'Uri history:'."\n" );
|
1726 |
+
foreach ( $wppa_session['uris'] as $uri ) {
|
1727 |
+
@ fwrite( $file, $uri . "\n" );
|
1728 |
+
}
|
1729 |
+
@ fwrite( $file, "\n\n" );
|
1730 |
}
|
1731 |
@ fclose( $file );
|
1732 |
}
|
2626 |
|
2627 |
// Post processing needed?
|
2628 |
if ( $index == 'photo' && ( ! wppa_is_int( $result ) ) ) {
|
2629 |
+
|
2630 |
+
// Encrypted?
|
2631 |
+
$result = wppa_decrypt_photo( $result );
|
2632 |
+
|
2633 |
+
// By name?
|
2634 |
$result = wppa_get_photo_id_by_name( $result, wppa_get_album_id_by_name( wppa_get_get( 'album' ) ) );
|
2635 |
+
|
|
|
|
|
2636 |
if ( ! $result ) return false; // Non existing photo, treat as not set
|
2637 |
}
|
2638 |
if ( $index == 'album' ) {
|
2639 |
+
|
2640 |
+
// Encrypted?
|
2641 |
+
$result = wppa_decrypt_album( $result );
|
2642 |
+
|
2643 |
if ( ! wppa_is_int( $result ) ) {
|
2644 |
$temp = wppa_get_album_id_by_name( $result );
|
2645 |
if ( wppa_is_int( $temp ) && $temp > '0' ) {
|
2657 |
}
|
2658 |
|
2659 |
function wppa_get_post( $index, $default = false ) {
|
2660 |
+
|
2661 |
if ( isset( $_POST['wppa-'.$index] ) ) { // New syntax first
|
2662 |
$result = $_POST['wppa-'.$index];
|
2663 |
if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #291' );
|
2664 |
if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #292' );
|
2665 |
+
if ( $index == 'album' ) $result = wppa_decrypt_album( $result );
|
2666 |
+
if ( $index == 'photo' ) $result = wppa_decrypt_photo( $result );
|
2667 |
return $result;
|
2668 |
}
|
2669 |
if ( isset( $_POST[$index] ) ) { // Old syntax
|
2670 |
$result = $_POST[$index];
|
2671 |
if ( strpos( $result, '<?' ) !== false ) die( 'Security check failure #391' );
|
2672 |
if ( strpos( $result, '?>' ) !== false ) die( 'Security check failure #392' );
|
2673 |
+
if ( $index == 'album' ) $result = wppa_decrypt_album( $result );
|
2674 |
+
if ( $index == 'photo' ) $result = wppa_decrypt_photo( $result );
|
2675 |
return $result;
|
2676 |
}
|
2677 |
return $default;
|
2985 |
function wppa_exit() {
|
2986 |
wppa_session_end();
|
2987 |
exit;
|
2988 |
+
}
|
2989 |
+
|
2990 |
+
function wppa_sanitize_custom_field( $txt ) {
|
2991 |
+
|
2992 |
+
if ( wppa_switch( 'allow_html_custom' ) ) {
|
2993 |
+
$result = wppa_strip_tags( $txt, 'script&style' );
|
2994 |
+
}
|
2995 |
+
else {
|
2996 |
+
$result = strip_tags( $txt );
|
2997 |
+
}
|
2998 |
+
return $result;
|
2999 |
}
|
wppa-wpdb-insert.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -252,7 +252,8 @@ global $wpdb;
|
|
252 |
'videox' => '0',
|
253 |
'videoy' => '0',
|
254 |
'scheduledtm' => $args['album'] ? $wpdb->get_var( $wpdb->prepare( "SELECT `scheduledtm` FROM `".WPPA_ALBUMS."` WHERE `id` = %s", $args['album'] ) ) : '',
|
255 |
-
'custom' => ''
|
|
|
256 |
) );
|
257 |
|
258 |
if ( $args['scheduledtm'] ) $args['status'] = 'scheduled';
|
@@ -284,9 +285,10 @@ global $wpdb;
|
|
284 |
`videox`,
|
285 |
`videoy`,
|
286 |
`scheduledtm`,
|
287 |
-
`custom
|
|
|
288 |
)
|
289 |
-
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
290 |
$args['id'],
|
291 |
$args['album'],
|
292 |
$args['ext'],
|
@@ -312,7 +314,8 @@ global $wpdb;
|
|
312 |
$args['videox'],
|
313 |
$args['videoy'],
|
314 |
$args['scheduledtm'],
|
315 |
-
$args['custom']
|
|
|
316 |
);
|
317 |
$iret = $wpdb->query($query);
|
318 |
|
@@ -344,7 +347,8 @@ global $wpdb;
|
|
344 |
'suba_order_by' => '',
|
345 |
'views' => '0',
|
346 |
'cats' => '',
|
347 |
-
'scheduledtm' => ''
|
|
|
348 |
) );
|
349 |
|
350 |
if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
|
@@ -368,9 +372,10 @@ global $wpdb;
|
|
368 |
`suba_order_by`,
|
369 |
`views`,
|
370 |
`cats`,
|
371 |
-
`scheduledtm
|
|
|
372 |
)
|
373 |
-
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
374 |
$args['id'],
|
375 |
trim( $args['name'] ),
|
376 |
trim( $args['description'] ),
|
@@ -390,7 +395,8 @@ global $wpdb;
|
|
390 |
$args['suba_order_by'],
|
391 |
$args['views'],
|
392 |
$args['cats'],
|
393 |
-
$args['scheduledtm']
|
|
|
394 |
);
|
395 |
$iret = $wpdb->query($query);
|
396 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that add new records
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
252 |
'videox' => '0',
|
253 |
'videoy' => '0',
|
254 |
'scheduledtm' => $args['album'] ? $wpdb->get_var( $wpdb->prepare( "SELECT `scheduledtm` FROM `".WPPA_ALBUMS."` WHERE `id` = %s", $args['album'] ) ) : '',
|
255 |
+
'custom' => '',
|
256 |
+
'crypt' => wppa_get_unique_photo_crypt()
|
257 |
) );
|
258 |
|
259 |
if ( $args['scheduledtm'] ) $args['status'] = 'scheduled';
|
285 |
`videox`,
|
286 |
`videoy`,
|
287 |
`scheduledtm`,
|
288 |
+
`custom`,
|
289 |
+
`crypt`
|
290 |
)
|
291 |
+
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
292 |
$args['id'],
|
293 |
$args['album'],
|
294 |
$args['ext'],
|
314 |
$args['videox'],
|
315 |
$args['videoy'],
|
316 |
$args['scheduledtm'],
|
317 |
+
$args['custom'],
|
318 |
+
$args['crypt']
|
319 |
);
|
320 |
$iret = $wpdb->query($query);
|
321 |
|
347 |
'suba_order_by' => '',
|
348 |
'views' => '0',
|
349 |
'cats' => '',
|
350 |
+
'scheduledtm' => '',
|
351 |
+
'crypt' => wppa_get_unique_album_crypt()
|
352 |
) );
|
353 |
|
354 |
if ( ! wppa_is_id_free( WPPA_ALBUMS, $args['id'] ) ) $args['id'] = wppa_nextkey( WPPA_ALBUMS );
|
372 |
`suba_order_by`,
|
373 |
`views`,
|
374 |
`cats`,
|
375 |
+
`scheduledtm`,
|
376 |
+
`crypt`
|
377 |
)
|
378 |
+
VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s ,%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )",
|
379 |
$args['id'],
|
380 |
trim( $args['name'] ),
|
381 |
trim( $args['description'] ),
|
395 |
$args['suba_order_by'],
|
396 |
$args['views'],
|
397 |
$args['cats'],
|
398 |
+
$args['scheduledtm'],
|
399 |
+
$args['crypt']
|
400 |
);
|
401 |
$iret = $wpdb->query($query);
|
402 |
|
wppa-wpdb-update.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that update records
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -53,6 +53,9 @@ global $wpdb;
|
|
53 |
$doit = true;
|
54 |
}
|
55 |
break;
|
|
|
|
|
|
|
56 |
|
57 |
default:
|
58 |
wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
|
@@ -156,6 +159,9 @@ global $wpdb;
|
|
156 |
case 'stereo':
|
157 |
$doit = true;
|
158 |
break;
|
|
|
|
|
|
|
159 |
|
160 |
default:
|
161 |
wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains low-level wpdb routines that update records
|
6 |
+
* Version 6.4.00
|
7 |
*
|
8 |
*/
|
9 |
|
53 |
$doit = true;
|
54 |
}
|
55 |
break;
|
56 |
+
case 'crypt':
|
57 |
+
$doit = true;
|
58 |
+
break;
|
59 |
|
60 |
default:
|
61 |
wppa_log( 'Error', 'Not implemented in wppa_update_album(): '.$itemname );
|
159 |
case 'stereo':
|
160 |
$doit = true;
|
161 |
break;
|
162 |
+
case 'crypt':
|
163 |
+
$doit = true;
|
164 |
+
break;
|
165 |
|
166 |
default:
|
167 |
wppa_log( 'Error', 'Not implemented in wppa_update_photo(): '.$itemname );
|
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.
|
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-
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|
@@ -275,6 +275,7 @@ require_once 'wppa-video.php';
|
|
275 |
require_once 'wppa-audio.php';
|
276 |
require_once 'wppa-mobile.php';
|
277 |
require_once 'wppa-stereo.php';
|
|
|
278 |
|
279 |
/* SET UP array $wppa, array $wppa_opt, and LANGUAGE */
|
280 |
add_action( 'init', 'wppa_initialize_runtime', '8' );
|
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.00
|
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 = '6400';
|
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-00-005';
|
38 |
|
39 |
/* start timers */
|
40 |
global $wppa_starttime; $wppa_starttime = microtime(true);
|
275 |
require_once 'wppa-audio.php';
|
276 |
require_once 'wppa-mobile.php';
|
277 |
require_once 'wppa-stereo.php';
|
278 |
+
require_once 'wppa-encrypt.php';
|
279 |
|
280 |
/* SET UP array $wppa, array $wppa_opt, and LANGUAGE */
|
281 |
add_action( 'init', 'wppa_initialize_runtime', '8' );
|