WP Photo Album Plus - Version 8.1.00.008

Version Description

= 8.0.10 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

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

Code changes from version 8.0.10.006 to 8.1.00.008

Files changed (63) hide show
  1. changelog.txt +12 -0
  2. js/sortable.js +1550 -0
  3. js/sortable.min.js +9 -0
  4. js/wppa-admin-scripts.js +168 -29
  5. js/wppa-admin-scripts.min.js +1 -1
  6. js/wppa-all.js +1 -1
  7. js/wppa-gutenberg-wppa.js +23 -21
  8. js/wppa.js +27 -13
  9. js/wppa.min.js +1 -1
  10. theme/wppa-style.css +16 -1
  11. {cloudinary → vendor/cloudinary}/README.md +0 -0
  12. {cloudinary → vendor/cloudinary}/index.php +0 -0
  13. {cloudinary → vendor/cloudinary}/src/Api.php +0 -0
  14. {cloudinary → vendor/cloudinary}/src/Cloudinary.php +0 -0
  15. {cloudinary → vendor/cloudinary}/src/Uploader.php +0 -0
  16. {cloudinary → vendor/cloudinary}/src/cacert.pem +0 -0
  17. wppa-admin-functions.php +24 -62
  18. wppa-admin-styles.css +213 -2
  19. wppa-admin.php +94 -37
  20. wppa-ajax-front.php +0 -30
  21. wppa-ajax.php +173 -202
  22. wppa-album-admin-autosave.php +88 -145
  23. wppa-album-navigator-widget.php +1 -10
  24. wppa-audio.php +20 -17
  25. wppa-boxes-html.php +78 -138
  26. wppa-cache.php +2 -2
  27. wppa-cloudinary.php +4 -4
  28. wppa-comment-admin.php +17 -56
  29. wppa-common-functions.php +5 -5
  30. wppa-cron.php +1 -7
  31. wppa-date-time.php +10 -43
  32. wppa-defaults.php +15 -15
  33. wppa-encrypt.php +1 -1
  34. wppa-export.php +4 -4
  35. wppa-filter.php +6 -10
  36. wppa-functions.php +18 -14
  37. wppa-gutenberg-photo.php +2 -2
  38. wppa-gutenberg-wppa.php +15 -15
  39. wppa-import.php +7 -16
  40. wppa-init.php +21 -6
  41. wppa-input.php +83 -38
  42. wppa-items.php +2 -2
  43. wppa-links.php +14 -24
  44. wppa-maintenance.php +31 -63
  45. wppa-non-admin.php +44 -68
  46. wppa-photo-admin-autosave.php +950 -1282
  47. wppa-scripts.php +628 -628
  48. wppa-session.php +6 -6
  49. wppa-setting-functions.php +8 -20
  50. wppa-settings-autosave.php +45 -165
  51. wppa-setup.php +2 -1
  52. wppa-slideshow.php +5 -11
  53. wppa-styles.php +4 -14
  54. wppa-tinymce-common.php +4 -78
  55. wppa-tinymce-shortcodes.php +1 -17
  56. wppa-upload.php +11 -18
  57. wppa-users.php +16 -1
  58. wppa-utils.php +61 -166
  59. wppa-video.php +7 -7
  60. wppa-widget-functions.php +2 -2
  61. wppa-wpdb-insert.php +1 -6
  62. wppa-wrappers.php +161 -6
  63. wppa.php +4 -4
changelog.txt CHANGED
@@ -1,5 +1,17 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 8.0.10 =
4
 
5
  * Security fix: The logfile was prone to XSS attacks. Fixed.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 8.1.00 =
4
+
5
+ * Many changes to comply with the wp coding standards to improve security:
6
+ - Removed ajax method 'Classic'.
7
+ - Javascript is now always deferred (Removed Advanced settings -> System I -> Item 11: Defer javascript),
8
+ in order to use the prescribed method for inline javascript.
9
+ - Dropped all custom style items in Advanced settings -> System -> I. Use wp customizer instead.
10
+ - Dropped the use of the wp editor for multiline textfields on admin pages.
11
+ - Dropped frontend edit photo method 'Classic'.
12
+ * Deleting a users 'Admins choice' zipfile will also remove his tags.
13
+ * Removed Google+ share.
14
+
15
  = 8.0.10 =
16
 
17
  * Security fix: The logfile was prone to XSS attacks. Fixed.
js/sortable.js ADDED
@@ -0,0 +1,1550 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI Sortable 1.12.1
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ */
9
+
10
+ //>>label: Sortable
11
+ //>>group: Interactions
12
+ //>>description: Enables items in a list to be sorted using the mouse.
13
+ //>>docs: http://api.jqueryui.com/sortable/
14
+ //>>demos: http://jqueryui.com/sortable/
15
+ //>>css.structure: ../../themes/base/sortable.css
16
+
17
+ ( function( factory ) {
18
+ if ( typeof define === "function" && define.amd ) {
19
+
20
+ // AMD. Register as an anonymous module.
21
+ define( [
22
+ "jquery",
23
+ "./mouse",
24
+ "./core"
25
+ ], factory );
26
+ } else {
27
+
28
+ // Browser globals
29
+ factory( jQuery );
30
+ }
31
+ }( function( $ ) {
32
+
33
+ return $.widget( "ui.sortable", $.ui.mouse, {
34
+ version: "1.12.1",
35
+ widgetEventPrefix: "sort",
36
+ ready: false,
37
+ options: {
38
+ appendTo: "parent",
39
+ axis: false,
40
+ connectWith: false,
41
+ containment: false,
42
+ cursor: "auto",
43
+ cursorAt: false,
44
+ dropOnEmpty: true,
45
+ forcePlaceholderSize: false,
46
+ forceHelperSize: false,
47
+ grid: false,
48
+ handle: false,
49
+ helper: "original",
50
+ items: "> *",
51
+ opacity: false,
52
+ placeholder: false,
53
+ revert: false,
54
+ scroll: true,
55
+ scrollSensitivity: 20,
56
+ scrollSpeed: 20,
57
+ scope: "default",
58
+ tolerance: "intersect",
59
+ zIndex: 1000,
60
+
61
+ // Callbacks
62
+ activate: null,
63
+ beforeStop: null,
64
+ change: null,
65
+ deactivate: null,
66
+ out: null,
67
+ over: null,
68
+ receive: null,
69
+ remove: null,
70
+ sort: null,
71
+ start: null,
72
+ stop: null,
73
+ update: null
74
+ },
75
+
76
+ _isOverAxis: function( x, reference, size ) {
77
+ return ( x >= reference ) && ( x < ( reference + size ) );
78
+ },
79
+
80
+ _isFloating: function( item ) {
81
+ return ( /left|right/ ).test( item.css( "float" ) ) ||
82
+ ( /inline|table-cell/ ).test( item.css( "display" ) );
83
+ },
84
+
85
+ _create: function() {
86
+ this.containerCache = {};
87
+ this._addClass( "ui-sortable" );
88
+
89
+ //Get the items
90
+ this.refresh();
91
+
92
+ //Let's determine the parent's offset
93
+ this.offset = this.element.offset();
94
+
95
+ //Initialize mouse events for interaction
96
+ this._mouseInit();
97
+
98
+ this._setHandleClassName();
99
+
100
+ //We're ready to go
101
+ this.ready = true;
102
+
103
+ },
104
+
105
+ _setOption: function( key, value ) {
106
+ this._super( key, value );
107
+
108
+ if ( key === "handle" ) {
109
+ this._setHandleClassName();
110
+ }
111
+ },
112
+
113
+ _setHandleClassName: function() {
114
+ var that = this;
115
+ this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
116
+ $.each( this.items, function() {
117
+ that._addClass(
118
+ this.instance.options.handle ?
119
+ this.item.find( this.instance.options.handle ) :
120
+ this.item,
121
+ "ui-sortable-handle"
122
+ );
123
+ } );
124
+ },
125
+
126
+ _destroy: function() {
127
+ this._mouseDestroy();
128
+
129
+ for ( var i = this.items.length - 1; i >= 0; i-- ) {
130
+ this.items[ i ].item.removeData( this.widgetName + "-item" );
131
+ }
132
+
133
+ return this;
134
+ },
135
+
136
+ _mouseCapture: function( event, overrideHandle ) {
137
+ var currentItem = null,
138
+ validHandle = false,
139
+ that = this;
140
+
141
+ if ( this.reverting ) {
142
+ return false;
143
+ }
144
+
145
+ if ( this.options.disabled || this.options.type === "static" ) {
146
+ return false;
147
+ }
148
+
149
+ //We have to refresh the items data once first
150
+ this._refreshItems( event );
151
+
152
+ //Find out if the clicked node (or one of its parents) is a actual item in this.items
153
+ $( event.target ).parents().each( function() {
154
+ if ( $.data( this, that.widgetName + "-item" ) === that ) {
155
+ currentItem = $( this );
156
+ return false;
157
+ }
158
+ } );
159
+ if ( $.data( event.target, that.widgetName + "-item" ) === that ) {
160
+ currentItem = $( event.target );
161
+ }
162
+
163
+ if ( !currentItem ) {
164
+ return false;
165
+ }
166
+ if ( this.options.handle && !overrideHandle ) {
167
+ $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() {
168
+ if ( this === event.target ) {
169
+ validHandle = true;
170
+ }
171
+ } );
172
+ if ( !validHandle ) {
173
+ return false;
174
+ }
175
+ }
176
+
177
+ this.currentItem = currentItem;
178
+ this._removeCurrentsFromItems();
179
+ return true;
180
+
181
+ },
182
+
183
+ _mouseStart: function( event, overrideHandle, noActivation ) {
184
+
185
+ var i, body,
186
+ o = this.options;
187
+
188
+ this.currentContainer = this;
189
+
190
+ //We only need to call refreshPositions, because the refreshItems call has been moved to
191
+ // mouseCapture
192
+ this.refreshPositions();
193
+
194
+ //Create and append the visible helper
195
+ this.helper = this._createHelper( event );
196
+
197
+ //Cache the helper size
198
+ this._cacheHelperProportions();
199
+
200
+ /*
201
+ * - Position generation -
202
+ * This block generates everything position related - it's the core of draggables.
203
+ */
204
+
205
+ //Cache the margins of the original element
206
+ this._cacheMargins();
207
+
208
+ //Get the next scrolling parent
209
+ this.scrollParent = this.helper.scrollParent();
210
+
211
+ //The element's absolute position on the page minus margins
212
+ this.offset = this.currentItem.offset();
213
+ this.offset = {
214
+ top: this.offset.top - this.margins.top,
215
+ left: this.offset.left - this.margins.left
216
+ };
217
+
218
+ $.extend( this.offset, {
219
+ click: { //Where the click happened, relative to the element
220
+ left: event.pageX - this.offset.left,
221
+ top: event.pageY - this.offset.top
222
+ },
223
+ parent: this._getParentOffset(),
224
+
225
+ // This is a relative to absolute position minus the actual position calculation -
226
+ // only used for relative positioned helper
227
+ relative: this._getRelativeOffset()
228
+ } );
229
+
230
+ // Only after we got the offset, we can change the helper's position to absolute
231
+ // TODO: Still need to figure out a way to make relative sorting possible
232
+ this.helper.css( "position", "absolute" );
233
+ this.cssPosition = this.helper.css( "position" );
234
+
235
+ //Generate the original position
236
+ this.originalPosition = this._generatePosition( event );
237
+ this.originalPageX = event.pageX;
238
+ this.originalPageY = event.pageY;
239
+
240
+ //Adjust the mouse offset relative to the helper if "cursorAt" is supplied
241
+ ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
242
+
243
+ //Cache the former DOM position
244
+ this.domPosition = {
245
+ prev: this.currentItem.prev()[ 0 ],
246
+ parent: this.currentItem.parent()[ 0 ]
247
+ };
248
+
249
+ // If the helper is not the original, hide the original so it's not playing any role during
250
+ // the drag, won't cause anything bad this way
251
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
252
+ this.currentItem.hide();
253
+ }
254
+
255
+ //Create the placeholder
256
+ this._createPlaceholder();
257
+
258
+ //Set a containment if given in the options
259
+ if ( o.containment ) {
260
+ this._setContainment();
261
+ }
262
+
263
+ if ( o.cursor && o.cursor !== "auto" ) { // cursor option
264
+ body = this.document.find( "body" );
265
+
266
+ // Support: IE
267
+ this.storedCursor = body.css( "cursor" );
268
+ body.css( "cursor", o.cursor );
269
+
270
+ this.storedStylesheet =
271
+ $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
272
+ }
273
+
274
+ if ( o.opacity ) { // opacity option
275
+ if ( this.helper.css( "opacity" ) ) {
276
+ this._storedOpacity = this.helper.css( "opacity" );
277
+ }
278
+ this.helper.css( "opacity", o.opacity );
279
+ }
280
+
281
+ if ( o.zIndex ) { // zIndex option
282
+ if ( this.helper.css( "zIndex" ) ) {
283
+ this._storedZIndex = this.helper.css( "zIndex" );
284
+ }
285
+ this.helper.css( "zIndex", o.zIndex );
286
+ }
287
+
288
+ //Prepare scrolling
289
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
290
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
291
+ this.overflowOffset = this.scrollParent.offset();
292
+ }
293
+
294
+ //Call callbacks
295
+ this._trigger( "start", event, this._uiHash() );
296
+
297
+ //Recache the helper size
298
+ if ( !this._preserveHelperProportions ) {
299
+ this._cacheHelperProportions();
300
+ }
301
+
302
+ //Post "activate" events to possible containers
303
+ if ( !noActivation ) {
304
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
305
+ this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
306
+ }
307
+ }
308
+
309
+ //Prepare possible droppables
310
+ if ( $.ui.ddmanager ) {
311
+ $.ui.ddmanager.current = this;
312
+ }
313
+
314
+ if ( $.ui.ddmanager && !o.dropBehaviour ) {
315
+ $.ui.ddmanager.prepareOffsets( this, event );
316
+ }
317
+
318
+ this.dragging = true;
319
+
320
+ this._addClass( this.helper, "ui-sortable-helper" );
321
+
322
+ // Execute the drag once - this causes the helper not to be visiblebefore getting its
323
+ // correct position
324
+ this._mouseDrag( event );
325
+ return true;
326
+
327
+ },
328
+
329
+ _mouseDrag: function( event ) {
330
+ var i, item, itemElement, intersection,
331
+ o = this.options,
332
+ scrolled = false;
333
+
334
+ //Compute the helpers position
335
+ this.position = this._generatePosition( event );
336
+ this.positionAbs = this._convertPositionTo( "absolute" );
337
+
338
+ if ( !this.lastPositionAbs ) {
339
+ this.lastPositionAbs = this.positionAbs;
340
+ }
341
+
342
+ //Do scrolling
343
+ if ( this.options.scroll ) {
344
+ if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
345
+ this.scrollParent[ 0 ].tagName !== "HTML" ) {
346
+
347
+ if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
348
+ event.pageY < o.scrollSensitivity ) {
349
+ this.scrollParent[ 0 ].scrollTop =
350
+ scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
351
+ } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
352
+ this.scrollParent[ 0 ].scrollTop =
353
+ scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
354
+ }
355
+
356
+ if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
357
+ event.pageX < o.scrollSensitivity ) {
358
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
359
+ this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
360
+ } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
361
+ this.scrollParent[ 0 ].scrollLeft = scrolled =
362
+ this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
363
+ }
364
+
365
+ } else {
366
+
367
+ if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
368
+ scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
369
+ } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
370
+ o.scrollSensitivity ) {
371
+ scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
372
+ }
373
+
374
+ if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
375
+ scrolled = this.document.scrollLeft(
376
+ this.document.scrollLeft() - o.scrollSpeed
377
+ );
378
+ } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
379
+ o.scrollSensitivity ) {
380
+ scrolled = this.document.scrollLeft(
381
+ this.document.scrollLeft() + o.scrollSpeed
382
+ );
383
+ }
384
+
385
+ }
386
+
387
+ if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
388
+ $.ui.ddmanager.prepareOffsets( this, event );
389
+ }
390
+ }
391
+
392
+ //Regenerate the absolute position used for position checks
393
+ this.positionAbs = this._convertPositionTo( "absolute" );
394
+
395
+ //Set the helper position
396
+ if ( !this.options.axis || this.options.axis !== "y" ) {
397
+ this.helper[ 0 ].style.left = this.position.left + "px";
398
+ }
399
+ if ( !this.options.axis || this.options.axis !== "x" ) {
400
+ this.helper[ 0 ].style.top = this.position.top + "px";
401
+ }
402
+
403
+ //Rearrange
404
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
405
+
406
+ //Cache variables and intersection, continue if no intersection
407
+ item = this.items[ i ];
408
+ itemElement = item.item[ 0 ];
409
+ intersection = this._intersectsWithPointer( item );
410
+ if ( !intersection ) {
411
+ continue;
412
+ }
413
+
414
+ // Only put the placeholder inside the current Container, skip all
415
+ // items from other containers. This works because when moving
416
+ // an item from one container to another the
417
+ // currentContainer is switched before the placeholder is moved.
418
+ //
419
+ // Without this, moving items in "sub-sortables" can cause
420
+ // the placeholder to jitter between the outer and inner container.
421
+ if ( item.instance !== this.currentContainer ) {
422
+ continue;
423
+ }
424
+
425
+ // Cannot intersect with itself
426
+ // no useless actions that have been done before
427
+ // no action if the item moved is the parent of the item checked
428
+ if ( itemElement !== this.currentItem[ 0 ] &&
429
+ this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement &&
430
+ !$.contains( this.placeholder[ 0 ], itemElement ) &&
431
+ ( this.options.type === "semi-dynamic" ?
432
+ !$.contains( this.element[ 0 ], itemElement ) :
433
+ true
434
+ )
435
+ ) {
436
+
437
+ this.direction = intersection === 1 ? "down" : "up";
438
+
439
+ if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) {
440
+ this._rearrange( event, item );
441
+ } else {
442
+ break;
443
+ }
444
+
445
+ this._trigger( "change", event, this._uiHash() );
446
+ break;
447
+ }
448
+ }
449
+
450
+ //Post events to containers
451
+ this._contactContainers( event );
452
+
453
+ //Interconnect with droppables
454
+ if ( $.ui.ddmanager ) {
455
+ $.ui.ddmanager.drag( this, event );
456
+ }
457
+
458
+ //Call callbacks
459
+ this._trigger( "sort", event, this._uiHash() );
460
+
461
+ this.lastPositionAbs = this.positionAbs;
462
+ return false;
463
+
464
+ },
465
+
466
+ _mouseStop: function( event, noPropagation ) {
467
+
468
+ if ( !event ) {
469
+ return;
470
+ }
471
+
472
+ //If we are using droppables, inform the manager about the drop
473
+ if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
474
+ $.ui.ddmanager.drop( this, event );
475
+ }
476
+
477
+ if ( this.options.revert ) {
478
+ var that = this,
479
+ cur = this.placeholder.offset(),
480
+ axis = this.options.axis,
481
+ animation = {};
482
+
483
+ if ( !axis || axis === "x" ) {
484
+ animation.left = cur.left - this.offset.parent.left - this.margins.left +
485
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
486
+ 0 :
487
+ this.offsetParent[ 0 ].scrollLeft
488
+ );
489
+ }
490
+ if ( !axis || axis === "y" ) {
491
+ animation.top = cur.top - this.offset.parent.top - this.margins.top +
492
+ ( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
493
+ 0 :
494
+ this.offsetParent[ 0 ].scrollTop
495
+ );
496
+ }
497
+ this.reverting = true;
498
+ $( this.helper ).animate(
499
+ animation,
500
+ parseInt( this.options.revert, 10 ) || 500,
501
+ function() {
502
+ that._clear( event );
503
+ }
504
+ );
505
+ } else {
506
+ this._clear( event, noPropagation );
507
+ }
508
+
509
+ return false;
510
+
511
+ },
512
+
513
+ cancel: function() {
514
+
515
+ if ( this.dragging ) {
516
+
517
+ this._mouseUp( new $.Event( "mouseup", { target: null } ) );
518
+
519
+ if ( this.options.helper === "original" ) {
520
+ this.currentItem.css( this._storedCSS );
521
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
522
+ } else {
523
+ this.currentItem.show();
524
+ }
525
+
526
+ //Post deactivating events to containers
527
+ for ( var i = this.containers.length - 1; i >= 0; i-- ) {
528
+ this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) );
529
+ if ( this.containers[ i ].containerCache.over ) {
530
+ this.containers[ i ]._trigger( "out", null, this._uiHash( this ) );
531
+ this.containers[ i ].containerCache.over = 0;
532
+ }
533
+ }
534
+
535
+ }
536
+
537
+ if ( this.placeholder ) {
538
+
539
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
540
+ // it unbinds ALL events from the original node!
541
+ if ( this.placeholder[ 0 ].parentNode ) {
542
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
543
+ }
544
+ if ( this.options.helper !== "original" && this.helper &&
545
+ this.helper[ 0 ].parentNode ) {
546
+ this.helper.remove();
547
+ }
548
+
549
+ $.extend( this, {
550
+ helper: null,
551
+ dragging: false,
552
+ reverting: false,
553
+ _noFinalSort: null
554
+ } );
555
+
556
+ if ( this.domPosition.prev ) {
557
+ $( this.domPosition.prev ).after( this.currentItem );
558
+ } else {
559
+ $( this.domPosition.parent ).prepend( this.currentItem );
560
+ }
561
+ }
562
+
563
+ return this;
564
+
565
+ },
566
+
567
+ serialize: function( o ) {
568
+
569
+ var items = this._getItemsAsjQuery( o && o.connected ),
570
+ str = [];
571
+ o = o || {};
572
+
573
+ $( items ).each( function() {
574
+ var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
575
+ .match( o.expression || ( /(.+)[\-=_](.+)/ ) );
576
+ if ( res ) {
577
+ str.push(
578
+ ( o.key || res[ 1 ] + "[]" ) +
579
+ "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
580
+ }
581
+ } );
582
+
583
+ if ( !str.length && o.key ) {
584
+ str.push( o.key + "=" );
585
+ }
586
+
587
+ return str.join( "&" );
588
+
589
+ },
590
+
591
+ toArray: function( o ) {
592
+
593
+ var items = this._getItemsAsjQuery( o && o.connected ),
594
+ ret = [];
595
+
596
+ o = o || {};
597
+
598
+ items.each( function() {
599
+ ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
600
+ } );
601
+ return ret;
602
+
603
+ },
604
+
605
+ /* Be careful with the following core functions */
606
+ _intersectsWith: function( item ) {
607
+
608
+ var x1 = this.positionAbs.left,
609
+ x2 = x1 + this.helperProportions.width,
610
+ y1 = this.positionAbs.top,
611
+ y2 = y1 + this.helperProportions.height,
612
+ l = item.left,
613
+ r = l + item.width,
614
+ t = item.top,
615
+ b = t + item.height,
616
+ dyClick = this.offset.click.top,
617
+ dxClick = this.offset.click.left,
618
+ isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
619
+ ( y1 + dyClick ) < b ),
620
+ isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
621
+ ( x1 + dxClick ) < r ),
622
+ isOverElement = isOverElementHeight && isOverElementWidth;
623
+
624
+ if ( this.options.tolerance === "pointer" ||
625
+ this.options.forcePointerForContainers ||
626
+ ( this.options.tolerance !== "pointer" &&
627
+ this.helperProportions[ this.floating ? "width" : "height" ] >
628
+ item[ this.floating ? "width" : "height" ] )
629
+ ) {
630
+ return isOverElement;
631
+ } else {
632
+
633
+ return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half
634
+ x2 - ( this.helperProportions.width / 2 ) < r && // Left Half
635
+ t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half
636
+ y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half
637
+
638
+ }
639
+ },
640
+
641
+ _intersectsWithPointer: function( item ) {
642
+ var verticalDirection, horizontalDirection,
643
+ isOverElementHeight = ( this.options.axis === "x" ) ||
644
+ this._isOverAxis(
645
+ this.positionAbs.top + this.offset.click.top, item.top, item.height ),
646
+ isOverElementWidth = ( this.options.axis === "y" ) ||
647
+ this._isOverAxis(
648
+ this.positionAbs.left + this.offset.click.left, item.left, item.width ),
649
+ isOverElement = isOverElementHeight && isOverElementWidth;
650
+
651
+ if ( !isOverElement ) {
652
+ return false;
653
+ }
654
+
655
+ verticalDirection = this._getDragVerticalDirection();
656
+ horizontalDirection = this._getDragHorizontalDirection();
657
+
658
+ return this.floating ?
659
+ ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 )
660
+ : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
661
+
662
+ },
663
+
664
+ _intersectsWithSides: function( item ) {
665
+
666
+ var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
667
+ this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
668
+ isOverRightHalf = this._isOverAxis( this.positionAbs.left +
669
+ this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
670
+ verticalDirection = this._getDragVerticalDirection(),
671
+ horizontalDirection = this._getDragHorizontalDirection();
672
+
673
+ if ( this.floating && horizontalDirection ) {
674
+ return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
675
+ ( horizontalDirection === "left" && !isOverRightHalf ) );
676
+ } else {
677
+ return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
678
+ ( verticalDirection === "up" && !isOverBottomHalf ) );
679
+ }
680
+
681
+ },
682
+
683
+ _getDragVerticalDirection: function() {
684
+ var delta = this.positionAbs.top - this.lastPositionAbs.top;
685
+ return delta !== 0 && ( delta > 0 ? "down" : "up" );
686
+ },
687
+
688
+ _getDragHorizontalDirection: function() {
689
+ var delta = this.positionAbs.left - this.lastPositionAbs.left;
690
+ return delta !== 0 && ( delta > 0 ? "right" : "left" );
691
+ },
692
+
693
+ refresh: function( event ) {
694
+ this._refreshItems( event );
695
+ this._setHandleClassName();
696
+ this.refreshPositions();
697
+ return this;
698
+ },
699
+
700
+ _connectWith: function() {
701
+ var options = this.options;
702
+ return options.connectWith.constructor === String ?
703
+ [ options.connectWith ] :
704
+ options.connectWith;
705
+ },
706
+
707
+ _getItemsAsjQuery: function( connected ) {
708
+
709
+ var i, j, cur, inst,
710
+ items = [],
711
+ queries = [],
712
+ connectWith = this._connectWith();
713
+
714
+ if ( connectWith && connected ) {
715
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
716
+ cur = $( connectWith[ i ], this.document[ 0 ] );
717
+ for ( j = cur.length - 1; j >= 0; j-- ) {
718
+ inst = $.data( cur[ j ], this.widgetFullName );
719
+ if ( inst && inst !== this && !inst.options.disabled ) {
720
+ queries.push( [ $.isFunction( inst.options.items ) ?
721
+ inst.options.items.call( inst.element ) :
722
+ $( inst.options.items, inst.element )
723
+ .not( ".ui-sortable-helper" )
724
+ .not( ".ui-sortable-placeholder" ), inst ] );
725
+ }
726
+ }
727
+ }
728
+ }
729
+
730
+ queries.push( [ $.isFunction( this.options.items ) ?
731
+ this.options.items
732
+ .call( this.element, null, { options: this.options, item: this.currentItem } ) :
733
+ $( this.options.items, this.element )
734
+ .not( ".ui-sortable-helper" )
735
+ .not( ".ui-sortable-placeholder" ), this ] );
736
+
737
+ function addItems() {
738
+ items.push( this );
739
+ }
740
+ for ( i = queries.length - 1; i >= 0; i-- ) {
741
+ queries[ i ][ 0 ].each( addItems );
742
+ }
743
+
744
+ return $( items );
745
+
746
+ },
747
+
748
+ _removeCurrentsFromItems: function() {
749
+
750
+ var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" );
751
+
752
+ this.items = $.grep( this.items, function( item ) {
753
+ for ( var j = 0; j < list.length; j++ ) {
754
+ if ( list[ j ] === item.item[ 0 ] ) {
755
+ return false;
756
+ }
757
+ }
758
+ return true;
759
+ } );
760
+
761
+ },
762
+
763
+ _refreshItems: function( event ) {
764
+
765
+ this.items = [];
766
+ this.containers = [ this ];
767
+
768
+ var i, j, cur, inst, targetData, _queries, item, queriesLength,
769
+ items = this.items,
770
+ queries = [ [ $.isFunction( this.options.items ) ?
771
+ this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
772
+ $( this.options.items, this.element ), this ] ],
773
+ connectWith = this._connectWith();
774
+
775
+ //Shouldn't be run the first time through due to massive slow-down
776
+ if ( connectWith && this.ready ) {
777
+ for ( i = connectWith.length - 1; i >= 0; i-- ) {
778
+ cur = $( connectWith[ i ], this.document[ 0 ] );
779
+ for ( j = cur.length - 1; j >= 0; j-- ) {
780
+ inst = $.data( cur[ j ], this.widgetFullName );
781
+ if ( inst && inst !== this && !inst.options.disabled ) {
782
+ queries.push( [ $.isFunction( inst.options.items ) ?
783
+ inst.options.items
784
+ .call( inst.element[ 0 ], event, { item: this.currentItem } ) :
785
+ $( inst.options.items, inst.element ), inst ] );
786
+ this.containers.push( inst );
787
+ }
788
+ }
789
+ }
790
+ }
791
+
792
+ for ( i = queries.length - 1; i >= 0; i-- ) {
793
+ targetData = queries[ i ][ 1 ];
794
+ _queries = queries[ i ][ 0 ];
795
+
796
+ for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
797
+ item = $( _queries[ j ] );
798
+
799
+ // Data for target checking (mouse manager)
800
+ item.data( this.widgetName + "-item", targetData );
801
+
802
+ items.push( {
803
+ item: item,
804
+ instance: targetData,
805
+ width: 0, height: 0,
806
+ left: 0, top: 0
807
+ } );
808
+ }
809
+ }
810
+
811
+ },
812
+
813
+ refreshPositions: function( fast ) {
814
+
815
+ // Determine whether items are being displayed horizontally
816
+ this.floating = this.items.length ?
817
+ this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
818
+ false;
819
+
820
+ //This has to be redone because due to the item being moved out/into the offsetParent,
821
+ // the offsetParent's position will change
822
+ if ( this.offsetParent && this.helper ) {
823
+ this.offset.parent = this._getParentOffset();
824
+ }
825
+
826
+ var i, item, t, p;
827
+
828
+ for ( i = this.items.length - 1; i >= 0; i-- ) {
829
+ item = this.items[ i ];
830
+
831
+ //We ignore calculating positions of all connected containers when we're not over them
832
+ if ( item.instance !== this.currentContainer && this.currentContainer &&
833
+ item.item[ 0 ] !== this.currentItem[ 0 ] ) {
834
+ continue;
835
+ }
836
+
837
+ t = this.options.toleranceElement ?
838
+ $( this.options.toleranceElement, item.item ) :
839
+ item.item;
840
+
841
+ if ( !fast ) {
842
+ item.width = t.outerWidth();
843
+ item.height = t.outerHeight();
844
+ }
845
+
846
+ p = t.offset();
847
+ item.left = p.left;
848
+ item.top = p.top;
849
+ }
850
+
851
+ if ( this.options.custom && this.options.custom.refreshContainers ) {
852
+ this.options.custom.refreshContainers.call( this );
853
+ } else {
854
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
855
+ p = this.containers[ i ].element.offset();
856
+ this.containers[ i ].containerCache.left = p.left;
857
+ this.containers[ i ].containerCache.top = p.top;
858
+ this.containers[ i ].containerCache.width =
859
+ this.containers[ i ].element.outerWidth();
860
+ this.containers[ i ].containerCache.height =
861
+ this.containers[ i ].element.outerHeight();
862
+ }
863
+ }
864
+
865
+ return this;
866
+ },
867
+
868
+ _createPlaceholder: function( that ) {
869
+ that = that || this;
870
+ var className,
871
+ o = that.options;
872
+
873
+ if ( !o.placeholder || o.placeholder.constructor === String ) {
874
+ className = o.placeholder;
875
+ o.placeholder = {
876
+ element: function() {
877
+
878
+ var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(),
879
+ element = $( "<" + nodeName + ">", that.document[ 0 ] );
880
+
881
+ that._addClass( element, "ui-sortable-placeholder",
882
+ className || that.currentItem[ 0 ].className )
883
+ ._removeClass( element, "ui-sortable-helper" );
884
+
885
+ if ( nodeName === "tbody" ) {
886
+ that._createTrPlaceholder(
887
+ that.currentItem.find( "tr" ).eq( 0 ),
888
+ $( "<tr>", that.document[ 0 ] ).appendTo( element )
889
+ );
890
+ } else if ( nodeName === "tr" ) {
891
+ that._createTrPlaceholder( that.currentItem, element );
892
+ } else if ( nodeName === "img" ) {
893
+ element.attr( "src", that.currentItem.attr( "src" ) );
894
+ }
895
+
896
+ if ( !className ) {
897
+ element.css( "visibility", "hidden" );
898
+ }
899
+
900
+ return element;
901
+ },
902
+ update: function( container, p ) {
903
+
904
+ // 1. If a className is set as 'placeholder option, we don't force sizes -
905
+ // the class is responsible for that
906
+ // 2. The option 'forcePlaceholderSize can be enabled to force it even if a
907
+ // class name is specified
908
+ if ( className && !o.forcePlaceholderSize ) {
909
+ return;
910
+ }
911
+
912
+ //If the element doesn't have a actual height by itself (without styles coming
913
+ // from a stylesheet), it receives the inline height from the dragged item
914
+ if ( !p.height() ) {
915
+ p.height(
916
+ that.currentItem.innerHeight() -
917
+ parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
918
+ parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
919
+ }
920
+ if ( !p.width() ) {
921
+ p.width(
922
+ that.currentItem.innerWidth() -
923
+ parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
924
+ parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
925
+ }
926
+ }
927
+ };
928
+ }
929
+
930
+ //Create the placeholder
931
+ that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) );
932
+
933
+ //Append it after the actual current item
934
+ that.currentItem.after( that.placeholder );
935
+
936
+ //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
937
+ o.placeholder.update( that, that.placeholder );
938
+
939
+ },
940
+
941
+ _createTrPlaceholder: function( sourceTr, targetTr ) {
942
+ var that = this;
943
+
944
+ sourceTr.children().each( function() {
945
+ $( "<td>&#160;</td>", that.document[ 0 ] )
946
+ .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
947
+ .appendTo( targetTr );
948
+ } );
949
+ },
950
+
951
+ _contactContainers: function( event ) {
952
+ var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
953
+ floating, axis,
954
+ innermostContainer = null,
955
+ innermostIndex = null;
956
+
957
+ // Get innermost container that intersects with item
958
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
959
+
960
+ // Never consider a container that's located within the item itself
961
+ if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
962
+ continue;
963
+ }
964
+
965
+ if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
966
+
967
+ // If we've already found a container and it's more "inner" than this, then continue
968
+ if ( innermostContainer &&
969
+ $.contains(
970
+ this.containers[ i ].element[ 0 ],
971
+ innermostContainer.element[ 0 ] ) ) {
972
+ continue;
973
+ }
974
+
975
+ innermostContainer = this.containers[ i ];
976
+ innermostIndex = i;
977
+
978
+ } else {
979
+
980
+ // container doesn't intersect. trigger "out" event if necessary
981
+ if ( this.containers[ i ].containerCache.over ) {
982
+ this.containers[ i ]._trigger( "out", event, this._uiHash( this ) );
983
+ this.containers[ i ].containerCache.over = 0;
984
+ }
985
+ }
986
+
987
+ }
988
+
989
+ // If no intersecting containers found, return
990
+ if ( !innermostContainer ) {
991
+ return;
992
+ }
993
+
994
+ // Move the item into the container if it's not there already
995
+ if ( this.containers.length === 1 ) {
996
+ if ( !this.containers[ innermostIndex ].containerCache.over ) {
997
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
998
+ this.containers[ innermostIndex ].containerCache.over = 1;
999
+ }
1000
+ } else {
1001
+
1002
+ // When entering a new container, we will find the item with the least distance and
1003
+ // append our item near it
1004
+ dist = 10000;
1005
+ itemWithLeastDistance = null;
1006
+ floating = innermostContainer.floating || this._isFloating( this.currentItem );
1007
+ posProperty = floating ? "left" : "top";
1008
+ sizeProperty = floating ? "width" : "height";
1009
+ axis = floating ? "pageX" : "pageY";
1010
+
1011
+ for ( j = this.items.length - 1; j >= 0; j-- ) {
1012
+ if ( !$.contains(
1013
+ this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
1014
+ ) {
1015
+ continue;
1016
+ }
1017
+ if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
1018
+ continue;
1019
+ }
1020
+
1021
+ cur = this.items[ j ].item.offset()[ posProperty ];
1022
+ nearBottom = false;
1023
+ if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) {
1024
+ nearBottom = true;
1025
+ }
1026
+
1027
+ if ( Math.abs( event[ axis ] - cur ) < dist ) {
1028
+ dist = Math.abs( event[ axis ] - cur );
1029
+ itemWithLeastDistance = this.items[ j ];
1030
+ this.direction = nearBottom ? "up" : "down";
1031
+ }
1032
+ }
1033
+
1034
+ //Check if dropOnEmpty is enabled
1035
+ if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) {
1036
+ return;
1037
+ }
1038
+
1039
+ if ( this.currentContainer === this.containers[ innermostIndex ] ) {
1040
+ if ( !this.currentContainer.containerCache.over ) {
1041
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
1042
+ this.currentContainer.containerCache.over = 1;
1043
+ }
1044
+ return;
1045
+ }
1046
+
1047
+ itemWithLeastDistance ?
1048
+ this._rearrange( event, itemWithLeastDistance, null, true ) :
1049
+ this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
1050
+ this._trigger( "change", event, this._uiHash() );
1051
+ this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
1052
+ this.currentContainer = this.containers[ innermostIndex ];
1053
+
1054
+ //Update the placeholder
1055
+ this.options.placeholder.update( this.currentContainer, this.placeholder );
1056
+
1057
+ this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
1058
+ this.containers[ innermostIndex ].containerCache.over = 1;
1059
+ }
1060
+
1061
+ },
1062
+
1063
+ _createHelper: function( event ) {
1064
+
1065
+ var o = this.options,
1066
+ helper = $.isFunction( o.helper ) ?
1067
+ $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
1068
+ ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
1069
+
1070
+ //Add the helper to the DOM if that didn't happen already
1071
+ if ( !helper.parents( "body" ).length ) {
1072
+ $( o.appendTo !== "parent" ?
1073
+ o.appendTo :
1074
+ this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] );
1075
+ }
1076
+
1077
+ if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
1078
+ this._storedCSS = {
1079
+ width: this.currentItem[ 0 ].style.width,
1080
+ height: this.currentItem[ 0 ].style.height,
1081
+ position: this.currentItem.css( "position" ),
1082
+ top: this.currentItem.css( "top" ),
1083
+ left: this.currentItem.css( "left" )
1084
+ };
1085
+ }
1086
+
1087
+ if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
1088
+ helper.width( this.currentItem.width() );
1089
+ }
1090
+ if ( !helper[ 0 ].style.height || o.forceHelperSize ) {
1091
+ helper.height( this.currentItem.height() );
1092
+ }
1093
+
1094
+ return helper;
1095
+
1096
+ },
1097
+
1098
+ _adjustOffsetFromHelper: function( obj ) {
1099
+ if ( typeof obj === "string" ) {
1100
+ obj = obj.split( " " );
1101
+ }
1102
+ if ( $.isArray( obj ) ) {
1103
+ obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
1104
+ }
1105
+ if ( "left" in obj ) {
1106
+ this.offset.click.left = obj.left + this.margins.left;
1107
+ }
1108
+ if ( "right" in obj ) {
1109
+ this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
1110
+ }
1111
+ if ( "top" in obj ) {
1112
+ this.offset.click.top = obj.top + this.margins.top;
1113
+ }
1114
+ if ( "bottom" in obj ) {
1115
+ this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
1116
+ }
1117
+ },
1118
+
1119
+ _getParentOffset: function() {
1120
+
1121
+ //Get the offsetParent and cache its position
1122
+ this.offsetParent = this.helper.offsetParent();
1123
+ var po = this.offsetParent.offset();
1124
+
1125
+ // This is a special case where we need to modify a offset calculated on start, since the
1126
+ // following happened:
1127
+ // 1. The position of the helper is absolute, so it's position is calculated based on the
1128
+ // next positioned parent
1129
+ // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
1130
+ // the document, which means that the scroll is included in the initial calculation of the
1131
+ // offset of the parent, and never recalculated upon drag
1132
+ if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1133
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
1134
+ po.left += this.scrollParent.scrollLeft();
1135
+ po.top += this.scrollParent.scrollTop();
1136
+ }
1137
+
1138
+ // This needs to be actually done for all browsers, since pageX/pageY includes this
1139
+ // information with an ugly IE fix
1140
+ if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
1141
+ ( this.offsetParent[ 0 ].tagName &&
1142
+ this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
1143
+ po = { top: 0, left: 0 };
1144
+ }
1145
+
1146
+ return {
1147
+ top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
1148
+ left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
1149
+ };
1150
+
1151
+ },
1152
+
1153
+ _getRelativeOffset: function() {
1154
+
1155
+ if ( this.cssPosition === "relative" ) {
1156
+ var p = this.currentItem.position();
1157
+ return {
1158
+ top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
1159
+ this.scrollParent.scrollTop(),
1160
+ left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
1161
+ this.scrollParent.scrollLeft()
1162
+ };
1163
+ } else {
1164
+ return { top: 0, left: 0 };
1165
+ }
1166
+
1167
+ },
1168
+
1169
+ _cacheMargins: function() {
1170
+ this.margins = {
1171
+ left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ),
1172
+ top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 )
1173
+ };
1174
+ },
1175
+
1176
+ _cacheHelperProportions: function() {
1177
+ this.helperProportions = {
1178
+ width: this.helper.outerWidth(),
1179
+ height: this.helper.outerHeight()
1180
+ };
1181
+ },
1182
+
1183
+ _setContainment: function() {
1184
+
1185
+ var ce, co, over,
1186
+ o = this.options;
1187
+ if ( o.containment === "parent" ) {
1188
+ o.containment = this.helper[ 0 ].parentNode;
1189
+ }
1190
+ if ( o.containment === "document" || o.containment === "window" ) {
1191
+ this.containment = [
1192
+ 0 - this.offset.relative.left - this.offset.parent.left,
1193
+ 0 - this.offset.relative.top - this.offset.parent.top,
1194
+ o.containment === "document" ?
1195
+ this.document.width() :
1196
+ this.window.width() - this.helperProportions.width - this.margins.left,
1197
+ ( o.containment === "document" ?
1198
+ ( this.document.height() || document.body.parentNode.scrollHeight ) :
1199
+ this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
1200
+ ) - this.helperProportions.height - this.margins.top
1201
+ ];
1202
+ }
1203
+
1204
+ if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) {
1205
+ ce = $( o.containment )[ 0 ];
1206
+ co = $( o.containment ).offset();
1207
+ over = ( $( ce ).css( "overflow" ) !== "hidden" );
1208
+
1209
+ this.containment = [
1210
+ co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
1211
+ ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
1212
+ co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
1213
+ ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
1214
+ co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
1215
+ ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
1216
+ ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
1217
+ this.helperProportions.width - this.margins.left,
1218
+ co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
1219
+ ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
1220
+ ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
1221
+ this.helperProportions.height - this.margins.top
1222
+ ];
1223
+ }
1224
+
1225
+ },
1226
+
1227
+ _convertPositionTo: function( d, pos ) {
1228
+
1229
+ if ( !pos ) {
1230
+ pos = this.position;
1231
+ }
1232
+ var mod = d === "absolute" ? 1 : -1,
1233
+ scroll = this.cssPosition === "absolute" &&
1234
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1235
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1236
+ this.offsetParent :
1237
+ this.scrollParent,
1238
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1239
+
1240
+ return {
1241
+ top: (
1242
+
1243
+ // The absolute mouse position
1244
+ pos.top +
1245
+
1246
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1247
+ this.offset.relative.top * mod +
1248
+
1249
+ // The offsetParent's offset without borders (offset + border)
1250
+ this.offset.parent.top * mod -
1251
+ ( ( this.cssPosition === "fixed" ?
1252
+ -this.scrollParent.scrollTop() :
1253
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
1254
+ ),
1255
+ left: (
1256
+
1257
+ // The absolute mouse position
1258
+ pos.left +
1259
+
1260
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1261
+ this.offset.relative.left * mod +
1262
+
1263
+ // The offsetParent's offset without borders (offset + border)
1264
+ this.offset.parent.left * mod -
1265
+ ( ( this.cssPosition === "fixed" ?
1266
+ -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
1267
+ scroll.scrollLeft() ) * mod )
1268
+ )
1269
+ };
1270
+
1271
+ },
1272
+
1273
+ _generatePosition: function( event ) {
1274
+
1275
+ var top, left,
1276
+ o = this.options,
1277
+ pageX = event.pageX,
1278
+ pageY = event.pageY,
1279
+ scroll = this.cssPosition === "absolute" &&
1280
+ !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1281
+ $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
1282
+ this.offsetParent :
1283
+ this.scrollParent,
1284
+ scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
1285
+
1286
+ // This is another very weird special case that only happens for relative elements:
1287
+ // 1. If the css position is relative
1288
+ // 2. and the scroll parent is the document or similar to the offset parent
1289
+ // we have to refresh the relative offset during the scroll so there are no jumps
1290
+ if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
1291
+ this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
1292
+ this.offset.relative = this._getRelativeOffset();
1293
+ }
1294
+
1295
+ /*
1296
+ * - Position constraining -
1297
+ * Constrain the position to a mix of grid, containment.
1298
+ */
1299
+
1300
+ if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options
1301
+
1302
+ if ( this.containment ) {
1303
+ if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) {
1304
+ pageX = this.containment[ 0 ] + this.offset.click.left;
1305
+ }
1306
+ if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) {
1307
+ pageY = this.containment[ 1 ] + this.offset.click.top;
1308
+ }
1309
+ if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) {
1310
+ pageX = this.containment[ 2 ] + this.offset.click.left;
1311
+ }
1312
+ if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) {
1313
+ pageY = this.containment[ 3 ] + this.offset.click.top;
1314
+ }
1315
+ }
1316
+
1317
+ if ( o.grid ) {
1318
+ top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
1319
+ o.grid[ 1 ] ) * o.grid[ 1 ];
1320
+ pageY = this.containment ?
1321
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] &&
1322
+ top - this.offset.click.top <= this.containment[ 3 ] ) ?
1323
+ top :
1324
+ ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
1325
+ top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
1326
+ top;
1327
+
1328
+ left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
1329
+ o.grid[ 0 ] ) * o.grid[ 0 ];
1330
+ pageX = this.containment ?
1331
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] &&
1332
+ left - this.offset.click.left <= this.containment[ 2 ] ) ?
1333
+ left :
1334
+ ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
1335
+ left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
1336
+ left;
1337
+ }
1338
+
1339
+ }
1340
+
1341
+ return {
1342
+ top: (
1343
+
1344
+ // The absolute mouse position
1345
+ pageY -
1346
+
1347
+ // Click offset (relative to the element)
1348
+ this.offset.click.top -
1349
+
1350
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1351
+ this.offset.relative.top -
1352
+
1353
+ // The offsetParent's offset without borders (offset + border)
1354
+ this.offset.parent.top +
1355
+ ( ( this.cssPosition === "fixed" ?
1356
+ -this.scrollParent.scrollTop() :
1357
+ ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
1358
+ ),
1359
+ left: (
1360
+
1361
+ // The absolute mouse position
1362
+ pageX -
1363
+
1364
+ // Click offset (relative to the element)
1365
+ this.offset.click.left -
1366
+
1367
+ // Only for relative positioned nodes: Relative offset from element to offset parent
1368
+ this.offset.relative.left -
1369
+
1370
+ // The offsetParent's offset without borders (offset + border)
1371
+ this.offset.parent.left +
1372
+ ( ( this.cssPosition === "fixed" ?
1373
+ -this.scrollParent.scrollLeft() :
1374
+ scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
1375
+ )
1376
+ };
1377
+
1378
+ },
1379
+
1380
+ _rearrange: function( event, i, a, hardRefresh ) {
1381
+
1382
+ a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) :
1383
+ i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
1384
+ ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
1385
+
1386
+ //Various things done here to improve the performance:
1387
+ // 1. we create a setTimeout, that calls refreshPositions
1388
+ // 2. on the instance, we have a counter variable, that get's higher after every append
1389
+ // 3. on the local scope, we copy the counter variable, and check in the timeout,
1390
+ // if it's still the same
1391
+ // 4. this lets only the last addition to the timeout stack through
1392
+ this.counter = this.counter ? ++this.counter : 1;
1393
+ var counter = this.counter;
1394
+
1395
+ this._delay( function() {
1396
+ if ( counter === this.counter ) {
1397
+
1398
+ //Precompute after each DOM insertion, NOT on mousemove
1399
+ this.refreshPositions( !hardRefresh );
1400
+ }
1401
+ } );
1402
+
1403
+ },
1404
+
1405
+ _clear: function( event, noPropagation ) {
1406
+
1407
+ this.reverting = false;
1408
+
1409
+ // We delay all events that have to be triggered to after the point where the placeholder
1410
+ // has been removed and everything else normalized again
1411
+ var i,
1412
+ delayedTriggers = [];
1413
+
1414
+ // We first have to update the dom position of the actual currentItem
1415
+ // Note: don't do it if the current item is already removed (by a user), or it gets
1416
+ // reappended (see #4088)
1417
+ if ( !this._noFinalSort && this.currentItem.parent().length ) {
1418
+ this.placeholder.before( this.currentItem );
1419
+ }
1420
+ this._noFinalSort = null;
1421
+
1422
+ if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) {
1423
+ for ( i in this._storedCSS ) {
1424
+ if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) {
1425
+ this._storedCSS[ i ] = "";
1426
+ }
1427
+ }
1428
+ this.currentItem.css( this._storedCSS );
1429
+ this._removeClass( this.currentItem, "ui-sortable-helper" );
1430
+ } else {
1431
+ this.currentItem.show();
1432
+ }
1433
+
1434
+ if ( this.fromOutside && !noPropagation ) {
1435
+ delayedTriggers.push( function( event ) {
1436
+ this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
1437
+ } );
1438
+ }
1439
+ if ( ( this.fromOutside ||
1440
+ this.domPosition.prev !==
1441
+ this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
1442
+ this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
1443
+
1444
+ // Trigger update callback if the DOM position has changed
1445
+ delayedTriggers.push( function( event ) {
1446
+ this._trigger( "update", event, this._uiHash() );
1447
+ } );
1448
+ }
1449
+
1450
+ // Check if the items Container has Changed and trigger appropriate
1451
+ // events.
1452
+ if ( this !== this.currentContainer ) {
1453
+ if ( !noPropagation ) {
1454
+ delayedTriggers.push( function( event ) {
1455
+ this._trigger( "remove", event, this._uiHash() );
1456
+ } );
1457
+ delayedTriggers.push( ( function( c ) {
1458
+ return function( event ) {
1459
+ c._trigger( "receive", event, this._uiHash( this ) );
1460
+ };
1461
+ } ).call( this, this.currentContainer ) );
1462
+ delayedTriggers.push( ( function( c ) {
1463
+ return function( event ) {
1464
+ c._trigger( "update", event, this._uiHash( this ) );
1465
+ };
1466
+ } ).call( this, this.currentContainer ) );
1467
+ }
1468
+ }
1469
+
1470
+ //Post events to containers
1471
+ function delayEvent( type, instance, container ) {
1472
+ return function( event ) {
1473
+ container._trigger( type, event, instance._uiHash( instance ) );
1474
+ };
1475
+ }
1476
+ for ( i = this.containers.length - 1; i >= 0; i-- ) {
1477
+ if ( !noPropagation ) {
1478
+ delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
1479
+ }
1480
+ if ( this.containers[ i ].containerCache.over ) {
1481
+ delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
1482
+ this.containers[ i ].containerCache.over = 0;
1483
+ }
1484
+ }
1485
+
1486
+ //Do what was originally in plugins
1487
+ if ( this.storedCursor ) {
1488
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
1489
+ this.storedStylesheet.remove();
1490
+ }
1491
+ if ( this._storedOpacity ) {
1492
+ this.helper.css( "opacity", this._storedOpacity );
1493
+ }
1494
+ if ( this._storedZIndex ) {
1495
+ this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex );
1496
+ }
1497
+
1498
+ this.dragging = false;
1499
+
1500
+ if ( !noPropagation ) {
1501
+ this._trigger( "beforeStop", event, this._uiHash() );
1502
+ }
1503
+
1504
+ //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
1505
+ // it unbinds ALL events from the original node!
1506
+ this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
1507
+
1508
+ if ( !this.cancelHelperRemoval ) {
1509
+ if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
1510
+ this.helper.remove();
1511
+ }
1512
+ this.helper = null;
1513
+ }
1514
+
1515
+ if ( !noPropagation ) {
1516
+ for ( i = 0; i < delayedTriggers.length; i++ ) {
1517
+
1518
+ // Trigger all delayed events
1519
+ delayedTriggers[ i ].call( this, event );
1520
+ }
1521
+ this._trigger( "stop", event, this._uiHash() );
1522
+ }
1523
+
1524
+ this.fromOutside = false;
1525
+ return !this.cancelHelperRemoval;
1526
+
1527
+ },
1528
+
1529
+ _trigger: function() {
1530
+ if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) {
1531
+ this.cancel();
1532
+ }
1533
+ },
1534
+
1535
+ _uiHash: function( _inst ) {
1536
+ var inst = _inst || this;
1537
+ return {
1538
+ helper: inst.helper,
1539
+ placeholder: inst.placeholder || $( [] ),
1540
+ position: inst.position,
1541
+ originalPosition: inst.originalPosition,
1542
+ offset: inst.positionAbs,
1543
+ item: inst.currentItem,
1544
+ sender: _inst ? _inst.element : null
1545
+ };
1546
+ }
1547
+
1548
+ } );
1549
+
1550
+ } ) );
js/sortable.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery UI Sortable 1.12.1
3
+ * http://jqueryui.com
4
+ *
5
+ * Copyright jQuery Foundation and other contributors
6
+ * Released under the MIT license.
7
+ * http://jquery.org/license
8
+ */
9
+ !function(t){"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(u){return u.widget("ui.sortable",u.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),u.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),!!(i=u.data(t.target,o.widgetName+"-item")===o?u(t.target):i)&&(!(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,o,r=this.options,n=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<r.scrollSensitivity?this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop+r.scrollSpeed:t.pageY-this.overflowOffset.top<r.scrollSensitivity&&(this.scrollParent[0].scrollTop=n=this.scrollParent[0].scrollTop-r.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<r.scrollSensitivity?this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft+r.scrollSpeed:t.pageX-this.overflowOffset.left<r.scrollSensitivity&&(this.scrollParent[0].scrollLeft=n=this.scrollParent[0].scrollLeft-r.scrollSpeed)):(t.pageY-this.document.scrollTop()<r.scrollSensitivity?n=this.document.scrollTop(this.document.scrollTop()-r.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<r.scrollSensitivity&&(n=this.document.scrollTop(this.document.scrollTop()+r.scrollSpeed)),t.pageX-this.document.scrollLeft()<r.scrollSensitivity?n=this.document.scrollLeft(this.document.scrollLeft()-r.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<r.scrollSensitivity&&(n=this.document.scrollLeft(this.document.scrollLeft()+r.scrollSpeed))),!1!==n&&u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new u.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection(),this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),t=this._getDragHorizontalDirection();return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push([u.isFunction(o.options.items)?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push([u.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[[u.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push([u.isFunction(o.options.items)?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],a=(n=c[e][i=0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},refreshPositions:function(t){var e,i,s,o;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),e=this.items.length-1;0<=e;e--)(i=this.items[e]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?u(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),o=s.offset(),i.left=o.left,i.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)o=this.containers[e].element.offset(),this.containers[e].containerCache.left=o.left,this.containers[e].containerCache.top=o.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,o.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=u("<"+t+">",i.document[0]);return i._addClass(e,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("<tr>",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u("<td>&#160;</td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"pageX":"pageY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)<i&&(i=Math.abs(t[l]-n),s=this.items[e],this.direction=h?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[p]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t=u.isFunction(e.helper)?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||u("parent"!==e.appendTo?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=u.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],e=u(i.containment).offset(),i="hidden"!==u(t).css("overflow"),this.containment=[e.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})});
js/wppa-admin-scripts.js CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
- /* Version 8.1.00.001
5
  /* Various js routines used in admin pages
6
  */
7
 
@@ -1014,7 +1014,7 @@ function wppaAjaxUpdateOptionCheckBox(slug, elem) {
1014
  url += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1015
  if (elem.checked) url += '&value=yes';
1016
  else url += '&value=no';
1017
- //wppaConsoleLog(url,'force');
1018
  // Process the result
1019
  xmlhttp.onreadystatechange=function() {
1020
  switch (xmlhttp.readyState) {
@@ -1153,6 +1153,9 @@ function wppaMaintenanceProc(slug, intern, asCronJob ) {
1153
  if ( ! asCronJob ) {
1154
  jQuery("#"+slug+"_status").html('Pending');
1155
  }
 
 
 
1156
  },
1157
 
1158
  error: function( xhr, status, error ) {
@@ -1263,6 +1266,14 @@ function wppaAjaxPopupWindow( slug ) {
1263
  jQuery( '.ui-widget-overlay' ).css({
1264
  backgroundColor: 'transparent',
1265
  });
 
 
 
 
 
 
 
 
1266
  }
1267
  }
1268
 
@@ -1374,7 +1385,6 @@ function wppaEncode(xtext) {
1374
  if (idx < temp.length) result += '||PLUS||';
1375
  }
1376
 
1377
- // alert('encoded result='+result);
1378
  return result;
1379
  }
1380
 
@@ -1402,6 +1412,7 @@ function wppaGetXmlHttp() {
1402
  }
1403
 
1404
  function wppaPhotoStatusChange(id) {
 
1405
  // Init
1406
  jQuery('#psdesc-'+id).css({display: 'none'});
1407
  if ( ! jQuery('#status-'+id) ) return;
@@ -1502,25 +1513,7 @@ function wppaReload(arg) {
1502
  document.location.reload( true );
1503
  }
1504
  }
1505
- /*
1506
- function wppaTrim (str, chr) {
1507
- if ( ! chr ) {
1508
- */
1509
- // return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
1510
- /* }
1511
- else {
1512
- // Ltrim
1513
- while ( str.substr( 0,1 ) == chr ) {
1514
- str = str.substr( 1 );
1515
- }
1516
- // Rtrim
1517
- while ( str.substr( str.length-1, 1 ) == chr ) {
1518
- str = str.substr( 0, str.length-1 );
1519
- }
1520
- }
1521
- return str;
1522
- }
1523
- */
1524
  var wppaFeCount = 0;
1525
  function wppaFeAjaxLog(key) {
1526
 
@@ -1705,6 +1698,7 @@ function wppaAjaxUpdateTogo(slug) {
1705
  type: 'GET',
1706
  timeout: 100000,
1707
  beforeSend: function( xhr ) {
 
1708
  },
1709
  success: function( result, status, xhr ) {
1710
 
@@ -1723,7 +1717,7 @@ function wppaAjaxUpdateTogo(slug) {
1723
  }
1724
  jQuery( '#' + slug + '_status' ).html( New );
1725
 
1726
- setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 5000 );
1727
  },
1728
  error: function( xhr ) {
1729
  },
@@ -1814,7 +1808,7 @@ function wppaTimedConfirm( text ) {
1814
  }
1815
 
1816
  function wppaAjaxGetSpinnerHtml( type, target ) {
1817
- //alert(type+' '+target);
1818
  jQuery.ajax( { url: wppaAjaxUrl,
1819
  data: 'action=wppa' +
1820
  '&wppa-action=update-option' +
@@ -1827,7 +1821,7 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
1827
  beforeSend: function( xhr ) {
1828
  },
1829
  success: function( result, status, xhr ) {
1830
- //alert(result);
1831
  // Split status and data
1832
  var data = result.split('|');
1833
 
@@ -1836,19 +1830,18 @@ function wppaAjaxGetSpinnerHtml( type, target ) {
1836
 
1837
  },
1838
  error: function( xhr ) {
1839
- //alert('Error');
1840
  },
1841
  complete: function( xhr ) {
1842
- //alert('Complete');
1843
  }
1844
  } );
1845
  }
1846
 
1847
 
1848
- // Movable horizon on photo admin page
1849
  function wppaDragHorizon(elmnt) {
1850
 
1851
- // var pos1 = 0, pos3 = 0;
1852
  var pos2 = 0, pos4 = 0;
1853
 
1854
  elmnt.onmousedown = dragMouseDown;
@@ -1889,6 +1882,127 @@ function wppaDragHorizon(elmnt) {
1889
  }
1890
  }
1891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1892
  // Replace log
1893
  function wppaAjaxReplaceLog() {
1894
 
@@ -1912,3 +2026,28 @@ function wppaAjaxReplaceLog() {
1912
  }
1913
  });
1914
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* admin-scripts.js */
2
  /* Package: wp-photo-album-plus
3
  /*
4
+ /* Version 8.1.00.004
5
  /* Various js routines used in admin pages
6
  */
7
 
1014
  url += '&wppa-nonce='+document.getElementById('wppa-nonce').value;
1015
  if (elem.checked) url += '&value=yes';
1016
  else url += '&value=no';
1017
+
1018
  // Process the result
1019
  xmlhttp.onreadystatechange=function() {
1020
  switch (xmlhttp.readyState) {
1153
  if ( ! asCronJob ) {
1154
  jQuery("#"+slug+"_status").html('Pending');
1155
  }
1156
+
1157
+ // Start update togo
1158
+ setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 1000 );
1159
  },
1160
 
1161
  error: function( xhr, status, error ) {
1266
  jQuery( '.ui-widget-overlay' ).css({
1267
  backgroundColor: 'transparent',
1268
  });
1269
+
1270
+ setTimeout( function() {
1271
+ if (jQuery("#wppa-maintenance-list").niceScroll) {
1272
+ jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{});
1273
+ };
1274
+ }, 1000 );
1275
+
1276
+ /* ' . wppa_opt( 'nicescroll_opts' ) . ' */
1277
  }
1278
  }
1279
 
1385
  if (idx < temp.length) result += '||PLUS||';
1386
  }
1387
 
 
1388
  return result;
1389
  }
1390
 
1412
  }
1413
 
1414
  function wppaPhotoStatusChange(id) {
1415
+
1416
  // Init
1417
  jQuery('#psdesc-'+id).css({display: 'none'});
1418
  if ( ! jQuery('#status-'+id) ) return;
1513
  document.location.reload( true );
1514
  }
1515
  }
1516
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1517
  var wppaFeCount = 0;
1518
  function wppaFeAjaxLog(key) {
1519
 
1698
  type: 'GET',
1699
  timeout: 100000,
1700
  beforeSend: function( xhr ) {
1701
+ // wppaConsoleLog('Requesting togo for slug '+slug, 'force');
1702
  },
1703
  success: function( result, status, xhr ) {
1704
 
1717
  }
1718
  jQuery( '#' + slug + '_status' ).html( New );
1719
 
1720
+ setTimeout( function() {wppaAjaxUpdateTogo(slug);}, 1000 );
1721
  },
1722
  error: function( xhr ) {
1723
  },
1808
  }
1809
 
1810
  function wppaAjaxGetSpinnerHtml( type, target ) {
1811
+
1812
  jQuery.ajax( { url: wppaAjaxUrl,
1813
  data: 'action=wppa' +
1814
  '&wppa-action=update-option' +
1821
  beforeSend: function( xhr ) {
1822
  },
1823
  success: function( result, status, xhr ) {
1824
+
1825
  // Split status and data
1826
  var data = result.split('|');
1827
 
1830
 
1831
  },
1832
  error: function( xhr ) {
1833
+
1834
  },
1835
  complete: function( xhr ) {
1836
+
1837
  }
1838
  } );
1839
  }
1840
 
1841
 
1842
+ // Movable wppa-horizon on photo admin page
1843
  function wppaDragHorizon(elmnt) {
1844
 
 
1845
  var pos2 = 0, pos4 = 0;
1846
 
1847
  elmnt.onmousedown = dragMouseDown;
1882
  }
1883
  }
1884
 
1885
+ // Photo admin page specific functions
1886
+ function wppaBulkActionChange( elm, id ) {
1887
+ wppa_setCookie( 'wppa_bulk_action',elm.value,365 );
1888
+ if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' );
1889
+ else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' );
1890
+ if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' );
1891
+ else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' );
1892
+ if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' );
1893
+ else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' );
1894
+ }
1895
+ function wppaBulkDoitOnClick() {
1896
+ var photos = jQuery( '.wppa-bulk-photo' );
1897
+ var count=0;
1898
+ for ( i=0; i< photos.length; i++ ) {
1899
+ var photo = photos[i];
1900
+ if ( photo.checked ) count++;
1901
+ }
1902
+ if ( count == 0 ) {
1903
+ alert( 'No photos selected' );
1904
+ return false;
1905
+ }
1906
+ var action = document.getElementById( 'wppa-bulk-action' ).value;
1907
+ switch ( action ) {
1908
+ case '':
1909
+ alert( 'No action selected' );
1910
+ return false;
1911
+ break;
1912
+ case 'wppa-bulk-delete':
1913
+ break;
1914
+ case 'wppa-bulk-move-to':
1915
+ case 'wppa-bulk-copy-to':
1916
+ var album = document.getElementById( 'wppa-bulk-album' ).value;
1917
+ if ( album == 0 ) {
1918
+ alert( 'No album selected' );
1919
+ return false;
1920
+ }
1921
+ break;
1922
+ case 'wppa-bulk-status':
1923
+ var status = document.getElementById( 'wppa-bulk-status' ).value;
1924
+ if ( status == 0 ) {
1925
+ alert( 'No status selected' );
1926
+ return false;
1927
+ }
1928
+ break;
1929
+ case 'wppa-bulk-owner':
1930
+ var owner = documnet.getElementById( 'wppa-bulk-owner' ).value;
1931
+ if ( owner == 0 ) {
1932
+ alert( 'No new owner selected' );
1933
+ return false;
1934
+ }
1935
+ break;
1936
+ default:
1937
+ alert( 'Unimplemented action requested: '+action );
1938
+ return false;
1939
+ break;
1940
+
1941
+ }
1942
+ return true;
1943
+ }
1944
+ function wppaSetThumbsize( elm ) {
1945
+ var thumbsize = elm.value;
1946
+ wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 );
1947
+ jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' );
1948
+ jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' );
1949
+ jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' );
1950
+ }
1951
+ jQuery(document).ready( function() {
1952
+ if ( !document.getElementById( 'wppa-bulk-action' ) ) return;
1953
+ var action = wppa_getCookie( 'wppa_bulk_action' );
1954
+ document.getElementById( 'wppa-bulk-action' ).value = action;
1955
+ if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
1956
+ jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
1957
+ document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
1958
+ }
1959
+ if ( action == 'wppa-bulk-status' ) {
1960
+ jQuery( '#wppa-bulk-status' ).css( 'display','inline' );
1961
+ document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' );
1962
+ }
1963
+ if ( action == 'wppa-bulk-owner' ) {
1964
+ jQuery( '#wppa-bulk-owner' ).css( 'display','inline' );
1965
+ document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' );
1966
+ }
1967
+ } );
1968
+
1969
+ function wppaToggleConfirmDelete( elm ) {
1970
+ var status = jQuery( elm ).prop( 'checked' );
1971
+ if ( status ) {
1972
+ wppa_setCookie( 'wppaConfirmDelete', 'checked', 365 );
1973
+ }
1974
+ else {
1975
+ wppa_setCookie( 'wppaConfirmDelete', 'unchecked', 365 );
1976
+ }
1977
+ }
1978
+ function wppaToggleConfirmMove( elm ) {
1979
+ var status = jQuery( elm ).prop( 'checked' );
1980
+ if ( status ) {
1981
+ wppa_setCookie( 'wppaConfirmMove', 'checked', 365 );
1982
+ }
1983
+ else {
1984
+ wppa_setCookie( 'wppaConfirmMove', 'unchecked', 365 );
1985
+ }
1986
+ }
1987
+ function wppaSetConfirmDelete( id ) {
1988
+ var status = wppa_getCookie( 'wppaConfirmDelete' );
1989
+ if ( status == 'checked' ) {
1990
+ jQuery( '#' + id ).prop( 'checked', true );
1991
+ }
1992
+ else {
1993
+ jQuery( '#' + id ).prop( 'checked', false );
1994
+ }
1995
+ }
1996
+ function wppaSetConfirmMove( id ) {
1997
+ var status = wppa_getCookie( 'wppaConfirmMove' );
1998
+ if ( status == 'checked' ) {
1999
+ jQuery( '#' + id ).prop( 'checked', true );
2000
+ }
2001
+ else {
2002
+ jQuery( '#' + id ).prop( 'checked', false );
2003
+ }
2004
+ }
2005
+
2006
  // Replace log
2007
  function wppaAjaxReplaceLog() {
2008
 
2026
  }
2027
  });
2028
  }
2029
+
2030
+ // Hide admin spinner
2031
+ jQuery(document).ready( function() {
2032
+ setTimeout( "wppaTestAdminReady()", 200 );
2033
+ });
2034
+ function wppaTestAdminReady() {
2035
+ if ( document.readyState === "complete" ) {
2036
+ jQuery( "#wppa-admin-spinner" ).fadeOut();
2037
+ }
2038
+ else {
2039
+ setTimeout( "wppaTestAdminReady()", 200 );
2040
+ }
2041
+ }
2042
+
2043
+ // Util for comment admin
2044
+ function wppaCommentAdminUpdateHref( id ) {
2045
+
2046
+ var val = encodeURIComponent(jQuery("#commenttext-"+id).val());
2047
+ var href = jQuery("#href-"+id).attr("href");
2048
+ var arr = href.split("commenttext=");
2049
+ arr[1] = val;
2050
+ href = arr[0] + "commenttext=" + arr[1];
2051
+ jQuery("#href-"+id).attr("href", href);
2052
+ jQuery("#href-"+id).css("display","inline");
2053
+ }
js/wppa-admin-scripts.min.js CHANGED
@@ -1 +1 @@
1
- function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var i=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;i.open("POST",wppaAjaxUrl+a,!0),i.onload=function(){if(200===i.status){var e=wppaTrim(i.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},i.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(i,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+i+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(i,l,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+i+"&item="+l+"&wppa-nonce="+document.getElementById("photo-nonce-"+i).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"visible"}),jQuery("#remark-"+i).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+i).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+i).html(o);break;case"photourl":wppaCropper[i]?wppaCropper[i].replace(r):jQuery("#photourl-"+i).attr("src",r),jQuery("#thumba-"+i).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+i).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+i).html(r),0<r.length?jQuery("#imstackbutton-"+i).css("display","inline"):jQuery("#imstackbutton-"+i).css("display","none");break;default:jQuery("#"+n+"-"+i).html(r)}}"description"==l&&jQuery("#wppa-photo-spin-"+i).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+i).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,i=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,i=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],i=o),wppaAlbumUpdateMatrix[i][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[i][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,i,l,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(i),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=i||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(l)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?r||jQuery("#"+n+"_status").html("Pending"):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}))}function wppaAjaxUpdateOptionValue(i,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(i)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+i,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+i.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+i.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+i).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=i&&"icon_corner_style"!=i||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=i&&"svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=i&&"ovl_svg_bg_color"!=i||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,i=0;i<e.length;)0!=(a=e[i].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),i++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},5e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}
1
+ function checkjQueryRev(e,t,a){var p=parseFloat(jQuery.fn.jquery);t.checked&&p<a&&(alert(e+"\nThe version of your jQuery library: "+p+" is too low for this feature. It requires version "+a),t.checked="")}function wppaReUpload(e,o,t,r){document.getElementById("wppa-re-up-form-"+o);var a=document.getElementById("wppa-re-up-file-"+o),u=document.getElementById("wppa-re-up-butn-"+o);e.preventDefault();a=a.files[0];if(a.type.match("image.*")){if(0==t.length)alert("Filename will be set to "+a.name);else if(a.name!=t&&!confirm("Filename is different.\nIf you continue, the filename will not be updated!.\n\nContinue?"))return void jQuery("#re-up-"+o).css("display","none");u.value="Uploading...",u.style.color="black";t=new FormData;t.append("photo",a,a.name);var l=new XMLHttpRequest,a="?action=wppa&wppa-action=update-photo&photo-id="+o+"&item=file&wppa-nonce="+document.getElementById("photo-nonce-"+o).value;l.open("POST",wppaAjaxUrl+a,!0),l.onload=function(){if(200===l.status){var e=wppaTrim(l.responseText).split("||");switch(""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),e[1]){case"0":var t,a,p,n=JSON.parse(e[2]);for(t in n)switch(p=n[t],t){case"remark":p=(p=(p=p.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),a="0"!=e[1]?'<span style="color:red;" >'+p+"</span>":'<span style="color:green;" >'+p+"</span>",r&&(a+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+o).html(a);break;case"photourl":wppaCropper[o]?wppaCropper[o].replace(p):jQuery("#photourl-"+o).attr("src",p),jQuery("#thumba-"+o).attr("href",p);break;case"thumburl":jQuery("#thumburl-"+o).attr("src",p);break;case"magickstack":jQuery("#magickstack-"+o).html(p),0<p.length?jQuery("#imstackbutton-"+o).css("display","inline"):jQuery("#imstackbutton-"+o).css("display","none");break;default:jQuery("#"+t+"-"+o).html(p)}u.value="Upload",jQuery("#re-up-"+o).css("display","none");break;case"99":document.getElementById("photoitem-"+o).innerHTML='<span style="color:red">'+e[2]+"</span>";break;default:document.getElementById("remark-"+o).innerHTML='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",u.value="Error occured",u.style.color="red"}}else alert("An error occurred!")},l.send(t)}else alert("File is not an image file!")}jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll",function(){wppaMakeLazyVisible("windowon")}),wppaMakeLazyVisible("docready")});var _wppaRefreshAfter=!1;function wppaRefreshAfter(){_wppaRefreshAfter=!0}function wppaCheckWidgetMethod(){var e,t,a;if("4"==document.getElementById("wppa-wm").value?(document.getElementById("wppa-wp").style.visibility="visible","day-of-week"==(a=jQuery("#wppa-wp").val())||"day-of-month"==a||"day-of-year"==a?jQuery(".wppa-order").css("visibility",""):jQuery(".wppa-order").css("visibility","hidden")):(document.getElementById("wppa-wp").style.visibility="hidden",jQuery(".wppa-order").css("visibility","hidden")),"1"==document.getElementById("wppa-wm").value)for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="visible",t++;else for(e=document.getElementsByName("wppa-widget-photo"),t=0;t<e.length;)e[t].style.visibility="hidden",t++}function wppa_tablecookieon(e){wppa_setCookie("table_"+e,"on","365")}function wppa_tablecookieoff(e){wppa_setCookie("table_"+e,"off","365")}function wppaCookieCheckbox(e,t){e.checked?wppa_setCookie(t,"on","365"):wppa_setCookie(t,"off","365")}function wppa_move_up(e){document.location=wppa_moveup_url+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value}function checkColor(e){var t=e.substr(5),e=jQuery("#"+t).val();jQuery("#colorbox-"+t).css("background-color",e)}function checkAll(e,t){e=document.getElementById(e);e&&(e.checked?jQuery(t).prop("checked",!0):jQuery(t).prop("checked",!1))}function impUpd(e,t){e.checked?(jQuery(t).val(wppa_update),jQuery(".hideifupdate").css("display","none")):(jQuery(t).val(wppa_import),jQuery(".hideifupdate").css("display",""))}function wppaAjaxDeletePhoto(t,e,a){var p="",n="",p=e||'<div style="padding-left:5px;" >';a?n=a:aftrer="</div>",wppaFeAjaxLog("in");var o=wppaGetXmlHttp(),a=wppaAjaxUrl+"?action=wppa&wppa-action=delete-photo&photo-id="+t;a+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,o.open("GET",a,!0),o.send(),o.onreadystatechange=function(){switch(o.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==o.status?("ER"==(e=wppaTrim(o.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:(document.getElementById("photoitem-"+t).innerHTML=p+e[2]+n,wppaProcessFull(e[3],e[4])),jQuery(window).trigger("scroll"),wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=p+'<span style="color:red;" >Comm error '+o.status+": "+o.statusText+"</span>"+n}}}function wppaAjaxUndeletePhoto(t){wppaFeAjaxLog("in");var a=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=undelete-photo&photo-id="+t;e+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,a.open("GET",e,!0),a.send(),a.onreadystatechange=function(){switch(a.readyState){case 1:document.getElementById("remark-"+t).innerHTML="server connection established";break;case 2:document.getElementById("remark-"+t).innerHTML="request received";break;case 3:document.getElementById("remark-"+t).innerHTML="processing request";break;case 4:var e;200==a.status?("ER"==(e=wppaTrim(a.responseText).split("||"))[0]?(e[3]&&alert(e[3]),jQuery("#wppa-delete-"+t).css("text-decoration","line-through")):""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),0==e[1]?document.getElementById("remark-"+t).innerHTML=e[2]:document.getElementById("photoitem-"+t).innerHTML='<div style="padding-left:5px;" >'+e[2]+"</div>",wppaFeAjaxLog("out")):document.getElementById("photoitem-"+t).innerHTML=before+'<span style="color:red;" >Comm error '+a.status+": "+a.statusText+"</span>"+after}}}function wppaAjaxApplyWatermark(t,e,a){wppaFeAjaxLog("in");var p=wppaGetXmlHttp();jQuery("#wppa-water-spin-"+t).css({visibility:"visible"});var n="action=wppa&wppa-action=watermark-photo&photo-id="+t;n+="&wppa-nonce="+document.getElementById("photo-nonce-"+t).value,e&&(n+="&wppa-watermark-file="+e),a&&(n+="&wppa-watermark-pos="+a),p.open("POST",wppaAjaxUrl,!0),p.setRequestHeader("Content-type","application/x-www-form-urlencoded"),p.send(n),p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?(document.getElementById("remark-"+t).innerHTML=e[2],setTimeout(function(){document.location.reload(!0)},500)):document.getElementById("remark-"+t).innerHTML='<span style="color:red">'+e[2]+"</span>",jQuery("#wppa-water-spin-"+t).css({visibility:"hidden"}),wppaFeAjaxLog("out")):document.getElementById("remark-"+t).innerHTML='<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>")}}function wppaAjaxUpdateIptc(l,e,t,a){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-iptc&photo-id="+l+"&item="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(t)+"&tagname="+a,async:!0,type:"POST",timeout:6e4,beforeSend:function(e){jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(bef+'<span style="color:red">'+p[2]+"</span>"+aft);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none")}}wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll")}})}function wppaAjaxUpdatePhoto(l,i,e,s,c,d){c=c||"",d=d||"",wppaFeAjaxLog("in"),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-photo&photo-id="+l+"&item="+i+"&wppa-nonce="+document.getElementById("photo-nonce-"+l).value+"&value="+wppaEncode(e),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"visible"}),jQuery("#remark-"+l).html("Working, please wait...")},success:function(e,t,a){var p=wppaTrim(e).split("||");if(""!=p[0]&&alert("The server returned unexpected output:\n"+p[0]),"99"===p[1])jQuery("#photoitem-"+l).html(c+'<span style="color:red">'+p[2]+"</span>"+d);else{var n,o,r,u=JSON.parse(p[2]);for(n in u)switch(r=u[n],n){case"remark":r=(r=(r=r.replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/\\/g,""),o="0"!=p[1]?'<span style="color:red;" >'+r+"</span>":'<span style="color:green;" >'+r+"</span>",s&&(o+=' <span style="color:blue;" >Reloading...</span>'),jQuery("#remark-"+l).html(o);break;case"photourl":wppaCropper[l]?wppaCropper[l].replace(r):jQuery("#photourl-"+l).attr("src",r),jQuery("#thumba-"+l).attr("href",r);break;case"thumburl":jQuery("#thumburl-"+l).attr("src",r);break;case"magickstack":jQuery("#magickstack-"+l).html(r),0<r.length?jQuery("#imstackbutton-"+l).css("display","inline"):jQuery("#imstackbutton-"+l).css("display","none");break;default:jQuery("#"+n+"-"+l).html(r)}}"description"==i&&jQuery("#wppa-photo-spin-"+l).css({visibility:"hidden"}),wppaFeAjaxLog("out")},error:function(e,t,a){jQuery("#remark-"+l).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("wppaAjaxUpdatePhoto failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){var p=(p=document.location.href).replace(/&pano-val=./,"");s?setTimeout(function(){document.location.href=p},300):(jQuery("#wppa-admin-spinner").css("display","none"),jQuery(window).trigger("scroll"))}})}function wppaChangeScheduleAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetime-"+e).css("display","inline"):(jQuery(".wppa-datetime-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledtm",Math.rand()))}function wppaChangeScheduleDelAlbum(e,t){jQuery(t).prop("checked")?jQuery(".wppa-datetimedel-"+e).css("display","inline"):(jQuery(".wppa-datetimedel-"+e).css("display","none"),wppaAjaxUpdateAlbum(e,"scheduledel",Math.rand()))}var _wppaRefreshAfter=!1,wppaAjaxAlbumCount=0,wppaAlbumUpdateMatrix=new Array;function wppaAjaxUpdateAlbum(e,t,a,p){var n=0==jQuery("#wppaalbumdesc:visible").length;jQuery("#wppaalbumdesc-html").click();for(var o=wppaAlbumUpdateMatrix.length,r=0,u=!1,l=-1;r<o;)wppaAlbumUpdateMatrix[r][0]==e&&wppaAlbumUpdateMatrix[r][1]==t&&(u=!0,l=r),r++;u||(wppaAlbumUpdateMatrix[o]=[e,t,"undefined",!1,!1,p],l=o),wppaAlbumUpdateMatrix[l][3]="number"==typeof a?a:a.value,wppaAlbumUpdateMatrix[l][5]=p,wppaAjaxUpdateAlbumMonitor(n)}function wppaAjaxUpdateAlbumMonitor(e){for(var t=wppaAlbumUpdateMatrix.length,a=0;a<t;)wppaAlbumUpdateMatrix[a][2]==wppaAlbumUpdateMatrix[a][3]||wppaAlbumUpdateMatrix[a][4]||(wppaAlbumUpdateMatrix[a][4]=!0,_wppaAjaxUpdateAlbum(wppaAlbumUpdateMatrix[a][0],wppaAlbumUpdateMatrix[a][1],wppaAlbumUpdateMatrix[a][3],e,wppaAlbumUpdateMatrix[a][5])),a++;e&&jQuery("#wppaalbumdesc-tmce").click()}function _wppaAjaxUpdateAlbum(r,u,l,i,s){wppaAjaxAlbumCount++;jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-album&album-id="+r+"&item="+u+"&wppa-nonce="+document.getElementById("album-nonce-"+r).value+"&value="+wppaEncode(l),async:!0,type:"POST",timeout:6e4,beforeSend:function(e){"description"==u&&jQuery("#wppa-album-spin").css({visibility:"visible"}),jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")")},success:function(e,t,a){e=wppaTrim(e).split("||");if(wppaAjaxAlbumCount--,""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?0==wppaAjaxAlbumCount?jQuery("#albumstatus-"+r).html(e[2]):jQuery("#albumstatus-"+r).html("Working, please wait... ("+wppaAjaxAlbumCount+")"):jQuery("#albumstatus-"+r).html='<span style="color:red">'+e[2]+" ("+e[1]+")</span>",void 0!==e[3]&&wppaProcessFull(e[3],e[4]),s&&"0"==e[1])return jQuery("#albumstatus-"+r).after('<span style="color:blue;font-weight:bold;"> Reloading...</span>'),jQuery("#wppa-admin-spinner").fadeIn(),void setTimeout(function(){wppaReload()},100);"description"==u&&jQuery("#wppa-album-spin").css({visibility:"hidden"});for(var p=0,n=-1,o=wppaAlbumUpdateMatrix.length;p<o;)wppaAlbumUpdateMatrix[p][0]==r&&wppaAlbumUpdateMatrix[p][1]==u&&(n=p),p++;wppaAlbumUpdateMatrix[n][2]=l||0,wppaAlbumUpdateMatrix[n][4]=!1,wppaAlbumUpdateMatrix[n][5]=!1,wppaAjaxUpdateAlbumMonitor(i)},error:function(e,t,a){wppaAjaxAlbumCount--,jQuery("#albumstatus-"+r).html('<span style="color:red;" >Comm error '+t+"</span>"),wppaConsoleLog("_wppaAjaxUpdateAlbum failed. Error = "+a+", status = "+t,"force")},complete:function(e,t,a){}})}function wppaProcessFull(e,t){"full"==e&&(jQuery("#full").css("display",""),jQuery("#notfull").css("display","none")),"notfull"==e&&(jQuery("#full").css("display","none"),0<t?jQuery("#notfull").attr("value",wppaUploadToThisAlbum+" (max "+t+")"):jQuery("#notfull").attr("value",wppaUploadToThisAlbum),jQuery("#notfull").css("display",""))}function wppaAjaxUpdateCommentStatus(t,a,e){var p=wppaGetXmlHttp(),e=wppaAjaxUrl+"?action=wppa&wppa-action=update-comment-status&wppa-photo-id="+t+"&wppa-comment-id="+a+"&wppa-comment-status="+e+"&wppa-nonce="+document.getElementById("photo-nonce-"+t).value;p.onreadystatechange=function(){var e;4==p.readyState&&(200==p.status?(""!=(e=wppaTrim(p.responseText).split("||"))[0]&&alert("The server returned unexpected output:\n"+e[0]),"0"===e[1]?jQuery("#remark-"+t).html(e[2]):jQuery("#remark-"+t).html('<span style="color:red">'+e[2]+"</span>"),jQuery("#wppa-comment-spin-"+a).css("visibility","hidden")):jQuery("#remark-"+t).html('<span style="color:red;" >Comm error '+p.status+": "+p.statusText+"</span>"))},p.open("GET",e,!0),p.send()}function wppaAjaxUpdateOptionCheckBox(t,e){var a=wppaGetXmlHttp(),p=wppaAjaxUrl+"?action=wppa&wppa-action=update-option&wppa-option="+t;p+="&wppa-nonce="+document.getElementById("wppa-nonce").value,e.checked?p+="&value=yes":p+="&value=no",a.onreadystatechange=function(){switch(a.readyState){case 1:case 2:case 3:jQuery("#img_"+t).attr("src",wppaImageDirectory+"spinner.gif");break;case 4:var e=wppaTrim(a.responseText).split("||");""!=e[0]&&alert("The server returned unexpected output:\n"+e[0]),404!=a.status?("0"===e[1]?(jQuery("#img_"+t).attr("src",wppaImageDirectory+"tick.png"),jQuery("#img_"+t).attr("title",e[2])):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Error #"+e[1]+", message: "+e[2]+", status: "+a.status)),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+t).attr("src",wppaImageDirectory+"cross.png"),jQuery("#img_"+t).attr("title","Communication error, status = "+a.status)),wppaCheckInconsistencies()}},a.open("GET",p,!0),a.send()}var wppaAlwaysContinue=100;function wppaMaintenanceProc(p,e,r){if(!r&&!e&&"yes"==document.getElementById(p+"_continue").value)return document.getElementById(p+"_continue").value="no",document.getElementById(p+"_button").value="Start!",void(0<jQuery("#"+p+"_togo").html()&&(jQuery("#"+p+"_status").html("Pausing..."),jQuery("#"+p+"_button").css("display","none")));r||(document.getElementById(p+"_continue").value="yes",document.getElementById(p+"_button").value="Stop!",""==jQuery("#"+p+"_status").html()&&jQuery("#"+p+"_status").html("Wait...")),jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenance&slug="+p+"&wppa-nonce="+jQuery("#wppa-nonce").val()+(r?"&wppa-cron=1":""),async:!0,type:"POST",timeout:3e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("||"),n=p[1],o=!1;return n?(10<p[0].length&&(alert("An error occurred:\n"+p[0]),o=!0),jQuery("#"+n+"_status").html(p[2]),jQuery("#"+n+"_togo").html(p[3]),jQuery("#"+n+"_button").css("display",""),o||"0"==p[3]?"reload"==p[4]?(alert("This page will now be reloaded to finish the operation. Please stay tuned..."),void wppaReload()):void setTimeout("wppaMaintenanceProc('"+n+"', false)",20):void("yes"!=document.getElementById(n+"_continue").value?(r||jQuery("#"+n+"_status").html("Pending"),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)):setTimeout("wppaMaintenanceProc('"+n+"', true)",20))):(alert("The server returned unexpected output:\n"+e+"\nIf the current procedure has a Skip One button, press it before retrying. Reloading page..."),void wppaReload())},error:function(e,t,a){wppaConsoleLog("wppaMaintenanceProc failed. Slug = "+p+", Error = "+a+", status = "+t,"force"),jQuery("#"+p+"_status").html("Server error #"+(11-wppaAlwaysContinue));t=!1;--wppaAlwaysContinue<1&&(t=confirm("10 Server errors happened.\nDo you want to continue?"))&&(wppaAlwaysContinue=100),(t||0<wppaAlwaysContinue)&&("wppa_remake"==p&&wppaAjaxUpdateOptionValue("wppa_remake_skip_one",0),"wppa_regen_thumbs"==p&&wppaAjaxUpdateOptionValue("wppa_regen_thumbs_skip_one",0),"wppa_create_o1_files"==p&&wppaAjaxUpdateOptionValue("wppa_create_o1_files_skip_one",0),setTimeout("wppaMaintenanceProc('"+p+"', true)",2e3))},complete:function(e,t,a){}})}function wppaAjaxPopupWindow(e){switch(e){case"wppa_list_index":0;break;case"wppa_list_errorlog":0;break;case"wppa_list_rating":0;break;case"wppa_list_session":0;break;case"wppa_list_comments":0}var t=.9*wppaWindowWidth(),a=wppaGetXmlHttp(),p=wppaAjaxUrl,e="action=wppa&wppa-action=maintenancepopup&slug="+e;e+="&wppa-nonce="+document.getElementById("wppa-nonce").value,a.open("POST",p,!1),a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(e),4==a.readyState&&200==a.status&&(a=(e=wppaEntityDecode(a.responseText).split("|"))[0],e[0]="",e=e.join("|").substring(1),t={modal:!0,resizable:!0,width:t,show:{effect:"fadeIn",duration:800},closeText:wppaCloseText},jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery("#wppa-modal-container").css({width:"100%"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"50px"}),jQuery(".ui-dialog-title").html("<h2>"+a+"</h2>"),jQuery(".ui-button").css({position:"absolute",top:"12px",right:"12px"}),jQuery(".ui-button").attr("title",wppaCloseText),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),setTimeout(function(){jQuery("#wppa-maintenance-list").niceScroll&&jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{})},1e3))}function wppaAjaxUpdateOptionValue(l,e,t){var a="action=wppa&wppa-action=update-option&wppa-option="+wppaEncode(l)+"&wppa-nonce="+document.getElementById("wppa-nonce").value;0!=e&&(a+="number"==typeof e?"&value="+e:t?"&value="+wppaGetSelectionEnumByClass("."+l,","):"&value="+wppaEncode(e.value)),jQuery.ajax({url:wppaAjaxUrl,data:a,async:!0,type:"POST",timeout:1e5,beforeSend:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"spinner.gif")},success:function(e,t,a){e=wppaTrim(e).split("||");if(""!=e[0])alert("The server returned unexpected output:\n"+e[0]);else if("0"===e[1]?(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"tick.png"),e[3]&&alert(e[3]),_wppaRefreshAfter&&(_wppaRefreshAfter=!1,document.location.reload(!0))):(jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),e[3]&&alert(e[3])),jQuery("#img_"+l.replace("#","H")).attr("title",e[2]),e[4])for(var p,n,o,r=e[4].split(";"),u=0;u<r.length;)p=r[u].split(":"),n=jQuery("#"+p[0]).html(),o=p[1],""!=n&&""==o&&(o='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+p[0]).html(o),u++},error:function(e){jQuery("#img_"+l.replace("#","H")).attr("src",wppaImageDirectory+"cross.png"),document.getElementById("img_"+l).title="Communication error"},complete:function(e){wppaCheckInconsistencies(),"spinner_shape"!=l&&"icon_corner_style"!=l||(wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")),"svg_color"!=l&&"svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("normal","wppa-spin-pre-1"),"ovl_svg_color"!=l&&"ovl_svg_bg_color"!=l||wppaAjaxGetSpinnerHtml("lightbox","wppa-spin-pre-2")}})}function wppaEncode(e){if(void 0!==e){if("number"==typeof e)return e;for(var t=(p=(p=e.replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,p="";a<t.length;)p+=t[a],++a<t.length&&(p+="||PLUS||");return p}}function wppaCheckInconsistencies(){jQuery("#use_thumb_popup").prop("checked")&&"lightbox"==jQuery("#thumb_linktype").val()?jQuery(".popup-lightbox-err").css("display",""):jQuery(".popup-lightbox-err").css("display","none")}function wppaGetXmlHttp(){return xmlhttp=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),xmlhttp}function wppaPhotoStatusChange(e){if(jQuery("#psdesc-"+e).css({display:"none"}),jQuery("#status-"+e)){if(elm=document.getElementById("status-"+e),"pending"!=elm.value&&"scheduled"!=elm.value||jQuery("#photoitem-"+e).css({backgroundColor:"#ffebe8",borderColor:"#cc0000"}),"publish"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffe0",borderColor:"#e6db55"}),"featured"==elm.value){jQuery("#photoitem-"+e).css({backgroundColor:"#e0ffe0",borderColor:"#55ee55"});var t=document.getElementById("pname-"+e).value.split(".");if(1<t.length)for(var a=0;a<t.length;)"jpg"!=t[a]&&"JPG"!=t[a]||jQuery("#psdesc-"+e).css({display:""}),a++}"gold"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#eeeecc",borderColor:"#ddddbb"}),"silver"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ffffff",borderColor:"#eeeeee"}),"bronze"==elm.value&&jQuery("#photoitem-"+e).css({backgroundColor:"#ddddbb",borderColor:"#ccccaa"}),"scheduled"==elm.value?jQuery(".wppa-datetime-"+e).css("display",""):jQuery(".wppa-datetime-"+e).css("display","none"),jQuery("#scheduledel-"+e).prop("checked")?jQuery(".wppa-del-datetime-"+e).css("display",""):jQuery(".wppa-del-datetime-"+e).css("display","none")}}function wppaSetComBgCol(e){"approved"==jQuery("#com-stat-"+e).val()?jQuery("#com-tr-"+e).css({backgroundColor:"#ffffe0"}):jQuery("#com-tr-"+e).css({backgroundColor:"#ffebe8"})}function wppaAddCat(e,t){wppaAddTag(e,t)}function wppaAddTag(e,t){t=document.getElementById(t);e&&(t.value?t.value+=","+e:t.value=e,"-clear-"==e&&(t.value=""))}function wppaRefresh(e){e=new String(document.location).split("#")[0]+"#"+e;document.location=e}function wppaReload(e){e?(url=document.location.href.split("#"),document.location.href=url[0]+e,setTimeout(function(){document.location.reload(!0)},10)):document.location.reload(!0)}var wppaFeCount=0;function wppaFeAjaxLog(e){"in"==e&&(0==wppaFeCount&&jQuery("#wppa-fe-exit").css("display","none"),wppaFeCount++,jQuery("#wppa-fe-count").html(wppaFeCount)),"out"==e&&(1==wppaFeCount&&(jQuery("#wppa-fe-count").html(""),jQuery("#wppa-fe-exit").css("display","inline"),wppaFeCount--),1<wppaFeCount&&(wppaFeCount--,jQuery("#wppa-fe-count").html(wppaFeCount)))}function wppaArrayToEnum(e,t){temp=e.sort(function(e,t){return e-t});for(var a,p="",n=-1,o=-2,r=0,u=!1,l=0;l<e.length;)0!=(a=e[l].valueOf())&&(r=n,a==++r?u=!0:u?(p+=n==o?t+n+t+a:t+t+n+t+a,u=!1):p+=t+a,u||(o=a,o++),n=a),l++;for(u&&(p+=".."+n);"."==p.substr(0,1);)p=p.substr(1);for(;p.substr(0,1)==t;)p=p.substr(1);return p}function wppaGetSelEnumToId(e,t){p=jQuery("."+e);var a=[];for(i=0,j=0;i<p.length;)p[i].selected&&(a[j]=p[i].value,j++),i++;jQuery("#"+t).val(wppaArrayToEnum(a,"."))}function wppaGetSelectionEnumByClass(e,t){var a,p=[],n=0,o=0;for(t=t||".",a=jQuery(e),o=n=0;n<a.length;)a[n].selected&&(p[o]=a[n].value,o++),n++;return wppaArrayToEnum(p,t)}function wppaEditSearch(e,t){t=jQuery("#"+t).val();0==t.length?alert("Please enter searchstring"):document.location.href=e+"&wppa-searchstring="+t}function wppaEditTrash(e){document.location.href=e}function wppaExportDbTable(p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=export-table&table="+p,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#"+p+"-spin").css("display","inline")},success:function(e,t,a){e=e.split("||");"0"==e[1]?document.location=e[2]:alert("Error: "+e[1]+"\n\n"+e[2])},error:function(e,t,a){alert("Export Db Table "+p+" failed. Error = "+a+", status = "+t)},complete:function(e,t,a){jQuery("#"+p+"-spin").css("display","none")}})}function wppaDismissAdminNotice(e,t){wppaAjaxUpdateOptionCheckBox(e,t),jQuery("#wppa-wr-").css("display","none")}function wppaAjaxUpdateTogo(n){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=gettogo&slug="+n,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){var p=e.split("|");jQuery("#"+n+"_togo").html(p[0]);e=jQuery("#"+n+"_status").html(),p=p[1];""!=e&&""==p&&(p='<input type="button" class="button-secundary" style="border-radius:3px;font-size:11px;height:18px;margin: 0 4px;padding:0px;color:red;background-color:pink;" onclick="document.location.reload(true)" value="Reload" />'),jQuery("#"+n+"_status").html(p),setTimeout(function(){wppaAjaxUpdateTogo(n)},1e3)},error:function(e){},complete:function(e){}})}function wppaIsEmpty(e){return(null==e||void 0===e||""==e||0==e)&&!0}function wppaTimedConfirm(e){var t={modal:!0,resizable:!1,width:400,show:{effect:"fadeIn",duration:800},closeText:"X",buttons:[{text:"NO",click:function(){jQuery(this).dialog("close")}},{text:"YES",click:function(){jQuery(this).dialog("close")}}]};jQuery("#wppa-modal-container").html(e).dialog(t).dialog("open"),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",padding:"8px",backgroundColor:"#cccccc",boxSizing:"content-box",zIndex:"200200"}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"32px"}),jQuery(".ui-button").css({float:"right",position:"relative",bottom:"40px"}),jQuery(".ui-dialog-titlebar-close").css({display:"none"}),jQuery(".ui-widget-overlay").css({backgroundColor:"transparent"}),jQuery(".ui-button").attr("title",wppaCloseText),setTimeout(function(){jQuery(".ui-button").trigger("click")},6e4)}function wppaAjaxGetSpinnerHtml(e,p){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=update-option&wppa-option=getspinnerpreview&type="+e+"&wppa-nonce="+document.getElementById("wppa-nonce").value,async:!0,type:"GET",timeout:1e5,beforeSend:function(e){},success:function(e,t,a){e=e.split("|");jQuery("#"+p).html(e[0])},error:function(e){},complete:function(e){}})}function wppaDragHorizon(t){var a=0,p=0;function n(e){(e=e||window.event).preventDefault(),a=p-e.clientY,p=e.clientY,t.style.top=t.offsetTop-a+"px"}function o(){document.onmouseup=null,document.onmousemove=null}t.onmousedown=function(e){(e=e||window.event).preventDefault(),pos3=e.clientX,p=e.clientY,document.onmouseup=o,document.onmousemove=n}}function wppaBulkActionChange(e,t){wppa_setCookie("wppa_bulk_action",e.value,365),"wppa-bulk-move-to"==e.value||"wppa-bulk-copy-to"==e.value?jQuery("#wppa-bulk-album").css("display","inline"):jQuery("#wppa-bulk-album").css("display","none"),"wppa-bulk-status"==e.value?jQuery("#wppa-bulk-status").css("display","inline"):jQuery("#wppa-bulk-status").css("display","none"),"wppa-bulk-owner"==e.value?jQuery("#wppa-bulk-owner").css("display","inline"):jQuery("#wppa-bulk-owner").css("display","none")}function wppaBulkDoitOnClick(){var e=jQuery(".wppa-bulk-photo"),t=0;for(i=0;i<e.length;i++)e[i].checked&&t++;if(0==t)return alert("No photos selected"),!1;var a=document.getElementById("wppa-bulk-action").value;switch(a){case"":return alert("No action selected"),!1;case"wppa-bulk-delete":break;case"wppa-bulk-move-to":case"wppa-bulk-copy-to":if(0==document.getElementById("wppa-bulk-album").value)return alert("No album selected"),!1;break;case"wppa-bulk-status":if(0==document.getElementById("wppa-bulk-status").value)return alert("No status selected"),!1;break;case"wppa-bulk-owner":if(0==documnet.getElementById("wppa-bulk-owner").value)return alert("No new owner selected"),!1;break;default:return alert("Unimplemented action requested: "+a),!1}return!0}function wppaSetThumbsize(e){e=e.value;wppa_setCookie("wppa_bulk_thumbsize",e,365),jQuery(".wppa-bulk-thumb").css("max-width",e+"px"),jQuery(".wppa-bulk-thumb").css("max-height",e/2+"px"),jQuery(".wppa-bulk-dec").css("height",e/2+"px")}function wppaToggleConfirmDelete(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmDelete","checked",365):wppa_setCookie("wppaConfirmDelete","unchecked",365)}function wppaToggleConfirmMove(e){jQuery(e).prop("checked")?wppa_setCookie("wppaConfirmMove","checked",365):wppa_setCookie("wppaConfirmMove","unchecked",365)}function wppaSetConfirmDelete(e){"checked"==wppa_getCookie("wppaConfirmDelete")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaSetConfirmMove(e){"checked"==wppa_getCookie("wppaConfirmMove")?jQuery("#"+e).prop("checked",!0):jQuery("#"+e).prop("checked",!1)}function wppaAjaxReplaceLog(){jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=maintenancepopup&slug=wppa_list_errorlog&raw=1&wppa-nonce="+jQuery("#wppa-nonce").val(),async:!0,type:"GET",timeout:1e5,beforeSend:function(e){jQuery("#wppa-spinner").show()},success:function(e,t,a){e=wppaEntityDecode(e),jQuery("#wppa-logbody").html(e),jQuery("#wppa-spinner").hide()}})}function wppaTestAdminReady(){"complete"===document.readyState?jQuery("#wppa-admin-spinner").fadeOut():setTimeout("wppaTestAdminReady()",200)}function wppaCommentAdminUpdateHref(e){var t=encodeURIComponent(jQuery("#commenttext-"+e).val()),a=jQuery("#href-"+e).attr("href"),p=a.split("commenttext=");p[1]=t,a=p[0]+"commenttext="+p[1],jQuery("#href-"+e).attr("href",a),jQuery("#href-"+e).css("display","inline")}jQuery(document).ready(function(){var e;document.getElementById("wppa-bulk-action")&&(e=wppa_getCookie("wppa_bulk_action"),"wppa-bulk-move-to"!=(document.getElementById("wppa-bulk-action").value=e)&&"wppa-bulk-copy-to"!=e||(jQuery("#wppa-bulk-album").css("display","inline"),document.getElementById("wppa-bulk-album").value=wppa_getCookie("wppa_bulk_album")),"wppa-bulk-status"==e&&(jQuery("#wppa-bulk-status").css("display","inline"),document.getElementById("wppa-bulk-status").value=wppa_getCookie("wppa_bulk_status")),"wppa-bulk-owner"==e&&(jQuery("#wppa-bulk-owner").css("display","inline"),document.getElementById("wppa-bulk-owner").value=wppa_getCookie("wppa_bulk_owner")))}),jQuery(document).ready(function(){setTimeout("wppaTestAdminReady()",200)});
js/wppa-all.js CHANGED
@@ -1,7 +1,7 @@
1
  // wppa-utils
2
  function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}var wppaMakeLazyVisibleScrollEndTimer;function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(function(){wppaMakeLazyVisible("scrollend")},wppaScrollEndDelay)}wppaJsUtilsVersion="8.0.04.006";var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(e){if(wppaLazyLoad&&!wppaLazyBusy){wppaLazyBusy=!0;var t,a=new Date,p=a.getTime();if(p<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible("selftimer")},100),void(wppaLazyBusy=!1);wppaInitMasonryPlus(),wppaLastLazy=p,clearTimeout(wppaLazyTimer);var i=0;jQuery("*[data-src]").each(function(){t=jQuery(this).attr("data-src"),wppaIsElementInViewport(this)&&(jQuery(this).attr("src",t),jQuery(this).removeAttr("data-src"),i++)}),0<i&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&(setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery("div").getNiceScroll().resize()},1500)),setTimeout(function(){jQuery(".wppa-box").trigger("scroll"),jQuery("body").trigger("scroll")},250)),p=(a=new Date).getTime(),wppaLastLazy=p,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;var a=jQuery(t[0]).css("visibility");if("hidden"==a||"collapse"==a)return!1;t=jQuery(t[0]).parent()}e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||(wppaIsMobile?0<e.bottom&&0<e.right&&e.left<3*screen.width&&e.top<3*screen.height:0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight())}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}function wppaShowCoords(e){e=e.getBoundingClientRect();alert("Top = "+parseInt(e.top)+", Left = "+parseInt(e.left)+", WinH = "+jQuery(window).height()+", WinW = "+jQuery(window).width()+", Scrolltop = "+jQuery(document).scrollTop())}
3
  // wppa
4
- function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.0.07.017",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.0.10.001";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*o/n))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=n||f-d<=o?l<(o+d)/(n+d)?(c=f-d,j=parseInt(c*n/o)):(j=x-d,c=parseInt(j*o/n)):(j=n,c=o),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n,o,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" ></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),o=".pdf"==(n=_wppaHiresUrl[p][e]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(o?"<iframe "+l+' src="'+n+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
1
  // wppa-utils
2
  function wppaAnimate(e,t,a,p,i){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css(t),i&&setTimeout(i,10)):jQuery(e).stop().animate(t,a,p,i)}function wppaFadeIn(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:""}),a&&setTimeout(a,10)):jQuery(e).stop().fadeIn(t,a)}function wppaFadeOut(e,t,a){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"none"}),a&&setTimeout(a,10)):jQuery(e).stop().fadeOut(t,a)}function wppaFadeTo(e,t,a,p){wppaIsMobile&&wppaNoAnimateOnMobile?(jQuery(e).css({display:"",opacity:a}),p&&setTimeout(p,10)):jQuery(e).stop().fadeTo(t,a,p)}function wppaTrim(e,t){e=wppaTrimLeft(e,t);return e=wppaTrimRight(e,t)}function wppaTrimLeft(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(0,i)==t;)p=(a=a.substr(i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimLeft(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/^\s\s*/,"")}return a}function wppaTrimRight(e,t){var a,p,i,n,r,o,s;switch(typeof t){case"string":for(p=(a=e).length,i=t.length;i<=p&&a.substr(p-i)==t;)p=(a=a.substr(0,p-i)).length;break;case"object":for(r=!1,s=e;!r;){for(n=0,o=s;n<t.length;)s=wppaTrimRight(s,t[n]),n++;r=o==s}a=s;break;default:return e.replace(/\s\s*$/,"")}return a}function wppa_setCookie(e,t,a){var p=new Date;p.setDate(p.getDate()+a);p=escape(t)+(null==a?"":"; expires="+p.toUTCString());document.cookie=e+"="+p}function wppa_getCookie(e){for(var t,a,p=document.cookie.split(";"),i=0;i<p.length;i++)if(t=p[i].substr(0,p[i].indexOf("=")),a=p[i].substr(p[i].indexOf("=")+1),(t=t.replace(/^\s+|\s+$/g,""))==e)return unescape(a);return""}function wppaStereoTypeChange(e){wppa_setCookie("stereotype",e,365)}function wppaStereoGlassChange(e){wppa_setCookie("stereoglass",e,365)}function wppaConsoleLog(e,t){var a,p,i;"undefined"==typeof console||!wppaDebug&&"force"!=t||(a=(new Date).getTime()%864e5,a-=60*(p=Math.floor(a/36e5))*60*1e3,a-=60*(i=Math.floor(a/6e4))*1e3,t=Math.floor(a/1e3),console.log("At: "+p+":"+i+":"+t+"."+(a-=1e3*t)+" message: "+e))}function wppaSvgHtml(e,t,a,p,i,n,r,o){var s;switch(i=i||"0",n=n||"10",r=r||"20",o=o||"50",wppaSvgCornerStyle){case"gif":case"none":radius=i;break;case"light":radius=n;break;case"medium":radius=r;break;case"heavy":radius=o}t=t||"32px",a="Full-Screen"==e||"Exit-Full-Screen"==e?(s=wppaFsFillcolor,wppaFsBgcolor):a?(s=wppaOvlSvgFillcolor,wppaOvlSvgBgcolor):(s=wppaSvgFillcolor,wppaSvgBgcolor),""==s&&(s="transparent"),""==a&&(a="transparent");var l='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 30" style="'+(t?"height:"+t+";":"")+"fill:"+s+";background-color:"+a+";text-decoration:none !important;vertical-align:middle;"+(radius?"border-radius:"+radius+"%;":"")+'" xml:space="preserve" ><g>';switch(e){case"Next-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.3-0.2,0.5-0.5,0.5S19,20.8,19,20.5v-4.2l-8.3,4.6c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1c-0.2-0.1-0.2-0.3-0.2-0.4v-11c0-0.2,0.1-0.4,0.3-0.4c0.2-0.1,0.4-0.1,0.5,0l8.2,5.5V9.5C19,9.2,19.2,9,19.5,9S20,9.2,20,9.5V20.5z" />';break;case"Prev-Button":l+='<path d="M30,0H0V30H30V0z M20,20.5c0,0.2-0.1,0.4-0.3,0.4c-0.1,0-0.2,0.1-0.2,0.1c-0.1,0-0.2,0-0.3-0.1L11,15.4v5.1c0,0.3-0.2,0.5-0.5,0.5S10,20.8,10,20.5v-11C10,9.2,10.2,9,10.5,9S11,9.2,11,9.5v4.2l8.3-4.6c0.2-0.1,0.3-0.1,0.5,0S20,9.3,20,9.5V20.5z" />';break;case"Pause-Button":l+='<path d="M30,0H0V30H30V0z M14,20.5c0,0.3-0.2,0.5-0.5,0.5h-4C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h4C13.8,9,14,9.2,14,9.5V20.5z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-4c-0.3,0-0.5-0.2-0.5-0.5v-11C16,9.2,16.2,9,16.5,9h4C20.8,9,21,9.2,21,9.5V20.5z" />';break;case"Play-Button":l+='<path d="M30,0H0V30H30V0zM19.8,14.9l-8,5C11.7,20,11.6,20,11.5,20c-0.1,0-0.2,0-0.2-0.1c-0.2-0.1-0.3-0.3-0.3-0.4v-9c0-0.2,0.1-0.3,0.2-0.4c0.1-0.1,0.3-0.1,0.5,0l8,4c0.2,0.1,0.3,0.2,0.3,0.4C20,14.7,19.9,14.8,19.8,14.9z" />';break;case"Stop-Button":l+='<path d="M30,0H0V30H30V0z M21,20.5c0,0.3-0.2,0.5-0.5,0.5h-11C9.2,21,9,20.8,9,20.5v-11C9,9.2,9.2,9,9.5,9h11C20.8,9,21,9.2,21,9.5V20.5z"/>';break;case"Exit":l+='<path d="M30 24.398l-8.406-8.398 8.406-8.398-5.602-5.602-8.398 8.402-8.402-8.402-5.598 5.602 8.398 8.398-8.398 8.398 5.598 5.602 8.402-8.402 8.398 8.402z"></path>';break;case"Exit-2":l+='<path d="M30,0H0V30H30V0z M9 4 L15 10 L21 4 L26 9 L20 15 L26 21 L21 26 L15 20 L9 26 L4 21 L10 15 L4 9Z" />';break;case"Full-Screen":l+='<path d="M27.414 24.586l-4.586-4.586-2.828 2.828 4.586 4.586-4.586 4.586h12v-12zM12 0h-12v12l4.586-4.586 4.543 4.539 2.828-2.828-4.543-4.539zM12 22.828l-2.828-2.828-4.586 4.586-4.586-4.586v12h12l-4.586-4.586zM32 0h-12l4.586 4.586-4.543 4.539 2.828 2.828 4.543-4.539 4.586 4.586z"></path>';break;case"Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M4 4 L12 4 L10 6 L14 10 L10 14 L6 10 L4 12Z M18 4 L26 4 L26 12 L24 10 L20 14 L16 10 L20 6Z M26 26 L18 26 L20 24 L16 20 L20 16 L24 20 L26 18Z M4 26 L4 18 L6 20 L10 16 L14 20 L10 24 L12 26Z" />';break;case"Exit-Full-Screen":l+='<path d="M24.586 27.414l4.586 4.586 2.828-2.828-4.586-4.586 4.586-4.586h-12v12zM0 12h12v-12l-4.586 4.586-4.539-4.543-2.828 2.828 4.539 4.543zM0 29.172l2.828 2.828 4.586-4.586 4.586 4.586v-12h-12l4.586 4.586zM20 12h12l-4.586-4.586 4.547-4.543-2.828-2.828-4.547 4.543-4.586-4.586z"></path>';break;case"Exit-Full-Screen-2":l+='<path d="M30,0H0V30H30V0z M17 17 L25 17 L23 19 L27 23 L23 27 L19 23 L17 25Z M5 17 L13 17 L13 25 L11 23 L7 27 L3 23 L7 19Z M13 13 L5 13 L7 11 L3 7 L7 3 L11 7 L13 5Z M17 13 L17 5 L19 7 L23 3 L27 7 L23 11 L25 13Z" />';break;default:l+='<path d="M30,0H0V30H30V0z" />'}return l+="</g></svg>"}var wppaMakeLazyVisibleScrollEndTimer;function wppaMakeLazyVisibleScrollEnd(){clearTimeout(wppaMakeLazyVisibleScrollEndTimer),wppaMakeLazyVisibleScrollEndTimer=setTimeout(function(){wppaMakeLazyVisible("scrollend")},wppaScrollEndDelay)}wppaJsUtilsVersion="8.0.04.006";var wppaLastLazy=0,wppaLazyTimer=0,wppaLazyBusy=!1;function wppaMakeLazyVisible(e){if(wppaLazyLoad&&!wppaLazyBusy){wppaLazyBusy=!0;var t,a=new Date,p=a.getTime();if(p<wppaLastLazy+250)return clearTimeout(wppaLazyTimer),wppaLazyTimer=setTimeout(function(){wppaMakeLazyVisible("selftimer")},100),void(wppaLazyBusy=!1);wppaInitMasonryPlus(),wppaLastLazy=p,clearTimeout(wppaLazyTimer);var i=0;jQuery("*[data-src]").each(function(){t=jQuery(this).attr("data-src"),wppaIsElementInViewport(this)&&(jQuery(this).attr("src",t),jQuery(this).removeAttr("data-src"),i++)}),0<i&&(wppaInitMasonryPlus(),jQuery("div").getNiceScroll&&(setTimeout(function(){jQuery("div").getNiceScroll().resize()},500),setTimeout(function(){jQuery("div").getNiceScroll().resize()},1500)),setTimeout(function(){jQuery(".wppa-box").trigger("scroll"),jQuery("body").trigger("scroll")},250)),p=(a=new Date).getTime(),wppaLastLazy=p,wppaLazyBusy=!1}}function wppaIsElementInViewport(e){if(void 0===e)return!1;if(!e)return!1;if(0==e.length)return!1;if(window.closed)return!1;if(document.hidden)return!1;for(var t=jQuery(e);t[0]&&"BODY"!=t[0].nodeName;){if("none"==jQuery(t[0]).css("display"))return!1;var a=jQuery(t[0]).css("visibility");if("hidden"==a||"collapse"==a)return!1;t=jQuery(t[0]).parent()}e instanceof jQuery&&(e=e[0]);e=e.getBoundingClientRect();return!e||(wppaIsMobile?0<e.bottom&&0<e.right&&e.left<3*screen.width&&e.top<3*screen.height:0<e.bottom&&0<e.right&&e.left<wppaWindowWidth()&&e.top<wppaWindowHeight())}function wppaSizeArea(){0<wppaAreaMaxFrac&&wppaAreaMaxFrac<1&&(jQuery(".wppa-thumb-area").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac),jQuery(".albumlist").css("max-height",wppaWindowHeight()*wppaAreaMaxFrac))}function wppaIconSize(e,t,a){a=a?wppaIconSizeSlide:wppaIconSizeNormal;return"default"==a?t:(wppaIsMini[e]?a/2:a)+"px;"}function wppaEntityDecode(e){return e=(e=(e=(e=(e=e.split("&amp;").join("&")).split("&gt;").join(">")).split("&lt;").join("<")).split("&quot;").join('"')).split("&#39;").join("'")}function wppaSetMaxWidthToParentWidth(e){var t=e.parentNode.clientWidth;jQuery(e).css({maxWidth:t})}function wppaWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function wppaWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function wppaAdjustControlbar(){var e,t,a=jQuery;wppaOvlOpen&&(t=wppaIsFs()?(a(".wppa-pctl-div-lb").css({position:"fixed",left:0,right:0,bottom:0}),screen.width):(a(".wppa-pctl-div-lb").css({position:"initial"}),a("#wppa-ovl-pan-container").width()),wppaIsMobile&&wppaIsFs()&&(t-=20),t<12*(parseInt(wppaOvlIconSize)+4)?0<(e=parseInt(t/12-4))&&(a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})):(e=wppaOvlIconSize,a(".wppa-pctl-div-lb").find("svg").css({height:e,width:e}),a(".wppa-pctl-div-lb").find("span").css({height:e,width:e})),wppaOvlIsSingle?(jQuery("#wppa-ovl-start-btn").hide(),jQuery("#wppa-ovl-stop-btn").hide()):wppaOvlRunning?(jQuery("#wppa-ovl-stop-btn").show(),jQuery("#wppa-ovl-start-btn").hide()):(jQuery("#wppa-ovl-start-btn").show(),jQuery("#wppa-ovl-stop-btn").hide()),wppaIsMobile&&wppaIsFs()?a(".wppa-pctl-div-lb").css({paddingLeft:10,paddingRight:10}):a(".wppa-pctl-div-lb").css({paddingLeft:0,paddingRight:0}),a(".wppa-pctl-div-lb").css({visibility:"visible"}))}function wppaKillEvent(e){return e.preventDefault(),e.stopPropagation(),!1}function wppaServerLog(e){e&&jQuery.ajax({url:wppaAjaxUrl,data:"action=wppa&wppa-action=log&message="+e,async:!0,type:"GET",timeout:6e4,success:function(e,t,a){},error:function(e,t,a){wppaConsoleLog("wppaServerLog failed. Error = "+a+", status = "+t,"force")}})}function wppaTimNow(){return(new Date).getTime()}function wppaShowCoords(e){e=e.getBoundingClientRect();alert("Top = "+parseInt(e.top)+", Left = "+parseInt(e.left)+", WinH = "+jQuery(window).height()+", WinW = "+jQuery(window).width()+", Scrolltop = "+jQuery(document).scrollTop())}
3
  // wppa
4
+ function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.1.00.005",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)}),jQuery(document).ready(function(){jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){jQuery(".wppa-ss-button").each(function(){mocc=jQuery(this).attr("data-mocc"),wppaSuperSearchSelect(mocc)})}),jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
5
  // wppa-slideshow
6
  var wppaJsSlideshowVersion="8.0.10.001";function wppaStoreSlideInfo(p,a,e,t,i,w,r,n,o,l,s,d,u,_,m,c,y,h,S,g,x,f,I,j,Q,b,v,N,T,C,k,R,F){o=wppaRepairScriptTags(o),_wppaSlides[p]&&"0"!=a||(_wppaSlides[p]=[],_wppaNames[p]=[],_wppaFilmThumbTitles[p]=[],_wppaFullNames[p]=[],_wppaDsc[p]=[],_wppaOgDsc[p]=[],_wppaCurIdx[p]=-1,_wppaNxtIdx[p]=0,"random"==S?_wppaTimeOut[p]="random":0<parseInt(S)?_wppaTimeOut[p]=parseInt(S):_wppaTimeOut[p]=wppaSlideShowTimeOut,_wppaSSRuns[p]=!1,_wppaTP[p]=-2,_wppaFg[p]=0,_wppaIsBusy[p]=!1,_wppaFirst[p]=!0,_wppaId[p]=[],_wppaRealId[p]=[],_wppaAvg[p]=[],_wppaDisc[p]=[],_wppaMyr[p]=[],_wppaVRU[p]=[],_wppaLinkUrl[p]=[],_wppaLinkTitle[p]=[],_wppaLinkTarget[p]=[],_wppaCommentHtml[p]=[],_wppaIptcHtml[p]=[],_wppaExifHtml[p]=[],_wppaUrl[p]=[],_wppaSkipRated[p]=!1,_wppaLbTitle[p]=[],_wppaDidGoto[p]=!1,wppaSlidePause[p]=!1,_wppaShareUrl[p]=[],_wppaShareHtml[p]=[],_wppaFilmNoMove[p]=!1,_wppaHiresUrl[p]=[],_wppaIsVideo[p]=[],_wppaVideoHtml[p]=[],_wppaAudioHtml[p]=[],_wppaVideoNatWidth[p]=[],_wppaVideoNatHeight[p]=[],wppaVideoPlaying[p]=!1,wppaAudioPlaying[p]=!1,_wppaWaitTexts[p]=[],_wppaImageAlt[p]=[],_wppaFilename[p]=[]),S="default",""!=c?S="pointer":""!=wppaLightBox[p]&&(S="url( "+wppaImageDirectory+wppaMagnifierCursor+" ),pointer"),_wppaIsVideo[p][a]=""!=N,_wppaIsVideo[p][a]?(_wppaSlides[p][a]=' alt="'+k+'" class="theimg theimg-'+p+' big" ',wppaSlideVideoStart&&""==wppaLightBox[p]&&(_wppaSlides[p][a]+=" autoplay "),0<R.length&&(_wppaSlides[p][a]+=' poster="'+R+'" ')):_wppaSlides[p][a]=' src="'+e+'" alt="'+k+'" class="theimg theimg-'+p+' big stereo" ',wppaSlideSwipe&&(_wppaSlides[p][a]+=' ontouchstart="wppaTouchStart( event, this.id, '+p+' );" ontouchend="wppaTouchEnd( event );" ontouchmove="wppaTouchMove( event );" ontouchcancel="wppaTouchCancel( event );" '),wppaAutoColumnWidth[p]||(_wppaSlides[p][a]+='width="'+i+'" height="'+w+'" '),_wppaIsVideo[p][a]?(R="wppa"==wppaLightBox[p]?"":"controls",_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none;" '+R+">"+N+"</video>"):_wppaSlides[p][a]+='style="'+t+"; cursor:"+S+'; display:none; vertical-align:middle;">',_wppaFullNames[p][a]='<span class="sdf-'+p+'" >'+wppaRepairBrTags(r)+"</span>",_wppaNames[p][a]='<span class="sdn-'+p+'" >'+n+"</span>",_wppaFilmThumbTitles[p][a]=n,_wppaDsc[p][a]=o,_wppaOgDsc[p][a]=b,_wppaId[p][a]=l,_wppaRealId[p][a]=s,_wppaAvg[p][a]=d,_wppaDisc[p][a]=u,_wppaMyr[p][a]=_,_wppaVRU[p][a]=m,_wppaLinkUrl[p][a]=c,_wppaLinkTitle[p][a]=y,""!=h?_wppaLinkTarget[p][a]=h:wppaSlideBlank[p]?_wppaLinkTarget[p][a]="_blank":_wppaLinkTarget[p][a]="_self",_wppaCommentHtml[p][a]=g,_wppaIptcHtml[p][a]=x,_wppaExifHtml[p][a]=f,_wppaUrl[p][a]=e,_wppaLbTitle[p][a]=wppaRepairScriptTags(I),_wppaShareUrl[p][a]=j,_wppaShareHtml[p][a]=wppaRepairScriptTags(Q),_wppaHiresUrl[p][a]=v,_wppaVideoHtml[p][a]=N,_wppaAudioHtml[p][a]=T,_wppaVideoNatWidth[p][a]=i,_wppaVideoNatHeight[p][a]=w,_wppaWaitTexts[p][a]=C,_wppaImageAlt[p][a]=k,_wppaFilename[p][a]=F}function wppaSpeed(p,a){_wppaSSRuns[p]&&_wppaSpeed(p,a)}function wppaStopShow(p){_wppaSSRuns[p]&&_wppaStop(p)}function wppaStartStop(p,a){wppaSlideInitRunning[p]&&("start"==wppaSlideInitRunning[p]?a=-1:"stopprev"==wppaSlideInitRunning[p]?a=_wppaSlides[p].length-1:"stopnext"==wppaSlideInitRunning[p]&&(a=0),wppaSlideInitRunning[p]=""),_wppaIsBusy[p]?_wppaTP[p]=a:(_wppaSSRuns[p]?(_wppaStop(p),jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))):(_wppaStart(p,a),-1==a&&jQuery("#wppa-startstop-icon-"+p).html(wppaSvgHtml("Pause-Button",wppaIconSize(p,"48px",!0),!1,!0,"0","10","50","50"))),wppaIsMobile&&(jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(10,1).fadeTo(3e3,0),jQuery(".ubb-"+p).stop().fadeTo(10,1).fadeTo(3e3,0)))}function wppaBbb(p,a,e){_wppaSSRuns[p]||_wppaBbb(p,a,e)}function wppaUbb(p,a,e){_wppaUbb(p,a,e)}function wppaRateIt(p,a){_wppaRateIt(p,a)}function wppaOvlRateIt(p,a,e,t){_wppaOvlRateIt(p,a,e,t)}function wppaPrev(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrev(p)}function wppaPrevN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaPrevN(p,a)}function wppaFirst(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,0)}function wppaNext(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNext(p)}function wppaNextN(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaNextN(p,a)}function wppaLast(p){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,_wppaSlides[p].length-1)}function wppaFollowMe(p,a){_wppaSSRuns[p]||_wppaFollowMe(p,a)}function wppaLeaveMe(p,a){_wppaSSRuns[p]||_wppaLeaveMe(p,a)}function wppaGoto(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||_wppaGoto(p,a)}function wppaGotoFilmNoMove(p,a){_wppaDidGoto[p]=!0,_wppaSSRuns[p]||(_wppaFilmNoMove[p]=!0,_wppaGoto(p,a))}function wppaGotoKeepState(p,a){_wppaNxtIdx[p]!=a&&(_wppaDidGoto[p]=!0,_wppaGotoKeepState(p,a))}function _wppaGotoKeepState(p,a){(_wppaSSRuns[p]?_wppaGotoRunning:_wppaGoto)(p,a)}function wppaGotoRunning(p,a){_wppaDidGoto[p]=!0,_wppaGotoRunning(p,a)}function wppaValidateComment(p){return _wppaValidateComment(p)}function _wppaNextSlide(p,a){var e=!document.getElementById("slide_frame-"+p);if(_wppaStopping[p])_wppaStopping[p]=0;else{if(!e&&!wppaIsSlidshowVisible(p))return wppaFilmInit[p]=!1,void setTimeout(function(){_wppaNextSlide(p,a)},400);if(_wppaLastIdx[p]=_wppaCurIdx[p],!document.getElementById("slide_frame-"+p)&&document.getElementById("filmwindow-"+p)&&wppaFilmonlyContinuous)return _wppaSSRuns[p]?(_wppaCurIdx[p]++,_wppaCurIdx[p]==_wppaSlides[p].length&&(_wppaCurIdx[p]=0),_wppaAdjustFilmstrip(p,"linear"),_wppaNxtIdx[p]=_wppaCurIdx[p],void setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",wppaAnimationSpeed)):(_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFilmInit[p]=!1,void _wppaAdjustFilmstrip(p,"linear"));if(document.getElementById("slide_frame-"+p)||document.getElementById("filmwindow-"+p)){var t=_wppaFg[p],e=1-t;if((wppaVideoPlaying[p]||wppaAudioPlaying[p])&&_wppaSSRuns[p])setTimeout("_wppaNextSlide( "+p+", '"+a+"' )",500);else{if(wppaStopVideo(p),wppaStopAudio(p),"auto"==a){if(wppaSlidePause[p])return jQuery("#theimg"+t+"-"+p).attr("title",wppaSlidePause[p]),jQuery("#slide_frame-"+p).attr("title",wppaSlidePause[p]),void setTimeout("_wppaNextSlide( "+p+', "auto" )',250)}else jQuery("#slide_frame-"+p).removeAttr("title");if((_wppaSSRuns[p]||"auto"!=a)&&_wppaSlides[p]&&(!(_wppaSlides[p].length<2)||_wppaFirst[p])){if(_wppaSSRuns[p]||"reset"!=a||(_wppaSSRuns[p]=!0,__wppaOverruleRun=!1),_wppaVoteInProgress=!1,_wppaIsBusy[p]=!0,_wppaSSRuns[p]&&_wppaShowMetaData(p,"hide"),_wppaSSRuns[p]&&(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0)),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaCurIdx[p]]).css({display:"none"}),jQuery("#geodiv-"+p+"-"+_wppaId[p][_wppaNxtIdx[p]]).css({display:""}),"undefined"!=typeof _wppaLat&&_wppaLat[p]?(n=_wppaRealId[p],_wppaLat[p][n[_wppaNxtIdx[p]]]?(jQuery("#map-canvas-"+p).css("display",""),wppaGeoInit(p,_wppaLat[p][n[_wppaNxtIdx[p]]],_wppaLon[p][n[_wppaNxtIdx[p]]])):jQuery("#map-canvas-"+p).css("display","none")):jQuery("#map-canvas-"+p).css("display","none"),jQuery("[id^=wppa-numbar-"+p+"-]").css({backgroundColor:wppaBGcolorNumbar,borderColor:wppaBcolorNumbar,fontFamily:wppaFontFamilyNumbar,fontSize:wppaFontSizeNumbar,color:wppaFontColorNumbar,fontWeight:wppaFontWeightNumbar}),jQuery("#wppa-numbar-"+p+"-"+_wppaNxtIdx[p]).css({backgroundColor:wppaBGcolorNumbarActive,borderColor:wppaBcolorNumbarActive,fontFamily:wppaFontFamilyNumbarActive,fontSize:wppaFontSizeNumbarActive,color:wppaFontColorNumbarActive,fontWeight:wppaFontWeightNumbarActive}),_wppaSlides[p].length>wppaNumbarMax){var i,w,r=_wppaSlides[p].length-1,n=_wppaNxtIdx[p],o=(wppaNumbarMax-1)/2;n<o?(i=0,w=wppaNumbarMax-1-1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-o<n?(i=(w=r)-wppaNumbarMax+1+1,jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(w=n+o+.5-1,(i=n-o+1)<2?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"none"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})):r-1<w?(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"none"})):(jQuery("#wppa-nbar-"+p+"-lodots").css({display:"block"}),jQuery("#wppa-nbar-"+p+"-hidots").css({display:"block"})));for(var l=0;l<_wppaSlides[p].length;)0!=l&&l!=r&&(l<i||w<l)?jQuery("#wppa-numbar-"+p+"-"+l).css({display:"none"}):jQuery("#wppa-numbar-"+p+"-"+l).css({display:"block"}),l++}_wppaFirst[p]?(-1!=_wppaCurIdx[p]&&wppaMakeTheSlideHtml(p,"0",_wppaCurIdx[p]),wppaMakeTheSlideHtml(p,"1",_wppaNxtIdx[p]),jQuery("#imagedesc-"+p).html(_wppaDsc[p][_wppaCurIdx[p]]),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),"icons"==wppaSlideshowNavigationType?(o=wppaIconSize(p,"1.5em",!1),jQuery("#prev-arrow-"+p).html(wppaSvgHtml("Prev-Button",o,!1,!0)),jQuery("#next-arrow-"+p).html(wppaSvgHtml("Next-Button",o,!1,!0))):wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPrevP),jQuery("#next-arrow-"+p).html(wppaNextP+"&nbsp;&raquo;")):(jQuery("#prev-arrow-"+p).html("&laquo;&nbsp;"+wppaPreviousPhoto),jQuery("#next-arrow-"+p).html(wppaNextPhoto+"&nbsp;&raquo;")),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRat),jQuery("#wppa-my-rat-"+p).html(wppaMyRat)):(jQuery("#wppa-avg-rat-"+p).html(wppaAvgRating),jQuery("#wppa-my-rat-"+p).html(wppaMyRating))):wppaMakeTheSlideHtml(p,e,_wppaNxtIdx[p]),_wppaLoadSpinner(p),_wppaFirst[p]=!1,_wppaCheckRewind(p),setTimeout("_wppaNextSlide_2( "+p+" )",10)}}}}}function _wppaNextSlide_2(p){var a=_wppaFg[p],e=1-a,t=document.getElementById("theimg"+e+"-"+p);!t||1!=t.nodeType||"IMG"!=t.nodeName||t.complete?(wppaUpdateLightboxes(),_wppaUnloadSpinner(p),-1!=_wppaSSRuns[p]&&(_wppaToTheSame||_wppaShowMetaData(p,"hide")),_wppaFg[p]=1-_wppaFg[p],_wppaFg[p],setTimeout("_wppaNextSlide_3( "+p+" )",10)):setTimeout("_wppaNextSlide_2( "+p+" )",200)}function _wppaNextSlide_3(p){var a=_wppaFg[p],e=1-a,t=_wppaCurIdx[p],i=_wppaNxtIdx[p],w="#theslide"+e+"-"+p,r="#theslide"+a+"-"+p,n="#theimg"+e+"-"+p,o="#theimg"+a+"-"+p,l=parseInt(jQuery(w).css("width")),s=t==i+1?"right":t==i-1?"left":t==i?"none":"nil";switch(t==_wppaSlides[p].length-1&&0==i&&wppaSlideWrap[p]&&(s="left"),0==t&&i==_wppaSlides[p].length-1&&wppaSlideWrap[p]&&(s="right"),"nil"==s&&(s=t<i?"left":"right"),jQuery(w).css({marginLeft:0,width:l}),jQuery(r).css({marginLeft:0,width:l}),wppaFormatSlide(p),wppaAnimationType){case"fadeafter":wppaFadeOut(n,wppaAnimationSpeed),setTimeout(wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p)),wppaAnimationSpeed);break;case"swipe":switch(s){case"left":wppaAnimate(w,{marginLeft:-l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"right":wppaAnimate(w,{marginLeft:l},wppaAnimationSpeed,wppaEasingSlide),jQuery(r).css({marginLeft:-l}),wppaFadeIn(o,10),wppaAnimate(r,{marginLeft:0},wppaAnimationSpeed,wppaEasingSlide,_wppaNextSlide_4(p));break;case"none":wppaFadeIn(o,10),setTimeout("_wppaNextSlide_4( "+p+" )",10)}break;default:wppaFadeOut(n,wppaAnimationSpeed),wppaFadeIn(o,wppaAnimationSpeed,_wppaNextSlide_4(p))}}function _wppaNextSlide_4(p){var a=_wppaFg[p],e="#theslide"+a+"-"+p;jQuery("#theslide"+(1-a)+"-"+p).css({zIndex:80}),jQuery(e).css({zIndex:81}),_wppaCurIdx[p]=_wppaNxtIdx[p],wppaFormatSlide(p),wppaIsMini[p]||wppaGetContainerWidth(p)<wppaMiniTreshold?jQuery("#counter-"+p).html(_wppaCurIdx[p]+1+" / "+_wppaSlides[p].length):jQuery("#counter-"+p).html(wppaPhoto+" "+(_wppaCurIdx[p]+1)+" "+wppaOf+" "+_wppaSlides[p].length),jQuery("#bc-pname-modal-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),jQuery("#bc-pname-"+p).html(_wppaNames[p][_wppaCurIdx[p]]),_wppaAdjustFilmstrip(p,wppaEasingSlide),_wppaSetRatingDisplay(p),setTimeout("_wppaNextSlide_5( "+p+" )",_wppaTextDelay)}function _wppaNextSlide_5(p){var a,e,t;if(_wppaToTheSame||(a=_wppaDsc[p][_wppaCurIdx[p]],jQuery("#imagedesc-"+p).html(a),wppaHideWhenEmpty&&(""==(a=_wppaDsc[p][_wppaCurIdx[p]])||"&nbsp;"==a?jQuery("#descbox-"+p).css("display","none"):jQuery("#descbox-"+p).css("display","")),jQuery("#imagetitle-"+p).html(wppaMakeNameHtml(p)),"void"==_wppaCommentHtml[p][_wppaCurIdx[p]]?(jQuery("#wppa-comments-"+p).hide(),jQuery("#wppa-comments-"+p).html("")):(jQuery("#wppa-comments-"+p).show(),jQuery("#wppa-comments-"+p).html(_wppaCommentHtml[p][_wppaCurIdx[p]])),jQuery("#iptc-"+p).html(_wppaIptcHtml[p][_wppaCurIdx[p]]),jQuery("#exif-"+p).html(_wppaExifHtml[p][_wppaCurIdx[p]]),jQuery("#wppa-share-"+p).html(_wppaShareHtml[p][_wppaCurIdx[p]])),_wppaToTheSame=!1,_wppaSSRuns[p]&&!wppaSlideWrap[p]&&_wppaCurIdx[p]+1==_wppaSlides[p].length)return _wppaIsBusy[p]=!1,void _wppaStop(p);if(_wppaShowMetaData(p,"show"),-2!=_wppaTP[p]){var i=_wppaTP[p];return _wppaTP[p]=-2,_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),_wppaDoAutocol(p,"next_5"),void wppaStartStop(p,i)}wppaUpdateLightboxes(),wppaIsMini[p]||(i=_wppaShareUrl[p][_wppaCurIdx[p]],"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(_wppaShareUrl[p][_wppaCurIdx[p]]),1<_wppaSlides[p].length&&wppaPushStateSlide(p,_wppaCurIdx[p],i)),_wppaSSRuns[p]?_wppaCurIdx[p]+1==_wppaSlides[p].length?(t=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<t.length&&"hidden"!=jQuery(t).css("visibility")?setTimeout(function(){wppaSlideInitRunning[p]="start",jQuery("#wppa-next-pagelink-"+p).trigger("click")},wppaGetSlideshowTimeout(p)):0<e.length?setTimeout(function(){jQuery(e).trigger("click")},wppaGetSlideshowTimeout(p)):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p))):setTimeout("_wppaNextSlide( "+p+', "auto" )',wppaGetSlideshowTimeout(p)):_wppaStopping[p]=!1,jQuery(document).trigger("glossaryTooltipReady"),_wppaDidGoto[p]=!1,_wppaIsBusy[p]=!1,wppaIsMini[p]||_bumpViewCount(_wppaId[p][_wppaCurIdx[p]]),wppaStopAudio(p),!wppaSlideAudioStart||0<(t=jQuery(".wppa-audio-"+_wppaId[p][_wppaCurIdx[p]]+"-"+p)).length&&((t=t[t.length-1])&&(wppaAudioPlaying[p]||t.play())),wppaProtect()}function wppaFormatSlide(p){var a="theimg"+_wppaFg[p]+"-"+p,e=document.getElementById(a);if(e){var t="theslide"+_wppaFg[p]+"-"+p,i="slide_frame-"+p,w=jQuery("#wppa-container-"+p).width();wppaColWidth[p]=w;var r=jQuery(".wppa-audio-"+p),n=e.naturalWidth;void 0===n&&(n=parseInt(e.style.maxWidth));var o=e.naturalHeight;void 0===o&&(o=parseInt(e.style.maxHeight));var l=wppaAspectRatio[p],s=wppaFullSize[p],d=wppaFullFrameDelta[p],u=wppaPortraitOnly[p],_=wppaFullValign[p];void 0===_&&(_="none");var m=wppaFullHalign[p];void 0===m&&(m="none");var c,y,h,S,g,x,f,e=wppaStretch;if(u)j=w-d,h=y=0,x=S=w,f=g=(c=parseInt(j*o/n))+d,jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c});else{if(s<(x=w)&&(x=s),S=x,g=f=parseInt(x*l),e||x-d<=n||f-d<=o?l<(o+d)/(n+d)?(c=f-d,j=parseInt(c*n/o)):(j=x-d,c=parseInt(j*o/n)):(j=n,c=o),"default"!=_&&"none"!=_){switch(_){case"top":h=0;break;case"center":h=parseInt((f-(c+d))/2);break;case"bottom":h=f-(c+d);break;case"fit":h=0,g=f=c+d}jQuery("#"+a).css({marginTop:h,marginBottom:0})}if(jQuery("#"+i).css({width:x,height:f}),jQuery("#"+t).css({width:S,height:g}),jQuery("#"+a).css({width:j,height:c}),"default"!=_&&"none"!=_&&"none"!=m&&"default"!=m){switch(m){case"left":y=0;break;case"center":y=parseInt((w-x)/2);break;case"right":y=w-x}y<0&&(y=0),jQuery("#"+a).css({marginLeft:"auto",marginRight:"auto"}),jQuery("#"+i).css({marginLeft:y})}var i=jQuery(r).height(),I=(x-j)/2;i&&0<i&&(wppaAudioHeight=i,jQuery(r).css({height:wppaAudioHeight,width:j,left:I}))}var j=parseInt(x/3),I=2*j,r=0<r.length?f-wppaAudioHeight-wppaSlideBorderWidth-h:f;jQuery("#bbb-"+p+"-l").css({height:r,width:j,left:0}),jQuery("#bbb-"+p+"-r").css({height:r,width:j,left:I})}}function wppaMakeNameHtml(p){var a,e,t="";if(_wppaCurIdx[p]<0)return"";if("void"==_wppaFullNames[p][_wppaCurIdx[p]])return jQuery("#namebox-"+p).hide(),"";if(jQuery("#namebox-"+p).show(),wppaIsMini[p]||_wppaIsVideo[p][_wppaCurIdx[p]])t=_wppaFullNames[p][_wppaCurIdx[p]];else switch(wppaArtMonkyLink){case"file":case"zip":t=wppaArtMonkeyButton?_wppaFullNames[p][_wppaCurIdx[p]]?(a=-1!=_wppaFullNames[p][_wppaCurIdx[p]].indexOf("plus.png"),e=_wppaFullNames[p][_wppaCurIdx[p]].replace(/(<([^>]+)>)/gi,""),e=a?e.replace(" )"," +)"):e.replace(" )",")"),'<input type="button" title="Download" style="cursor:pointer;margin-bottom:0px;max-width:'+(wppaGetContainerWidth(p)-24)+'px;" class="wppa-download-button" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+'\' );" value="'+wppaDownLoad+": "+e+'" />'):"":wppaArtmonkeyFileNotSource?'<a href="'+_wppaUrl[p][_wppaCurIdx[p]]+'" title="Download" style="cursor:pointer;" download="'+_wppaFilename[p][_wppaCurIdx[p]]+'" >'+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>":'<a title="Download" style="cursor:pointer;" onclick="'+(wppaIsSafari&&"file"==wppaArtMonkyLink?"wppaWindowReference = window.open();":"")+"wppaAjaxMakeOrigName( "+p+", '"+_wppaId[p][_wppaCurIdx[p]]+"' );\" >"+wppaDownLoad+": "+_wppaFullNames[p][_wppaCurIdx[p]]+"</a>";break;case"none":case"new":t=_wppaFullNames[p][_wppaCurIdx[p]];break;default:t=""}return t=wppaRepairBrTags(t)}function wppaMakeTheSlideHtml(p,a,e){var t,i,w=_wppaIsVideo[p][e]?"video":"img",r="title";"wppa"==wppaLightBox[p]&&(r="data-lbtitle");var n,o,l=""==wppaLightBox[p]?' onpause="wppaVideoPlaying['+p+'] = false;" onplay="wppaVideoPlaying['+p+'] = true;"':"";if(""!=_wppaLinkUrl[p][e])t=wppaSlideToFullpopup?'<a onclick="wppaStopAudio();wppaStopShow('+p+");"+_wppaLinkUrl[p][e]+'" target="'+_wppaLinkTarget[p][e]+'" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>":"<a onclick=\"_bumpClickCount('"+_wppaId[p][e]+"');wppaStopAudio();wppaStopShow("+p+");window.open('"+_wppaLinkUrl[p][e]+"', '"+_wppaLinkTarget[p][e]+'\');" title="'+_wppaLinkTitle[p][e]+'"><'+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e]+"</a>";else if(""==wppaLightBox[p])t="<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e];else{for(var s="",d=0,u=wppaLightboxSingle[p]?"":"[slide-"+p+"-"+a+"]";d<e;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" ></a>',d++;for(i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][e]:wppaMakeFullsizeUrl(_wppaUrl[p][e]),o=".pdf"==(n=_wppaHiresUrl[p][e]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(wppaSlideLinkEqual?' onclick="wppaStopAudio();wppaStopShow('+p+");jQuery('#wppa-film-"+e+"-"+p+"').trigger('click');return false;\"":' onclick="wppaStopAudio();wppaStopShow('+p+');"')+' style="cursor:pointer;" target="'+_wppaLinkTarget[p][e]+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][e]+'" data-videonatheight="'+_wppaVideoNatHeight[p][e]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][e])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][e])+'"':"")+" "+r+'="'+_wppaLbTitle[p][e]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+">"+(o?"<iframe "+l+' src="'+n+'" title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" style="width:100%;height:100%;" ></iframe>':"<"+w+l+' title="'+_wppaLinkTitle[p][e]+'" id="theimg'+a+"-"+p+'" '+_wppaSlides[p][e])+"</a>",d=e+1;d<_wppaUrl[p].length;)i=wppaOvlHires||"wppa"!=wppaLightBox[p]?_wppaHiresUrl[p][d]:wppaMakeFullsizeUrl(_wppaUrl[p][d]),o=".pdf"==(n=_wppaHiresUrl[p][d]).substr(n.length-4,n.length),s+='<a href="'+i+'"'+(_wppaIsVideo[p][d]?' data-videonatwidth="'+_wppaVideoNatWidth[p][d]+'" data-videonatheight="'+_wppaVideoNatHeight[p][d]+'" data-videohtml="'+encodeURI(_wppaVideoHtml[p][d])+'"':"")+(o?" data-pdfhtml=\"src='"+n+"'\"":"")+(""!=_wppaAudioHtml[p][d]?' data-audiohtml="'+encodeURI(_wppaAudioHtml[p][d])+'"':"")+" "+r+'="'+_wppaLbTitle[p][d]+'" '+(wppaSlideLinkEqual?"":wppaRel+'="'+wppaLightBox[p]+u+'"')+"></a>",d++;t=s}""!=_wppaAudioHtml[p][e]&&(t+='<audio controls id="wppa-audio-'+_wppaId[p][e]+"-"+p+'" class="wppa-audio-'+p+" wppa-audio-"+_wppaId[p][e]+"-"+p+'" data-from="wppa" onplay="wppaAudioPlaying['+p+'] = true;" onpause="wppaAudioPlaying['+p+'] = false" style="position:relative;top:-'+(wppaAudioHeight+wppaSlideBorderWidth)+"px;z-index:10;width:"+_wppaVideoNatWidth[p][e]+'px;padding:0;box-sizing:border-box;" >'+_wppaAudioHtml[p][e]+"</audio>"),t=t.replace(/title=""/g,""),jQuery("#theslide"+a+"-"+p).html(t)}function wppaAdjustAllFilmstrips(p){jQuery(".wppa-filmstrip").each(function(){_wppaAdjustFilmstrip(jQuery(this).attr("id").substr(15),p)})}var wppaLastAnimFilmLoc=[];function _wppaAdjustFilmstrip(p,a){if("linear"!=a&&(a=wppaEasingSlide),document.getElementById("wppa-filmstrip-"+p)&&_wppaSlides[p]){var e,t,i,w,r=!document.getElementById("slide_frame-"+p);if(wppaLastAnimFilmLoc[p]||(wppaLastAnimFilmLoc[p]=0),r){var n=jQuery("#wppa-filmstrip-"+p);if(!wppaIsElementInViewport(n))return}if(r||jQuery(".wppa-film-"+p).removeClass("wppa-filmthumb-active"),_wppaFilmNoMove[p]&&wppaFilmInit[p]?_wppaFilmNoMove[p]=!1:(e=wppaFilmStripLength[p]/2-(_wppaCurIdx[p]+.5+wppaPreambule[p])*wppaThumbnailPitch[p]-wppaFilmStripMargin[p],wppaFilmShowGlue&&(e-=2*wppaFilmStripMargin[p]+2),i=e+wppaThumbnailPitch[p],w=e-wppaThumbnailPitch[p],t=wppaAnimationSpeed,wppaFilmInit[p]||(t=1),0==_wppaCurIdx[p]&&_wppaLastIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+"px"}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):0==_wppaLastIdx[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1?(jQuery("#wppa-filmstrip-"+p).css({marginLeft:w}),wppaLastAnimFilmLoc[p]!=e&&(wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e)):(n=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),i=parseInt(e),w=wppaThumbnailPitch[p],_wppaSSRuns[p]?(n<i?2:i<n-2*w?1:0)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i+w}):(i<n-1.5*w||n+1.5*w<i)&&jQuery("#wppa-filmstrip-"+p).css({marginLeft:i}),wppaAnimate("#wppa-filmstrip-"+p,{marginLeft:e},t,a),wppaLastAnimFilmLoc[p]=e,wppaFilmInit[p]=!0),_wppaLastIdx[p]=_wppaCurIdx[p]),wppaMakeLazyVisible("filmstripmocc="+p),!r&&-1!=_wppaCurIdx[p]){_wppaCurIdx[p];_wppaCurIdx[p]+10>_wppaSlides[p].length&&_wppaSlides[p].length;for(var o=0;o<_wppaSlides[p].length;)jQuery("#film_wppatnf_"+_wppaId[p][o]+"_"+p).html()&&(""!=jQuery("#wppa-film-"+o+"-"+p).attr("data-title")?(jQuery("#wppa-film-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title")),jQuery("#wppa-pre-"+o+"-"+p).attr("title",jQuery("#wppa-film-"+o+"-"+p).attr("data-title"))):""!=wppaFilmThumbTitle&&_wppaCurIdx[p]==o?(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaFilmThumbTitle),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaFilmThumbTitle)):(jQuery("#wppa-film-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]),jQuery("#wppa-pre-"+o+"-"+p).attr("title",wppaClickToView+" "+_wppaFilmThumbTitles[p][o]))),o++}r||jQuery("#wppa-film-"+_wppaCurIdx[p]+"-"+p).addClass("wppa-filmthumb-active")}}function _wppaNext(p){var a,e;!wppaSlideWrap[p]&&_wppaCurIdx[p]==_wppaSlides[p].length-1||(_wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length?(a=jQuery("#wppa-next-pagelink-"+p),e=jQuery("#wppa-first-pagelink-"+p),0<a.length&&"hidden"!=jQuery(a).css("visibility")?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery("#wppa-next-pagelink-"+p).trigger("click")):0<e.length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopnext",jQuery(e).trigger("click")):_wppaNextSlide(p,_wppaNxtIdx[p]=0)):_wppaNextSlide(p,0))}function _wppaNextN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]>=_wppaSlides[p].length-a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]+a;_wppaNxtIdx[p]>=_wppaSlides[p].length;)_wppaNxtIdx[p]-=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaNextOnCallback(p){if(wppaSlideWrap[p]||_wppaCurIdx[p]!=_wppaSlides[p].length-1){if(_wppaSkipRated[p]){var a=_wppaCurIdx[p]+1;a==_wppaSlides[p].length&&(a=0);var e=a;if(0!=_wppaMyr[p][e]){for(++a==_wppaSlides[p].length&&(a=0);a!=e&&0!=_wppaMyr[p][a];)++a==_wppaSlides[p].length&&(a=0);e=a}_wppaNxtIdx[p]=e}else _wppaNxtIdx[p]=_wppaCurIdx[p]+1,_wppaNxtIdx[p]==_wppaSlides[p].length&&(_wppaNxtIdx[p]=0);_wppaNextSlide(p,0)}}function _wppaPrev(p){!wppaSlideWrap[p]&&0==_wppaCurIdx[p]||(_wppaNxtIdx[p]=_wppaCurIdx[p]-1,_wppaNxtIdx[p]<0?jQuery("#wppa-prev-page-last-item-"+p).length?(wppaSlideInitRunning[p]=_wppaSSRuns[p]?"start":"stopprev",jQuery("#wppa-prev-page-last-item-"+p).trigger("click")):(_wppaNxtIdx[p]+=_wppaSlides[p].length,_wppaNextSlide(p,0)):_wppaNextSlide(p,0))}function _wppaPrevN(p,a){if(wppaSlideWrap[p]||!(_wppaCurIdx[p]<a)){for(_wppaNxtIdx[p]=_wppaCurIdx[p]-a;_wppaNxtIdx[p]<0;)_wppaNxtIdx[p]+=_wppaSlides[p].length;_wppaNextSlide(p,0)}}function _wppaGoto(p,a){_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,_wppaNextSlide(p,0)}function _wppaGotoRunning(p,a){_wppaIsBusy[p]?setTimeout("_wppaGotoRunning( "+p+","+a+" )",10):(_wppaSSRuns[p]=!1,_wppaToTheSame=_wppaNxtIdx[p]==a,_wppaNxtIdx[p]=a,__wppaOverruleRun=!0,_wppaNextSlide(p,"manual"),_wppaGotoContinue(p))}function _wppaGotoContinue(p){_wppaIsBusy[p]?setTimeout("_wppaGotoContinue( "+p+" )",10):setTimeout("_wppaNextSlide( "+p+', "reset" )',wppaGetSlideshowTimeout(p)+10)}function _wppaStart(p,a){if(_wppaStopping[p])return _wppaStopping[p]--,void setTimeout(function(){_wppaStart(p,a)},(wppaAnimationSpeed+wppaGetSlideshowTimeout(p))/10);_wppaSSRuns[p]||("icons"==wppaSlideshowNavigationType?_wppaStartIcons:_wppaStartText)(p,a)}function _wppaStartIcons(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}var t=wppaIconSize(p,"1.5em",!1);-1<a?(jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaSvgHtml("Pause-Button",t,!1,!0,"0","10","20","50")),jQuery("#speed0-"+p).show(),jQuery("#speed1-"+p).show(),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStartText(p,a){if(-2==a){var e=0;if(a=0,_wppaSkipRated[p]=!0,0!=_wppaMyr[p][e])for(;e<_wppaSlides[p].length;)0==a&&0==_wppaMyr[p][e]&&(a=e),e++}-1<a?(jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaNxtIdx[p]=a,_wppaCurIdx[p]=a,_wppaNextSlide(p,0),_wppaShowMetaData(p,"show")):(_wppaSSRuns[p]=!0,_wppaNextSlide(p,0),jQuery("#startstop-"+p).html(wppaStop),jQuery("#speed0-"+p).css("display","inline"),jQuery("#speed1-"+p).css("display","inline"),_wppaShowMetaData(p,"hide"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(wppaSlideShow)),_wppaSetRatingDisplay(p)}function _wppaStop(p){_wppaStopping[p]=12,("icons"==wppaSlideshowNavigationType?_wppaStopIcons:_wppaStopText)(p)}function _wppaStopIcons(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaSvgHtml("Play-Button",wppaIconSize(p,"1.5em",!1),!1,!0)),jQuery("#speed0-"+p).hide(),jQuery("#speed1-"+p).hide(),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaStopText(p){_wppaSSRuns[p]=!1,jQuery("#startstop-"+p).html(wppaStart+" "+wppaSlideShow),jQuery("#speed0-"+p).css("display","none"),jQuery("#speed1-"+p).css("display","none"),_wppaShowMetaData(p,"show"),(jQuery("#bc-pname-modal-"+p)?jQuery("#bc-pname-modal-"+p):jQuery("#bc-pname-"+p)).html(_wppaNames[p][_wppaCurIdx[p]])}function _wppaSpeed(p,a){"random"!=_wppaTimeOut[p]&&(a?500<_wppaTimeOut[p]&&(_wppaTimeOut[p]/=1.5):_wppaTimeOut[p]<6e4&&(_wppaTimeOut[p]*=1.5))}function _wppaLoadSpinner(p){}function _wppaUnloadSpinner(p){jQuery("#wppa-slide-spin-"+p).stop().fadeOut(),setTimeout(function(){jQuery("#wppa-slide-spin-"+p).stop().fadeOut()},1e3)}function _wppaCheckRewind(p){var a,e;document.getElementById("wppa-filmstrip-"+p)&&((e=Math.abs(_wppaCurIdx[p]-_wppaNxtIdx[p]))<=wppaFilmPageSize[p]||(1+wppaFilmStripLength[p]/wppaThumbnailPitch[p])/2<=e&&(a=wppaThumbnailPitch[p]*_wppaSlides[p].length,wppaFilmShowGlue&&(a+=2+2*wppaFilmStripMargin[p]),e=parseInt(jQuery("#wppa-filmstrip-"+p).css("margin-left")),_wppaNxtIdx[p]>_wppaCurIdx[p]?e-=a:e+=a,jQuery("#wppa-filmstrip-"+p).css("margin-left",e+"px")))}function _wppaSetRatingDisplay(p){if(document.getElementById("wppa-rating-"+p)){var a,e,t=_wppaAvg[p][_wppaCurIdx[p]];if(void 0!==t){if("likes"==wppaRatingDisplayType){"void"==(e=_wppaMyr[p][_wppaCurIdx[p]])?(jQuery("#wppa-dislike-imgdiv-"+p).hide(),jQuery("#wppa-like-imgdiv-"+p).hide()):(jQuery("#wppa-dislike-imgdiv-"+p).show(),jQuery("#wppa-like-imgdiv-"+p).show());var w=t.split("|");return jQuery("#wppa-like-"+p).attr("title",w[0]),jQuery("#wppa-liketext-"+p).html(w[1]),void("1"==_wppaMyr[p][_wppaCurIdx[p]]?jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbdown.png"):jQuery("#wppa-like-"+p).attr("src",wppaImageDirectory+"thumbup.png"))}if(t=(a=t.split("|"))[0],w=a[1],a=_wppaDisc[p][_wppaCurIdx[p]],e=_wppaMyr[p][_wppaCurIdx[p]],"void"==a)jQuery("#wppa-rating-"+p).hide();else{if(jQuery("#wppa-rating-"+p).show(),"graphic"==wppaRatingDisplayType)_wppaSetRd(p,t,"#wppa-avg-"),_wppaSetRd(p,e,"#wppa-rate-"),0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),document.getElementById("wppa-dislike-"+p)&&jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).stop().fadeTo(100,wppaStarOpacity),jQuery("#wppa-filler-"+p).attr("title",a));else{if(jQuery("#wppa-numrate-avg-"+p).html(t+" ( "+w+" ) "),jQuery(".wppa-my-rat-"+p).show(),"void"==e)jQuery("#wppa-numrate-mine-"+p).html(""),jQuery(".wppa-my-rat-"+p).hide();else if(wppaRatingOnce&&0<e)jQuery("#wppa-numrate-mine-"+p).html(e);else if(e<0)jQuery("#wppa-numrate-mine-"+p).html(" dislike");else{var r="";for(i=1;i<=wppaRatingMax;i++)e==i?r+='<span class="wppa-rating-numeric-mine" style="cursor:pointer; font-weight:bold;" onclick="_wppaRateIt( '+p+", "+i+' )">&nbsp;'+i+"&nbsp;</span>":(e>i-1&&e<i&&(r+="&nbsp;( "+e+" )&nbsp;"),r+='<span class="wppa-rating-numeric" style="cursor:pointer;" onclick="_wppaRateIt( '+p+", "+i+' )" onmouseover="this.style.fontWeight=\'bold\'" onmouseout="this.style.fontWeight=\'normal\'" >&nbsp;'+i+"&nbsp;</span>");jQuery("#wppa-numrate-mine-"+p).html(r)}0==e?(jQuery("#wppa-dislike-"+p).css("display","inline"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","inline"),jQuery("#wppa-filler-"+p).css("display","none"),jQuery("#wppa-dislike-"+p).stop().fadeTo(100,wppaStarOpacity)):(jQuery("#wppa-dislike-"+p).css("display","none"),jQuery("#wppa-dislike-imgdiv-"+p).css("display","none"),jQuery("#wppa-filler-"+p).css("display","inline")),jQuery("#wppa-discount-"+p).html(a+"&bull; "),jQuery("#wppa-filler-"+p).css("display","none")}0==e?jQuery("#wppa-vote-button-"+p).val(wppaVoteForMe):jQuery("#wppa-vote-button-"+p).val(wppaVotedForMe),jQuery("#wppa-vote-count-"+p).html(w)}}}}function wppaGetDislikeText(p,a,e){return p}function _wppaSetRd(p,a,e){var t=parseInt(a),i=t+1,w=wppaStarOpacity+(a-t)*(1-wppaStarOpacity),r=wppaRatingMax;if("void"==a)jQuery("#wppa-my-rat-"+p).hide(),jQuery(".wppa-my-rat-"+p).hide(),jQuery(".wppa-rate-"+p).hide(),jQuery(".wppa-ratingthumb").hide(),jQuery("#wppa-numrate-mine-"+p).hide();else for(jQuery("#wppa-my-rat-"+p).show(),jQuery(".wppa-my-rat-"+p).show(),jQuery(".wppa-rate-"+p).show(),jQuery(".wppa-ratingthumb").show(),jQuery("#wppa-numrate-mine-"+p).show(),idx=1;idx<=r;idx++)"#wppa-rate-"!=e&&".wppa-rate-"!=e||jQuery(e+p+"-"+idx).attr("src")!=wppaImageDirectory+"star.ico"&&jQuery(e+p+"-"+idx).attr("src",wppaImageDirectory+"star.ico"),idx<=t?jQuery(e+p+"-"+idx).stop().fadeTo(100,1):idx==i?jQuery(e+p+"-"+idx).stop().fadeTo(100,w):jQuery(e+p+"-"+idx).stop().fadeTo(100,wppaStarOpacity)}function _wppaFollowMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,a,"#wppa-rate-")}function wppaOvlFollowMe(p,a,e){e||_wppaSetRd(p,a,".wppa-rate-")}function _wppaLeaveMe(p,a){_wppaSSRuns[p]||0!=_wppaMyr[p][_wppaCurIdx[p]]&&wppaRatingOnce||_wppaMyr[p][_wppaCurIdx[p]]<0||_wppaVoteInProgress||_wppaSetRd(p,_wppaMyr[p][_wppaCurIdx[p]],"#wppa-rate-")}function wppaOvlLeaveMe(p,a,e){_wppaSetRd(p,e,".wppa-rate-")}function _wppaValidateComment(p,a){if(a=a||_wppaId[p][_wppaCurIdx[p]],jQuery("#wppa-comname-"+p).val().length<1)return alert(wppaPleaseName),!1;if("required"==wppaEmailRequired||"optional"==wppaEmailRequired){var e=jQuery("#wppa-comemail-"+p).val();if("optional"==wppaEmailRequired&&0==e.length)return!0;var t=e.indexOf("@"),a=e.lastIndexOf(".");if(t<1||a<t+2||a+2>=e.length)return alert(wppaPleaseEmail),!1}return!(jQuery("#wppa-comment-"+p).val().length<1)||(alert(wppaPleaseComment),!1)}function _wppaGo(p){document.location=p}function _wppaBbb(p,a,e){if(!_wppaSSRuns[p]){var t="#bbb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".bbb-"+p).css("cursor","pointer");break;case"hide":jQuery(".bbb-"+p).removeAttr("title"),jQuery(".bbb-"+p).css("cursor","default");break;case"click":"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}}function _wppaUbb(p,a,e){var t="#ubb-"+p+"-"+a;switch(e){case"show":"l"==a&&jQuery(t).attr("title",wppaPreviousPhoto),"r"==a&&jQuery(t).attr("title",wppaNextPhoto),jQuery(".ubb-"+p).css("cursor","pointer"),jQuery(".ubb-"+p).stop().fadeTo(200,.8),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,.8);break;case"hide":jQuery(".ubb-"+p).removeAttr("title"),jQuery(".ubb-"+p).css("cursor","default"),wppaIsMobile?jQuery(".ubb-"+p).stop().fadeTo(200,.1):jQuery(".ubb-"+p).stop().fadeTo(200,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,0);break;case"click":wppaIsMobile&&(jQuery(".ubb-"+p).stop().fadeTo(200,1).fadeTo(1e3,0),jQuery("#wppa-startstop-icon-"+p).stop().fadeTo(200,1).fadeTo(1e3,0)),"l"==a&&wppaPrev(p),"r"==a&&wppaNext(p);break;default:alert("Unimplemented instruction: "+e+" on: "+t)}}function wppaOpenComments(p){_wppaSSRuns[p]&&_wppaStop(p),jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none"),wppaColWidth[p]=0,setTimeout("_wppaDoAutocol( "+p+" )",100)}function _wppaShowMetaData(p,a){_wppaSlides[p]&&(_wppaSSRuns[p]||__wppaOverruleRun?"show"==a?wppaFotomotoHideWhenRunning||wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]]):wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display","none"):"show"==a?(wppaAutoOpenComments&&(jQuery("#wppa-comtable-wrap-"+p).css("display","block"),jQuery("#wppa-comform-wrap-"+p).css("display","block"),jQuery("#wppa-comfooter-wrap-"+p).css("display","none")),0!=_wppaCurIdx[p]&&jQuery(".wppa-first-"+p).show(),_wppaCurIdx[p]!=_wppaSlides[p].length-1&&jQuery(".wppa-last-"+p).show(),wppaShareHideWhenRunning&&jQuery("#wppa-share-"+p).css("display",""),wppaFotomotoToolbar(p,_wppaHiresUrl[p][_wppaCurIdx[p]])):(jQuery("#wppa-comtable-wrap-"+p).css("display","none"),jQuery("#wppa-comform-wrap-"+p).css("display","none"),jQuery("#wppa-comfooter-wrap-"+p).css("display","block"),wppaFotomotoHide(p)),"show"==a?(jQuery("#imagedesc-"+p).css("visibility","visible"),jQuery("#imagetitle-"+p).css("visibility","visible"),jQuery("#counter-"+p).css("visibility","visible"),jQuery("#iptccontent-"+p).css("visibility","visible"),jQuery("#exifcontent-"+p).css("visibility","visible")):(jQuery("#counter-"+p).css("visibility","hidden"),jQuery(".wppa-first-"+p).hide(),jQuery(".wppa-last-"+p).hide(),jQuery("#iptccontent-"+p).css("visibility","hidden"),jQuery("#exifcontent-"+p).css("visibility","hidden")))}function wppaGetSlideshowTimeout(p){var a,e;return"random"==_wppaTimeOut[p]?(a=2*wppaAnimationSpeed,e=7*wppaAnimationSpeed,Math.floor(Math.random()*(e-a+1))+a):_wppaTimeOut[p]}function wppaIsSlidshowVisible(p){for(var a,e=["slide_frame-"+p,"filmwindow-"+p],t=e.length,i=0;i<t;i++)if(a=document.getElementById(e[i]),a&&(a.getBoundingClientRect(),wppaIsElementInViewport(a)))return!0;return wppaFilmInit[p]=!1}
7
  // wppa-ajax-front
js/wppa-gutenberg-wppa.js CHANGED
@@ -1,7 +1,7 @@
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
- * Version 7.5.10
5
  */
6
 
7
  // Global vars
@@ -382,10 +382,10 @@ function wppaGutenbergGalleryEvaluate() {
382
  if ( ! wppaIsEmpty( album ) ) {
383
  jQuery('#wppagallery-album-virt').css('color', '#070');
384
  switch ( album ) {
385
- case '#topten':
386
- case '#lasten':
387
- case '#featen':
388
- case '#comten':
389
  jQuery('#wppagallery-album-realopt-tr').show();
390
 
391
  // We use parent here for optional album(s), because album is already used for virtual album type
@@ -404,7 +404,7 @@ function wppaGutenbergGalleryEvaluate() {
404
  jQuery('#wppagallery-photo-count-tr').show();
405
  count = jQuery('#wppagallery-photo-count').val();
406
  break;
407
- case '#tags':
408
  jQuery('#wppagallery-phototags-tr').show();
409
  jQuery('#wppagallery-tags-cats-tr').show();
410
  andor = jQuery('[name=andor]:checked').val();
@@ -426,13 +426,13 @@ function wppaGutenbergGalleryEvaluate() {
426
  }
427
  tags = wppaArrayToEnum( tagarr, sep );
428
  break;
429
- case '#last':
430
  jQuery('#wppagallery-album-parent-tr').show();
431
  parent = jQuery('#wppagallery-album-parent-parent').val();
432
  jQuery('#wppagallery-album-count-tr').show();
433
  count = jQuery('#wppagallery-album-count').val();
434
  break;
435
- case '#cat':
436
  jQuery('#wppagallery-albumcat-tr').show();
437
  jQuery('#wppagallery-tags-cats-tr').show();
438
  andor = jQuery('[name=andor]:checked').val();
@@ -454,8 +454,8 @@ function wppaGutenbergGalleryEvaluate() {
454
  }
455
  cats = wppaArrayToEnum( catarr, sep );
456
  break;
457
- case '#owner':
458
- case '#upldr':
459
  jQuery('#wppagallery-owner-tr').show();
460
  needOwner = true;
461
  owner = jQuery('#wppagallery-owner').val();
@@ -466,20 +466,20 @@ function wppaGutenbergGalleryEvaluate() {
466
  parent = parent.toString().replace( 'zero', '0' );
467
  }
468
  break;
469
- case '#all':
470
  break;
471
  default:
472
  if ( album != null ) {
473
  alert( wppaUIERR + ': ' + album );
474
  }
475
  }
476
- if ( ( album != '#cat' || cats != '' ) &&
477
- ( album != '#owner' || owner != '' ) &&
478
- ( album != '#upldr' || owner != '' ) &&
479
- ( album != '#topten' || parent != '' ) &&
480
- ( album != '#lasten' || parent != '' ) &&
481
- ( album != '#comten' || parent != '' ) &&
482
- ( album != '#featen' || parent != '' ) ) {
483
  }
484
  }
485
  break;
@@ -629,6 +629,7 @@ function wppaGutenbergGalleryEvaluate() {
629
 
630
  // Display shortcode
631
  dispShortcode = shortcode.replace(/"/g, '&quot;');
 
632
  html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+dispShortcode+'" />';
633
  jQuery('#wppagallery-shortcode-preview-container').html( html );
634
 
@@ -671,6 +672,8 @@ function wppaGutenbergGalleryEvaluate() {
671
 
672
  if ( shortcodeOk ) {
673
  result = shortcode.replace( /#/g, '@' );
 
 
674
  }
675
  else {
676
  result = '';
@@ -681,7 +684,7 @@ function wppaGutenbergGalleryEvaluate() {
681
 
682
 
683
 
684
- // Get the rendered shrtcode by ajax
685
  function wppaGutenbergGetWppaShorcodeRendered( shortcode, divId ) {
686
 
687
  console.log('Fetching shortcode rendered '+shortcode);
@@ -692,7 +695,7 @@ function wppaGutenbergGetWppaShorcodeRendered( shortcode, divId ) {
692
  data: 'action=wppa' +
693
  '&wppa-action=getshortcodedrendered' +
694
  '&shortcode=' + shortcode +
695
- '&moccur=' + wppaPhotoDialogCounter,
696
  async: true,
697
  type: 'GET',
698
  timeout: 10000,
@@ -701,7 +704,6 @@ function wppaGutenbergGetWppaShorcodeRendered( shortcode, divId ) {
701
  },
702
  success: function( result, status, xhr ) {
703
  jQuery( '#' + divId ).html( '<div id="wppa-container-'+wppaPhotoDialogCounter+'" style="clear:both;" ></div>' + result + '<div style="clear:both;" ></div>' );
704
- // jQuery( '#' + divId ).html( '<div id="wppa-container-1" style="clear:both;" ></div>' + result + '<div style="clear:both;" ></div>' );
705
  },
706
  error: function( xhr, status, error ) {
707
  wppaConsoleLog( 'Get gutenberg get shortcode rendered failed. Error = ' + error + ', status = ' + status, 'force' );
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
+ * Version 8.1.00.008
5
  */
6
 
7
  // Global vars
382
  if ( ! wppaIsEmpty( album ) ) {
383
  jQuery('#wppagallery-album-virt').css('color', '#070');
384
  switch ( album ) {
385
+ case '@topten':
386
+ case '@lasten':
387
+ case '@featen':
388
+ case '@comten':
389
  jQuery('#wppagallery-album-realopt-tr').show();
390
 
391
  // We use parent here for optional album(s), because album is already used for virtual album type
404
  jQuery('#wppagallery-photo-count-tr').show();
405
  count = jQuery('#wppagallery-photo-count').val();
406
  break;
407
+ case '@tags':
408
  jQuery('#wppagallery-phototags-tr').show();
409
  jQuery('#wppagallery-tags-cats-tr').show();
410
  andor = jQuery('[name=andor]:checked').val();
426
  }
427
  tags = wppaArrayToEnum( tagarr, sep );
428
  break;
429
+ case '@last':
430
  jQuery('#wppagallery-album-parent-tr').show();
431
  parent = jQuery('#wppagallery-album-parent-parent').val();
432
  jQuery('#wppagallery-album-count-tr').show();
433
  count = jQuery('#wppagallery-album-count').val();
434
  break;
435
+ case '@cat':
436
  jQuery('#wppagallery-albumcat-tr').show();
437
  jQuery('#wppagallery-tags-cats-tr').show();
438
  andor = jQuery('[name=andor]:checked').val();
454
  }
455
  cats = wppaArrayToEnum( catarr, sep );
456
  break;
457
+ case '@owner':
458
+ case '@upldr':
459
  jQuery('#wppagallery-owner-tr').show();
460
  needOwner = true;
461
  owner = jQuery('#wppagallery-owner').val();
466
  parent = parent.toString().replace( 'zero', '0' );
467
  }
468
  break;
469
+ case '@all':
470
  break;
471
  default:
472
  if ( album != null ) {
473
  alert( wppaUIERR + ': ' + album );
474
  }
475
  }
476
+ if ( ( album != '@cat' || cats != '' ) &&
477
+ ( album != '@owner' || owner != '' ) &&
478
+ ( album != '@upldr' || owner != '' ) &&
479
+ ( album != '@topten' || parent != '' ) &&
480
+ ( album != '@lasten' || parent != '' ) &&
481
+ ( album != '@comten' || parent != '' ) &&
482
+ ( album != '@featen' || parent != '' ) ) {
483
  }
484
  }
485
  break;
629
 
630
  // Display shortcode
631
  dispShortcode = shortcode.replace(/"/g, '&quot;');
632
+ dispShortcode = dispShortcode.replace(/@/g, '&#35;');
633
  html = '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+dispShortcode+'" />';
634
  jQuery('#wppagallery-shortcode-preview-container').html( html );
635
 
672
 
673
  if ( shortcodeOk ) {
674
  result = shortcode.replace( /#/g, '@' );
675
+ result = shortcode.replace( /"/g, '&quot;' );
676
+ result = shortcode.replace( /'/g, '&apos;' );
677
  }
678
  else {
679
  result = '';
684
 
685
 
686
 
687
+ // Get the rendered shortcode by ajax
688
  function wppaGutenbergGetWppaShorcodeRendered( shortcode, divId ) {
689
 
690
  console.log('Fetching shortcode rendered '+shortcode);
695
  data: 'action=wppa' +
696
  '&wppa-action=getshortcodedrendered' +
697
  '&shortcode=' + shortcode +
698
+ '&occur=' + wppaPhotoDialogCounter,
699
  async: true,
700
  type: 'GET',
701
  timeout: 10000,
704
  },
705
  success: function( result, status, xhr ) {
706
  jQuery( '#' + divId ).html( '<div id="wppa-container-'+wppaPhotoDialogCounter+'" style="clear:both;" ></div>' + result + '<div style="clear:both;" ></div>' );
 
707
  },
708
  error: function( xhr, status, error ) {
709
  wppaConsoleLog( 'Get gutenberg get shortcode rendered failed. Error = ' + error + ', status = ' + status, 'force' );
js/wppa.js CHANGED
@@ -3,7 +3,7 @@
3
  // contains common vars and functions
4
  //
5
 
6
- wppaWppaVer = '8.0.07.017';
7
 
8
  // Tabby click function
9
  function wppaTabbyClick(){
@@ -186,6 +186,11 @@ function wppaSizeAutoDiv() {
186
  });
187
  }
188
 
 
 
 
 
 
189
  var wppaLastAllAutocols = 0;
190
  var wppaLastAllAutocolsTimer = 0;
191
  // Do the auto cols
@@ -974,23 +979,32 @@ function wppaUrlToId( url ) {
974
  return temp;
975
  }
976
 
 
 
 
 
 
 
 
 
 
977
  // Opens/closes selection boxes in supersearch html
978
  function wppaSuperSearchSelect( mocc, go ) {
979
 
980
  // Init
981
  jQuery( '#wppa-ss-albumopt-'+mocc ).css('display', 'none');
982
- jQuery( '#wppa-ss-albumcat-'+mocc ).css('display', 'none');
983
- jQuery( '#wppa-ss-albumname-'+mocc ).css('display', 'none');
984
- jQuery( '#wppa-ss-albumtext-'+mocc ).css('display', 'none');
985
- jQuery( '#wppa-ss-photoopt-'+mocc ).css('display', 'none');
986
- jQuery( '#wppa-ss-photoname-'+mocc ).css('display', 'none');
987
- jQuery( '#wppa-ss-photoowner-'+mocc ).css('display', 'none');
988
- jQuery( '#wppa-ss-phototag-'+mocc ).css('display', 'none');
989
- jQuery( '#wppa-ss-phototext-'+mocc ).css('display', 'none');
990
- jQuery( '#wppa-ss-photoexif-'+mocc ).css('display', 'none');
991
- jQuery( '#wppa-ss-photoiptc-'+mocc ).css('display', 'none');
992
- jQuery( '#wppa-ss-exifopts-'+mocc ).css('display', 'none');
993
- jQuery( '#wppa-ss-iptcopts-'+mocc ).css('display', 'none');
994
 
995
  jQuery( '#wppa-ss-spinner-'+mocc ).css('display', 'none');
996
  jQuery( '#wppa-ss-button-'+mocc ).css('display', 'none');
3
  // contains common vars and functions
4
  //
5
 
6
+ wppaWppaVer = '8.1.00.005';
7
 
8
  // Tabby click function
9
  function wppaTabbyClick(){
186
  });
187
  }
188
 
189
+ // Add nicescroller to thumbarea
190
+ jQuery(document).ready(function(){
191
+ jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts);
192
+ });
193
+
194
  var wppaLastAllAutocols = 0;
195
  var wppaLastAllAutocolsTimer = 0;
196
  // Do the auto cols
979
  return temp;
980
  }
981
 
982
+ // Init supersearch
983
+ jQuery(document).ready(function () {
984
+ jQuery('.wppa-ss-button').each(function(){
985
+ mocc = jQuery(this).attr('data-mocc');
986
+ wppaSuperSearchSelect(mocc);
987
+ });
988
+ });
989
+
990
+
991
  // Opens/closes selection boxes in supersearch html
992
  function wppaSuperSearchSelect( mocc, go ) {
993
 
994
  // Init
995
  jQuery( '#wppa-ss-albumopt-'+mocc ).css('display', 'none');
996
+ jQuery( '#wppa-ss-albumcat-'+mocc ).css('display', 'none');
997
+ jQuery( '#wppa-ss-albumname-'+mocc ).css('display', 'none');
998
+ jQuery( '#wppa-ss-albumtext-'+mocc ).css('display', 'none');
999
+ jQuery( '#wppa-ss-photoopt-'+mocc ).css('display', 'none');
1000
+ jQuery( '#wppa-ss-photoname-'+mocc ).css('display', 'none');
1001
+ jQuery( '#wppa-ss-photoowner-'+mocc ).css('display', 'none');
1002
+ jQuery( '#wppa-ss-phototag-'+mocc ).css('display', 'none');
1003
+ jQuery( '#wppa-ss-phototext-'+mocc ).css('display', 'none');
1004
+ jQuery( '#wppa-ss-photoexif-'+mocc ).css('display', 'none');
1005
+ jQuery( '#wppa-ss-photoiptc-'+mocc ).css('display', 'none');
1006
+ jQuery( '#wppa-ss-exifopts-'+mocc ).css('display', 'none');
1007
+ jQuery( '#wppa-ss-iptcopts-'+mocc ).css('display', 'none');
1008
 
1009
  jQuery( '#wppa-ss-spinner-'+mocc ).css('display', 'none');
1010
  jQuery( '#wppa-ss-button-'+mocc ).css('display', 'none');
js/wppa.min.js CHANGED
@@ -1 +1 @@
1
- function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.0.07.017",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
1
+ function wppaTabbyClick(){jQuery(window).trigger("resize"),jQuery(document).trigger("tabbychange"),jQuery(window).trigger("orientationchange"),wppaAdjustAllFilmstrips(wppaEasingSlide)}function wppaDoInit(){_wppaTextDelay=wppaAnimationSpeed,wppaFadeInAfterFadeOut&&(_wppaTextDelay*=2),wppaIsMobile&&wppaNoAnimateOnMobile&&(_wppaTextDelay=10),jQuery(".wppa-ajax-spin").hide(),jQuery(".wppa-ovl-spin").hide(),setTimeout(function(){jQuery(".wppa-ubb").each(function(){var e=jQuery(this).attr("id").substr(6);wppaUbb(e,"l","hide"),wppaUbb(e,"r","hide")})},3e3),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaDoAllAutocols),jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeArea),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitwindowon")}),jQuery(".wppa-divnicewrap").on("DOMContentLoaded load resize wppascrollend wheelend orientationchange",function(){wppaMakeLazyVisibleScrollEnd("doinitnicewrapon")}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",wppaInitMasonryPlus),jQuery(window).on("resize",function(){wppaAdjustAllFilmstrips(wppaEasingSlide)}),jQuery(window).on("DOMContentLoaded load resize wppascrollend orientationchange",function(){setTimeout(function(){wppaResizeNice()},1e3)}),jQuery(window).trigger("resize"),wppaProtect(),setTimeout(function(){jQuery(".responsive-tabs__heading").on("click",wppaTabbyClick),jQuery(".responsive-tabs__list__item").on("click",wppaTabbyClick)},10),jQuery(document).on("tabbychange",function(){void 0!==jQuery("div").getNiceScroll&&setTimeout(function(){jQuery("div").getNiceScroll().resize(),wppaDoAllAutocols()},500),setTimeout(function(){wppaDoAllAutocols(),jQuery(window).trigger("resize"),jQuery("#wppa-ovl-spin").hide(),wppaMakeLazyVisibleScrollEnd("tabbychange")},1500)}),wppaOvlGlobal&&jQuery("a").each(function(){var e=jQuery(this).attr("href");e&&("jpg"!=(e=(e=e.split("."))[e.length-1])&&"jpeg"!=e&&"png"!=e||jQuery(this).attr("data-rel")||(jQuery(this).attr("data-rel",wppaOvlGlobal),jQuery(this).css("cursor","wait")))}),jQuery("div").on("touchmove",wppaMakeLazyVisibleScrollEnd)}var wppaResizeNiceTimer,wppaResizeEndTimer,wppaScrollEndTimer;function wppaResizeNice(){clearTimeout(wppaResizeNiceTimer),wppaResizeNiceTimer=setTimeout(function(){_wppaResizeNice()},200)}function _wppaResizeNice(){"function"==typeof jQuery("body").getNiceScroll&&jQuery("body").getNiceScroll().resize(),jQuery("div").each(function(){"function"==typeof jQuery(this).getNiceScroll&&jQuery(this).getNiceScroll().resize()})}function wppaSizeAutoDiv(){jQuery(".wppa-autodiv").each(function(e){var p=jQuery(window).height(),a=jQuery(this).attr("data-max-height");jQuery(this).css({maxHeight:p*a})})}wppaWppaVer="8.1.00.005",jQuery(document).ready(function(){wppaDoInit()}),jQuery(document).ready(function(){jQuery(window).on("resize load",function(){clearTimeout(wppaResizeEndTimer),wppaResizeEndTimer=setTimeout(function(){jQuery(window).trigger("wpparesizeend")},wppaResizeEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("scroll wheel touchmove",function(){clearTimeout(wppaScrollEndTimer),wppaScrollEndTimer=setTimeout(function(){jQuery(window).trigger("wppascrollend")},wppaScrollEndDelay)})}),jQuery(document).ready(function(){jQuery(window).on("DOMContentLoaded load resize scroll wheel orientationchange",wppaSizeAutoDiv)}),jQuery(document).ready(function(){jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",wppaNieScrollOpts)});var wppaLastAllAutocols=0,wppaLastAllAutocolsTimer=0;function wppaDoAllAutocols(e){wppaTimNow()<wppaLastAllAutocols+200?wppaLastAllAutocolsTimer=wppaLastAllAutocolsTimer||setTimeout(wppaDoAllAutocols,200):(clearTimeout(wppaLastAllAutocolsTimer),wppaLastAllAutocols=wppaTimNow(),_wppaDoAllAutocols(0))}function _wppaDoAllAutocols(p){return jQuery(".wppa-container").each(function(){var e=jQuery(this).attr("id").substr(15);wppaAutoColumnWidth[e]&&_wppaDoAutocol(e,p)}),(p<wppaExtendedResizeCount||-1==wppaExtendedResizeCount)&&setTimeout(function(){_wppaDoAllAutocols(p+1)},wppaExtendedResizeDelay),!0}function wppaProtect(){wppaHideRightClick&&(jQuery("img").bind("contextmenu",function(e){return!1}),jQuery("video").bind("contextmenu",function(e){return!1}),jQuery("canvas").bind("contextmenu",function(e){return!1}))}function wppaUpdateLightboxes(){"function"==typeof wppaInitOverlay&&wppaInitOverlay(),"undefined"!=typeof myLightbox&&"function"==typeof myLightbox.updateImageList&&myLightbox.updateImageList(),jQuery().prettyPhoto&&jQuery("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:!1})}function wppaStopVideo(e){var p,a,t=[];for(t[1]="wppa-overlay-img",t[2]="theimg0-"+e,t[3]="theimg1-"+e,a=0;a<3;)1==++a&&0!=e||(p=document.getElementById(t[a]))&&"function"==typeof p.pause&&p.pause()}function wppaStopAudio(e){if("number"==typeof e)jQuery("#audio-"+e).pause&&jQuery("#audio-"+e).pause();else{var p=jQuery("audio");if(0<p.length)for(var a=0;a<p.length;)"wppa"==jQuery(p[a]).attr("data-from")&&p[a].pause(),a++}}function wppaMakeFullsizeUrl(e){var p,a;e=(p=(e=e.replace("/thumbs/","/")).split("//"))[1]?(a=p[1].split("/"),p[0]+"//"):(a=p[0].split("/"),"");for(var t=0;t<a.length;){var o=a[t];"w"!=o.split("_")[0]&&(0!=t&&(e+="/"),e+=o),t++}return e}function wppaGetContainerWidth(e){var p=document.getElementById("wppa-container-"+e);if(p){var a=0;if(!wppaAutoColumnWidth[e])return p.clientWidth;for(;0==a;)p=p.parentNode,a=jQuery(p).width();return parseInt(a)}}function _wppaDoAutocol(e,p){if(!wppaAutoColumnWidth[e])return!0;var a,t,o=wppaGetContainerWidth(e);if(document.getElementById("wppa-container-"+e)){if(wppaCoverImageResponsive[e]||1<(a=jQuery(".wppa-asym-text-frame-"+e)).length&&(jQuery(a[0]).width(),0==wppaResponseSpeed?(jQuery(".wppa-asym-text-frame-"+e).css({width:o-wppaTextFrameDelta}),jQuery(".wppa-cover-box-"+e).css({width:o})):(wppaAnimate(".wppa-asym-text-frame-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),wppaAnimate(".wppa-cover-box-"+e,{width:o},wppaResponseSpeed,wppaEasingDefault))),1<(a=jQuery(".wppa-cover-box-mcr-"+e)).length){var r=document.getElementById("wppa-albumlist-"+e).clientWidth,n=parseInt((r+wppaCoverSpacing)/(wppaMaxCoverWidth+wppaCoverSpacing))+1,s=n-1,i=parseInt((r+wppaCoverSpacing)/n-wppaCoverSpacing);if(wppaColWidth[e]!=r||wppaMCRWidth[e]!=i){wppaColWidth[e]=r,wppaMCRWidth[e]=i;for(var l=0;l<a.length;){switch(l%n){case 0:jQuery(a[l]).css({marginLeft:"0px",clear:"both",float:"left"});break;case s:jQuery(a[l]).css({marginLeft:"0px",clear:"none",float:"right"});break;default:jQuery(a[l]).css({marginLeft:wppaCoverSpacing,clear:"none",float:"left"})}l++}wppaCoverImageResponsive[e]||wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:i-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(a[0]).width(),wppaAnimate(".wppa-cover-box-mcr-"+e,{width:i},wppaResponseSpeed,wppaEasingDefault)}}else 1==a.length&&(wppaCoverImageResponsive[e]||(wppaAnimate(".wppa-asym-text-frame-mcr-"+e,{width:o-wppaTextFrameDelta},wppaResponseSpeed,wppaEasingDefault),jQuery(".wppa-cover-box-mcr-"+e).css({marginLeft:"0px",float:"left"})));0<jQuery(".wppa-album-cover-grid-"+e).length&&(jQuery("#wppa-container-"+e).css("line-height","0"),(t=parseInt(o/wppaMaxCoverWidth+.9999))<1&&(t=1),jQuery(".wppa-album-cover-grid-"+e).css({width:100/t+"%"})),!wppaThumbSpaceAuto||(r=parseInt(jQuery(".thumbnail-frame-"+e).css("width")))&&(i=wppaMinThumbSpace,t=o-wppaThumbnailAreaDelta-7,i=Math.max(1,parseInt(t/(r+i))),i=parseInt((t-i*r)/(i+1)),jQuery(".thumbnail-frame-"+e).css({marginLeft:i})),jQuery(".thumbnail-frame-comalt-"+e).css("width",o-wppaThumbnailAreaDelta),jQuery(".wppa-com-alt-"+e).css("width",o-wppaThumbnailAreaDelta-wppaComAltSize-16);for(var u,c=1,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");w;)u=w*(o-wppaThumbnailAreaDelta)/100,jQuery("#wppa-mas-h-"+c+"-"+e).css("height",u),c++,w=jQuery("#wppa-mas-h-"+c+"-"+e).attr("data-height-perc");return wppaSetMasHorFrameWidthsForIeAndChrome(e),document.getElementById("slide_frame-"+e)&&wppaFormatSlide(e),jQuery("#audio-slide-"+e).css("width",o-wppaBoxDelta-6),jQuery(".wppa-comment-textarea-"+e).css("width",.7*o),wppaFilmStripLength[e]=o-wppaFilmStripAreaDelta[e],jQuery("#filmwindow-"+e).css("width",wppaFilmStripLength[e]),_wppaAdjustFilmstrip(e,wppaEasingSlide),wppaIsMini[e]||void 0===_wppaSlides[e]||(wppaColWidth[e]<wppaMiniTreshold?(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRat),jQuery("#wppa-my-rat-"+e).html(wppaMyRat),jQuery("#counter-"+e).html(_wppaCurIdx[e]+1+" / "+_wppaSlides[e].length)):(jQuery("#wppa-avg-rat-"+e).html(wppaAvgRating),jQuery("#wppa-my-rat-"+e).html(wppaMyRating),jQuery("#counter-"+e).html(wppaPhoto+" "+(_wppaCurIdx[e]+1)+" "+wppaOf+" "+_wppaSlides[e].length))),jQuery(".wppa-sphoto-"+e).css("width",o),jQuery(".wppa-simg-"+e).css("width",o-2*wppaSlideBorderWidth),jQuery(".wppa-simg-"+e).css("height",""),jQuery(".wppa-mphoto-"+e).css("width",o+10),jQuery(".wppa-mimg-"+e).css("width",o),jQuery(".wppa-mimg-"+e).css("height",""),jQuery(".smxpdf-"+e).css("height",.8*wppaWindowHeight()),0<wppaSearchBoxSelItems[e]&&(o/wppaSearchBoxSelItems[e]<125?jQuery(".wppa-searchsel-item-"+e).css("width","100%"):jQuery(".wppa-searchsel-item-"+e).css("width",100/wppaSearchBoxSelItems[e]+"%")),jQuery(".wppa-upload-album-"+e).css("maxWidth",.6*o),wppaSetRealCalendarHeights(e),!0}}function wppaSetRealCalendarHeights(p){var a,t,o,e=jQuery("#wppa-real-calendar-"+p).width();0<e&&(a=!0,t=e*wppaThumbAspect/7,jQuery(".wppa-real-calendar-day-"+p).css({height:t}),e=e/50+2,jQuery("#wppa-real-calendar-"+p).css({fontSize:e}),e=e/4,jQuery(".wppa-real-calendar-head-td-"+p).css({marginTop:e,marginBottom:e}),o=t/2,jQuery(".wppa-realcalimg-"+p).each(function(){var e;0==this.height?a=!1:(e=jQuery(this).attr("data-day"),thisb=o-(t-this.height)/2,jQuery(".wppa-real-calendar-day-content-"+e+"-"+p).css({bottom:thisb}))}),a||setTimeout(function(){wppaSetRealCalendarHeights(p)},100))}function wppaSetMasHorFrameWidthsForIeAndChrome(e){for(var p=jQuery(".wppa-mas-h-"+e),a=wppaMinThumbSpace,t=0;t<p.length;t++){var o=wppaGetChildI(p[t]);if(o){if("IMG"==o.nodeName&&!o.complete)return void setTimeout("wppaSetMasHorFrameWidthsForIeAndChrome( "+e+" )",400);o=o.naturalWidth/o.naturalHeight*o.height+a;jQuery(p[t]).css({width:o})}}}function wppaGetChildI(e){for(var p=e.childNodes,a=0;a<p.length;a++){var t=p[a];if(t.id&&"i-"==t.id.substr(0,2))return t;t=wppaGetChildI(t);if(t)return t}return!1}jQuery(document).ready(function(e){if(wppaAllowAjax&&jQuery.ajax&&(wppaCanAjaxRender=!0),void 0!==history.pushState){for(var p=1;p<=wppaMaxOccur;)wppaStartHtml[p]=jQuery("#wppa-container-"+p).html(),p++;wppaCanPushState=!0}});var wppaFotomotoLoaded=!1,wppaFotomotoToolbarIds=[];function fotomoto_loaded(){wppaFotomotoLoaded=!0}function wppaFotomotoToolbar(e,p){if(!(wppaColWidth[e]>=wppaFotomotoMinWidth))return jQuery("#wppa-fotomoto-container-"+e).css("display","none"),void jQuery("#wppa-fotomoto-checkout-"+e).css("display","none");jQuery("#wppa-fotomoto-container-"+e).css("display","inline"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","inline"),wppaFotomoto&&document.getElementById("wppa-fotomoto-container-"+e)&&(wppaFotomotoLoaded?(FOTOMOTO.API.checkinImage(p),wppaFotomotoToolbarIds[e]=FOTOMOTO.API.showToolbar("wppa-fotomoto-container-"+e,p)):setTimeout("wppaFotomotoToolbar( "+e+',"'+p+'" )',200))}function wppaFotomotoHide(e){jQuery("#wppa-fotomoto-container-"+e).css("display","none"),jQuery("#wppa-fotomoto-checkout-"+e).css("display","none")}function wppaStringContainsForbiddenChars(e){for(var p=["?","&","#","/",'"',"'"],a=0;a<p.length;){if(-1!=e.indexOf(p[a]))return!0;a++}return!1}function wppaPushStateSlide(e,p,a){if(!wppaIsMini[e]&&wppaCanPushState&&wppaUpdateAddressLine&&""!=a)try{history.pushState({page:wppaHis,occur:e,type:"slide",slide:p},"---",a)}catch(e){}}function wppaRepairScriptTags(e){if(void 0===e)return"";for(;-1!=e.indexOf("[script");)e=e.replace("[script","<script");for(;-1!=e.indexOf("[/script");)e=e.replace("[/script","</script");return e}function wppaRepairBrTags(e){return void 0===e?"":e.replace("[br /]","<br />").replace("[a","<a").replace(/&quot;/g,'"').replace('"]','">').replace("[/a]","</a>").replace("[img","<img").replace("/]","/>")}function wppaTrimAlt(e){return void 0===e?"":13<e.length?e.substr(0,10)+"...":e}window.onpopstate=function(e){var p=0;if(wppaCanPushState){if(e.state)switch(p=e.state.occur,e.state.type){case"html":jQuery("#wppa-container-"+p).html(e.state.html);break;case"slide":_wppaGoto(p,e.state.slide)}else if(wppaUpdateAddressLine){p=wppaFirstOccur,jQuery("#wppa-container-"+p).html(wppaStartHtml[p]),(wppaFirstOccur=0)==p&&(a=document.location.href.split("&wppa-occur="),p=parseInt(a[1]));var a=document.location.href.split("&wppa-photo="),t=parseInt(a[1]);if(0<t){for(var o=0;o<_wppaId[p].length&&_wppaId[p][o]!=t;)o++;o<_wppaId[p].length&&_wppaGoto(p,o)}}document.getElementById("theslide0-"+p)&&_wppaStop(p)}"undefined"!=typeof wppaQRUpdate&&wppaQRUpdate(document.location.href)};var wppaFbInitBusy=!1;function wppaFbInit(){wppaFbInitBusy||("undefined"!=typeof FB?(wppaFbInitBusy=!0,setTimeout("_wppaFbInit()",10)):setTimeout("wppaFbInit()",200))}function _wppaFbInit(){FB.init({status:!0,xfbml:!0}),wppaFbInitBusy=!1}function wppaInsertAtCursor(e,p){var a,t;document.selection?(e.focus(),sel=document.selection.createRange(),sel.text=p):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,t=e.selectionEnd,e.value=e.value.substring(0,a)+p+e.value.substring(t,e.value.length),e.selectionStart=a+p.length,e.selectionEnd=a+p.length):e.value+=p}function wppaGeoInit(e,p,a){var p=new google.maps.LatLng(p,a),a={disableDefaultUI:!1,panControl:!1,zoomControl:!0,mapTypeControl:!0,scaleControl:!0,streetViewControl:!0,overviewMapControl:!0,zoom:wppaGeoZoom,center:p},t=new google.maps.Map(document.getElementById("map-canvas-"+e),a),o=new google.maps.Marker({position:p,map:t,title:""});google.maps.event.addListener(t,"center_changed",function(){window.setTimeout(function(){t.panTo(o.getPosition())},1e3)})}function wppaEncode(e){if(void 0!==e){for(var p=(t=(t=String(e).replace(/#/g,"||HASH||")).replace(/&/g,"||AMP||")).split("+"),a=0,t="";a<p.length;)t+=p[a],++a<p.length&&(t+="||PLUS||");return t}}function wppaUrlToId(e){var p=e.split("/wppa/");return 1==p.length&&(p=e.split("/upload/")),1==p.length?0:p=(p=(p=(p=(p=(p=(p=p[1]).split("."))[0].replace("/","")).replace("/","")).replace("/","")).replace("/","")).replace("/","")}function wppaSuperSearchSelect(e,p){jQuery("#wppa-ss-albumopt-"+e).css("display","none"),jQuery("#wppa-ss-albumcat-"+e).css("display","none"),jQuery("#wppa-ss-albumname-"+e).css("display","none"),jQuery("#wppa-ss-albumtext-"+e).css("display","none"),jQuery("#wppa-ss-photoopt-"+e).css("display","none"),jQuery("#wppa-ss-photoname-"+e).css("display","none"),jQuery("#wppa-ss-photoowner-"+e).css("display","none"),jQuery("#wppa-ss-phototag-"+e).css("display","none"),jQuery("#wppa-ss-phototext-"+e).css("display","none"),jQuery("#wppa-ss-photoexif-"+e).css("display","none"),jQuery("#wppa-ss-photoiptc-"+e).css("display","none"),jQuery("#wppa-ss-exifopts-"+e).css("display","none"),jQuery("#wppa-ss-iptcopts-"+e).css("display","none"),jQuery("#wppa-ss-spinner-"+e).css("display","none"),jQuery("#wppa-ss-button-"+e).css("display","none");var a=jQuery("#wppa-ss-pa-"+e).val(),t="",o="",r="";switch(a){case"a":switch(jQuery("#wppa-ss-albumopt-"+e).css("display",""),t=jQuery("#wppa-ss-albumopt-"+e).val()){case"c":jQuery("#wppa-ss-albumcat-"+e).css("display","");var n=jQuery(".wppa-ss-albumcat-"+e),r="";for(s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"n":jQuery("#wppa-ss-albumname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-albumname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-albumtext-"+e).css("display","");n=jQuery(".wppa-ss-albumtext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","")}break;case"p":switch(jQuery("#wppa-ss-photoopt-"+e).css("display",""),t=jQuery("#wppa-ss-photoopt-"+e).val()){case"n":jQuery("#wppa-ss-photoname-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoname-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"o":jQuery("#wppa-ss-photoowner-"+e).css("display",""),null!=(r=jQuery("#wppa-ss-photoowner-"+e).val())&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"g":jQuery("#wppa-ss-phototag-"+e).css("display","");n=jQuery(".wppa-ss-phototag-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"t":jQuery("#wppa-ss-phototext-"+e).css("display","");var s,n=jQuery(".wppa-ss-phototext-"+e);for(r="",s=0;s<n.length;s++)jQuery(n[s]).prop("selected")&&(r+="."+jQuery(n[s]).val());""!=(r=r.substr(1))&&jQuery("#wppa-ss-button-"+e).css("display","");break;case"i":jQuery("#wppa-ss-photoiptc-"+e).css("display",""),(o=jQuery("#wppa-ss-photoiptc-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-iptcopts-"+e).css("display",""),wppaLastIptc!=o?(wppaAjaxGetSsIptcList(e,o,"wppa-ss-iptcopts-"+e),wppaLastIptc=o):null!=(r=jQuery("#wppa-ss-iptcopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")));break;case"e":jQuery("#wppa-ss-photoexif-"+e).css("display",""),(o=jQuery("#wppa-ss-photoexif-"+e).val())&&(2<o.length&&(o=o.replace("#","H")),""!=o&&(jQuery("#wppa-ss-exifopts-"+e).css("display",""),wppaLastExif!=o?(wppaAjaxGetSsExifList(e,o,"wppa-ss-exifopts-"+e),wppaLastExif=o):null!=(r=jQuery("#wppa-ss-exifopts-"+e).val())&&""!=r&&jQuery("#wppa-ss-button-"+e).css("display","")))}}p&&(-1==(p=jQuery("#wppa-ss-pageurl-"+e).val()).indexOf("?")?p+="?":p+="&",p+="occur=1&wppa-supersearch="+a+","+t+","+o+","+r,document.location.href=p)}function wppaSetIptcExifSize(e,p){e=jQuery(e).length;6<e&&(e=6),e<2&&(e=2),jQuery(p).attr("size",e)}function wppaUpdateSearchRoot(e,p){for(var a=jQuery(".wppa-search-root"),t=0;t<a.length;)jQuery(a[t]).html(e),t++;for(a=jQuery(".wppa-rootbox"),t=0;t<a.length;)p?(jQuery(a[t]).prop("checked",!1),jQuery(a[t]).prop("disabled",!1)):(jQuery(a[t]).prop("checked",!0),jQuery(a[t]).prop("disabled",!0)),t++;for(a=jQuery(".wppa-search-root-id"),t=0;t<a.length;)jQuery(a[t]).val(p),t++}function wppaSubboxChange(e){jQuery(e).prop("checked")&&jQuery(".wppa-rootbox").each(function(e){jQuery(this).prop("checked",!0)})}function wppaClearSubsearch(){for(var e=jQuery(".wppa-display-searchstring"),p=0;p<e.length;)jQuery(e[p]).html(""),p++;for(e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).prop("disabled",!0),p++}function wppaEnableSubsearch(){for(var e=jQuery(".wppa-search-sub-box"),p=0;p<e.length;)jQuery(e[p]).removeAttr("disabled"),p++}function wppaDisplaySelectedFiles(e){for(var p=jQuery("#"+e),a=0,t="";a<p[0].files.length;)t+=p[0].files[a].name+" ",a++;jQuery("#"+e+"-display").val(t)}function wppaIsEmpty(e){return null==e||(void 0===e||(""==e||(0==e||(0==e||void 0))))}function wppaGetUploadOptions(yalb,mocc,where,onComplete){var options={beforeSend:function(){jQuery("#progress-"+yalb+"-"+mocc).show(),jQuery("#bar-"+yalb+"-"+mocc).width("0%"),jQuery("#message-"+yalb+"-"+mocc).html(""),jQuery("#percent-"+yalb+"-"+mocc).html("")},uploadProgress:function(e,p,a,t){jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#7F7"),jQuery("#bar-"+yalb+"-"+mocc).width(t+"%"),t<95?jQuery("#percent-"+yalb+"-"+mocc).html(t+"%"):jQuery("#percent-"+yalb+"-"+mocc).html(wppaProcessing)},success:function(){jQuery("#bar-"+yalb+"-"+mocc).width("100%"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaDone),jQuery(".wppa-upload-button").val(wppaUploadButtonText)},complete:function(response){-1!=response.responseText.indexOf(wppaUploadFailed)?(jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed),jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>")):(jQuery("#message-"+yalb+"-"+mocc).html('<span style="font-size: 10px;" >'+response.responseText+"</span>"),"thumb"!=where&&"cover"!=where||eval(onComplete))},error:function(){jQuery("#message-"+yalb+"-"+mocc).html('<span style="color: red;" >'+wppaServerError+"</span>"),jQuery("#bar-"+yalb+"-"+mocc).css("backgroundColor","#F77"),jQuery("#percent-"+yalb+"-"+mocc).html(wppaUploadFailed)}};return options}function wppaInitMasonryPlus(){jQuery(".grid-masonryplus").each(function(){var e=jQuery(this).attr("id").substr(5),p=wppaGetContainerWidth(e)-wppaThumbnailAreaDelta,p=p/parseInt((p+wppaTfMargin)/(.75*wppaThumbSize+wppaTfMargin));jQuery(".grid-item").css("visibility","visible"),jQuery(".grid-item-"+e).css("width",p+"px"),jQuery("#grid-"+e).masonry({itemSelector:".grid-item-"+e,columnWidth:p,fitWidth:!0})})}function wppaFsChange(){wppaFsShow(),wppaOvlShowSame()}function wppaGlobalFS(){if(wppaIsIpad)return!1;if(wppaIsSafari)return!1;var e=parseInt(wppaGlobalFsIconSize/4),p=e;!wppaIsMobile&&0<jQuery("#wpadminbar").length&&(e+=jQuery("#wpadminbar").height()),jQuery("body").append('<div id="wppa-fulls-btn-1" class="wppa-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Enter fullscreen" onclick="wppaFsOn()" >'+wppaSvgHtml("Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),jQuery("body").append('<div id="wppa-exit-fulls-btn-1" class="wppa-exit-fulls-btn" style="position:fixed;top:'+e+"px;right:"+p+'px;display:none;" title="Leave fullscreen" onclick="wppaFsOff()" >'+wppaSvgHtml("Exit-Full-Screen",wppaGlobalFsIconSize+"px",!0,!1,"0","0","0","0")+"</div>"),wppaFsShow()}function wppaFsOn(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}function wppaFsOff(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}function wppaIsFs(){return!wppaIsIpad&&(!wppaIsSafari&&null!==document.fullscreenElement)}function wppaFsShow(){wppaIsFs()?(jQuery(".wppa-fulls-btn").hide(),jQuery(".wppa-exit-fulls-btn").show()):(jQuery(".wppa-fulls-btn").show(),jQuery(".wppa-exit-fulls-btn").hide())}jQuery(document).ready(function(){jQuery(".wppa-ss-button").each(function(){mocc=jQuery(this).attr("data-mocc"),wppaSuperSearchSelect(mocc)})}),jQuery(document).ready(function(){"global"==wppaFsPolicy&&wppaGlobalFS(),jQuery(window).on("DOMContentLoaded load",wppaFsShow),jQuery(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange msfullscreenchange",wppaFsChange)});
theme/wppa-style.css CHANGED
@@ -529,7 +529,7 @@ display:none;
529
  font-weight:bold;
530
  }
531
  .wppa-real-calendar-caption {
532
-
533
  font-size:1.4em;
534
  }
535
  .wppa-real-calendar-days {
@@ -644,3 +644,18 @@ display:none;
644
  text-align:right !important;
645
  padding-right: 2% !important;
646
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  font-weight:bold;
530
  }
531
  .wppa-real-calendar-caption {
532
+ text-align:center !important;
533
  font-size:1.4em;
534
  }
535
  .wppa-real-calendar-days {
644
  text-align:right !important;
645
  padding-right: 2% !important;
646
  }
647
+
648
+ /* Grid box */
649
+ .wppa-grid {
650
+ border:none;
651
+ margin:0 !important;
652
+ padding:0 !important;
653
+ }
654
+ .wppa-grid tr {
655
+ border:none;
656
+ }
657
+ .wppa-grid td {
658
+ border:none;
659
+ padding:6px;
660
+ vertical-align:middle;
661
+ }
{cloudinary → vendor/cloudinary}/README.md RENAMED
File without changes
{cloudinary → vendor/cloudinary}/index.php RENAMED
File without changes
{cloudinary → vendor/cloudinary}/src/Api.php RENAMED
File without changes
{cloudinary → vendor/cloudinary}/src/Cloudinary.php RENAMED
File without changes
{cloudinary → vendor/cloudinary}/src/Uploader.php RENAMED
File without changes
{cloudinary → vendor/cloudinary}/src/cacert.pem RENAMED
File without changes
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 8.0.09.001
7
  *
8
  */
9
 
@@ -206,25 +206,29 @@ global $wpdb;
206
  // display usefull message
207
  function wppa_update_message( $msg, $fixed = false, $id = '' ) {
208
 
209
- echo '<div class="notice notice-info is-dismissible"><p>' . strip_tags( $msg, '<a><br><input><div><em><strong><b>' ) . '</p></div>';
 
210
  }
211
 
212
  // display error message
213
  function wppa_error_message( $msg ) {
214
 
215
- echo '<div class="notice notice-error is-dismissible"><p>' . strip_tags( $msg, '<a><br><input><div><em><strong><b>' ) . '</p></div>';
 
216
  }
217
 
218
  // display warning message
219
  function wppa_warning_message( $msg ) {
220
 
221
- echo '<div class="notice notice-warning is-dismissible"><p>' . strip_tags( $msg, '<a><br><input><div><em><strong><b>' ) . '</p></div>';
 
222
  }
223
 
224
  // display ok message
225
  function wppa_ok_message( $msg ) {
226
 
227
- echo '<div class="notice notice-success is-dismissible"><p>' . strip_tags( $msg, '<a><br><input><div><em><strong><b>' ) . '</p></div>';
 
228
  }
229
 
230
  function wppa_check_numeric( $value, $minval, $target, $maxval = '' ) {
@@ -244,19 +248,6 @@ function wppa_has_albums() {
244
  return wppa_have_access( '0' );
245
  }
246
 
247
- function wppa_user_select( $select = '' ) {
248
- $result = '';
249
- $iam = $select == '' ? wppa_get_user() : $select;
250
- $users = wppa_get_users();
251
- $sel = $select == '--- public ---' ? 'selected="selected"' : '';
252
- $result .= '<option value="--- public ---" '.$sel.'>'.__( '--- public ---' , 'wp-photo-album-plus').'</option>';
253
- foreach ( $users as $usr ) {
254
- if ( $usr['user_login'] == $iam ) $sel = 'selected="selected"';
255
- else $sel = '';
256
- $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . htmlspecialchars( $usr['display_name'] ) . '</option>';
257
- }
258
- echo ( $result );
259
- }
260
 
261
  function wppa_copy_photo( $photoid, $albumto ) {
262
  global $wpdb;
@@ -564,6 +555,7 @@ function _wppa_sanitze_files( $root ) {
564
  }
565
 
566
  function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = '' ) {
 
567
 
568
  if ( $pagesize < '1' ) return; // Pagination is off
569
 
@@ -578,53 +570,37 @@ function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = ''
578
  $lastpagecount = $pagesize;
579
  }
580
 
 
581
  if ( $npages > '1' ) {
582
- echo '<div style="line-height:1.5em" >';
583
  if ( $curpage != '1' ) {
584
- ?><a href="<?php echo( $prevurl ) ?>"><?php _e( 'Prev page' , 'wp-photo-album-plus') ?></a><?php
585
  }
586
 
587
- /*
588
- $i = '1';
589
- while ( $i <= $npages ) {
590
- if ( $i == $curpage ) {
591
- echo ' <span style="padding:0 0.25em;" >' . $i . '</span>';
592
- }
593
- else {
594
- echo
595
- ' <a' .
596
- ' href="' . $pagurl . $i . $extra . '"' .
597
- ' style="border:1px solid;padding:0 0.25em;line-height:1.7em;"' .
598
- ( $i == $npages ? ' title="' . $lastpagecount . '"' : '' ) .
599
- ' >' .
600
- $i .
601
- '</a>';
602
- }
603
- $i++;
604
- }
605
- */
606
 
607
- echo '<select onchange="document.location = jQuery( this ).val()" >';
608
  $i = '1';
609
  while ( $i <= $npages ) {
610
  if ( $i == $curpage ) {
611
- echo '<option selected="selected" >' . $i . '</option>';
612
  }
613
  else {
614
- echo '<option value="' . $pagurl . $i . $extra . '"' . ( $i == $npages ? ' title="' . $lastpagecount . '"' : '' ) . ' >' . $i . '</option>';
615
  }
616
  $i++;
617
  }
618
- echo '</select>';
619
 
620
 
621
  if ( $curpage != $npages ) {
622
- echo
623
- ' <a href="' . $nexturl . '" >' .
624
- __( 'Next page', 'wp-photo-album-plus' ) .
625
  '</a>';
626
  }
627
- echo '</div><br />&nbsp;';
 
 
628
  }
629
  }
630
 
@@ -934,21 +910,7 @@ function wppa_admin_spinner() {
934
  'margin-top:-33px;' .
935
  'z-index:9999999;' .
936
  '"' .
937
- ' />' .
938
- '<script type="text/javascript" >' .
939
- /* 'jQuery( "#wppa-admin-spinner" ).css( { left:(screen.width/2-33),top:(screen.height/2-33) } );' . */
940
- 'jQuery(document).ready( function() { ' .
941
- 'setTimeout( "wppaTestAdminReady()", 200 ); ' .
942
- '} );' .
943
- 'function wppaTestAdminReady() { ' .
944
- ' if ( document.readyState === "complete" ) {' .
945
- 'jQuery( "#wppa-admin-spinner" ).fadeOut(); ' .
946
- ' } else { ' .
947
- ' setTimeout( "wppaTestAdminReady()", 200 ); ' .
948
- '}' .
949
- '}' .
950
- '</script>';
951
-
952
  echo $result;
953
  }
954
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
206
  // display usefull message
207
  function wppa_update_message( $msg, $fixed = false, $id = '' ) {
208
 
209
+ if ( defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) return;
210
+ wppa_echo( '<div class="notice notice-info is-dismissible" ><p>' . $msg . '</p></div>', 'post' );
211
  }
212
 
213
  // display error message
214
  function wppa_error_message( $msg ) {
215
 
216
+ if ( defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) return;
217
+ wppa_echo( '<div class="notice notice-error is-dismissible"><p>' . $msg . '</p></div>', 'post' );
218
  }
219
 
220
  // display warning message
221
  function wppa_warning_message( $msg ) {
222
 
223
+ if ( defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) return;
224
+ wppa_echo( '<div class="notice notice-warning is-dismissible"><p>' . $msg . '</p></div>', 'post' );
225
  }
226
 
227
  // display ok message
228
  function wppa_ok_message( $msg ) {
229
 
230
+ if ( defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) return;
231
+ wppa_echo( '<div class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>', 'post' );
232
  }
233
 
234
  function wppa_check_numeric( $value, $minval, $target, $maxval = '' ) {
248
  return wppa_have_access( '0' );
249
  }
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
 
252
  function wppa_copy_photo( $photoid, $albumto ) {
253
  global $wpdb;
555
  }
556
 
557
  function wppa_admin_page_links( $curpage, $pagesize, $count, $link, $extra = '' ) {
558
+ global $wppa_kses_maxi;
559
 
560
  if ( $pagesize < '1' ) return; // Pagination is off
561
 
570
  $lastpagecount = $pagesize;
571
  }
572
 
573
+ $result = '';
574
  if ( $npages > '1' ) {
575
+ $result .= '<div style="line-height:1.5em" >';
576
  if ( $curpage != '1' ) {
577
+ $result .= '<a href="' . esc_url( $prevurl ) . ' ">' . esc_html__( 'Prev page', 'wp-photo-album-plus' ) . '</a>';
578
  }
579
 
580
+ $result .= '<select onchange="document.location = jQuery( this ).val()" >';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
581
 
 
582
  $i = '1';
583
  while ( $i <= $npages ) {
584
  if ( $i == $curpage ) {
585
+ $result .= '<option selected="selected" >' . $i . '</option>';
586
  }
587
  else {
588
+ $result .= '<option value="' . esc_url( $pagurl . $i . $extra ) . '"' . ( $i == $npages ? ' title="' . esc_attr( $lastpagecount ) . '"' : '' ) . ' >' . $i . '</option>';
589
  }
590
  $i++;
591
  }
592
+ $result .= '</select>';
593
 
594
 
595
  if ( $curpage != $npages ) {
596
+ $result .=
597
+ ' <a href="' . esc_url( $nexturl ) . '" >' .
598
+ esc_html__( 'Next page', 'wp-photo-album-plus' ) .
599
  '</a>';
600
  }
601
+ $result .= '</div><br />&nbsp;';
602
+
603
+ wppa_echo( $result, $wppa_kses_maxi );
604
  }
605
  }
606
 
910
  'margin-top:-33px;' .
911
  'z-index:9999999;' .
912
  '"' .
913
+ ' />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
914
  echo $result;
915
  }
916
 
wppa-admin-styles.css CHANGED
@@ -1,7 +1,7 @@
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
- * version 7.3.05
5
  */
6
  #files_list, #files_list2
7
  {
@@ -81,7 +81,8 @@ ul.wppa_nav
81
  }
82
 
83
  .wppa-table-wrap {
84
- border: 1px solid #ccc;
 
85
  }
86
  .wppa-table {
87
  padding: 5px;
@@ -137,6 +138,7 @@ ul.wppa_nav
137
  }
138
  .wppa-photo-table {
139
  float: left;
 
140
  }
141
  .wppa-photo-table th {
142
  max-width: 150px;
@@ -285,3 +287,212 @@ border:1px solid black;
285
  /*.wppa-links table { border-top:1px solid #ccc; margin:0; padding:0; }*/
286
  .wppa-links td { margin:0 !important; padding:0 10px !important; }
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /* admin-styles.css
2
  *
3
  * wp-photo-album-plus
4
+ * version 8.1.00.008
5
  */
6
  #files_list, #files_list2
7
  {
81
  }
82
 
83
  .wppa-table-wrap {
84
+ border:1px solid #ccc;
85
+ position:relative;
86
  }
87
  .wppa-table {
88
  padding: 5px;
138
  }
139
  .wppa-photo-table {
140
  float: left;
141
+ width: 100%;
142
  }
143
  .wppa-photo-table th {
144
  max-width: 150px;
287
  /*.wppa-links table { border-top:1px solid #ccc; margin:0; padding:0; }*/
288
  .wppa-links td { margin:0 !important; padding:0 10px !important; }
289
 
290
+ /* Album admin used styles */
291
+ .sortable-placeholder-albums {
292
+ width: 100%;
293
+ height: 60px;
294
+ margin: 5px;
295
+ border: 1px dotted #cccccc;
296
+ border-radius:3px;
297
+ float: left;
298
+ }
299
+ .ui-state-default-albums {
300
+ position: relative;
301
+ width: 100%;
302
+ height: 60px;
303
+ margin: 5px;
304
+ border: 1px solid #cccccc;
305
+ border-radius:3px;
306
+ float: left;
307
+ }
308
+ .ui-state-default-albums td {
309
+ padding:0 !important;
310
+ line-height:12px !important;
311
+ text-align:center !important;
312
+ }
313
+ #src-alb{
314
+ color:transparent;
315
+ }
316
+ /* Comment admin */
317
+ .column-photo {
318
+ width:180px;
319
+ }
320
+ .column-user, .column-email, .column-timestamp {
321
+ width:180px;
322
+ }
323
+ .column-status {
324
+ width:100px;
325
+ }
326
+ /* Maintenance popup */
327
+ #wppa-maintenance-list h2 {
328
+ margin-top:0;
329
+ }
330
+ #wppa-maintenance-list div {
331
+ background-color:#f1f1f1; border:1px solid #ddd;
332
+ }
333
+ #wppa-maintenance-list td, #wppa-maintenance-list th {
334
+ border-right: 1px solid darkgray;
335
+ }
336
+ /* Photo admin */
337
+ .cropper-drag-box{
338
+ background-color:transparent;
339
+ }
340
+ #wppa-horizon {
341
+ background-color:transparent;
342
+ height:11px;
343
+ position:fixed;
344
+ width:100%;
345
+ top:500px;
346
+ z-index:100000;
347
+ display:none;
348
+ cursor:ns-resize;
349
+ }
350
+ #wppa-horizon hr {
351
+ color:black;
352
+ position:relative;
353
+ top:5px;
354
+ left:0px;
355
+ border:none;
356
+ background-color:black;
357
+ height:1px;
358
+ width:100%;
359
+ }
360
+ .wppa-photo-table {
361
+ width:100%;
362
+ }
363
+ .wppa-photo-table .cropper-modal {
364
+ background-color: transparent;
365
+ }
366
+ .wppa-cropper-container-wrapper {
367
+ display:inline-block;
368
+ margin-left:25%;
369
+ width:50%;
370
+ }
371
+
372
+ /* Photo admin sequence */
373
+ .sortable-placeholder {
374
+ border-color: #cccccc;
375
+ }
376
+ .ui-state-default, .sortable-placeholder {
377
+ border: 1px solid !important;
378
+ position: relative !important;
379
+ width: 180px;
380
+ height: 180px;
381
+ margin: 5px;
382
+ border-radius:3px;
383
+ float: left !important;
384
+ }
385
+
386
+ .wppa-publish {
387
+ background-color: rgb( 255, 255, 224 );
388
+ border-color: rgb( 230, 219, 85 );
389
+ }
390
+ .wppa-featured {
391
+ background-color: rgb( 224, 255, 224 );
392
+ border-color: rgb( 85, 238, 85 );
393
+ }
394
+ .wppa-pending, .wppa-scheduled, .wppa-private {
395
+ background-color: rgb( 255, 235, 232 );
396
+ border-color: rgb( 204, 0, 0 );
397
+ }
398
+ .wppa-bronze {
399
+ background-color: rgb( 221, 221, 187 );
400
+ border-color: rgb( 204, 204, 170 );
401
+ }
402
+ .wppa-silver {
403
+ background-color: rgb( 255, 255, 255 );
404
+ border-color: rgb( 238, 238, 238 );
405
+ }
406
+ .wppa-gold {
407
+ background-color: rgb( 238, 238, 204 );
408
+ border-color: rgb( 221, 221, 187 );
409
+ }
410
+
411
+ /* Settigs page */
412
+
413
+ .wppa-master-tabs {
414
+ position:relative;
415
+ top:24px;
416
+ }
417
+ .wppa-setting-tabs {
418
+ position:relative;
419
+ top:24px;
420
+ }
421
+ .wppa-setting-tabs li {
422
+ border-color: darkgrey;
423
+ border-width: 1px;
424
+ float: left;
425
+ background-color: white;
426
+ padding: 8px 10px;
427
+ font-size: 22px;
428
+ color: darkgrey;
429
+ border-style: solid;
430
+ text-align: center;
431
+ margin: 0 4px 0 0;
432
+ border-top-left-radius: 8px;
433
+ border-top-right-radius: 8px;
434
+ cursor: pointer;
435
+ }
436
+ .wppa-master-tabs li {
437
+ border-color: darkgrey;
438
+ border-width: 1px;
439
+ float: left;
440
+ background-color: white;
441
+ padding: 8px 10px;
442
+ font-size: 22px;
443
+ color: darkgrey;
444
+ border-style: solid;
445
+ text-align: center;
446
+ margin: 0 4px 6px 0;
447
+ border-radius: 8px;
448
+ cursor: pointer;
449
+ }
450
+ #wppa-setting-tab-99 {
451
+ float: right;
452
+ }
453
+ .wppa-tabdesc h3 {
454
+ margin: 0 0 9px 0;
455
+ padding: 6px 0 0 0;
456
+ }
457
+ .wppa-master-tabs .active {
458
+ color: black;
459
+ background-color:#dddddd;
460
+ }
461
+ .wppa-setting-tabs .active {
462
+ color: black;
463
+ border-bottom-color: white;
464
+ background-color:#dddddd;
465
+ }
466
+ #wppa-setting-content {
467
+ clear:both;
468
+ background-color: white;
469
+ border-left:1px solid black;
470
+ border-right:1px solid black;
471
+ border-bottom:1px solid black;
472
+ position:relative;
473
+ top:24px;
474
+ border-color:darkgrey;
475
+ margin-bottom:12px;
476
+ }
477
+ .wppa-colorbox {
478
+ height: 28px !important;
479
+ }
480
+ .wppa-doit-button {
481
+ float:left;
482
+ border-radius:3px;
483
+ font-size: 11px !important;
484
+ margin: 0 4px;
485
+ padding: 0 6px;
486
+ border: 1px solid darkgrey !important;
487
+ }
488
+
489
+ #wppa-cloudinary-table table, #wppa-cloudinary-table tbody, #wppa-cloudinary-table tr, #wppa-cloudinary-table td {
490
+ margin:0;
491
+ padding:0;
492
+ border:none;
493
+ font-size:9px;
494
+ line-height: 11px;
495
+ }
496
+ #wppa-cloudinary-table td {
497
+ height:11px;
498
+ }
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.0.08.007
7
  *
8
  */
9
 
@@ -84,7 +84,15 @@ add_action( 'admin_init', 'wppa_admin_styles' );
84
 
85
  function wppa_admin_styles() {
86
  global $wppa_api_version;
87
- wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $wppa_api_version );
 
 
 
 
 
 
 
 
88
  wp_enqueue_style( 'wppa_admin_style' );
89
 
90
  if ( wppa_can_magick() ) {
@@ -96,6 +104,46 @@ global $wppa_api_version;
96
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $wppa_api_version);
97
  wp_enqueue_style('wppa_style');
98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
101
  /* ADMIN SCRIPTS */
@@ -103,40 +151,37 @@ add_action( 'admin_init', 'wppa_admin_scripts' );
103
 
104
  function wppa_admin_scripts() {
105
  global $wppa_api_version;
106
- wp_register_script( 'wppa_upload_script', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version );
107
- wp_enqueue_script( 'wppa_upload_script' );
108
- if ( is_file( WPPA_PATH.'/js/wppa-admin-scripts.min.js' ) ) {
109
- wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.min.js', '', $wppa_api_version );
 
 
 
 
 
 
 
110
  }
111
  else {
112
- wp_register_script( 'wppa_admin_script', WPPA_URL.'/js/wppa-admin-scripts.js', '', $wppa_api_version );
113
  }
114
- wp_enqueue_script( 'wppa_admin_script' );
115
- wp_enqueue_script( 'jquery' );
116
- wp_enqueue_script( 'jquery-ui-sortable' );
117
- wp_enqueue_script( 'jquery-ui-dialog' );
118
- wp_enqueue_script( 'jquery-form' );
119
- wp_enqueue_script( 'jquery-masonry' );
120
- wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js', array(), $wppa_api_version );
121
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', array(), $wppa_api_version );
122
- wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', array(), $wppa_api_version );
123
- wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', array(), $wppa_api_version );
124
- wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', array(), $wppa_api_version );
125
- wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', array(), $wppa_api_version );
126
- wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', array(), $wppa_api_version );
127
  if ( wppa_can_magick() ) {
128
- wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', array(), $wppa_api_version );
129
  }
130
 
131
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
132
- }
133
-
134
- add_action( 'admin_head', 'wppa_inject_css' );
135
 
136
- function wppa_inject_css() {
137
- global $wppa_api_version;
138
-
139
- echo wppa_create_wppa_dynamic_css();
140
  }
141
 
142
  /* ADMIN PAGE PHP's */
@@ -178,7 +223,6 @@ function wppa_page_import() {
178
  wppa_grant_albums();
179
  wppa_rename_files_sanitized( WPPA_DEPOT_PATH );
180
  require_once 'wppa-import.php';
181
- echo '<script type="text/javascript" >/* <![CDATA[ */wppa_import = "'.__('Import', 'wp-photo-album-plus').'"; wppa_update = "'.__('Update', 'wp-photo-album-plus').'";/* ]]> */</script>';
182
  _wppa_page_import();
183
  }
184
  // Moderate admin page
@@ -312,24 +356,37 @@ function wppa_block_categories( $categories, $post ) {
312
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
313
 
314
  // Fix Gutenberg bug
315
- function wppa_fix_gutenberg_shortcodes( $post ) {
316
  global $wpdb;
317
 
318
  // Get the post
319
- $post_content = $wpdb->get_var( $wpdb->prepare( "SELECT post_content FROM $wpdb->posts WHERE ID = %d", $post ) );
 
 
320
 
321
  // Fix
322
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
323
 
 
 
 
 
 
 
 
 
 
 
324
  // Update if fixed
325
  if ( $post_content != $new_content ) {
326
- $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_content = %s WHERE ID = %d", $new_content, $post ) );
327
- }
328
 
329
- // If wppa content, clear wppa cache
330
- if ( strpos( $post_content, '[wppa' ) !== false ||
331
- strpos( $post_content, '[photo' ) !== false ) {
332
- wppa_clear_cache( ['page' => $post] );
 
 
 
333
  }
334
  }
335
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
84
 
85
  function wppa_admin_styles() {
86
  global $wppa_api_version;
87
+
88
+ // Load styles only when on a wppa page
89
+ // $page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
90
+ // if ( substr( $page, 0, 4 ) !== 'wppa' ) {
91
+ // return;
92
+ // }
93
+
94
+ $ver = filemtime( WPPA_PATH . '/wppa-admin-styles.css' );
95
+ wp_register_style( 'wppa_admin_style', WPPA_URL.'/wppa-admin-styles.css', '', $ver );
96
  wp_enqueue_style( 'wppa_admin_style' );
97
 
98
  if ( wppa_can_magick() ) {
104
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $wppa_api_version);
105
  wp_enqueue_style('wppa_style');
106
 
107
+ $the_css = wppa_create_wppa_dynamic_css();
108
+ $the_css .= '
109
+ /* WPPA Admin styles */
110
+ #TB_ajaxContent {
111
+ box-sizing:border-box; width:100% !important;
112
+ }
113
+ #wppagallery-table select {
114
+ max-width:540px;
115
+ }
116
+ #wppagallery-table option {
117
+ color: #070;
118
+ }
119
+ #wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {
120
+ padding: 2px; 0;
121
+ }
122
+
123
+ .wppa-bar {
124
+ background-color: #7f7;
125
+ width:0%;
126
+ height:18px;
127
+ border-radius: 3px;
128
+ line-height: 18px;
129
+ margin: 0;
130
+ }
131
+ .wppa-percent {
132
+ position:relative;
133
+ display:inline-block;
134
+ top:-19px;
135
+ font-size: 12px;
136
+ line-height: 18px;
137
+ margin: 0;
138
+ }
139
+ .wppa-message {
140
+ clear: both;
141
+ }
142
+ #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
143
+ padding: 2px; 0;
144
+ }';
145
+ wp_add_inline_style( 'wppa_style', $the_css );
146
+
147
  }
148
 
149
  /* ADMIN SCRIPTS */
151
 
152
  function wppa_admin_scripts() {
153
  global $wppa_api_version;
154
+
155
+ $depts = array(
156
+ 'jquery',
157
+ // 'jquery-ui-sortable', // does not work in 5.9RC2
158
+ 'jquery-ui-dialog',
159
+ 'jquery-form',
160
+ 'jquery-masonry',
161
+ );
162
+
163
+ if ( wppa_is_file( WPPA_PATH.'/js/wppa-admin-scripts.min.js' ) ) {
164
+ wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.min.js', $depts, $wppa_api_version, true );
165
  }
166
  else {
167
+ wp_enqueue_script( 'wppa-admin', WPPA_URL.'/js/wppa-admin-scripts.js', $depts, $wppa_api_version, true );
168
  }
169
+ wp_enqueue_script( 'wppa-upload', WPPA_URL.'/js/wppa-multifile-compressed.js', '', $wppa_api_version, true );
170
+ wp_enqueue_script( 'wppa-utils', WPPA_URL . '/js/wppa-utils.js',$depts, $wppa_api_version );
171
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa.js', $depts, $wppa_api_version );
172
+ wp_enqueue_script( 'wppa-slideshow', WPPA_URL . '/js/wppa-slideshow.js', $depts, $wppa_api_version );
173
+ wp_enqueue_script( 'wppa-ajax-front', WPPA_URL . '/js/wppa-ajax-front.js', $depts, $wppa_api_version );
174
+ wp_enqueue_script( 'wppa-zoom', WPPA_URL . '/js/wppa-zoom.js', $depts, $wppa_api_version );
175
+ wp_enqueue_script( 'wppa-spheric', WPPA_URL . '/js/wppa-spheric.js', $depts, $wppa_api_version );
176
+ wp_enqueue_script( 'wppa-three', WPPA_URL . '/vendor/three/three.min.js', $depts, $wppa_api_version );
 
 
 
 
 
177
  if ( wppa_can_magick() ) {
178
+ wp_enqueue_script( 'cropperjs', WPPA_URL . '/vendor/cropperjs/dist/cropper.min.js', $depts, $wppa_api_version );
179
  }
180
 
181
  wp_enqueue_style( 'wp-jquery-ui-dialog' );
 
 
 
182
 
183
+ // jQuery sortable 1.13.0 fails, 1.12.1 works. Tested on 5.9RC2 vs 5.8
184
+ wp_enqueue_script( 'wppa-jquery-sortable', WPPA_URL . '/js/sortable.min.js', $depts );
 
 
185
  }
186
 
187
  /* ADMIN PAGE PHP's */
223
  wppa_grant_albums();
224
  wppa_rename_files_sanitized( WPPA_DEPOT_PATH );
225
  require_once 'wppa-import.php';
 
226
  _wppa_page_import();
227
  }
228
  // Moderate admin page
356
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
357
 
358
  // Fix Gutenberg bug
359
+ function wppa_fix_gutenberg_shortcodes( $id ) {
360
  global $wpdb;
361
 
362
  // Get the post
363
+ $post = get_post( $id, ARRAY_A );
364
+
365
+ $post_content = $post['post_content'];
366
 
367
  // Fix
368
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
369
 
370
+ $temp = explode( '[wppa ', $new_content );
371
+ if ( is_array( $temp ) ) {
372
+ foreach( array_keys( $temp ) as $key ) {
373
+ $t = explode( ']', $temp[$key] );
374
+ $t[0] = str_replace( ['@', '&quot;', '&apos;'], ['#', '"', "'"], $t[0] );
375
+ $temp[$key] = implode( ']', $t );
376
+ }
377
+ $new_content = implode( '[wppa ', $temp );
378
+ }
379
+
380
  // Update if fixed
381
  if ( $post_content != $new_content ) {
 
 
382
 
383
+ $post['post_content'] = $new_content;
384
+ $iret = wp_insert_post( $post );
385
+
386
+ // If successfull, clear cache for this post
387
+ if ( $iret == $post ) {
388
+ wppa_clear_cache( ['page' => $id] );
389
+ }
390
  }
391
  }
392
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
wppa-ajax-front.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /* wppa-ajax-front.php
3
- *
4
- * Supplies the functionality like wp-admin/admin-ajax.php for wppa frontend ajax requests without using wp-admin files
5
- * version 7.3.00
6
- *
7
- */
8
- define( 'DOING_AJAX', true );
9
-
10
- /** Load WordPress Bootstrap */
11
- require_once ( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-load.php' );
12
-
13
- /** Allow for cross-domain requests (from the frontend). */
14
- send_origin_headers();
15
-
16
- // Require an action parameter
17
- if ( empty( $_REQUEST['action'] ) )
18
- die( '0' );
19
-
20
- // Load the wppa admin functions
21
- require_once 'wppa-admin.php';
22
-
23
- @header( 'Content-Type: text/html; charset=' . wppa_get_option( 'blog_charset' ) );
24
- @header( 'X-Robots-Tag: noindex' );
25
-
26
- send_nosniff_header();
27
- nocache_headers();
28
-
29
- wppa_ajax_callback();
30
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.0.10.005
6
  *
7
  */
8
 
@@ -56,7 +56,7 @@ global $wppa;
56
  wppa( 'error', '0' );
57
  wppa( 'out', '' );
58
  if ( ! isset( $wppa_session['page'] ) ) {
59
- wppa_session_start();
60
  }
61
  if ( ! isset( $wppa_session['page'] ) ) {
62
  $wppa_session['page'] = '0';
@@ -71,14 +71,14 @@ global $wppa;
71
  $args = '';
72
  $t = array_merge( $_GET, $_POST );
73
  foreach( array_keys( $t ) as $key ) {
74
- $args .= $key . '=' . $t[$key] . ', ';
75
  }
76
  wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
77
  }
78
 
79
  // Any runtime modifyable settings?
80
  foreach( array_keys( $_GET ) as $key ) {
81
- $value = $_GET[$key];
82
  if ( substr( $key, 0, 5 ) == 'wppa_' ) {
83
  if ( isset( $wppa_opt[$key] ) ) {
84
  $wppa_opt[$key] = $value;
@@ -170,7 +170,7 @@ global $wppa;
170
  }
171
  $mailinglist = wppa_index_array_to_string( $userarray );
172
  update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
173
- echo $msg;
174
  break;
175
 
176
  default:
@@ -185,7 +185,7 @@ global $wppa;
185
  }
186
  $url = wppa_get( 'url' );
187
  $result = wppa_create_qrcode_cache( $url, wppa_opt( 'qr_size' ) );
188
- echo $result . '|' . wppa_convert_to_pretty( $url );
189
  wppa_exit();
190
  break;
191
  case 'gettogo':
@@ -193,12 +193,11 @@ global $wppa;
193
  $result = wppa_get_option( $slug . '_togo', '' ) .
194
  '|' .
195
  wppa_get_option( $slug . '_status', '' );
196
- echo $result;
197
  wppa_exit();
198
  break;
199
 
200
  case 'getssiptclist':
201
-
202
  $tag = '';
203
  $mocc = '1';
204
  $oldvalue = '';
@@ -224,21 +223,22 @@ global $wppa;
224
  ORDER BY description", $tag ), ARRAY_A );
225
  $last = '';
226
  $any = false;
 
227
  if ( is_array( $iptcdata ) ) foreach( $iptcdata as $item ) {
228
  $desc = sanitize_text_field( $item['description'] );
229
- $desc = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $desc );
230
 
231
  if ( $desc != $last ) {
232
  $sel = ( $oldvalue && $oldvalue == $desc ) ? 'selected="selected"' : '';
233
- if ( $sel ) echo 'selected:'.$oldvalue;
234
  $ddesc = strlen( $desc ) > '32' ? substr( $desc, 0, 30 ) . '...' : $desc;
235
- echo '<option' .
236
- ' value="' . esc_attr( $desc ) . '"' .
237
- ' class="wppa-iptclist-' . $mocc . '"' .
238
- ' ' . $sel .
239
- ' >' .
240
- $ddesc .
241
- '</option>';
 
242
  $last = $desc;
243
  $any = true;
244
  }
@@ -249,6 +249,7 @@ global $wppa;
249
  WHERE photo = 0 AND tag = %s", $tag );
250
  $wpdb->query( $query );
251
  }
 
252
  wppa_exit();
253
  break;
254
 
@@ -259,6 +260,7 @@ global $wppa;
259
  $mocc = '1';
260
  $oldvalue = '';
261
  $ss_data = array();
 
262
 
263
  $tag = str_replace( 'H', '#', substr( wppa_get( 'exiftag' ), 0, 6 ) );
264
  $brand = substr( wppa_get( 'exiftag' ), 6 );
@@ -337,8 +339,6 @@ global $wppa;
337
  $any = false;
338
  if ( ! empty( $exifdata ) ) foreach( $exifdata as $item ) {
339
  $desc = sanitize_text_field( $item['f_description'] );
340
- $desc = str_replace( array(chr(0),chr(1),chr(2),chr(3),chr(4),chr(5),chr(6),chr(7)), '', $desc );
341
- $desc = trim( $desc );
342
 
343
  if ( $desc ) {
344
 
@@ -350,13 +350,14 @@ global $wppa;
350
  $ddesc = '(' . sprintf( '%5.2f', $t[0]/$t[1] ) . ') ' . $ddesc;
351
  }
352
 
353
- echo '<option' .
354
- ' value="' . esc_attr( $desc ) . '"' .
355
- ' class="wppa-exiflist-' . $mocc . '"' .
356
- ' ' . $sel .
357
- ' >' .
358
- $ddesc .
359
- '</option>';
 
360
  $any = true;
361
  }
362
  }
@@ -369,6 +370,7 @@ global $wppa;
369
  AND tag = %s", $tag );
370
  $wpdb->query( $query );
371
  }
 
372
  wppa_exit();
373
  break;
374
 
@@ -389,25 +391,7 @@ global $wppa;
389
  // Do it
390
  require_once 'wppa-photo-admin-autosave.php';
391
 
392
- // New style?
393
- if ( wppa_opt( 'upload_edit' ) == 'new' ) {
394
- wppa_fe_edit_new_style( $photo );
395
- }
396
-
397
- // Old style
398
- if ( wppa_opt( 'upload_edit' ) == 'classic' ) {
399
- wppa( 'front_edit', true );
400
- echo ' <div style="padding-bottom:4px;height:24px;" >
401
- <span style="color:#777;" >
402
- <i>'.
403
- __( 'All modifications are instantly updated on the server.<br />The <b style="color:#070" >Remark</b> field keeps you informed on the actions taken at the background.' , 'wp-photo-album-plus').
404
- '</i>
405
- </span>
406
- <input id="wppa-fe-exit" type="button" style="float:right;color:red;font-weight:bold;" onclick="window.opener.location.reload( true );window.close();" value="'.__( 'Exit & Refresh' , 'wp-photo-album-plus').'" />
407
- <div id="wppa-fe-count" style="float:right;" ></div>
408
- </div><div style="clear:both;"></div>';
409
- wppa_album_photos( '', $photo );
410
- }
411
 
412
  // Done
413
  wppa_exit();
@@ -501,29 +485,17 @@ global $wppa;
501
  wppa_secfail( '72' );
502
  }
503
 
504
- // If db agree required, see if it is present
505
- $doit = true;
506
- if ( wppa_switch( 'comment_need_db_agree' ) ) {
507
- if ( wppa_get( 'db-agree' ) ) {
508
- echo
509
- '<script type="text/javascript" >' .
510
- 'alert( "' . esc_js( __( 'Your comment needs your agreement for database storage', 'wp-photo-album-plus' ) ) . '" )' .
511
- '</script>';
512
- $doit = false;
513
- }
514
- }
515
-
516
  wppa( 'mocc', $mocc );
517
  wppa( 'comment_photo', $photoid );
518
  wppa( 'comment_id', $commentid );
519
 
520
  $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
521
- if ( wppa_switch( 'show_comments' ) && $comment_allowed && $doit ) {
522
  wppa_do_comment( $photoid ); // Process the comment
523
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
524
  }
525
  wppa( 'no_esc', true );
526
- echo wppa_comment_html( $photoid, $comment_allowed ); // Retrieve the new commentbox content
527
  wppa_exit();
528
  break;
529
 
@@ -574,19 +546,19 @@ global $wppa;
574
  if ( wppa_switch( 'search_comments' ) ) {
575
  wppa_update_photo( $pid );
576
  }
577
- echo 'OK';
578
  }
579
  else {
580
  if ( $pid ) {
581
  if ( current_user_can( 'wppa_moderate' ) ) {
582
- echo sprintf( __( 'Failed to update stutus of photo %d' , 'wp-photo-album-plus'), $pid )."\n".__( 'Please refresh the page', 'wp-photo-album-plus' );
583
  }
584
  else {
585
  wppa_secfail( '21' );
586
  }
587
  }
588
  if ( $cid ) {
589
- echo sprintf( __( 'Failed to update stutus of comment %d' , 'wp-photo-album-plus'), $cid )."\n".__( 'Please refresh the page', 'wp-photo-album-plus' );
590
  }
591
  }
592
  wppa_exit();
@@ -601,7 +573,7 @@ global $wppa;
601
  if ( wppa_may_user_fe_delete( $pid ) ) {
602
 
603
  wppa_delete_photo( $pid );
604
- echo 'OK||' . __( 'Photo removed', 'wp-photo-album-plus' );
605
  wppa_exit();
606
  }
607
  }
@@ -625,29 +597,29 @@ global $wppa;
625
  if ( wppa_opt( 'search_comments' ) ) {
626
  wppa_update_photo( $pid );
627
  }
628
- echo 'OK||' . __( 'Comment removed', 'wp-photo-album-plus' );
629
  }
630
  else {
631
- _e( 'Could not remove comment', 'wp-photo-album-plus' );
632
  }
633
  wppa_exit();
634
  }
635
 
636
  // Remove request issued, but it is not a photo and not a comment
637
- _e( 'Unexpected error', 'wp-photo-album-plus' );
638
  wppa_exit();
639
 
640
  case 'downloadalbum':
641
 
642
  // Feature enabled?
643
  if ( ! wppa_switch( 'allow_download_album' ) ) {
644
- echo '||ER||' . __( 'This feature is not enabled on this website', 'wp-photo-album-plus' );
645
  wppa_exit();
646
  }
647
 
648
  // Restricted and not admin?
649
  if ( wppa_switch( 'download_album_is_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
650
- echo '||ER||' . __( 'This feature is restricted to administrators', 'wp-photo-album-plus' );
651
  wppa_exit();
652
  }
653
 
@@ -672,13 +644,13 @@ global $wppa;
672
  $photos = $wpdb->get_results( $wpdb->prepare( $query, $alb, wppa_get_user() ), ARRAY_A );
673
 
674
  if ( ! $photos ) {
675
- echo '||ER||' . __( 'The album is empty', 'wp-photo-album-plus' );
676
  wppa_exit();
677
  }
678
 
679
  // Open zipfile
680
  if ( ! class_exists( 'ZipArchive' ) ) {
681
- echo '||ER||' . __( 'Unable to create zip archive', 'wp-photo-album-plus' );
682
  wppa_exit();
683
  }
684
  $zipfilename = wppa_get_album_name( $alb );
@@ -687,7 +659,7 @@ global $wppa;
687
  $wppa_zip = new ZipArchive;
688
  $iret = $wppa_zip->open( $zipfilepath, 1 );
689
  if ( $iret !== true ) {
690
- echo '||ER||'.sprintf( __( 'Unable to create zip archive. code = %s' , 'wp-photo-album-plus'), $iret );
691
  wppa_exit();
692
  }
693
 
@@ -723,8 +695,10 @@ global $wppa;
723
 
724
  // A zip is created
725
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$zipfilename;
726
- echo htmlentities( $desturl.'||OK||' );
727
- if ( $zipcount != count( $photos ) ) echo sprintf( __( 'Only %s out of %s photos could be added to the zipfile' , 'wp-photo-album-plus'), $zipcount, count( $photos ) );
 
 
728
  wppa_exit();
729
  break;
730
 
@@ -735,10 +709,10 @@ global $wppa;
735
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
736
  $zipfileurl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename;
737
  if ( is_file( $zipfilepath ) ) {
738
- echo htmlentities( $zipfileurl );
739
  }
740
  else {
741
- echo 'ER';
742
  }
743
  wppa_exit();
744
  break;
@@ -760,7 +734,7 @@ global $wppa;
760
  else {
761
  $alert .= __( 'You are not allowed to do this (2)', 'wp-photo-album-plus' );
762
  $status = 'ER';
763
- echo $status . '||' . $alert;
764
  wppa_exit();
765
  }
766
 
@@ -784,7 +758,7 @@ global $wppa;
784
  }
785
  }
786
  if ( wppa_opt( 'admins_choice_action' ) == 'album' ) {
787
- echo $status . '||' . $alert;
788
  wppa_exit();
789
  }
790
 
@@ -792,7 +766,7 @@ global $wppa;
792
  if ( ! class_exists( 'ZipArchive' ) ) {
793
  $status = 'ER';
794
  $alert .= __( 'Unable to create zip archive' , 'wp-photo-album-plus' ) . '. ';
795
- echo $status . '||' . $alert;
796
  wppa_exit();
797
  }
798
 
@@ -802,7 +776,7 @@ global $wppa;
802
  if ( ! wppa_is_dir( $zipsdir ) ) {
803
  $status = 'ER';
804
  $alert .= __( 'Unable to create zipsdir' , 'wp-photo-album-plus' ) . '. ';;
805
- echo $status . '||' . $alert;
806
  wppa_exit();
807
  }
808
 
@@ -846,7 +820,7 @@ global $wppa;
846
  $status = 'OK';
847
 
848
  // Done!
849
- echo $status . '||' . $alert;
850
  wppa_exit();
851
  break;
852
 
@@ -860,7 +834,7 @@ global $wppa;
860
  // Its ok
861
  }
862
  else {
863
- echo 'ER||You are not allowed to do this';
864
  wppa_exit();
865
  }
866
 
@@ -887,7 +861,7 @@ global $wppa;
887
  wppa_clear_taglist();
888
  }
889
 
890
- echo 'OK||'.__('Removed', 'wp-photo-album-plus');
891
  wppa_exit();
892
  break;
893
 
@@ -907,7 +881,7 @@ global $wppa;
907
  }
908
 
909
  // Remove all User-<userid> tags
910
- $tag = 'user-' . wppa_get_user( 'id' );
911
  $items = $wpdb->get_results( "SELECT id, tags FROM $wpdb->wppa_photos
912
  WHERE tags LIKE '%" . str_replace( "'", "\'", ',' . $wpdb->esc_like( $tag ) . ',' ) . "%'", ARRAY_A );
913
  foreach( $items as $item ) {
@@ -926,7 +900,7 @@ global $wppa;
926
 
927
  // Check if the user is allowed to do this
928
  if ( ! is_user_logged_in() ) {
929
- echo 'ER||You must be logged in to request info';
930
  wppa_exit();
931
  }
932
 
@@ -963,7 +937,7 @@ global $wppa;
963
  ) );
964
 
965
  // Done
966
- echo 'OK||Request issued';
967
  wppa_exit();
968
  break;
969
 
@@ -978,7 +952,7 @@ global $wppa;
978
  $type = wppa_opt( 'art_monkey_popup_link' );
979
  }
980
  else {
981
- echo '||7||'.__( 'Unknown source of request' , 'wp-photo-album-plus');
982
  wppa_exit();
983
  }
984
 
@@ -997,7 +971,7 @@ global $wppa;
997
  $name = wppa_sanitize_file_name( $name ); // Remove illegal chars
998
  $name = preg_replace( '/\.[^.]*$/', '', $name ); // Remove file extension
999
  if ( strlen( $name ) == '0' ) {
1000
- echo '||1||'.__( 'Empty filename' , 'wp-photo-album-plus');
1001
  wppa_exit();
1002
  }
1003
 
@@ -1024,7 +998,7 @@ global $wppa;
1024
  $tempdir = WPPA_UPLOAD_PATH.'/temp';
1025
  if ( ! wppa_is_dir( $tempdir ) ) wppa_mkdir( $tempdir );
1026
  if ( ! wppa_is_dir( $tempdir ) ) {
1027
- echo '||2||'.__( 'Unable to create tempdir' , 'wp-photo-album-plus');
1028
  wppa_exit();
1029
  }
1030
 
@@ -1035,7 +1009,7 @@ global $wppa;
1035
  }
1036
  elseif ( $type == 'zip' ) {
1037
  if ( ! class_exists( 'ZipArchive' ) ) {
1038
- echo '||8||'.__( 'Unable to create zip archive' , 'wp-photo-album-plus');
1039
  wppa_exit();
1040
  }
1041
  $ext = 'zip';
@@ -1045,7 +1019,7 @@ global $wppa;
1045
  $wppa_zip->close();
1046
  }
1047
  else {
1048
- echo '||6||'.__( 'Unknown type' , 'wp-photo-album-plus');
1049
  wppa_exit();
1050
  }
1051
 
@@ -1053,11 +1027,11 @@ global $wppa;
1053
  wppa_bump_dlcount( $photo );
1054
 
1055
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$name.'.'.$ext;
1056
- echo '||0||' . esc_url( $desturl ); // No error: return url
1057
  wppa_exit();
1058
  }
1059
  else {
1060
- echo '||9||'.__( 'The photo does no longer exist' , 'wp-photo-album-plus');
1061
  wppa_exit();
1062
  }
1063
  wppa_exit();
@@ -1065,37 +1039,38 @@ global $wppa;
1065
 
1066
  case 'tinymcedialog':
1067
  $result = wppa_make_tinymce_dialog();
1068
- echo htmlentities( $result );
1069
  wppa_exit();
1070
  break;
1071
 
1072
  case 'tinymcephotodialog':
1073
  $result = wppa_make_tinymce_photo_dialog();
1074
- echo htmlentities( $result );
1075
  wppa_exit();
1076
  break;
1077
 
1078
  case 'tinymcephotodialogfront':
1079
  $result = wppa_make_tinymce_photo_dialog( 'front' );
1080
- echo htmlentities( $result );
1081
  wppa_exit();
1082
  break;
1083
 
1084
  case 'gutenbergphotodialog':
1085
  $result = wppa_make_gutenberg_photo_dialog();
1086
- echo htmlentities( $result );
1087
  wppa_exit();
1088
  break;
1089
 
1090
  case 'gutenbergwppadialog':
1091
  $result = wppa_make_gutenberg_wppa_dialog();
1092
- echo htmlentities( $result );
1093
  wppa_exit();
1094
  break;
1095
 
1096
  case 'getshortcodedrendered':
1097
  $shortcode = wppa_get( 'shortcode' );
1098
- $shortcode = str_replace( '@', '#', $shortcode );
 
1099
 
1100
  wppa_load_theme();
1101
 
@@ -1105,15 +1080,13 @@ global $wppa;
1105
  $result = str_replace( 'href=', 'data-href=', $result );
1106
  $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1107
 
1108
- echo
1109
- '<div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >' .
1110
- '<div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" ><i>(' .
1111
- __('Links and buttons will not work in this preview', 'wp-photo-album-plus') .
1112
- ')</i></div>' .
1113
- $result .
1114
- '</div>
1115
- <script>_wppaDoAutocol(' . $wppa['mocc'] . ');</script>';
1116
-
1117
  wppa_exit();
1118
  break;
1119
 
@@ -1123,7 +1096,7 @@ global $wppa;
1123
  wppa_bump_viewcount( 'photo', wppa_get( 'photo' ) );
1124
  }
1125
  else {
1126
- _e( 'Security check failure' , 'wp-photo-album-plus');
1127
  }
1128
  wppa_exit();
1129
  break;
@@ -1135,7 +1108,7 @@ global $wppa;
1135
  wppa_bump_clickcount( $photo );
1136
  }
1137
  else {
1138
- _e( 'Security check failure' , 'wp-photo-album-plus');
1139
  }
1140
  wppa_exit();
1141
  break;
@@ -1158,18 +1131,18 @@ global $wppa;
1158
  // Security check
1159
  if ( wppa_switch( 'direct_comment' ) && wppa_switch( 'use_encrypted_links' ) && wppa_switch( 'refuse_unencrypted' ) ) {
1160
  if ( ! $photo || ( wppa_get_photo_item( $photo, 'album' ) < '1' ) ) {
1161
- echo '0||100||'.__( 'Missing or invalid photo id' , 'wp-photo-album-plus');
1162
  wppa_exit();
1163
  }
1164
  wppa_log('dbg', 'Bypassed nonce');
1165
  }
1166
  else {
1167
  if ( ! wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1168
- echo '0||100||'.$errtxt;
1169
  wppa_exit();
1170
  }
1171
  if ( ! $photo || ( wppa_get_photo_item( $photo, 'album' ) < '1' ) ) {
1172
- _e( 'Missing or invalid photo id' , 'wp-photo-album-plus');
1173
  wppa_exit();
1174
  }
1175
  }
@@ -1181,28 +1154,28 @@ global $wppa;
1181
 
1182
  // Check on validity
1183
  if ( wppa_opt( 'rating_max' ) == '1' && $rating != '1' ) {
1184
- echo '0||106||'.$errtxt.':'.$rating;
1185
  wppa_exit(); // Value out of range
1186
  }
1187
  elseif ( wppa_opt( 'rating_max' ) == '5' && ! in_array( $rating, array( '-1', '1', '2', '3', '4', '5' ) ) ) {
1188
- echo '0||106||'.$errtxt.':'.$rating;
1189
  wppa_exit(); // Value out of range
1190
  }
1191
  elseif ( wppa_opt( 'rating_max' ) == '10' && ! in_array( $rating, array( '-1', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ) ) ) {
1192
- echo '0||106||'.$errtxt.':'.$rating;
1193
  wppa_exit(); // Value out of range
1194
  }
1195
 
1196
  // Check for one rating per period
1197
  $wait_text = wppa_get_rating_wait_text( $photo );
1198
  if ( $wait_text ) {
1199
- echo '0||900||'.$wait_text; // 900 is recoverable error
1200
  wppa_exit();
1201
  }
1202
 
1203
  // Get other data
1204
  if ( ! wppa_photo_exists( $photo ) ) {
1205
- echo '0||999||'.__( 'Photo has been removed.' , 'wp-photo-album-plus');
1206
  wppa_exit();
1207
  }
1208
 
@@ -1214,7 +1187,7 @@ global $wppa;
1214
 
1215
  // Rate own photo?
1216
  if ( wppa_get_photo_item( $photo, 'owner' ) == wppa_get_user( 'login' ) && ! wppa_switch( 'allow_owner_votes' ) ) {
1217
- echo '0||900||' . __( 'Sorry, you can not rate your own photos', 'wp-photo-album-plus' );
1218
  wppa_exit();
1219
  }
1220
 
@@ -1266,7 +1239,7 @@ global $wppa;
1266
 
1267
  if ( $pending ) {
1268
  if ( ! $hascommented ) {
1269
- echo '0||900||' . __( 'Please enter a comment.', 'wp-photo-album-plus' );
1270
  wppa_exit();
1271
  }
1272
  else {
@@ -1316,7 +1289,7 @@ global $wppa;
1316
  $allavgratcombi = $lt['title'] . '|' . $lt['display'];
1317
 
1318
  // Output and quit
1319
- echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.esc_attr( $allavgratcombi ).'||||||likes';
1320
  wppa_exit();
1321
  }
1322
 
@@ -1327,19 +1300,19 @@ global $wppa;
1327
 
1328
  // Can vote only once
1329
  if ( ! wppa_switch( 'rating_change' ) && ! wppa_switch( 'rating_multi' ) ) {
1330
- echo '0||900||'.__('You can not change your vote', 'wp-photo-album-plus');
1331
  wppa_exit();
1332
  }
1333
 
1334
  // I did a dislike, can not modify
1335
  if ( $mylast < '0' ) {
1336
- echo '0||900||'.__('You can not change a dislike', 'wp-photo-album-plus');
1337
  wppa_exit();
1338
  }
1339
 
1340
  // I did a rating, can not change into dislike
1341
  if ( $mylast > '0' && $rating == '-1' ) {
1342
- echo '0||900||'.__('You can not change your vote into a dislike', 'wp-photo-album-plus');
1343
  wppa_exit();
1344
  }
1345
  }
@@ -1350,7 +1323,7 @@ global $wppa;
1350
  // Add my dislike
1351
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1352
  if ( ! $iret ) {
1353
- echo '0||101||'.$errtxt;
1354
  wppa_exit(); // Fail on storing vote
1355
  }
1356
 
@@ -1362,7 +1335,7 @@ global $wppa;
1362
 
1363
  // Photo is removed?
1364
  if ( ! is_file( wppa_get_thumb_path( $photo ) ) ) {
1365
- echo $occur.'||'.$photo.'||'.$index.'||-1||-1|0||'.wppa_opt( 'dislike_delete' );
1366
  wppa_exit();
1367
  }
1368
  }
@@ -1372,7 +1345,7 @@ global $wppa;
1372
  // Add my vote
1373
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1374
  if ( ! $iret ) {
1375
- echo '0||102||'.$errtxt;
1376
  wppa_exit(); // Fail on storing vote
1377
  }
1378
  // Add points
@@ -1390,7 +1363,7 @@ global $wppa;
1390
  wppa_clear_cache( ['photo' => $photo, 'other' => 'R'] );
1391
 
1392
  if ( $iret === false ) {
1393
- echo '0||103||' . $errtxt;
1394
  wppa_exit(); // Fail on update
1395
  }
1396
  }
@@ -1399,13 +1372,13 @@ global $wppa;
1399
  elseif ( wppa_switch( 'rating_multi' ) ) { // Rating multi is allowed
1400
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1401
  if ( ! $iret ) {
1402
- echo '0||104||'.$errtxt;
1403
  wppa_exit(); // Fail on storing vote
1404
  }
1405
  }
1406
 
1407
  else { // Should never get here....
1408
- echo '0||110||'.__( 'Unexpected error' , 'wp-photo-album-plus');
1409
  wppa_exit();
1410
  }
1411
 
@@ -1435,7 +1408,7 @@ global $wppa;
1435
  else {
1436
  $myavgrat = '0';
1437
  }
1438
- /*hbi*/
1439
  // Compute new allavgrat
1440
  $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_rating
1441
  WHERE photo = %d
@@ -1460,7 +1433,7 @@ global $wppa;
1460
  // Store it in the photo info
1461
  $iret = wppa_update_photo( array( 'id' => $photo, 'mean_rating' => $allavgrat ) );
1462
  if ( $iret === false ) {
1463
- echo '0||106||'.$wartxt;
1464
  wppa_exit(); // Fail on save
1465
  }
1466
 
@@ -1471,7 +1444,7 @@ global $wppa;
1471
  if ( $ratcount !== false ) {
1472
  $iret = wppa_update_photo( array( 'id' => $photo, 'rating_count' => $ratcount ) );
1473
  if ( $iret === false ) {
1474
- echo '0||107||'.$wartxt;
1475
  wppa_exit(); // Fail on save
1476
  }
1477
  }
@@ -1485,7 +1458,7 @@ global $wppa;
1485
  AND value = -1
1486
  AND status = 'publish'", $photo ) );
1487
  if ( $discount === false ) {
1488
- echo '0||108||'.$wartxt;
1489
  wppa_exit(); // Fail on save
1490
  }
1491
  $distext = wppa_get_distext( $discount, $rating );
@@ -1506,7 +1479,7 @@ global $wppa;
1506
  $message = '';
1507
  }
1508
 
1509
- echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgratcombi.'||'.$distext.'||'.$hascommented.'||'.$message;
1510
  break;
1511
 
1512
  case 'render':
@@ -1528,7 +1501,7 @@ global $wppa;
1528
  $mem = memory_get_peak_usage( true ) / 1024 / 1024;
1529
 
1530
  $msg = sprintf( 'WPPA Ajax render: db queries: WP:%d, WPPA+: %d in %4.2f seconds, using %4.2f MB memory max', $nq_1, $nq_2 - $nq_1, $tim_2 - $tim_1, $mem );
1531
- echo '<script type="text/javascript" >wppaConsoleLog( \''.$msg.'\', \'force\' )</script>';
1532
  break;
1533
 
1534
  case 'delete-photo':
@@ -1537,17 +1510,17 @@ global $wppa;
1537
 
1538
  // Check validity
1539
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1540
- echo '||0||'.__( 'You do not have the rights to delete a photo' , 'wp-photo-album-plus');
1541
  wppa_exit(); // Nonce check failed
1542
  }
1543
  if ( ! is_numeric( $photo ) ) {
1544
- echo '||0||'.__( 'Security check failure' , 'wp-photo-album-plus');
1545
  wppa_exit(); // Nonce check failed
1546
  }
1547
 
1548
  // Non admins/superusers can only delete their own photos
1549
  if ( ! wppa_user_is( 'administrator' ) && wppa_get_photo_item( $photo, 'owner' ) != wppa_get_user() ) {
1550
- echo '||0||'.__( 'You do not have the rights to delete this photo' , 'wp-photo-album-plus');
1551
  wppa_exit();
1552
  }
1553
 
@@ -1557,11 +1530,10 @@ global $wppa;
1557
  wppa_clear_cache( ['photo' => $photo] );
1558
  wppa_clear_cache( ['album' => $album] );
1559
  $edit_link = wppa_ea_url( 'single', $tab = 'edit' ) . '&photo=' . $photo;
1560
- echo '||1||<span style="color:red" >' . sprintf( __( 'Photo %s has been deleted' , 'wp-photo-album-plus'), '<a href="'.$edit_link.'" target="_blank" >' . $photo . '</a>' ) . '</span>';
1561
- echo '||';
1562
  $a = wppa_allow_uploads( $album );
1563
- if ( ! $a ) echo 'full';
1564
- else echo 'notfull||'.$a;
 
1565
  break;
1566
 
1567
  case 'undelete-photo':
@@ -1570,11 +1542,11 @@ global $wppa;
1570
 
1571
  // Check validity
1572
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1573
- echo '||0||'.__( 'You do not have the rights to undelete a photo' , 'wp-photo-album-plus');
1574
  wppa_exit(); // Nonce check failed
1575
  }
1576
  if ( ! is_numeric( $photo ) ) {
1577
- echo '||0||'.__( 'Security check failure' , 'wp-photo-album-plus');
1578
  wppa_exit(); // Nonce check failed
1579
  }
1580
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
@@ -1608,10 +1580,10 @@ global $wppa;
1608
  if ( $album_exists ) {
1609
  wppa_update_photo( array( 'id' => $photo, 'album' => $real_alb ) );
1610
  wppa_invalidate_treecounts( - ( $album + '9' ) );
1611
- echo '||1||<span style="color:red" >'.sprintf( __( 'Photo %s has been undeleted and placed in album %d', 'wp-photo-album-plus' ), $photo, $real_alb ).'</span>';
1612
  }
1613
  else {
1614
- echo '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>';
1615
  }
1616
  }
1617
  wppa_clear_cache( ['force' => true] );
@@ -1634,7 +1606,7 @@ global $wppa;
1634
 
1635
  // Check validity
1636
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
1637
- echo '||0||'.__( 'You do not have the rights to update album information' , 'wp-photo-album-plus').$nonce;
1638
  wppa_exit(); // Nonce check failed
1639
  }
1640
 
@@ -1647,13 +1619,13 @@ global $wppa;
1647
  $iret2 = wppa_update_photo( array( 'id' => $photo['id'], 'mean_rating' => '' ) );
1648
  }
1649
  if ( $photos && $iret1 !== false && $iret2 !== false ) {
1650
- echo '||0||'.__( 'Ratings cleared' , 'wp-photo-album-plus').'||'.__( 'No ratings for this photo.' , 'wp-photo-album-plus');
1651
  }
1652
  elseif ( $photos ) {
1653
- echo '||1||'.__( 'An error occurred while clearing ratings' , 'wp-photo-album-plus');
1654
  }
1655
  else {
1656
- echo '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus').'||'.__( 'No ratings for this photo.' , 'wp-photo-album-plus');
1657
  }
1658
  wppa_exit();
1659
  break;
@@ -1670,14 +1642,14 @@ global $wppa;
1670
  $iret = wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
1671
  }
1672
  if ( $photos && $iret !== false ) {
1673
- echo '||0||'.__( 'Tags set to defaults' , 'wp-photo-album-plus');
1674
  wppa_update_album( $album );
1675
  }
1676
  elseif ( $photos ) {
1677
- echo '||1||'.__( 'An error occurred while setting tags' , 'wp-photo-album-plus');
1678
  }
1679
  else {
1680
- echo '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus');
1681
  }
1682
  wppa_clear_taglist();
1683
  wppa_exit();
@@ -1696,13 +1668,13 @@ global $wppa;
1696
  }
1697
  if ( $photos && $iret !== false ) {
1698
  wppa_update_album( $album );
1699
- echo '||0||'.__( 'Tags added with defaults' , 'wp-photo-album-plus');
1700
  }
1701
  elseif ( $photos ) {
1702
- echo '||1||'.__( 'An error occurred while adding tags' , 'wp-photo-album-plus');
1703
  }
1704
  else {
1705
- echo '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus');
1706
  }
1707
  wppa_clear_taglist();
1708
  wppa_exit();
@@ -1725,23 +1697,23 @@ global $wppa;
1725
  }
1726
  }
1727
  else {
1728
- echo '||0||' . __( 'No subalbums found to process', 'wp-photo-album-plus' );
1729
  wppa_exit();
1730
  }
1731
  }
1732
  else {
1733
- echo '||0||' . __( 'No categories found to process', 'wp-photo-album-plus' );
1734
  wppa_exit();
1735
  }
1736
  $n = count( $albarr ) - 1;
1737
- echo '||0||' . sprintf( _n( '%d album updated', '%d albums updated', $n, 'wp-photo-album-plus' ), $n );
1738
  wppa_exit();
1739
  break;
1740
  case 'name':
1741
  $value = trim( strip_tags( $value ) );
1742
  if ( ! wppa_sanitize_file_name( $value ) ) { // Empty album name is not allowed
1743
  $value = 'Album-#' . $album;
1744
- echo '||5||' . sprintf( __( 'Album name may not be empty.<br />Reset to %s', 'wp-photo-album-plus' ), htmlentities( $value ) );
1745
  }
1746
  $itemname = __( 'Name' , 'wp-photo-album-plus');
1747
  wppa_update_album( array( 'id' => $album, 'name' => $value, 'modified' => time() ) );
@@ -1786,14 +1758,14 @@ global $wppa;
1786
  case 'owner':
1787
  $itemname = __( 'Owner' , 'wp-photo-album-plus');
1788
  if ( $value != '--- public ---' && ! wppa_get_user_by( 'login', $value ) ) {
1789
- echo '||4||'.sprintf( __( 'User %s does not exist' , 'wp-photo-album-plus'), $value );
1790
  wppa_exit();
1791
  }
1792
  break;
1793
  case 'upload_limit_count':
1794
  wppa_ajax_check_range( $value, false, '-1', false, __( 'Upload limit count' , 'wp-photo-album-plus') );
1795
  if ( wppa( 'error' ) ) {
1796
- echo '||7||'.__('Invalid value', 'wp-photo-album-plus');
1797
  wppa_exit();
1798
  }
1799
  $oldval = $wpdb->get_var( $wpdb->prepare( "SELECT upload_limit FROM $wpdb->wppa_albums
@@ -1844,7 +1816,7 @@ global $wppa;
1844
  if ( $item == 'min' ) $temp[4] = $value;
1845
  $scheduledtm = implode( ',', $temp );
1846
  wppa_update_album( array( 'id' => $album, 'scheduledtm' => $scheduledtm, 'modified' => time() ) );
1847
- echo '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) );
1848
  wppa_exit();
1849
  break;
1850
 
@@ -1868,7 +1840,7 @@ global $wppa;
1868
  if ( $item == 'delmin' ) $temp[4] = $value;
1869
  $scheduledel = implode( ',', $temp );
1870
  wppa_update_album( array( 'id' => $album, 'scheduledel' => $scheduledel, 'modified' => time() ) );
1871
- echo '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) );
1872
  wppa_exit();
1873
  break;
1874
 
@@ -1880,7 +1852,7 @@ global $wppa;
1880
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
1881
  SET status = 'scheduled', scheduledtm = %s
1882
  WHERE album = %d", $scheduledtm, $album ) );
1883
- echo '||0||'.__( 'All photos set to scheduled per date', 'wp-photo-album-plus' ) . ' ' . wppa_format_scheduledtm( $scheduledtm );
1884
  }
1885
  wppa_exit();
1886
  break;
@@ -1901,7 +1873,7 @@ global $wppa;
1901
  $i = substr( $item , 10 );
1902
  $opts[$i] = $value;
1903
  wppa_update_album( array( 'id' => $album, 'displayopts' => implode( ',', $opts ) ) );
1904
- echo '||0||'.sprintf( __( 'Display options of album %s updated', 'wp-photo-album-plus' ), htmlentities( $album ) );
1905
  wppa_exit();
1906
  break;
1907
 
@@ -1927,7 +1899,7 @@ global $wppa;
1927
  $custom = serialize( $custom_data );
1928
  wppa_update_album( array( 'id' => $album, 'custom' => $custom, 'modified' => time() ) );
1929
  wppa_index_update( 'album', $album );
1930
- echo '||0||'.sprintf( __( 'Custom field %s updated' , 'wp-photo-album-plus'), wppa_opt( 'album_custom_caption_'.$index ) );
1931
  wppa_exit();
1932
  break;
1933
 
@@ -1953,18 +1925,20 @@ global $wppa;
1953
  if ( $item == 'name' ) {
1954
  wppa_create_pl_htaccess();
1955
  }
1956
- echo '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) );
1957
  if ( $item == 'upload_limit' ) {
1958
- echo '||';
1959
  $a = wppa_allow_uploads( $album );
1960
- if ( ! $a ) echo 'full';
1961
- else echo 'notfull||'.$a;
1962
  }
1963
  wppa_update_album( $album );
1964
  }
1965
  else {
1966
- echo '||2||'.sprintf( __( 'An error occurred while trying to update %s of album %s' , 'wp-photo-album-plus'), $itemname, htmlentities( $album ) );
1967
- echo '<br>'.__( 'Press CTRL+F5 and try again.' , 'wp-photo-album-plus');
 
 
 
1968
  }
1969
  wppa_clear_cache( ['album' => $album] );
1970
  wppa_exit();
@@ -1978,7 +1952,7 @@ global $wppa;
1978
 
1979
  // Check validity
1980
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1981
- echo '||0||'.__( 'You do not have the rights to update comment status' , 'wp-photo-album-plus').$nonce;
1982
  wppa_exit(); // Nonce check failed
1983
  }
1984
 
@@ -1997,22 +1971,21 @@ global $wppa;
1997
  wppa_get_photo_item( $photo, 'owner' )
1998
  );
1999
  }
2000
- echo '||0||'.sprintf( __( 'Status of comment #%s updated' , 'wp-photo-album-plus'), $comid );
2001
  }
2002
  else {
2003
- echo '||1||'.sprintf( __( 'Error updating status comment #%s' , 'wp-photo-album-plus'), $comid );
2004
  }
2005
  wppa_exit();
2006
  break;
2007
- /**/
2008
- /**/
2009
  case 'watermark-photo':
2010
  $photo = wppa_get( 'photo-id', '0', 'int' );
2011
  $nonce = wppa_get( 'nonce' );
2012
 
2013
  // Check validity
2014
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
2015
- echo '||1||'.__( 'You do not have the rights to change photos' , 'wp-photo-album-plus');
2016
  wppa_exit(); // Nonce check failed
2017
  }
2018
 
@@ -2023,11 +1996,11 @@ global $wppa;
2023
  }
2024
  wppa_bump_thumb_rev();
2025
  wppa_bump_photo_rev();
2026
- echo '||0||'.__( 'Watermark applied. Reloading the page...' , 'wp-photo-album-plus');
2027
  wppa_exit();
2028
  }
2029
  else {
2030
- echo '||1||'.__( 'An error occurred while trying to apply a watermark' , 'wp-photo-album-plus');
2031
  wppa_exit();
2032
  }
2033
  /**/
@@ -2456,7 +2429,7 @@ global $wppa;
2456
  $edit_link = wppa_ea_url( 'single', $tab = 'edit' ) . '&photo=' . $photodata['id'];
2457
  if ( $iret ) {
2458
  wppa_move_source( $photodata['filename'], $photodata['album'], $value );
2459
- echo '||99||'.sprintf( __( 'Photo %s has been moved to album %s (%s)' , 'wp-photo-album-plus'), '<a href="'.$edit_link.'" target="_blank" >' . $photodata['id'] . '</a>', wppa_get_album_name( $value ), $value );
2460
  wppa_exit();
2461
  }
2462
  else {
@@ -2530,7 +2503,7 @@ global $wppa;
2530
  case 'owner':
2531
  $usr = wppa_get_user_by( 'login', $value );
2532
  if ( ! $usr ) {
2533
- echo '||4||' . sprintf( __( 'User %s does not exists' , 'wp-photo-album-plus'), $value );
2534
  wppa_exit();
2535
  }
2536
  $value = $usr->user_login; // Correct possible case mismatch
@@ -3004,12 +2977,12 @@ global $wppa;
3004
 
3005
  // Verify that we are legally here
3006
  if ( ! current_user_can( 'wppa_settings' ) ) {
3007
- echo '||1||'.__( 'You do not have the rights to update settings', 'wp-photo-album-plus' );
3008
  wppa_exit();
3009
  }
3010
  $nonce = wppa_get( 'nonce' );
3011
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3012
- echo '||1||'.__( 'Security check failure', 'wp-photo-album-plus' );
3013
  wppa_exit();
3014
  }
3015
 
@@ -3052,7 +3025,7 @@ global $wppa;
3052
  ) );
3053
  }
3054
  else {
3055
- echo 'Error';
3056
  }
3057
  wppa_exit();
3058
  }
@@ -3119,16 +3092,16 @@ global $wppa;
3119
  $setting = explode( '-', $option );
3120
  if ( $value == 'yes' ) {
3121
  $wp_roles->add_cap( $setting[2], $setting[1] );
3122
- echo '||0||'.__( 'Capability granted' , 'wp-photo-album-plus').'||';
3123
  wppa_exit();
3124
  }
3125
  elseif ( $value == 'no' ) {
3126
  $wp_roles->remove_cap( $setting[2], $setting[1] );
3127
- echo '||0||'.__( 'Capability withdrawn' , 'wp-photo-album-plus').'||';
3128
  wppa_exit();
3129
  }
3130
  else {
3131
- echo '||1||Invalid value: '.$value.'||';
3132
  wppa_exit();
3133
  }
3134
  }
@@ -3177,7 +3150,7 @@ global $wppa;
3177
  // Changing potd_album_type ( physical / virtual ) also clears potd_album
3178
  case 'wppa_potd_album_type':
3179
  if ( ! in_array( $value, array( 'physical', 'virtual' ) ) ) {
3180
- echo '||1||Invalid value: '.$value.'||';
3181
  wppa_exit();
3182
  }
3183
  if ( $value == 'physical' ) {
@@ -3429,7 +3402,7 @@ global $wppa;
3429
 
3430
  case 'wppa_recup':
3431
  $result = wppa_recuperate_iptc_exif();
3432
- echo '||0||'.__( 'Recuperation performed' , 'wp-photo-album-plus').'||'.$result;
3433
  wppa_exit();
3434
  break;
3435
 
@@ -3763,24 +3736,22 @@ global $wppa;
3763
 
3764
  case 'wppa_search_numbers_void':
3765
  case 'wppa_index_ignore_slash':
3766
- ob_start();
3767
  if ( $value == 'yes' ) {
 
3768
  // Cleanup index
3769
  wppa_schedule_maintenance_proc( 'wppa_cleanup_index', true );
3770
  }
3771
  else {
 
3772
  // Remake index
3773
  wppa_schedule_maintenance_proc( 'wppa_remake_index_albums', true );
3774
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos', true );
3775
  }
3776
- ob_end_clean();
3777
  break;
3778
  case 'wppa_search_user_void':
3779
- ob_start();
3780
  wppa_schedule_maintenance_proc( 'wppa_remake_index_albums', true );
3781
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos', true );
3782
  wppa_schedule_maintenance_proc( 'wppa_cleanup_index', true );
3783
- ob_end_clean();
3784
  break;
3785
  case 'wppa_image_magick':
3786
  $value = rtrim( $value, '/' );
@@ -3898,7 +3869,7 @@ global $wppa;
3898
 
3899
  // Security check
3900
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3901
- echo 'Security check failure||'.$slug.'||Error||0';
3902
  wppa_exit();
3903
  }
3904
 
@@ -3922,7 +3893,7 @@ global $wppa;
3922
  $slug = wppa_get( 'slug' );
3923
  $nonce = wppa_get( 'nonce' );
3924
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3925
- echo 'Security check failure||'.$slug.'||Error||0';
3926
  wppa_exit();
3927
  }
3928
  echo htmlentities( wppa_do_maintenance_popup( $slug ) );
@@ -3936,7 +3907,7 @@ global $wppa;
3936
  echo wppa( 'out' );
3937
  global $wppa_upload_succes_id;
3938
  if ( ( wppa_get( 'fromtinymce' ) || wppa_get( 'fromgutenberg' ) ) && $wppa_upload_succes_id ) {
3939
- echo '||' . $wppa_upload_succes_id . '||';
3940
  echo htmlentities( wppa_get_myphotos_selection_body_for_tinymce( $wppa_upload_succes_id ) );
3941
  }
3942
  wppa_exit();
@@ -3959,7 +3930,7 @@ global $wppa;
3959
  }
3960
  $nonce = wppa_get( 'nonce' );
3961
  if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
3962
- echo 'Security check failure #798';
3963
  wppa_exit();
3964
  }
3965
 
@@ -3984,16 +3955,16 @@ global $wppa;
3984
 
3985
  case 'export-table':
3986
  if ( ! wppa_user_is( 'administrator' ) ) {
3987
- echo '||1||'.__( 'Security check failure' , 'wp-photo-album-plus' );
3988
  wppa_exit();
3989
  }
3990
  $table = wppa_get( 'table' );
3991
  $bret = wppa_export_table( $table );
3992
  if ( $bret ) {
3993
- echo '||0||' . WPPA_UPLOAD_URL . '/temp/' . $table . '.csv';
3994
  }
3995
  else {
3996
- echo '||2||' . __( 'An error has occurred', 'wp-photo-album-plus' );
3997
  }
3998
  wppa_exit();
3999
  break;
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.1.00.008
6
  *
7
  */
8
 
56
  wppa( 'error', '0' );
57
  wppa( 'out', '' );
58
  if ( ! isset( $wppa_session['page'] ) ) {
59
+ wppa_begin_session();
60
  }
61
  if ( ! isset( $wppa_session['page'] ) ) {
62
  $wppa_session['page'] = '0';
71
  $args = '';
72
  $t = array_merge( $_GET, $_POST );
73
  foreach( array_keys( $t ) as $key ) {
74
+ $args .= $key . '=' . wppa_get( $key ) . ', ';
75
  }
76
  wppa_log( 'Ajx', 'Script = ' . basename( $_SERVER['SCRIPT_FILENAME'] ) . ', Args = ' . $args );
77
  }
78
 
79
  // Any runtime modifyable settings?
80
  foreach( array_keys( $_GET ) as $key ) {
81
+ $value = sanitize_text_field( $_GET[$key] );
82
  if ( substr( $key, 0, 5 ) == 'wppa_' ) {
83
  if ( isset( $wppa_opt[$key] ) ) {
84
  $wppa_opt[$key] = $value;
170
  }
171
  $mailinglist = wppa_index_array_to_string( $userarray );
172
  update_option( 'wppa_mailinglist_' . $list_type, $mailinglist );
173
+ wppa_echo( $msg );
174
  break;
175
 
176
  default:
185
  }
186
  $url = wppa_get( 'url' );
187
  $result = wppa_create_qrcode_cache( $url, wppa_opt( 'qr_size' ) );
188
+ wppa_echo( $result . '|' . wppa_convert_to_pretty( $url ) );
189
  wppa_exit();
190
  break;
191
  case 'gettogo':
193
  $result = wppa_get_option( $slug . '_togo', '' ) .
194
  '|' .
195
  wppa_get_option( $slug . '_status', '' );
196
+ wppa_echo( $result );
197
  wppa_exit();
198
  break;
199
 
200
  case 'getssiptclist':
 
201
  $tag = '';
202
  $mocc = '1';
203
  $oldvalue = '';
223
  ORDER BY description", $tag ), ARRAY_A );
224
  $last = '';
225
  $any = false;
226
+ $result = '';
227
  if ( is_array( $iptcdata ) ) foreach( $iptcdata as $item ) {
228
  $desc = sanitize_text_field( $item['description'] );
 
229
 
230
  if ( $desc != $last ) {
231
  $sel = ( $oldvalue && $oldvalue == $desc ) ? 'selected="selected"' : '';
232
+ if ( $sel ) $result .= 'selected:' . $oldvalue;
233
  $ddesc = strlen( $desc ) > '32' ? substr( $desc, 0, 30 ) . '...' : $desc;
234
+ $result .= '
235
+ <option
236
+ value="' . esc_attr( $desc ) . '"
237
+ class="wppa-iptclist-' . $mocc . '" ' .
238
+ $sel . '
239
+ >' .
240
+ $ddesc . '
241
+ </option>';
242
  $last = $desc;
243
  $any = true;
244
  }
249
  WHERE photo = 0 AND tag = %s", $tag );
250
  $wpdb->query( $query );
251
  }
252
+ wppa_echo( $result );
253
  wppa_exit();
254
  break;
255
 
260
  $mocc = '1';
261
  $oldvalue = '';
262
  $ss_data = array();
263
+ $result = '';
264
 
265
  $tag = str_replace( 'H', '#', substr( wppa_get( 'exiftag' ), 0, 6 ) );
266
  $brand = substr( wppa_get( 'exiftag' ), 6 );
339
  $any = false;
340
  if ( ! empty( $exifdata ) ) foreach( $exifdata as $item ) {
341
  $desc = sanitize_text_field( $item['f_description'] );
 
 
342
 
343
  if ( $desc ) {
344
 
350
  $ddesc = '(' . sprintf( '%5.2f', $t[0]/$t[1] ) . ') ' . $ddesc;
351
  }
352
 
353
+ $result .= '
354
+ <option
355
+ value="' . esc_attr( $desc ) . '"
356
+ class="wppa-exiflist-' . $mocc . '" ' .
357
+ $sel . '
358
+ >' .
359
+ $ddesc . '
360
+ </option>';
361
  $any = true;
362
  }
363
  }
370
  AND tag = %s", $tag );
371
  $wpdb->query( $query );
372
  }
373
+ wppa_echo( $result );
374
  wppa_exit();
375
  break;
376
 
391
  // Do it
392
  require_once 'wppa-photo-admin-autosave.php';
393
 
394
+ wppa_fe_edit_photo( $photo );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
396
  // Done
397
  wppa_exit();
485
  wppa_secfail( '72' );
486
  }
487
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  wppa( 'mocc', $mocc );
489
  wppa( 'comment_photo', $photoid );
490
  wppa( 'comment_id', $commentid );
491
 
492
  $comment_allowed = ! wppa_user_is_basic() && ( ! wppa_switch( 'comment_login' ) || is_user_logged_in() );
493
+ if ( wppa_switch( 'show_comments' ) && $comment_allowed ) {
494
  wppa_do_comment( $photoid ); // Process the comment
495
  if ( wppa_switch( 'search_comments' ) ) wppa_index_update( 'photo', $photoid );
496
  }
497
  wppa( 'no_esc', true );
498
+ wppa_echo( wppa_comment_html( $photoid, $comment_allowed ) ); // Retrieve the new commentbox content
499
  wppa_exit();
500
  break;
501
 
546
  if ( wppa_switch( 'search_comments' ) ) {
547
  wppa_update_photo( $pid );
548
  }
549
+ wppa_echo( 'OK' );
550
  }
551
  else {
552
  if ( $pid ) {
553
  if ( current_user_can( 'wppa_moderate' ) ) {
554
+ wppa_echo( sprintf( __( 'Failed to update stutus of photo %d' , 'wp-photo-album-plus'), $pid )."\n".__( 'Please refresh the page', 'wp-photo-album-plus' ) );
555
  }
556
  else {
557
  wppa_secfail( '21' );
558
  }
559
  }
560
  if ( $cid ) {
561
+ wppa_echo( sprintf( __( 'Failed to update stutus of comment %d' , 'wp-photo-album-plus'), $cid )."\n".__( 'Please refresh the page', 'wp-photo-album-plus' ) );
562
  }
563
  }
564
  wppa_exit();
573
  if ( wppa_may_user_fe_delete( $pid ) ) {
574
 
575
  wppa_delete_photo( $pid );
576
+ wppa_echo( 'OK||' . __( 'Photo removed', 'wp-photo-album-plus' ) );
577
  wppa_exit();
578
  }
579
  }
597
  if ( wppa_opt( 'search_comments' ) ) {
598
  wppa_update_photo( $pid );
599
  }
600
+ wppa_echo( 'OK||' . __( 'Comment removed', 'wp-photo-album-plus' ) );
601
  }
602
  else {
603
+ wppa_echo( __( 'Could not remove comment', 'wp-photo-album-plus' ) );
604
  }
605
  wppa_exit();
606
  }
607
 
608
  // Remove request issued, but it is not a photo and not a comment
609
+ wppa_echo( __( 'Unexpected error', 'wp-photo-album-plus' ) );
610
  wppa_exit();
611
 
612
  case 'downloadalbum':
613
 
614
  // Feature enabled?
615
  if ( ! wppa_switch( 'allow_download_album' ) ) {
616
+ wppa_echo( '||ER||' . __( 'This feature is not enabled on this website', 'wp-photo-album-plus' ) );
617
  wppa_exit();
618
  }
619
 
620
  // Restricted and not admin?
621
  if ( wppa_switch( 'download_album_is_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
622
+ wppa_echo( '||ER||' . __( 'This feature is restricted to administrators', 'wp-photo-album-plus' ) );
623
  wppa_exit();
624
  }
625
 
644
  $photos = $wpdb->get_results( $wpdb->prepare( $query, $alb, wppa_get_user() ), ARRAY_A );
645
 
646
  if ( ! $photos ) {
647
+ wppa_echo( '||ER||' . __( 'The album is empty', 'wp-photo-album-plus' ) );
648
  wppa_exit();
649
  }
650
 
651
  // Open zipfile
652
  if ( ! class_exists( 'ZipArchive' ) ) {
653
+ wppa_echo( '||ER||' . __( 'Unable to create zip archive', 'wp-photo-album-plus' ) );
654
  wppa_exit();
655
  }
656
  $zipfilename = wppa_get_album_name( $alb );
659
  $wppa_zip = new ZipArchive;
660
  $iret = $wppa_zip->open( $zipfilepath, 1 );
661
  if ( $iret !== true ) {
662
+ wppa_echo( '||ER||'.sprintf( __( 'Unable to create zip archive. code = %s' , 'wp-photo-album-plus'), $iret ) );
663
  wppa_exit();
664
  }
665
 
695
 
696
  // A zip is created
697
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$zipfilename;
698
+ wppa_echo( $desturl.'||OK||' );
699
+ if ( $zipcount != count( $photos ) ) {
700
+ wppa_echo( sprintf( __( 'Only %s out of %s photos could be added to the zipfile' , 'wp-photo-album-plus'), $zipcount, count( $photos ) ) );
701
+ }
702
  wppa_exit();
703
  break;
704
 
709
  $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename;
710
  $zipfileurl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename;
711
  if ( is_file( $zipfilepath ) ) {
712
+ wppa_echo( $zipfileurl );
713
  }
714
  else {
715
+ wppa_echo( 'ER' );
716
  }
717
  wppa_exit();
718
  break;
734
  else {
735
  $alert .= __( 'You are not allowed to do this (2)', 'wp-photo-album-plus' );
736
  $status = 'ER';
737
+ wppa_echo( $status . '||' . $alert );
738
  wppa_exit();
739
  }
740
 
758
  }
759
  }
760
  if ( wppa_opt( 'admins_choice_action' ) == 'album' ) {
761
+ wppa_echo( $status . '||' . $alert );
762
  wppa_exit();
763
  }
764
 
766
  if ( ! class_exists( 'ZipArchive' ) ) {
767
  $status = 'ER';
768
  $alert .= __( 'Unable to create zip archive' , 'wp-photo-album-plus' ) . '. ';
769
+ wppa_echo( $status . '||' . $alert );
770
  wppa_exit();
771
  }
772
 
776
  if ( ! wppa_is_dir( $zipsdir ) ) {
777
  $status = 'ER';
778
  $alert .= __( 'Unable to create zipsdir' , 'wp-photo-album-plus' ) . '. ';;
779
+ wppa_echo( $status . '||' . $alert );
780
  wppa_exit();
781
  }
782
 
820
  $status = 'OK';
821
 
822
  // Done!
823
+ wppa_echo( $status . '||' . $alert );
824
  wppa_exit();
825
  break;
826
 
834
  // Its ok
835
  }
836
  else {
837
+ wppa_echo( 'ER||You are not allowed to do this' );
838
  wppa_exit();
839
  }
840
 
861
  wppa_clear_taglist();
862
  }
863
 
864
+ wppa_echo( 'OK||'.__( 'Removed', 'wp-photo-album-plus' ) );
865
  wppa_exit();
866
  break;
867
 
881
  }
882
 
883
  // Remove all User-<userid> tags
884
+ $tag = wppa_get_user( 'display' );
885
  $items = $wpdb->get_results( "SELECT id, tags FROM $wpdb->wppa_photos
886
  WHERE tags LIKE '%" . str_replace( "'", "\'", ',' . $wpdb->esc_like( $tag ) . ',' ) . "%'", ARRAY_A );
887
  foreach( $items as $item ) {
900
 
901
  // Check if the user is allowed to do this
902
  if ( ! is_user_logged_in() ) {
903
+ wppa_echo( 'ER||You must be logged in to request info' );
904
  wppa_exit();
905
  }
906
 
937
  ) );
938
 
939
  // Done
940
+ wppa_echo( 'OK||Request issued' );
941
  wppa_exit();
942
  break;
943
 
952
  $type = wppa_opt( 'art_monkey_popup_link' );
953
  }
954
  else {
955
+ wppa_echo( '||7||'.__( 'Unknown source of request' , 'wp-photo-album-plus') );
956
  wppa_exit();
957
  }
958
 
971
  $name = wppa_sanitize_file_name( $name ); // Remove illegal chars
972
  $name = preg_replace( '/\.[^.]*$/', '', $name ); // Remove file extension
973
  if ( strlen( $name ) == '0' ) {
974
+ wppa_echo( '||1||'.__( 'Empty filename' , 'wp-photo-album-plus') );
975
  wppa_exit();
976
  }
977
 
998
  $tempdir = WPPA_UPLOAD_PATH.'/temp';
999
  if ( ! wppa_is_dir( $tempdir ) ) wppa_mkdir( $tempdir );
1000
  if ( ! wppa_is_dir( $tempdir ) ) {
1001
+ wppa_echo( '||2||'.__( 'Unable to create tempdir' , 'wp-photo-album-plus') );
1002
  wppa_exit();
1003
  }
1004
 
1009
  }
1010
  elseif ( $type == 'zip' ) {
1011
  if ( ! class_exists( 'ZipArchive' ) ) {
1012
+ wppa_echo( '||8||' . __( 'Unable to create zip archive', 'wp-photo-album-plus' ) );
1013
  wppa_exit();
1014
  }
1015
  $ext = 'zip';
1019
  $wppa_zip->close();
1020
  }
1021
  else {
1022
+ wppa_echo( '||6||'.__( 'Unknown type' , 'wp-photo-album-plus') );
1023
  wppa_exit();
1024
  }
1025
 
1027
  wppa_bump_dlcount( $photo );
1028
 
1029
  $desturl = WPPA_UPLOAD_URL.'/temp/'.$name.'.'.$ext;
1030
+ wppa_echo( '||0||' . esc_url( $desturl ) ); // No error: return url
1031
  wppa_exit();
1032
  }
1033
  else {
1034
+ wppa_echo( '||9||'.__( 'The photo does no longer exist' , 'wp-photo-album-plus') );
1035
  wppa_exit();
1036
  }
1037
  wppa_exit();
1039
 
1040
  case 'tinymcedialog':
1041
  $result = wppa_make_tinymce_dialog();
1042
+ wppa_echo( $result );
1043
  wppa_exit();
1044
  break;
1045
 
1046
  case 'tinymcephotodialog':
1047
  $result = wppa_make_tinymce_photo_dialog();
1048
+ wppa_echo( $result );
1049
  wppa_exit();
1050
  break;
1051
 
1052
  case 'tinymcephotodialogfront':
1053
  $result = wppa_make_tinymce_photo_dialog( 'front' );
1054
+ wppa_echo( $result );
1055
  wppa_exit();
1056
  break;
1057
 
1058
  case 'gutenbergphotodialog':
1059
  $result = wppa_make_gutenberg_photo_dialog();
1060
+ echo( $result );
1061
  wppa_exit();
1062
  break;
1063
 
1064
  case 'gutenbergwppadialog':
1065
  $result = wppa_make_gutenberg_wppa_dialog();
1066
+ echo( $result );
1067
  wppa_exit();
1068
  break;
1069
 
1070
  case 'getshortcodedrendered':
1071
  $shortcode = wppa_get( 'shortcode' );
1072
+ $shortcode = str_replace( ['@', '&quot;', '&apos;'], ['#', '"', "'"], $shortcode );
1073
+ $shortcode = stripslashes( $shortcode );
1074
 
1075
  wppa_load_theme();
1076
 
1080
  $result = str_replace( 'href=', 'data-href=', $result );
1081
  $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1082
 
1083
+ echo ( '
1084
+ <div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >
1085
+ <div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" >
1086
+ <i>(' . esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) . ')</i>
1087
+ </div>' .
1088
+ $result . '
1089
+ </div>' );
 
 
1090
  wppa_exit();
1091
  break;
1092
 
1096
  wppa_bump_viewcount( 'photo', wppa_get( 'photo' ) );
1097
  }
1098
  else {
1099
+ wppa_echo( __( 'Security check failure', 'wp-photo-album-plus' ) );
1100
  }
1101
  wppa_exit();
1102
  break;
1108
  wppa_bump_clickcount( $photo );
1109
  }
1110
  else {
1111
+ wppa_echo( __( 'Security check failure', 'wp-photo-album-plus' ) );
1112
  }
1113
  wppa_exit();
1114
  break;
1131
  // Security check
1132
  if ( wppa_switch( 'direct_comment' ) && wppa_switch( 'use_encrypted_links' ) && wppa_switch( 'refuse_unencrypted' ) ) {
1133
  if ( ! $photo || ( wppa_get_photo_item( $photo, 'album' ) < '1' ) ) {
1134
+ wppa_echo( '0||100||'.__( 'Missing or invalid photo id', 'wp-photo-album-plus' ) );
1135
  wppa_exit();
1136
  }
1137
  wppa_log('dbg', 'Bypassed nonce');
1138
  }
1139
  else {
1140
  if ( ! wp_verify_nonce( $nonce, 'wppa-check' ) ) {
1141
+ wppa_echo( '0||100||'.$errtxt );
1142
  wppa_exit();
1143
  }
1144
  if ( ! $photo || ( wppa_get_photo_item( $photo, 'album' ) < '1' ) ) {
1145
+ wppa_echo( __( 'Missing or invalid photo id', 'wp-photo-album-plus' ) );
1146
  wppa_exit();
1147
  }
1148
  }
1154
 
1155
  // Check on validity
1156
  if ( wppa_opt( 'rating_max' ) == '1' && $rating != '1' ) {
1157
+ wppa_echo( '0||106||'.$errtxt.':'.$rating );
1158
  wppa_exit(); // Value out of range
1159
  }
1160
  elseif ( wppa_opt( 'rating_max' ) == '5' && ! in_array( $rating, array( '-1', '1', '2', '3', '4', '5' ) ) ) {
1161
+ wppa_echo( '0||106||'.$errtxt.':'.$rating );
1162
  wppa_exit(); // Value out of range
1163
  }
1164
  elseif ( wppa_opt( 'rating_max' ) == '10' && ! in_array( $rating, array( '-1', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ) ) ) {
1165
+ wppa_echo( '0||106||'.$errtxt.':'.$rating );
1166
  wppa_exit(); // Value out of range
1167
  }
1168
 
1169
  // Check for one rating per period
1170
  $wait_text = wppa_get_rating_wait_text( $photo );
1171
  if ( $wait_text ) {
1172
+ wppa_echo( '0||900||'.$wait_text ); // 900 is recoverable error
1173
  wppa_exit();
1174
  }
1175
 
1176
  // Get other data
1177
  if ( ! wppa_photo_exists( $photo ) ) {
1178
+ wppa_echo( '0||999||'.__( 'Photo has been removed.', 'wp-photo-album-plus' ) );
1179
  wppa_exit();
1180
  }
1181
 
1187
 
1188
  // Rate own photo?
1189
  if ( wppa_get_photo_item( $photo, 'owner' ) == wppa_get_user( 'login' ) && ! wppa_switch( 'allow_owner_votes' ) ) {
1190
+ wppa_echo( '0||900||' . __( 'Sorry, you can not rate your own photos', 'wp-photo-album-plus' ) );
1191
  wppa_exit();
1192
  }
1193
 
1239
 
1240
  if ( $pending ) {
1241
  if ( ! $hascommented ) {
1242
+ wppa_echo( '0||900||' . __( 'Please enter a comment.', 'wp-photo-album-plus' ) );
1243
  wppa_exit();
1244
  }
1245
  else {
1289
  $allavgratcombi = $lt['title'] . '|' . $lt['display'];
1290
 
1291
  // Output and quit
1292
+ wppa_echo( $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.esc_attr( $allavgratcombi ).'||||||likes' );
1293
  wppa_exit();
1294
  }
1295
 
1300
 
1301
  // Can vote only once
1302
  if ( ! wppa_switch( 'rating_change' ) && ! wppa_switch( 'rating_multi' ) ) {
1303
+ wppa_echo( '0||900||'.__( 'You can not change your vote', 'wp-photo-album-plus' ) );
1304
  wppa_exit();
1305
  }
1306
 
1307
  // I did a dislike, can not modify
1308
  if ( $mylast < '0' ) {
1309
+ wppa_echo( '0||900||'.__('You can not change a dislike', 'wp-photo-album-plus') );
1310
  wppa_exit();
1311
  }
1312
 
1313
  // I did a rating, can not change into dislike
1314
  if ( $mylast > '0' && $rating == '-1' ) {
1315
+ wppa_echo( '0||900||'.__('You can not change your vote into a dislike', 'wp-photo-album-plus') );
1316
  wppa_exit();
1317
  }
1318
  }
1323
  // Add my dislike
1324
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1325
  if ( ! $iret ) {
1326
+ wppa_echo( '0||101||'.$errtxt );
1327
  wppa_exit(); // Fail on storing vote
1328
  }
1329
 
1335
 
1336
  // Photo is removed?
1337
  if ( ! is_file( wppa_get_thumb_path( $photo ) ) ) {
1338
+ wppa_echo( $occur.'||'.$photo.'||'.$index.'||-1||-1|0||'.wppa_opt( 'dislike_delete' ) );
1339
  wppa_exit();
1340
  }
1341
  }
1345
  // Add my vote
1346
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1347
  if ( ! $iret ) {
1348
+ wppa_echo( '0||102||'.$errtxt );
1349
  wppa_exit(); // Fail on storing vote
1350
  }
1351
  // Add points
1363
  wppa_clear_cache( ['photo' => $photo, 'other' => 'R'] );
1364
 
1365
  if ( $iret === false ) {
1366
+ wppa_echo( '0||103||' . $errtxt );
1367
  wppa_exit(); // Fail on update
1368
  }
1369
  }
1372
  elseif ( wppa_switch( 'rating_multi' ) ) { // Rating multi is allowed
1373
  $iret = wppa_create_rating_entry( array( 'photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus ) );
1374
  if ( ! $iret ) {
1375
+ wppa_echo( '0||104||'.$errtxt );
1376
  wppa_exit(); // Fail on storing vote
1377
  }
1378
  }
1379
 
1380
  else { // Should never get here....
1381
+ wppa_echo( '0||110||'.__( 'Unexpected error' , 'wp-photo-album-plus') );
1382
  wppa_exit();
1383
  }
1384
 
1408
  else {
1409
  $myavgrat = '0';
1410
  }
1411
+
1412
  // Compute new allavgrat
1413
  $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_rating
1414
  WHERE photo = %d
1433
  // Store it in the photo info
1434
  $iret = wppa_update_photo( array( 'id' => $photo, 'mean_rating' => $allavgrat ) );
1435
  if ( $iret === false ) {
1436
+ wppa_echo( '0||106||'.$wartxt );
1437
  wppa_exit(); // Fail on save
1438
  }
1439
 
1444
  if ( $ratcount !== false ) {
1445
  $iret = wppa_update_photo( array( 'id' => $photo, 'rating_count' => $ratcount ) );
1446
  if ( $iret === false ) {
1447
+ wppa_echo( '0||107||'.$wartxt );
1448
  wppa_exit(); // Fail on save
1449
  }
1450
  }
1458
  AND value = -1
1459
  AND status = 'publish'", $photo ) );
1460
  if ( $discount === false ) {
1461
+ wppa_echo( '0||108||'.$wartxt );
1462
  wppa_exit(); // Fail on save
1463
  }
1464
  $distext = wppa_get_distext( $discount, $rating );
1479
  $message = '';
1480
  }
1481
 
1482
+ wppa_echo( $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgratcombi.'||'.$distext.'||'.$hascommented.'||'.$message );
1483
  break;
1484
 
1485
  case 'render':
1501
  $mem = memory_get_peak_usage( true ) / 1024 / 1024;
1502
 
1503
  $msg = sprintf( 'WPPA Ajax render: db queries: WP:%d, WPPA+: %d in %4.2f seconds, using %4.2f MB memory max', $nq_1, $nq_2 - $nq_1, $tim_2 - $tim_1, $mem );
1504
+ wppa_log( 'ajx', $msg );
1505
  break;
1506
 
1507
  case 'delete-photo':
1510
 
1511
  // Check validity
1512
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1513
+ wppa_echo( '||0||'.__( 'You do not have the rights to delete a photo' , 'wp-photo-album-plus') );
1514
  wppa_exit(); // Nonce check failed
1515
  }
1516
  if ( ! is_numeric( $photo ) ) {
1517
+ wppa_echo( '||0||'.__( 'Security check failure' , 'wp-photo-album-plus') );
1518
  wppa_exit(); // Nonce check failed
1519
  }
1520
 
1521
  // Non admins/superusers can only delete their own photos
1522
  if ( ! wppa_user_is( 'administrator' ) && wppa_get_photo_item( $photo, 'owner' ) != wppa_get_user() ) {
1523
+ wppa_echo( '||0||'.__( 'You do not have the rights to delete this photo' , 'wp-photo-album-plus') );
1524
  wppa_exit();
1525
  }
1526
 
1530
  wppa_clear_cache( ['photo' => $photo] );
1531
  wppa_clear_cache( ['album' => $album] );
1532
  $edit_link = wppa_ea_url( 'single', $tab = 'edit' ) . '&photo=' . $photo;
 
 
1533
  $a = wppa_allow_uploads( $album );
1534
+ wppa_echo( '||1||<span style="color:red" >' .
1535
+ sprintf( __( 'Photo %s has been deleted' ,'wp-photo-album-plus' ), '<a href="'.$edit_link.'" target="_blank" >' . $photo . '</a>' ) .
1536
+ '</span>||' . ( $a ? 'notfull||'.$a : 'full' ) );
1537
  break;
1538
 
1539
  case 'undelete-photo':
1542
 
1543
  // Check validity
1544
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1545
+ wppa_echo( '||0||'.__( 'You do not have the rights to undelete a photo' , 'wp-photo-album-plus') );
1546
  wppa_exit(); // Nonce check failed
1547
  }
1548
  if ( ! is_numeric( $photo ) ) {
1549
+ wppa_echo( '||0||'.__( 'Security check failure' , 'wp-photo-album-plus') );
1550
  wppa_exit(); // Nonce check failed
1551
  }
1552
  $album = $wpdb->get_var( $wpdb->prepare( "SELECT album FROM $wpdb->wppa_photos
1580
  if ( $album_exists ) {
1581
  wppa_update_photo( array( 'id' => $photo, 'album' => $real_alb ) );
1582
  wppa_invalidate_treecounts( - ( $album + '9' ) );
1583
+ wppa_echo( '||1||<span style="color:red" >'.sprintf( __( 'Photo %s has been undeleted and placed in album %d', 'wp-photo-album-plus' ), $photo, $real_alb ).'</span>' );
1584
  }
1585
  else {
1586
+ wppa_echo( '||1||<span style="color:red" >'.sprintf( __( 'Could not undelete photo %s' , 'wp-photo-album-plus'), $photo ).'</span>' );
1587
  }
1588
  }
1589
  wppa_clear_cache( ['force' => true] );
1606
 
1607
  // Check validity
1608
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
1609
+ wppa_echo( '||0||'.__( 'You do not have the rights to update album information' , 'wp-photo-album-plus').$nonce );
1610
  wppa_exit(); // Nonce check failed
1611
  }
1612
 
1619
  $iret2 = wppa_update_photo( array( 'id' => $photo['id'], 'mean_rating' => '' ) );
1620
  }
1621
  if ( $photos && $iret1 !== false && $iret2 !== false ) {
1622
+ wppa_echo( '||0||'.__( 'Ratings cleared' , 'wp-photo-album-plus').'||'.__( 'No ratings for this photo.' , 'wp-photo-album-plus') );
1623
  }
1624
  elseif ( $photos ) {
1625
+ wppa_echo( '||1||'.__( 'An error occurred while clearing ratings' , 'wp-photo-album-plus') );
1626
  }
1627
  else {
1628
+ wppa_echo( '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus').'||'.__( 'No ratings for this photo.' , 'wp-photo-album-plus') );
1629
  }
1630
  wppa_exit();
1631
  break;
1642
  $iret = wppa_update_photo( array( 'id' => $photo['id'], 'tags' => $tags ) );
1643
  }
1644
  if ( $photos && $iret !== false ) {
1645
+ wppa_echo( '||0||'.__( 'Tags set to defaults' , 'wp-photo-album-plus') );
1646
  wppa_update_album( $album );
1647
  }
1648
  elseif ( $photos ) {
1649
+ wppa_echo( '||1||'.__( 'An error occurred while setting tags' , 'wp-photo-album-plus') );
1650
  }
1651
  else {
1652
+ wppa_echo( '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus') );
1653
  }
1654
  wppa_clear_taglist();
1655
  wppa_exit();
1668
  }
1669
  if ( $photos && $iret !== false ) {
1670
  wppa_update_album( $album );
1671
+ wppa_echo( '||0||'.__( 'Tags added with defaults' , 'wp-photo-album-plus') );
1672
  }
1673
  elseif ( $photos ) {
1674
+ wppa_echo( '||1||'.__( 'An error occurred while adding tags' , 'wp-photo-album-plus') );
1675
  }
1676
  else {
1677
+ wppa_echo( '||0||'.__( 'No photos in this album' , 'wp-photo-album-plus') );
1678
  }
1679
  wppa_clear_taglist();
1680
  wppa_exit();
1697
  }
1698
  }
1699
  else {
1700
+ wppa_echo( '||0||' . __( 'No subalbums found to process', 'wp-photo-album-plus' ) );
1701
  wppa_exit();
1702
  }
1703
  }
1704
  else {
1705
+ wppa_echo( '||0||' . __( 'No categories found to process', 'wp-photo-album-plus' ) );
1706
  wppa_exit();
1707
  }
1708
  $n = count( $albarr ) - 1;
1709
+ wppa_echo( '||0||' . sprintf( _n( '%d album updated', '%d albums updated', $n, 'wp-photo-album-plus' ), $n ) );
1710
  wppa_exit();
1711
  break;
1712
  case 'name':
1713
  $value = trim( strip_tags( $value ) );
1714
  if ( ! wppa_sanitize_file_name( $value ) ) { // Empty album name is not allowed
1715
  $value = 'Album-#' . $album;
1716
+ wppa_echo( '||5||' . sprintf( __( 'Album name may not be empty.<br />Reset to %s', 'wp-photo-album-plus' ), htmlentities( $value ) ) );
1717
  }
1718
  $itemname = __( 'Name' , 'wp-photo-album-plus');
1719
  wppa_update_album( array( 'id' => $album, 'name' => $value, 'modified' => time() ) );
1758
  case 'owner':
1759
  $itemname = __( 'Owner' , 'wp-photo-album-plus');
1760
  if ( $value != '--- public ---' && ! wppa_get_user_by( 'login', $value ) ) {
1761
+ wppa_echo( '||4||'.sprintf( __( 'User %s does not exist' , 'wp-photo-album-plus'), $value ) );
1762
  wppa_exit();
1763
  }
1764
  break;
1765
  case 'upload_limit_count':
1766
  wppa_ajax_check_range( $value, false, '-1', false, __( 'Upload limit count' , 'wp-photo-album-plus') );
1767
  if ( wppa( 'error' ) ) {
1768
+ wppa_echo( '||7||'.__('Invalid value', 'wp-photo-album-plus') );
1769
  wppa_exit();
1770
  }
1771
  $oldval = $wpdb->get_var( $wpdb->prepare( "SELECT upload_limit FROM $wpdb->wppa_albums
1816
  if ( $item == 'min' ) $temp[4] = $value;
1817
  $scheduledtm = implode( ',', $temp );
1818
  wppa_update_album( array( 'id' => $album, 'scheduledtm' => $scheduledtm, 'modified' => time() ) );
1819
+ wppa_echo( '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) ) );
1820
  wppa_exit();
1821
  break;
1822
 
1840
  if ( $item == 'delmin' ) $temp[4] = $value;
1841
  $scheduledel = implode( ',', $temp );
1842
  wppa_update_album( array( 'id' => $album, 'scheduledel' => $scheduledel, 'modified' => time() ) );
1843
+ wppa_echo( '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) ) );
1844
  wppa_exit();
1845
  break;
1846
 
1852
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
1853
  SET status = 'scheduled', scheduledtm = %s
1854
  WHERE album = %d", $scheduledtm, $album ) );
1855
+ wppa_echo( '||0||'.__( 'All photos set to scheduled per date', 'wp-photo-album-plus' ) . ' ' . wppa_format_scheduledtm( $scheduledtm ) );
1856
  }
1857
  wppa_exit();
1858
  break;
1873
  $i = substr( $item , 10 );
1874
  $opts[$i] = $value;
1875
  wppa_update_album( array( 'id' => $album, 'displayopts' => implode( ',', $opts ) ) );
1876
+ wppa_echo( '||0||'.sprintf( __( 'Display options of album %s updated', 'wp-photo-album-plus' ), htmlentities( $album ) ) );
1877
  wppa_exit();
1878
  break;
1879
 
1899
  $custom = serialize( $custom_data );
1900
  wppa_update_album( array( 'id' => $album, 'custom' => $custom, 'modified' => time() ) );
1901
  wppa_index_update( 'album', $album );
1902
+ wppa_echo( '||0||'.sprintf( __( 'Custom field %s updated' , 'wp-photo-album-plus'), wppa_opt( 'album_custom_caption_'.$index ) ) );
1903
  wppa_exit();
1904
  break;
1905
 
1925
  if ( $item == 'name' ) {
1926
  wppa_create_pl_htaccess();
1927
  }
1928
+ wppa_echo( '||0||'.sprintf( __( '%s of album %s updated', 'wp-photo-album-plus' ), $itemname, htmlentities( $album ) ) );
1929
  if ( $item == 'upload_limit' ) {
 
1930
  $a = wppa_allow_uploads( $album );
1931
+ if ( $a ) wppa_echo( '||notfull||' . $a );
1932
+ else wppa_echo( '||full' );
1933
  }
1934
  wppa_update_album( $album );
1935
  }
1936
  else {
1937
+ wppa_echo( '||2||' .
1938
+ sprintf( __( 'An error occurred while trying to update %s of album %s' , 'wp-photo-album-plus'), $itemname, htmlentities( $album ) ) .
1939
+ '<br>' .
1940
+ __( 'Press CTRL+F5 and try again.', 'wp-photo-album-plus' )
1941
+ );
1942
  }
1943
  wppa_clear_cache( ['album' => $album] );
1944
  wppa_exit();
1952
 
1953
  // Check validity
1954
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1955
+ wppa_echo( '||0||'.__( 'You do not have the rights to update comment status' , 'wp-photo-album-plus').$nonce );
1956
  wppa_exit(); // Nonce check failed
1957
  }
1958
 
1971
  wppa_get_photo_item( $photo, 'owner' )
1972
  );
1973
  }
1974
+ wppa_echo( '||0||'.sprintf( __( 'Status of comment #%s updated' , 'wp-photo-album-plus'), $comid ) );
1975
  }
1976
  else {
1977
+ wppa_echo( '||1||'.sprintf( __( 'Error updating status comment #%s' , 'wp-photo-album-plus'), $comid ) );
1978
  }
1979
  wppa_exit();
1980
  break;
1981
+
 
1982
  case 'watermark-photo':
1983
  $photo = wppa_get( 'photo-id', '0', 'int' );
1984
  $nonce = wppa_get( 'nonce' );
1985
 
1986
  // Check validity
1987
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$photo ) ) {
1988
+ wppa_echo( '||1||'.__( 'You do not have the rights to change photos', 'wp-photo-album-plus' ) );
1989
  wppa_exit(); // Nonce check failed
1990
  }
1991
 
1996
  }
1997
  wppa_bump_thumb_rev();
1998
  wppa_bump_photo_rev();
1999
+ wppa_echo( '||0||'.__( 'Watermark applied. Reloading the page...', 'wp-photo-album-plus' ) );
2000
  wppa_exit();
2001
  }
2002
  else {
2003
+ wppa_echo( '||1||'.__( 'An error occurred while trying to apply a watermark', 'wp-photo-album-plus' ) );
2004
  wppa_exit();
2005
  }
2006
  /**/
2429
  $edit_link = wppa_ea_url( 'single', $tab = 'edit' ) . '&photo=' . $photodata['id'];
2430
  if ( $iret ) {
2431
  wppa_move_source( $photodata['filename'], $photodata['album'], $value );
2432
+ wppa_echo( '||99||'.sprintf( __( 'Photo %s has been moved to album %s (%s)', 'wp-photo-album-plus' ), '<a href="'.$edit_link.'" target="_blank" >' . $photodata['id'] . '</a>', wppa_get_album_name( $value ), $value ) );
2433
  wppa_exit();
2434
  }
2435
  else {
2503
  case 'owner':
2504
  $usr = wppa_get_user_by( 'login', $value );
2505
  if ( ! $usr ) {
2506
+ wppa_echo( '||4||' . sprintf( __( 'User %s does not exists' , 'wp-photo-album-plus'), $value ) );
2507
  wppa_exit();
2508
  }
2509
  $value = $usr->user_login; // Correct possible case mismatch
2977
 
2978
  // Verify that we are legally here
2979
  if ( ! current_user_can( 'wppa_settings' ) ) {
2980
+ wppa_echo( '||1||'.__( 'You do not have the rights to update settings', 'wp-photo-album-plus' ) );
2981
  wppa_exit();
2982
  }
2983
  $nonce = wppa_get( 'nonce' );
2984
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
2985
+ wppa_echo( '||1||'.__( 'Security check failure', 'wp-photo-album-plus' ) );
2986
  wppa_exit();
2987
  }
2988
 
3025
  ) );
3026
  }
3027
  else {
3028
+ wppa_echo( 'Error' );
3029
  }
3030
  wppa_exit();
3031
  }
3092
  $setting = explode( '-', $option );
3093
  if ( $value == 'yes' ) {
3094
  $wp_roles->add_cap( $setting[2], $setting[1] );
3095
+ wppa_echo( '||0||'.__( 'Capability granted' , 'wp-photo-album-plus').'||' );
3096
  wppa_exit();
3097
  }
3098
  elseif ( $value == 'no' ) {
3099
  $wp_roles->remove_cap( $setting[2], $setting[1] );
3100
+ wppa_echo( '||0||'.__( 'Capability withdrawn' , 'wp-photo-album-plus').'||' );
3101
  wppa_exit();
3102
  }
3103
  else {
3104
+ wppa_echo( '||1||Invalid value: '.$value.'||' );
3105
  wppa_exit();
3106
  }
3107
  }
3150
  // Changing potd_album_type ( physical / virtual ) also clears potd_album
3151
  case 'wppa_potd_album_type':
3152
  if ( ! in_array( $value, array( 'physical', 'virtual' ) ) ) {
3153
+ wppa_echo( '||1||Invalid value: '.$value.'||' );
3154
  wppa_exit();
3155
  }
3156
  if ( $value == 'physical' ) {
3402
 
3403
  case 'wppa_recup':
3404
  $result = wppa_recuperate_iptc_exif();
3405
+ wppa_echo( '||0||'.__( 'Recuperation performed' , 'wp-photo-album-plus').'||'.$result );
3406
  wppa_exit();
3407
  break;
3408
 
3736
 
3737
  case 'wppa_search_numbers_void':
3738
  case 'wppa_index_ignore_slash':
 
3739
  if ( $value == 'yes' ) {
3740
+
3741
  // Cleanup index
3742
  wppa_schedule_maintenance_proc( 'wppa_cleanup_index', true );
3743
  }
3744
  else {
3745
+
3746
  // Remake index
3747
  wppa_schedule_maintenance_proc( 'wppa_remake_index_albums', true );
3748
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos', true );
3749
  }
 
3750
  break;
3751
  case 'wppa_search_user_void':
 
3752
  wppa_schedule_maintenance_proc( 'wppa_remake_index_albums', true );
3753
  wppa_schedule_maintenance_proc( 'wppa_remake_index_photos', true );
3754
  wppa_schedule_maintenance_proc( 'wppa_cleanup_index', true );
 
3755
  break;
3756
  case 'wppa_image_magick':
3757
  $value = rtrim( $value, '/' );
3869
 
3870
  // Security check
3871
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3872
+ wppa_echo( 'Security check failure||'.$slug.'||Error||0' );
3873
  wppa_exit();
3874
  }
3875
 
3893
  $slug = wppa_get( 'slug' );
3894
  $nonce = wppa_get( 'nonce' );
3895
  if ( ! wp_verify_nonce( $nonce, 'wppa-nonce' ) ) {
3896
+ wppa_echo( 'Security check failure||'.$slug.'||Error||0' );
3897
  wppa_exit();
3898
  }
3899
  echo htmlentities( wppa_do_maintenance_popup( $slug ) );
3907
  echo wppa( 'out' );
3908
  global $wppa_upload_succes_id;
3909
  if ( ( wppa_get( 'fromtinymce' ) || wppa_get( 'fromgutenberg' ) ) && $wppa_upload_succes_id ) {
3910
+ wppa_echo( '||' . $wppa_upload_succes_id . '||' );
3911
  echo htmlentities( wppa_get_myphotos_selection_body_for_tinymce( $wppa_upload_succes_id ) );
3912
  }
3913
  wppa_exit();
3930
  }
3931
  $nonce = wppa_get( 'nonce' );
3932
  if ( ! $nonce || ! wp_verify_nonce( $nonce, 'wppa-nonce_'.$album ) ) {
3933
+ wppa_echo( 'Security check failure #798' );
3934
  wppa_exit();
3935
  }
3936
 
3955
 
3956
  case 'export-table':
3957
  if ( ! wppa_user_is( 'administrator' ) ) {
3958
+ wppa_echo( '||1||'.__( 'Security check failure' , 'wp-photo-album-plus' ) );
3959
  wppa_exit();
3960
  }
3961
  $table = wppa_get( 'table' );
3962
  $bret = wppa_export_table( $table );
3963
  if ( $bret ) {
3964
+ wppa_echo( '||0||' . WPPA_UPLOAD_URL . '/temp/' . $table . '.csv' );
3965
  }
3966
  else {
3967
+ wppa_echo( '||2||' . __( 'An error has occurred', 'wp-photo-album-plus' ) );
3968
  }
3969
  wppa_exit();
3970
  break;
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 8.0.09.003
7
  *
8
  */
9
 
@@ -288,18 +288,21 @@ global $wppa_revno;
288
  }
289
  }
290
 
 
 
291
  // Set all to pano
292
  $timeup = false;
293
  $pano = wppa_get( 'pano-val', '9' );
294
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
295
 
296
- $last = get_option( 'wppa_last_pano_set', '0' );
297
  $done = '0';
298
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
299
  WHERE album = %d
300
- AND id > %d
301
  AND ext = 'jpg'
302
- ORDER BY id", $edit_id, $last ), ARRAY_A );
 
303
  $tot = count( $todo );
304
 
305
  if ( $tot ) foreach( $todo as $item ) {
@@ -356,18 +359,18 @@ global $wppa_revno;
356
  wppa_remake_files( '', $id );
357
  wppa_get_photox( $id, true );
358
  wppa_get_photoy( $id, true );
359
- update_option( 'wppa_last_pano_set', $id );
360
  $done++;
361
 
362
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
363
- $status = __( 'No items processed', 'wp-photo-album-plus' );
364
  }
365
  elseif ( $done == $tot ) {
366
- $status = __( 'All applicable items processed', 'wp-photo-album-plus' );
367
- delete_option( 'wppa_last_pano_set' );
368
  }
369
  else {
370
- $status = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
371
  }
372
  }
373
 
@@ -375,17 +378,13 @@ global $wppa_revno;
375
  $timeup = wppa_is_time_up() && ( $done != $tot );
376
  if ( $timeup ) break;
377
  }
 
 
 
378
 
379
  if ( $timeup ) {
380
- $status .= ' ' . __( 'No time left, the page will be reloaded to continue. Stay tuned...', 'wp-photo-album-plus' );
381
  }
382
-
383
- echo '
384
- <script>
385
- jQuery(document).ready(function(){
386
- jQuery("#albumstatus-'.$edit_id.'").html("'.$status.'");
387
- }); ' . ( $timeup ? 'setTimeout(function(){document.location.reload();}, 10000);' : '' ) . '
388
- </script>';
389
  }
390
 
391
  // Get the album information
@@ -424,6 +423,7 @@ global $wppa_revno;
424
  $tpviews = $treecounts['treephotoviews'];
425
  $nsub = $treecounts['selfalbums'];
426
 
 
427
  // Open the photo album admin page
428
  echo
429
  '<div class="wrap">';
@@ -431,9 +431,8 @@ global $wppa_revno;
431
  // The spinner to indicate busyness
432
  wppa_admin_spinner();
433
 
434
- // Local js functions placed here as long as there is not yet a possibility to translate texts in js files
435
- echo '
436
- <script>
437
  function wppaTryInheritCats( id ) {
438
 
439
  var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
@@ -497,9 +496,9 @@ global $wppa_revno;
497
  else {
498
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
499
  }
500
- }
501
 
502
- </script>';
503
 
504
  // The header
505
  echo '
@@ -618,9 +617,8 @@ global $wppa_revno;
618
  <select
619
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
620
  title="' . esc_attr( $title ) . '"
621
- >';
622
- wppa_user_select( $owner );
623
- echo '
624
  </select>&nbsp;';
625
  }
626
  }
@@ -1043,7 +1041,7 @@ global $wppa_revno;
1043
  id="albumstatus-' . $id . '"
1044
  style="font-weight:bold;color:#00AA00;"
1045
  >' .
1046
- sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $id ) . '
1047
  </span>';
1048
 
1049
 
@@ -1090,43 +1088,17 @@ global $wppa_revno;
1090
  <td>' .
1091
  __( 'Description:', 'wp-photo-album-plus' ) . '
1092
  </td>';
1093
- if ( wppa_switch( 'use_wp_editor') ) {
1094
- echo '
1095
- <td>';
1096
- wp_editor( $description,
1097
- 'wppaalbumdesc',
1098
- array( 'wpautop' => true,
1099
- 'media_buttons' => false,
1100
- 'textarea_rows' => '6',
1101
- 'tinymce' => false
1102
- )
1103
- );
1104
- echo '
1105
- <input
1106
- type="button"
1107
- class="button-secundary"
1108
- value="' . esc_attr( __( 'Update Album description', 'wp-photo-album-plus' ) ) . '"
1109
- onclick="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', document.getElementById( \'wppaalbumdesc\' ) )"
1110
- />
1111
- <img
1112
- id="wppa-album-spin"
1113
- src="' . wppa_get_imgdir() . 'spinner.gif"
1114
- alt="Spin"
1115
- style="visibility:hidden"
1116
- />
1117
- </td>';
1118
- }
1119
- else {
1120
- echo '
1121
- <td>
1122
- <textarea
1123
- style="width:100%;height:60px;"
1124
- onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1125
- >' .
1126
- esc_textarea( stripslashes( $description ) ) .
1127
- '</textarea>
1128
- </td>';
1129
- }
1130
  echo '
1131
  <td>
1132
  </td>
@@ -1787,16 +1759,16 @@ global $wppa_revno;
1787
  type="button"
1788
  value="' . esc_attr( __( 'Go', 'wp-photo-album-plus' ) ) . '"
1789
  onclick="wppaGoEditAlbNo();"
1790
- />
1791
- <script>
 
1792
  function wppaGoEditAlbNo() {
1793
  var id = document.getElementById("wppa-edit-albid").value;
1794
  var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
1795
  var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
1796
  document.location.href=href;
1797
- }
1798
- </script>
1799
- ';
1800
 
1801
  ?>
1802
 
@@ -2658,23 +2630,23 @@ global $wpdb;
2658
  </tfoot>
2659
 
2660
  </table>
2661
-
2662
- <script type="text/javascript" >
2663
  function checkArrows() {
2664
- elms = jQuery('.alb-arrow-off');
2665
  for(i=0;i<elms.length;i++) {
2666
  elm = elms[i];
2667
- if ( elm.parentNode.parentNode.style.display == 'none' ) elm.style.display = 'none';
2668
  }
2669
- elms = jQuery('.alb-arrow-on');
2670
  for(i=0;i<elms.length;i++) {
2671
  elm = elms[i];
2672
- if ( elm.parentNode.parentNode.style.display == 'none' ) elm.style.display = '';
2673
  }
2674
- }
2675
- </script>
 
2676
 
2677
- <?php
2678
  wppa_album_table_pagination( $page, $count );
2679
  wppa_album_admin_footer();
2680
 
@@ -2941,18 +2913,17 @@ global $wpdb;
2941
  />';
2942
 
2943
  // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2944
- if ( isset( $_COOKIE['alb-arrow-' . $id] ) && $_COOKIE['alb-arrow-' . $id] == 'on' ) {
2945
- echo '
2946
- <script>
2947
- jQuery(document).ready(function(){
2948
- if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2949
- jQuery("#alb-arrow-on-'.$id.'").trigger("click");
2950
- }
2951
- else {
2952
- wppa_setCookie("alb-arrow-'.$id.'","off",365);
2953
- }
2954
- });
2955
- </script>';
2956
  }
2957
  }
2958
 
@@ -3340,33 +3311,7 @@ global $wpdb;
3340
  '</table>';
3341
 
3342
 
3343
-
3344
- ?>
3345
- <style>
3346
- .sortable-placeholder-albums {
3347
- width: 100%;
3348
- height: 60px;
3349
- margin: 5px;
3350
- border: 1px dotted #cccccc;
3351
- border-radius:3px;
3352
- float: left;
3353
- }
3354
- .ui-state-default-albums {
3355
- position: relative;
3356
- width: 100%;
3357
- height: 60px;
3358
- margin: 5px;
3359
- border: 1px solid #cccccc;
3360
- border-radius:3px;
3361
- float: left;
3362
- }
3363
- .ui-state-default-albums td {
3364
- padding:0;
3365
- line-height:12px;
3366
- text-align:center;
3367
- }
3368
- </style>
3369
- <script>
3370
  jQuery( function() {
3371
  jQuery( "#sortable-albums" ).sortable( {
3372
  cursor: "move",
@@ -3395,7 +3340,7 @@ global $wpdb;
3395
  // Init
3396
  var ids = jQuery( ".wppa-sort-item-albums" );
3397
  var seq = jQuery( ".wppa-sort-seqn-albums" );
3398
- var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
3399
 
3400
  // Mark needs update
3401
  var idx = 0;
@@ -3406,7 +3351,7 @@ global $wpdb;
3406
  var oldvalue = seq[idx].value;
3407
  var album = ids[idx].value;
3408
  if ( newvalue != oldvalue ) {
3409
- jQuery( '#wppa-pb-'+idx ).css({backgroundColor:'orange'});
3410
  }
3411
  idx++;
3412
  }
@@ -3421,7 +3366,7 @@ global $wpdb;
3421
  var album = ids[idx].value;
3422
  if ( newvalue != oldvalue ) {
3423
  wppaDoSeqUpdateAlbum( album, newvalue );
3424
- jQuery( '#wppa-pb-'+idx ).css({backgroundColor:'yellow'});
3425
  wppaLastAlbum = album;
3426
  }
3427
  idx++;
@@ -3430,40 +3375,40 @@ global $wpdb;
3430
 
3431
  function wppaDoSeqUpdateAlbum( album, seqno ) {
3432
 
3433
- var data = 'action=wppa' +
3434
- '&wppa-action=update-album' +
3435
- '&album-id=' + album +
3436
- '&item=a_order' +
3437
- '&wppa-nonce=' + document.getElementById( 'album-nonce-' + album ).value +
3438
- '&value=' + seqno;
3439
  var xmlhttp = new XMLHttpRequest();
3440
 
3441
  xmlhttp.onreadystatechange = function() {
3442
  if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3443
  var ArrValues = xmlhttp.responseText.split( "||" );
3444
- if ( ArrValues[0] != '' ) {
3445
- alert( 'The server returned unexpected output:\n' + ArrValues[0] );
3446
  }
3447
  switch ( ArrValues[1] ) {
3448
- case '0': // No error
3449
  var i = seqno - 1;
3450
- var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
3451
  if ( descend ) {
3452
- i = <?php echo count( $albums ) ?> - seqno;
3453
  }
3454
- jQuery( '#wppa-album-seqno-' + album ).html( seqno );
3455
  if ( wppaRenumberPending ) {
3456
- jQuery( '#wppa-pb-'+i ).css({backgroundColor:'orange'});
3457
  }
3458
  else {
3459
- jQuery( '#wppa-pb-'+i ).css({backgroundColor:'green'});
3460
  }
3461
  if ( wppaLastAlbum = album ) {
3462
  wppaRenumberBusy = false;
3463
  }
3464
  break;
3465
  default: // Any error
3466
- jQuery( '#wppa-album-seqno-' + album ).html( '<span style="color"red" >Err:' + ArrValues[1] + '</span>' );
3467
  break;
3468
  }
3469
  wppaAjaxInProgress--;
@@ -3480,16 +3425,19 @@ global $wpdb;
3480
  }
3481
  }
3482
  }
3483
- xmlhttp.open( 'POST',wppaAjaxUrl,true );
3484
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3485
  xmlhttp.send( data );
3486
  wppaAjaxInProgress++;
3487
 
3488
- jQuery( "#wppa-sort-seqn-albums-" + album ).prop( 'value', seqno ); // set hidden value to new value to prevent duplicate action
3489
- var spinnerhtml = '<img src="' + wppaImageDirectory + 'spinner.gif" />';
3490
- jQuery( '#wppa-album-seqno-' + album ).html( spinnerhtml );
3491
- }
3492
- </script>
 
 
 
3493
 
3494
  <br />
3495
 
@@ -3622,11 +3570,6 @@ function _wppa_search() {
3622
  update_option( 'wppa_search_page', 'wppa_search' );
3623
 
3624
  echo '
3625
- <style>
3626
- #src-alb{
3627
- color:transparent;
3628
- }
3629
- </style>
3630
  <div class="wrap" >
3631
  <img src="' . esc_attr( WPPA_URL . '/img/magnifier-large.png' ) . '" />
3632
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
288
  }
289
  }
290
 
291
+ $remark = sprintf( __( 'Album %s is not modified yet', 'wp-photo-album-plus' ), $edit_id );
292
+
293
  // Set all to pano
294
  $timeup = false;
295
  $pano = wppa_get( 'pano-val', '9' );
296
  if ( in_array( $pano, array( '0', '1', '2' ) ) ) {
297
 
298
+ // $last = get_option( 'wppa_last_pano_set', '0' );
299
  $done = '0';
300
  $todo = $wpdb->get_results( $wpdb->prepare( "SELECT id, photox, photoy, panorama, angle FROM $wpdb->wppa_photos
301
  WHERE album = %d
302
+
303
  AND ext = 'jpg'
304
+ AND panorama <> %d
305
+ ORDER BY id", $edit_id, $pano ), ARRAY_A );
306
  $tot = count( $todo );
307
 
308
  if ( $tot ) foreach( $todo as $item ) {
359
  wppa_remake_files( '', $id );
360
  wppa_get_photox( $id, true );
361
  wppa_get_photoy( $id, true );
362
+ // update_option( 'wppa_last_pano_set', $id );
363
  $done++;
364
 
365
  if ( ! in_array( $pano, array( '0', '1', '2' ) ) ) {
366
+ $remark = __( 'No items processed', 'wp-photo-album-plus' );
367
  }
368
  elseif ( $done == $tot ) {
369
+ $remark = __( 'All applicable items processed', 'wp-photo-album-plus' );
370
+ // delete_option( 'wppa_last_pano_set' );
371
  }
372
  else {
373
+ $remark = sprintf( __( '%1d items out of %2d processed', 'wp-photo-album-plus' ), $done, $tot );
374
  }
375
  }
376
 
378
  $timeup = wppa_is_time_up() && ( $done != $tot );
379
  if ( $timeup ) break;
380
  }
381
+ else {
382
+ $remark = __( 'No items to process', 'wp-photo-album-plus' );
383
+ }
384
 
385
  if ( $timeup ) {
386
+ $remark .= ' ' . __( 'No time left, please reload the page to continue.', 'wp-photo-album-plus' );
387
  }
 
 
 
 
 
 
 
388
  }
389
 
390
  // Get the album information
423
  $tpviews = $treecounts['treephotoviews'];
424
  $nsub = $treecounts['selfalbums'];
425
 
426
+
427
  // Open the photo album admin page
428
  echo
429
  '<div class="wrap">';
431
  // The spinner to indicate busyness
432
  wppa_admin_spinner();
433
 
434
+ // Local js functions
435
+ $the_js = '
 
436
  function wppaTryInheritCats( id ) {
437
 
438
  var query = "' . esc_js( __( 'Are you sure you want to inherit categories to all (grand)children of this album?', 'wp-photo-album-plus' ) ) . '";
496
  else {
497
  alert("' . __( 'Please select a valid panorama mode', 'wp-photo-album-plus' ) . '");
498
  }
499
+ }';
500
 
501
+ wp_add_inline_script( 'wppa-admin', $the_js );
502
 
503
  // The header
504
  echo '
617
  <select
618
  onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'owner\', this )"
619
  title="' . esc_attr( $title ) . '"
620
+ >' .
621
+ wppa_get_user_select( $owner ) . '
 
622
  </select>&nbsp;';
623
  }
624
  }
1041
  id="albumstatus-' . $id . '"
1042
  style="font-weight:bold;color:#00AA00;"
1043
  >' .
1044
+ esc_html( $remark ) . '
1045
  </span>';
1046
 
1047
 
1088
  <td>' .
1089
  __( 'Description:', 'wp-photo-album-plus' ) . '
1090
  </td>';
1091
+
1092
+ echo '
1093
+ <td>
1094
+ <textarea
1095
+ style="width:100%;height:60px;"
1096
+ onchange="wppaAjaxUpdateAlbum( ' . $id . ', \'description\', this )"
1097
+ >' .
1098
+ esc_textarea( stripslashes( $description ) ) .
1099
+ '</textarea>
1100
+ </td>';
1101
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1102
  echo '
1103
  <td>
1104
  </td>
1759
  type="button"
1760
  value="' . esc_attr( __( 'Go', 'wp-photo-album-plus' ) ) . '"
1761
  onclick="wppaGoEditAlbNo();"
1762
+ />';
1763
+
1764
+ $the_js = '
1765
  function wppaGoEditAlbNo() {
1766
  var id = document.getElementById("wppa-edit-albid").value;
1767
  var nonce = "' . wp_create_nonce( 'wppa-nonce' ) .'";
1768
  var href = "' . get_admin_url() . 'admin.php?page=wppa_admin_menu&wppa-nonce="+nonce+"&tab=edit&edit-id="+id;
1769
  document.location.href=href;
1770
+ };';
1771
+ wp_add_inline_script( 'wppa-admin', $the_js );
 
1772
 
1773
  ?>
1774
 
2630
  </tfoot>
2631
 
2632
  </table>
2633
+ <?php
2634
+ $the_js = '
2635
  function checkArrows() {
2636
+ elms = jQuery(".alb-arrow-off");
2637
  for(i=0;i<elms.length;i++) {
2638
  elm = elms[i];
2639
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "none";
2640
  }
2641
+ elms = jQuery(".alb-arrow-on");
2642
  for(i=0;i<elms.length;i++) {
2643
  elm = elms[i];
2644
+ if ( elm.parentNode.parentNode.style.display == "none" ) elm.style.display = "";
2645
  }
2646
+ }';
2647
+
2648
+ wp_add_inline_script( 'wppa-admin', $the_js );
2649
 
 
2650
  wppa_album_table_pagination( $page, $count );
2651
  wppa_album_admin_footer();
2652
 
2913
  />';
2914
 
2915
  // Open subalbums by clicking the open button if it was before (cookie), and if it is visible (!)
2916
+ if ( wppa_get_cookie( 'alb-arrow-' . $id ) == 'on' ) {
2917
+ $the_js = '
2918
+ jQuery(document).ready(function(){
2919
+ if (jQuery("#alb-'.$id.'").css("display")!=="none") {
2920
+ jQuery("#alb-arrow-on-'.$id.'").trigger("click");
2921
+ }
2922
+ else {
2923
+ wppa_setCookie("alb-arrow-'.$id.'","off",365);
2924
+ }
2925
+ });';
2926
+ wp_add_inline_script( 'wppa-admin', $the_js );
 
2927
  }
2928
  }
2929
 
3311
  '</table>';
3312
 
3313
 
3314
+ $the_js = '
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3315
  jQuery( function() {
3316
  jQuery( "#sortable-albums" ).sortable( {
3317
  cursor: "move",
3340
  // Init
3341
  var ids = jQuery( ".wppa-sort-item-albums" );
3342
  var seq = jQuery( ".wppa-sort-seqn-albums" );
3343
+ var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3344
 
3345
  // Mark needs update
3346
  var idx = 0;
3351
  var oldvalue = seq[idx].value;
3352
  var album = ids[idx].value;
3353
  if ( newvalue != oldvalue ) {
3354
+ jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"orange"});
3355
  }
3356
  idx++;
3357
  }
3366
  var album = ids[idx].value;
3367
  if ( newvalue != oldvalue ) {
3368
  wppaDoSeqUpdateAlbum( album, newvalue );
3369
+ jQuery( "#wppa-pb-"+idx ).css({backgroundColor:"yellow"});
3370
  wppaLastAlbum = album;
3371
  }
3372
  idx++;
3375
 
3376
  function wppaDoSeqUpdateAlbum( album, seqno ) {
3377
 
3378
+ var data = "action=wppa" +
3379
+ "&wppa-action=update-album" +
3380
+ "&album-id=" + album +
3381
+ "&item=a_order" +
3382
+ "&wppa-nonce=" + document.getElementById( "album-nonce-" + album ).value +
3383
+ "&value=" + seqno;
3384
  var xmlhttp = new XMLHttpRequest();
3385
 
3386
  xmlhttp.onreadystatechange = function() {
3387
  if ( xmlhttp.readyState == 4 && xmlhttp.status != 404 ) {
3388
  var ArrValues = xmlhttp.responseText.split( "||" );
3389
+ if ( ArrValues[0] != "" ) {
3390
+ alert( "The server returned unexpected output:\n" + ArrValues[0] );
3391
  }
3392
  switch ( ArrValues[1] ) {
3393
+ case "0": // No error
3394
  var i = seqno - 1;
3395
+ var descend = ' . ( $is_descending ? 'true' : 'false' ) . ';
3396
  if ( descend ) {
3397
+ i = ' . count( $albums ) . ' - seqno;
3398
  }
3399
+ jQuery( "#wppa-album-seqno-" + album ).html( seqno );
3400
  if ( wppaRenumberPending ) {
3401
+ jQuery( "#wppa-pb-"+i ).css({backgroundColor:"orange"});
3402
  }
3403
  else {
3404
+ jQuery( "#wppa-pb-"+i ).css({backgroundColor:"green"});
3405
  }
3406
  if ( wppaLastAlbum = album ) {
3407
  wppaRenumberBusy = false;
3408
  }
3409
  break;
3410
  default: // Any error
3411
+ jQuery( "#wppa-album-seqno-" + album ).html( "<span style=\'color:red\' >Err:" + ArrValues[1] + "</span>" );
3412
  break;
3413
  }
3414
  wppaAjaxInProgress--;
3425
  }
3426
  }
3427
  }
3428
+ xmlhttp.open( "POST",wppaAjaxUrl,true );
3429
  xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" );
3430
  xmlhttp.send( data );
3431
  wppaAjaxInProgress++;
3432
 
3433
+ jQuery( "#wppa-sort-seqn-albums-" + album ).prop( "value", seqno ); // set hidden value to new value to prevent duplicate action
3434
+ var spinnerhtml = "<img src=\'" + wppaImageDirectory + "spinner.gif\' />";
3435
+ jQuery( "#wppa-album-seqno-" + album ).html( spinnerhtml );
3436
+ }';
3437
+
3438
+ wp_add_inline_script( 'wppa-admin', $the_js );
3439
+
3440
+ ?>
3441
 
3442
  <br />
3443
 
3570
  update_option( 'wppa_search_page', 'wppa_search' );
3571
 
3572
  echo '
 
 
 
 
 
3573
  <div class="wrap" >
3574
  <img src="' . esc_attr( WPPA_URL . '/img/magnifier-large.png' ) . '" />
3575
  <h1 style="display:inline;" >' . __( 'Search photos', 'wp-photo-album-plus' ) . '</h1>
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 8.0.08.006
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
@@ -366,15 +366,6 @@ class AlbumNavigatorWidget extends WP_Widget {
366
  }
367
  }
368
  $result .= '</ul>';
369
- if ( $level == '1' && $ca ) {
370
- $result .= '<script type="text/javascript" >';
371
- while ( $ca != '0' && $ca != '-1' ) {
372
- $result .= '
373
- jQuery(\'.anw-'.$w.'-'.$ca.'\').css(\'display\',\'\'); jQuery(\'.anw-'.$w.'-'.$ca.'-\').css(\'display\',\'none\');';
374
- $ca = wppa_get_parentalbumid($ca);
375
- }
376
- $result .= '</script>';
377
- }
378
  }
379
  $level--;
380
  return wppa_compress_html( $result );
3
  * Package: wp-photo-album-plus
4
  *
5
  * display album names linking to content
6
+ * Version 8.1.00.004
7
  */
8
 
9
  class AlbumNavigatorWidget extends WP_Widget {
366
  }
367
  }
368
  $result .= '</ul>';
 
 
 
 
 
 
 
 
 
369
  }
370
  $level--;
371
  return wppa_compress_html( $result );
wppa-audio.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all audio routines
6
- * Version 8.0.00.012
7
  *
8
  */
9
 
@@ -81,23 +81,23 @@ function wppa_get_audio_html( $args ) {
81
 
82
  // Prepare attributes
83
  if ( $width ) {
84
- $w = ' width:'.$width.'px;';
85
  }
86
  else {
87
  if ( wppa_is_chrome() ) {
88
- $w = ' width: -webkit-fill-available;';
89
  }
90
  elseif ( wppa_is_firefox() ) {
91
- $w = ' width: -moz-available;';
92
  }
93
  else {
94
- $w = ' width: auto';
95
  }
96
  }
97
  // $w = $width ? ' width:'.$width.'px;' : '';
98
- $h = $height ? ' height:'.$height.'px;' : '';
99
- $t = $margin_top ? ' margin-top:'.$margin_top.'px;' : '';
100
- $b = $margin_bottom ? ' margin-bottom:'.$margin_bottom.'px;' : '';
101
  $ctrl = $controls ? ' controls' : '';
102
  $tit = $title ? ' title="'.$title.'"' : '';
103
  $onc = $onclick ? ' onclick="'.$onclick.'"' : '';
@@ -109,15 +109,18 @@ function wppa_get_audio_html( $args ) {
109
  if ( $mp3 || $wav || $ogg ) {
110
 
111
  // Assume the browser supports html5
112
- $result = '<audio' .
113
- ' id="'.$tagid.'"' .
114
- ' data-from="wppa"' .
115
- ' '.$ctrl.$play.
116
- ' style="'.$style.$w.$h.$t.$b.$cursor.'"' .
117
- ' '.$events.
118
- ' '.$tit.$onc.
119
- ' preload="'.$preload.'"'.$cls.
120
- ' >';
 
 
 
121
 
122
  $result .= wppa_get_audio_body( $id, false, $width, $height );
123
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all audio routines
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
81
 
82
  // Prepare attributes
83
  if ( $width ) {
84
+ $w = 'width:'.$width.'px;';
85
  }
86
  else {
87
  if ( wppa_is_chrome() ) {
88
+ $w = 'width:-webkit-fill-available;';
89
  }
90
  elseif ( wppa_is_firefox() ) {
91
+ $w = 'width:-moz-available;';
92
  }
93
  else {
94
+ $w = 'width:auto;';
95
  }
96
  }
97
  // $w = $width ? ' width:'.$width.'px;' : '';
98
+ $h = $height ? 'height:'.$height.'px;' : '';
99
+ $t = $margin_top ? 'margin-top:'.$margin_top.'px;' : '';
100
+ $b = $margin_bottom ? 'margin-bottom:'.$margin_bottom.'px;' : '';
101
  $ctrl = $controls ? ' controls' : '';
102
  $tit = $title ? ' title="'.$title.'"' : '';
103
  $onc = $onclick ? ' onclick="'.$onclick.'"' : '';
109
  if ( $mp3 || $wav || $ogg ) {
110
 
111
  // Assume the browser supports html5
112
+ $result = '
113
+ <audio
114
+ id="'.$tagid.'"
115
+ data-from="wppa" ' .
116
+ $ctrl.
117
+ $play.'
118
+ style="'.$style.$w.$h.$t.$b.$cursor.'" ' .
119
+ $events.
120
+ $tit.$onc.'
121
+ preload="'.$preload.'" '.
122
+ $cls.'
123
+ >';
124
 
125
  $result .= wppa_get_audio_body( $id, false, $width, $height );
126
 
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.0.10.002
7
  *
8
  */
9
 
@@ -78,11 +78,6 @@ function wppa_thumb_area( $action ) {
78
  // Nicescroller
79
  if ( $nice ) {
80
  $result .= '
81
- <script>
82
- jQuery(document).ready(function(){
83
- jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
84
- });
85
- </script>
86
  </div>'; // close .wppa-nicewrap div
87
  }
88
 
@@ -140,11 +135,6 @@ function wppa_contest_box() {
140
  // Nicescroller
141
  if ( $nice ) {
142
  $result .= '
143
- <script>
144
- jQuery(document).ready(function(){
145
- jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
146
- });
147
- </script>
148
  </div>'; // close .wppa-nicewrap div
149
  }
150
 
@@ -628,14 +618,7 @@ global $wppa_session;
628
 
629
  // Use theme or modified form
630
  else {
631
- $form_core = get_search_form( false );
632
-
633
- // Themes like weaver ii return nothing at this point. Some do echo get_search_form(), try this first
634
- if ( ! $form_core ) {
635
- ob_start();
636
- get_search_form();
637
- $form_core = ob_get_clean();
638
- }
639
 
640
  // If still no luck, use wp default
641
  if ( ! $form_core ) {
@@ -1375,16 +1358,15 @@ global $photos_used;
1375
  <input
1376
  type="button"
1377
  id="wppa-ss-button-' . $mocc . '"
 
 
1378
  value="' . __( 'Submit', 'wp-photo-album-plus' ) . '"
1379
- style="vertical-align:top;margin:2px;"
1380
  onclick="wppaSuperSearchSelect(' . $mocc . ' , true)"
1381
  />';
1382
 
1383
  $result .= '
1384
- </form>
1385
- <script>
1386
- jQuery(document).ready(function(){wppaSuperSearchSelect(' . $mocc . ')});
1387
- </script>';
1388
 
1389
  return $result; // wppa_compress_html( $result );
1390
  }
@@ -2000,12 +1982,24 @@ global $wppa_locale;
2000
  title="' . sprintf( __( 'Tweet %s on Twitter', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"
2001
  href="https://twitter.com/intent/tweet?text=' . $tweet . '"
2002
  target="_blank"
2003
- >
2004
- <img
2005
- src="' . wppa_get_imgdir() . 'twitter.png"
2006
- style="height:' . $s . 'px;vertical-align:top;"
2007
- alt="' . esc_attr( __( 'Share on Twitter', 'wp-photo-album-plus' ) ) . '"
2008
- />
 
 
 
 
 
 
 
 
 
 
 
 
2009
  </a>
2010
  </div>';
2011
  }
@@ -2013,27 +2007,6 @@ global $wppa_locale;
2013
  $tw = '';
2014
  }
2015
 
2016
- // Google
2017
- if ( wppa_switch( 'share_google' ) ) {
2018
- $go = '
2019
- <div class="wppa-share-icon" style="float:left; padding:0 2px;" >
2020
- <a
2021
- title="' . sprintf( __( 'Share %s on Google+', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"
2022
- href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"
2023
- target="_blank"
2024
- >
2025
- <img
2026
- src="' . wppa_get_imgdir() . 'google.png"
2027
- style="height:' . $s . 'px;vertical-align:top;"
2028
- alt="' . esc_attr( __( 'Share on Google+', 'wp-photo-album-plus' ) ) . '"
2029
- />
2030
- </a>
2031
- </div>';
2032
- }
2033
- else {
2034
- $go = '';
2035
- }
2036
-
2037
  // Pinterest
2038
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
2039
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
@@ -2047,12 +2020,24 @@ global $wppa_locale;
2047
  '&description=' . $desc .
2048
  '"
2049
  target="_blank"
2050
- >
2051
- <img
2052
- src="' . wppa_get_imgdir() . 'pinterest.png"
2053
- style="height:' . $s . 'px;vertical-align:top;border-radius:' . $br . 'px;"
2054
- alt="' . esc_attr( __( 'Share on Pinterest', 'wp-photo-album-plus' ) ) . '"
2055
- />
 
 
 
 
 
 
 
 
 
 
 
 
2056
  </a>
2057
  </div>';
2058
  }
@@ -2062,19 +2047,27 @@ global $wppa_locale;
2062
 
2063
  // LinkedIn
2064
  if ( wppa_switch( 'share_linkedin' ) && $key != 'thumb' && $key != 'lightbox' ) {
2065
-
2066
- // New style under development
2067
- $li = '
2068
  <div class="wppa-share-icon" style="float:left; padding:0 2px;" >
2069
  <a
2070
  title="' . sprintf( __( 'Share %s on LinkedIn' ,'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"
2071
  href="https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode( $share_url ) . '"
2072
  target="_blank"
2073
- >
2074
- <img
2075
- src="' . wppa_get_imgdir() . 'linkedin.png"
2076
- style="height:' . $s . 'px;vertical-align:top;"
2077
- />
 
 
 
 
 
 
 
 
 
 
2078
  </a>
2079
  </div>';
2080
  }
@@ -2210,7 +2203,7 @@ global $wppa_locale;
2210
  }
2211
  }
2212
 
2213
- return wppa_compress_html( '<div class="wppa-share-'.$key.'" >'.$qr.$tw.$go.$pi.$li.$fb.'<div style="clear:both"></div></div>' );
2214
  }
2215
 
2216
  // Make html for share a page/post
@@ -2301,28 +2294,6 @@ global $wpdb;
2301
  $tw = '';
2302
  }
2303
 
2304
- // Google
2305
- if ( wppa_switch( 'share_google' ) ) {
2306
- $go = '
2307
- <div class="wppa-share-icon" style="float:left; padding:0 2px;" >
2308
- <a
2309
- title="' . sprintf( __( 'Share %s on Google+', 'wp-photo-album-plus' ), esc_attr( $share_name ) ) . '"
2310
- href="https://plus.google.com/share?url=' . urlencode( $share_url ) . '"
2311
- onclick="javascript:window.open( this.href, \"\", \"menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600\" );return false;"
2312
- target="_blank"
2313
- >
2314
- <img
2315
- src="' . wppa_get_imgdir() . 'google.png"
2316
- style="height:' . $s . 'px;vertical-align:top;"
2317
- alt="' . esc_attr( __( 'Share on Google+', 'wp-photo-album-plus' ) ) . '"
2318
- />
2319
- </a>
2320
- </div>';
2321
- }
2322
- else {
2323
- $go = '';
2324
- }
2325
-
2326
  // Pinterest
2327
  $pi = '';
2328
 
@@ -2408,7 +2379,7 @@ global $wpdb;
2408
  }
2409
 
2410
  $result = '<div style="clear:both"></div>' .
2411
- $qr . $tw . $go . $pi . $li . $fb .
2412
  '<div style="clear:both"></div>';
2413
 
2414
  return wppa_compress_html( $result );
@@ -2620,7 +2591,7 @@ function wppa_get_user_create_html( $alb, $width, $where = '', $mcr = false ) {
2620
  action="#"
2621
  method="post"
2622
  >' .
2623
- wppa_nonce_field( 'wppa-album-check', 'wppa-nonce', false, false, $alb ) . '
2624
  <input type="hidden" name="wppa-fe-create" value="yes" />';
2625
 
2626
  // Parent
@@ -3019,7 +2990,7 @@ static $albums_granted;
3019
  method="post"
3020
  enctype="multipart/form-data"
3021
  >' .
3022
- wppa_nonce_field( 'wppa-check', 'wppa-nonce', false, false, $yalb );
3023
 
3024
  // Single Album given
3025
  if ( wppa_is_int( $alb ) ) {
@@ -3253,7 +3224,7 @@ static $albums_granted;
3253
  style="margin:0; border:0;"
3254
  >
3255
  <tbody>
3256
- <tr valign="top" style="border: 0 none; " >
3257
  <td
3258
  class="wppa-box-text wppa-td"
3259
  >' .
@@ -3274,7 +3245,7 @@ static $albums_granted;
3274
  </select>
3275
  </td>
3276
  </tr>
3277
- <tr valign="top" style="border: 0 none;" >
3278
  <td
3279
  class="wppa-box-text wppa-td"
3280
  style="width:' . $width . ';"
@@ -3944,7 +3915,6 @@ global $wpdb;
3944
  // Prepare html
3945
  $originatorblock = '
3946
  <td
3947
- valign="top"
3948
  class="wppa-box-text wppa-td"
3949
  style="vertical-align:top; width:30%; border-width: 0 0 0 0;"
3950
  >' .
@@ -4124,14 +4094,12 @@ global $wpdb;
4124
  $result .= '
4125
  <tr
4126
  class="wppa-comment-'.$comment['id'].'"
4127
- valign="top"
4128
- style="border:0 none;"
4129
  >' .
4130
  $originatorblock .
4131
  '</tr>
4132
  <tr class="wppa-comment-'.$comment['id'].'"
4133
- valign="top"
4134
- style="border:0 none;"
4135
  >' .
4136
  $commentblock .
4137
  '</tr>
@@ -4145,8 +4113,7 @@ global $wpdb;
4145
  $result .= '
4146
  <tr
4147
  class="wppa-comment-'.$comment['id'].'"
4148
- valign="top"
4149
- style="border:0 none;"
4150
  >' .
4151
  $originatorblock .
4152
  $commentblock .
@@ -4268,16 +4235,16 @@ global $wpdb;
4268
  // Name
4269
  if ( $mob ) {
4270
  $result .= '
4271
- <tr valign="top" style="' . $vis . '">' .
4272
  $label_html . '
4273
  </tr >
4274
- <tr valign="top" style="' . $vis . '">' .
4275
  $value_html . '
4276
  </tr >';
4277
  }
4278
  else {
4279
  $result .= '
4280
- <tr valign="top" style="' . $vis . '">' .
4281
  $label_html .
4282
  $value_html . '
4283
  </tr >';
@@ -4310,16 +4277,16 @@ global $wpdb;
4310
  // Email
4311
  if ( $mob ) {
4312
  $result .= '
4313
- <tr valign="top" style="' . $vis . '">' .
4314
  $label_html . '
4315
  </tr >
4316
- <tr valign="top" style="' . $vis . '">' .
4317
  $value_html . '
4318
  </tr >';
4319
  }
4320
  else {
4321
  $result .= '
4322
- <tr valign="top" style="' . $vis . '">' .
4323
  $label_html .
4324
  $value_html . '
4325
  </tr >';
@@ -4411,8 +4378,7 @@ global $wpdb;
4411
  style="background-color:transparent;"
4412
  >' .
4413
  $smily_html .
4414
- $comment_input .
4415
- ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4416
  </td>
4417
  <tr>
4418
  <tr>
@@ -4436,11 +4402,9 @@ global $wpdb;
4436
  else {
4437
  $result .= '
4438
  <tr
4439
- valign="top"
4440
  style="vertical-align:top;"
4441
  >
4442
  <td
4443
- valign="top"
4444
  class="wppa-box-text wppa-td"
4445
  style="vertical-align:top; width:30%;background-color:transparent;"
4446
  >' .
@@ -4460,8 +4424,7 @@ global $wpdb;
4460
  </td>
4461
  <td>' .
4462
  $smily_html .
4463
- $comment_input .
4464
- ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4465
  </td>
4466
  </tr>';
4467
  }
@@ -6390,7 +6353,7 @@ global $wppa_supported_stereo_glass_names;
6390
  $result .=
6391
  '<option' .
6392
  ' value="' . $wppa_supported_stereo_types[$key] . '"' .
6393
- ( isset( $_COOKIE["stereotype"] ) && $_COOKIE["stereotype"] == $wppa_supported_stereo_types[$key] ? ' selected' : '' ) .
6394
  ' >' .
6395
  $wppa_supported_stereo_type_names[$key] .
6396
  '</option>';
@@ -6406,7 +6369,7 @@ global $wppa_supported_stereo_glass_names;
6406
  $result .=
6407
  '<option' .
6408
  ' value="' . $wppa_supported_stereo_glasses[$key] . '"' .
6409
- ( isset( $_COOKIE["stereoglass"] ) && $_COOKIE["stereoglass"] == $wppa_supported_stereo_glasses[$key] ? ' selected' : '' ) .
6410
  ' >' .
6411
  $wppa_supported_stereo_glass_names[$key] .
6412
  '</option>';
@@ -6606,11 +6569,6 @@ function wppa_grid_box() {
6606
  // Nicescroller
6607
  if ( $nice ) {
6608
  $result .= '
6609
- <script>
6610
- jQuery(document).ready(function(){
6611
- jQuery(".wppa-thumb-area").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
6612
- });
6613
- </script>
6614
  </div>'; // close .wppa-nicewrap div
6615
  }
6616
 
@@ -6629,25 +6587,7 @@ function wppa_get_grid_box_html( $photos ) {
6629
  $cols = wppa( 'gridcols' );
6630
  $size = 100 / $cols . '%';
6631
  $mocc = wppa( 'mocc' );
6632
-
6633
- // Local styles
6634
- $result = '
6635
- <style>
6636
- .wppa-grid {
6637
- border:none;
6638
- margin:0 !important;
6639
- padding:0 !important;
6640
- }
6641
- .wppa-grid tr {
6642
- border:none;
6643
- }
6644
- .wppa-grid-' . $mocc . ' td {
6645
- border:none;
6646
- padding:6px;
6647
- vertical-align:middle;
6648
- width:' . $size . ';
6649
- }
6650
- </style>';
6651
 
6652
  // Open table
6653
  $result .= '
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
78
  // Nicescroller
79
  if ( $nice ) {
80
  $result .= '
 
 
 
 
 
81
  </div>'; // close .wppa-nicewrap div
82
  }
83
 
135
  // Nicescroller
136
  if ( $nice ) {
137
  $result .= '
 
 
 
 
 
138
  </div>'; // close .wppa-nicewrap div
139
  }
140
 
618
 
619
  // Use theme or modified form
620
  else {
621
+ $form_core = get_search_form( ['echo' => false] );
 
 
 
 
 
 
 
622
 
623
  // If still no luck, use wp default
624
  if ( ! $form_core ) {
1358
  <input
1359
  type="button"
1360
  id="wppa-ss-button-' . $mocc . '"
1361
+ data-mocc="' . $mocc . '"
1362
+ class="wppa-ss-button"
1363
  value="' . __( 'Submit', 'wp-photo-album-plus' ) . '"
1364
+ style="vertical-align:top;margin:2px;display:none;"
1365
  onclick="wppaSuperSearchSelect(' . $mocc . ' , true)"
1366
  />';
1367
 
1368
  $result .= '
1369
+ </form>';
 
 
 
1370
 
1371
  return $result; // wppa_compress_html( $result );
1372
  }
1982
  title="' . sprintf( __( 'Tweet %s on Twitter', 'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"
1983
  href="https://twitter.com/intent/tweet?text=' . $tweet . '"
1984
  target="_blank"
1985
+ >';
1986
+ if ( wppa_switch( 'twitter_black' ) ) {
1987
+ $tw .= '
1988
+ <img
1989
+ src="' . wppa_get_imgdir() . 'twitter.svg' . '"
1990
+ style="height:' . $s . 'px;vertical-align:top;border-radius:50%;background-color:black"
1991
+ alt="' . esc_attr( __( 'Share on Twitter', 'wp-photo-album-plus' ) ) . '"
1992
+ />';
1993
+ }
1994
+ else {
1995
+ $tw .= '
1996
+ <img
1997
+ src="' . wppa_get_imgdir() . 'twitter.png"
1998
+ style="height:' . $s . 'px;vertical-align:top;"
1999
+ alt="' . esc_attr( __( 'Share on Twitter', 'wp-photo-album-plus' ) ) . '"
2000
+ />';
2001
+ }
2002
+ $tw .= '
2003
  </a>
2004
  </div>';
2005
  }
2007
  $tw = '';
2008
  }
2009
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2010
  // Pinterest
2011
  $desc = urlencode( $see_on_site ).': '.urlencode( $photo_desc );
2012
  if ( strlen( $desc ) > 500 ) $desc = substr( $desc, 0, 495 ).'...';
2020
  '&description=' . $desc .
2021
  '"
2022
  target="_blank"
2023
+ >';
2024
+ if ( wppa_switch( 'pinterest_black' ) ) {
2025
+ $pi .=
2026
+ '<img
2027
+ src="' . wppa_get_imgdir() . 'pinterest.svg' . '"
2028
+ style="height:' . $s . 'px;vertical-align:top;border-radius:50%;background-color:black"
2029
+ alt="' . esc_attr( __( 'Share on Pinterest', 'wp-photo-album-plus' ) ) . '"
2030
+ />';
2031
+ }
2032
+ else {
2033
+ $pi .=
2034
+ '<img
2035
+ src="' . wppa_get_imgdir() . 'pinterest.png"
2036
+ style="height:' . $s . 'px;vertical-align:top;border-radius:' . $br . 'px;"
2037
+ alt="' . esc_attr( __( 'Share on Pinterest', 'wp-photo-album-plus' ) ) . '"
2038
+ />';
2039
+ }
2040
+ $pi .= '
2041
  </a>
2042
  </div>';
2043
  }
2047
 
2048
  // LinkedIn
2049
  if ( wppa_switch( 'share_linkedin' ) && $key != 'thumb' && $key != 'lightbox' ) {
2050
+ $li = '
 
 
2051
  <div class="wppa-share-icon" style="float:left; padding:0 2px;" >
2052
  <a
2053
  title="' . sprintf( __( 'Share %s on LinkedIn' ,'wp-photo-album-plus' ), esc_attr( $photo_name ) ) . '"
2054
  href="https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode( $share_url ) . '"
2055
  target="_blank"
2056
+ >';
2057
+ if ( wppa_switch( 'linkedin_black' ) ) {
2058
+ $li .= '
2059
+ <img
2060
+ src="' . wppa_get_imgdir() . 'linkedin.svg' . '"
2061
+ style="height:' . $s . 'px;vertical-align:top;border-radius:50%;background-color:black"
2062
+ />'; }
2063
+ else {
2064
+ $li .= '
2065
+ <img
2066
+ src="' . wppa_get_imgdir() . 'linkedin.png' . '"
2067
+ style="height:' . $s . 'px;vertical-align:top;"
2068
+ />';
2069
+ }
2070
+ $li .= '
2071
  </a>
2072
  </div>';
2073
  }
2203
  }
2204
  }
2205
 
2206
+ return wppa_compress_html( '<div class="wppa-share-'.$key.'" >'.$qr.$tw.$pi.$li.$fb.'<div style="clear:both"></div></div>' );
2207
  }
2208
 
2209
  // Make html for share a page/post
2294
  $tw = '';
2295
  }
2296
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2297
  // Pinterest
2298
  $pi = '';
2299
 
2379
  }
2380
 
2381
  $result = '<div style="clear:both"></div>' .
2382
+ $qr . $tw . $pi . $li . $fb .
2383
  '<div style="clear:both"></div>';
2384
 
2385
  return wppa_compress_html( $result );
2591
  action="#"
2592
  method="post"
2593
  >' .
2594
+ wppa_nonce_field( 'wppa-album-check', 'wppa-nonce', false, $alb ) . '
2595
  <input type="hidden" name="wppa-fe-create" value="yes" />';
2596
 
2597
  // Parent
2990
  method="post"
2991
  enctype="multipart/form-data"
2992
  >' .
2993
+ wppa_nonce_field( 'wppa-check', 'wppa-nonce', false, $yalb );
2994
 
2995
  // Single Album given
2996
  if ( wppa_is_int( $alb ) ) {
3224
  style="margin:0; border:0;"
3225
  >
3226
  <tbody>
3227
+ <tr style="border:0 none;vertical-align:top" >
3228
  <td
3229
  class="wppa-box-text wppa-td"
3230
  >' .
3245
  </select>
3246
  </td>
3247
  </tr>
3248
+ <tr style="border:0 none;vertical-align:top" >
3249
  <td
3250
  class="wppa-box-text wppa-td"
3251
  style="width:' . $width . ';"
3915
  // Prepare html
3916
  $originatorblock = '
3917
  <td
 
3918
  class="wppa-box-text wppa-td"
3919
  style="vertical-align:top; width:30%; border-width: 0 0 0 0;"
3920
  >' .
4094
  $result .= '
4095
  <tr
4096
  class="wppa-comment-'.$comment['id'].'"
4097
+ style="border:0 none;vertical-align:top"
 
4098
  >' .
4099
  $originatorblock .
4100
  '</tr>
4101
  <tr class="wppa-comment-'.$comment['id'].'"
4102
+ style="border:0 none;vertical-align:top"
 
4103
  >' .
4104
  $commentblock .
4105
  '</tr>
4113
  $result .= '
4114
  <tr
4115
  class="wppa-comment-'.$comment['id'].'"
4116
+ style="border:0 none;vertical-align:top"
 
4117
  >' .
4118
  $originatorblock .
4119
  $commentblock .
4235
  // Name
4236
  if ( $mob ) {
4237
  $result .= '
4238
+ <tr style="vertical-align:top;' . $vis . '">' .
4239
  $label_html . '
4240
  </tr >
4241
+ <tr style="vertical-align:top;' . $vis . '">' .
4242
  $value_html . '
4243
  </tr >';
4244
  }
4245
  else {
4246
  $result .= '
4247
+ <tr style="vertical-align:top;' . $vis . '">' .
4248
  $label_html .
4249
  $value_html . '
4250
  </tr >';
4277
  // Email
4278
  if ( $mob ) {
4279
  $result .= '
4280
+ <tr style="vertical-align:top;' . $vis . '">' .
4281
  $label_html . '
4282
  </tr >
4283
+ <tr style="vertical-align:top;' . $vis . '">' .
4284
  $value_html . '
4285
  </tr >';
4286
  }
4287
  else {
4288
  $result .= '
4289
+ <tr style="vertical-align:top;' . $vis . '">' .
4290
  $label_html .
4291
  $value_html . '
4292
  </tr >';
4378
  style="background-color:transparent;"
4379
  >' .
4380
  $smily_html .
4381
+ $comment_input . '
 
4382
  </td>
4383
  <tr>
4384
  <tr>
4402
  else {
4403
  $result .= '
4404
  <tr
 
4405
  style="vertical-align:top;"
4406
  >
4407
  <td
 
4408
  class="wppa-box-text wppa-td"
4409
  style="vertical-align:top; width:30%;background-color:transparent;"
4410
  >' .
4424
  </td>
4425
  <td>' .
4426
  $smily_html .
4427
+ $comment_input . '
 
4428
  </td>
4429
  </tr>';
4430
  }
6353
  $result .=
6354
  '<option' .
6355
  ' value="' . $wppa_supported_stereo_types[$key] . '"' .
6356
+ ( wppa_get_cookie( "stereotype" ) == $wppa_supported_stereo_types[$key] ? ' selected' : '' ) .
6357
  ' >' .
6358
  $wppa_supported_stereo_type_names[$key] .
6359
  '</option>';
6369
  $result .=
6370
  '<option' .
6371
  ' value="' . $wppa_supported_stereo_glasses[$key] . '"' .
6372
+ ( wppa_get_cookie( "stereoglass" ) == $wppa_supported_stereo_glasses[$key] ? ' selected' : '' ) .
6373
  ' >' .
6374
  $wppa_supported_stereo_glass_names[$key] .
6375
  '</option>';
6569
  // Nicescroller
6570
  if ( $nice ) {
6571
  $result .= '
 
 
 
 
 
6572
  </div>'; // close .wppa-nicewrap div
6573
  }
6574
 
6587
  $cols = wppa( 'gridcols' );
6588
  $size = 100 / $cols . '%';
6589
  $mocc = wppa( 'mocc' );
6590
+ $result = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6591
 
6592
  // Open table
6593
  $result .= '
wppa-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
- /* Version 8.0.10.003
7
  */
8
 
9
  // Test for caching
@@ -215,7 +215,7 @@ function wppa_clear_cache( $args = array() ) {
215
  global $cache_path;
216
  global $wpdb;
217
 
218
- wppa_log( 'obs', 'Clear cache called with args ' . var_export( $args, true ) );
219
 
220
  // Fill in default args
221
  $defaults = array( 'album' => '',
3
  /*
4
  /* Contains all wppa smart cache functions
5
  /*
6
+ /* Version 8.1.00.001
7
  */
8
 
9
  // Test for caching
215
  global $cache_path;
216
  global $wpdb;
217
 
218
+ // wppa_log( 'obs', 'Clear cache called with args ' . var_export( $args, true ) );
219
 
220
  // Fill in default args
221
  $defaults = array( 'album' => '',
wppa-cloudinary.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /* Only loads when php version >= 5.3
3
  *
4
- * Version 7.5.03
5
  *
6
  */
7
 
@@ -14,9 +14,9 @@ function wppa_load_cloudinary() {
14
 
15
  if ( $cdn != 'cloudinary' && $cdn != 'cloudinarymaintenance' ) return;
16
 
17
- require_once 'cloudinary/src/Cloudinary.php';
18
- require_once 'cloudinary/src/Uploader.php';
19
- require_once 'cloudinary/src/Api.php';
20
 
21
  \Cloudinary::config(array(
22
  "cloud_name" => wppa_get_option('wppa_cdn_cloud_name'),
1
  <?php
2
  /* Only loads when php version >= 5.3
3
  *
4
+ * Version 8.1.00.001
5
  *
6
  */
7
 
14
 
15
  if ( $cdn != 'cloudinary' && $cdn != 'cloudinarymaintenance' ) return;
16
 
17
+ require_once 'vendor/cloudinary/src/Cloudinary.php';
18
+ require_once 'vendor/cloudinary/src/Uploader.php';
19
+ require_once 'vendor/cloudinary/src/Api.php';
20
 
21
  \Cloudinary::config(array(
22
  "cloud_name" => wppa_get_option('wppa_cdn_cloud_name'),
wppa-comment-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
- * Version 8.0.08.005
7
  *
8
  */
9
 
@@ -34,7 +34,7 @@ class WPPA_Comment_table extends WP_List_Table {
34
  function extra_tablenav( $which ) {
35
 
36
  if ( 'top' === $which ) {
37
- $comment_show = isset( $_COOKIE['comadmin-show'] ) ? $_COOKIE['comadmin-show'] : 'all';
38
  echo
39
  '<div class="alignleft actions">' .
40
  '<select id="wppa_comadmin_show" name="wppa_comadmin_show" onchange="" >
@@ -118,7 +118,7 @@ class WPPA_Comment_table extends WP_List_Table {
118
  '<textarea' .
119
  ' id="commenttext-' . $item['id'] . '"' .
120
  ' style="width:98%;"' .
121
- ' onchange="wppaUpdateHref(\'' . $item['id'] . '\')"' .
122
  ' >' .
123
  stripslashes( $item['comment'] ) .
124
  '</textarea>' .
@@ -294,22 +294,20 @@ class WPPA_Comment_table extends WP_List_Table {
294
 
295
  // Normal use
296
  else {
297
- if ( isset( $_COOKIE['comadmin-show'] ) ) {
298
- switch( $_COOKIE['comadmin-show'] ) {
299
- case 'all':
300
- break;
301
- case 'spam':
302
- $filter = "WHERE status = 'spam'";
303
- break;
304
- case 'pending':
305
- $filter = "WHERE status = 'pending' OR status = ''";
306
- break;
307
- case 'approved':
308
- $filter = "WHERE status = 'approved'";
309
- break;
310
- default:
311
- break;
312
- }
313
  }
314
  }
315
 
@@ -355,28 +353,6 @@ function _wppa_comment_admin() {
355
  // Open page
356
  echo
357
  '<div class="wrap">
358
- <script type="text/javascript" >
359
- function wppaUpdateHref( id ) {
360
- var val = encodeURIComponent(jQuery(\'#commenttext-\'+id).val());
361
- var href = jQuery(\'#href-\'+id).attr(\'href\');
362
- var arr = href.split(\'commenttext=\');
363
- arr[1] = val;
364
- href = arr[0] + \'commenttext=\' + arr[1];
365
- jQuery(\'#href-\'+id).attr(\'href\', href);
366
- jQuery(\'#href-\'+id).css(\'display\',\'inline\');
367
- }
368
- </script>
369
- <style type="text/css" >
370
- .column-photo {
371
- width:180px;
372
- }
373
- .column-user, .column-email, .column-timestamp {
374
- width:180px;
375
- }
376
- .column-status {
377
- width:100px;
378
- }
379
- </style>
380
  <h1>' .
381
  ( $moderating ? __( 'Photo Albums -> Moderate Comment', 'wp-photo-album-plus' ) :
382
  __( 'Photo Albums -> Comment admin', 'wp-photo-album-plus' ) ) .
@@ -430,21 +406,6 @@ function _wppa_comment_admin() {
430
  echo
431
  '</tbody>
432
  </table>';
433
-
434
- /*
435
- // Filter
436
- $comment_show = isset( $_COOKIE['comadmin-show'] ) ? $_COOKIE['comadmin-show'] : 'all';
437
- echo
438
- '<p>' .
439
- '<b>' . __( 'Filter', 'wp-photo-album-plus' ) . ': </b>' .
440
- '<select name="wppa_comadmin_show" onchange="wppa_setCookie(\'comadmin-show\', this.value, \'365\'); document.location.reload(true);" >
441
- <option value="all" ' . ( $comment_show == 'all' ? 'selected="selected"' : '' ) . ' >' . __( 'all', 'wp-photo-album-plus' ) . '</option>
442
- <option value="pending" ' . ( $comment_show == 'pending' ? 'selected="selected"' : '' ) . '>' . __( 'pending', 'wp-photo-album-plus' ) . '</option>
443
- <option value="approved" ' . ( $comment_show == 'approved' ? 'selected="selected"' : '' ) . '>' . __( 'approved', 'wp-photo-album-plus' ) . '</option>
444
- <option value="spam" ' . ( $comment_show == 'spam' ? 'selected="selected"' : '' ) . '>' . __( 'spam', 'wp-photo-album-plus' ) . '</option>
445
- </select>
446
- </p>';
447
- */
448
  }
449
 
450
  echo
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all comments
6
+ * Version 8.1.00.005
7
  *
8
  */
9
 
34
  function extra_tablenav( $which ) {
35
 
36
  if ( 'top' === $which ) {
37
+ $comment_show = wppa_get_cookie( 'comadmin-show', 'all' );
38
  echo
39
  '<div class="alignleft actions">' .
40
  '<select id="wppa_comadmin_show" name="wppa_comadmin_show" onchange="" >
118
  '<textarea' .
119
  ' id="commenttext-' . $item['id'] . '"' .
120
  ' style="width:98%;"' .
121
+ ' onchange="wppaCommentAdminUpdateHref(\'' . $item['id'] . '\')"' .
122
  ' >' .
123
  stripslashes( $item['comment'] ) .
124
  '</textarea>' .
294
 
295
  // Normal use
296
  else {
297
+ switch( wppa_get_cookie( 'comadmin-show' ) ) {
298
+ case 'all':
299
+ break;
300
+ case 'spam':
301
+ $filter = "WHERE status = 'spam'";
302
+ break;
303
+ case 'pending':
304
+ $filter = "WHERE status = 'pending' OR status = ''";
305
+ break;
306
+ case 'approved':
307
+ $filter = "WHERE status = 'approved'";
308
+ break;
309
+ default:
310
+ break;
 
 
311
  }
312
  }
313
 
353
  // Open page
354
  echo
355
  '<div class="wrap">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  <h1>' .
357
  ( $moderating ? __( 'Photo Albums -> Moderate Comment', 'wp-photo-album-plus' ) :
358
  __( 'Photo Albums -> Comment admin', 'wp-photo-album-plus' ) ) .
406
  echo
407
  '</tbody>
408
  </table>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  }
410
 
411
  echo
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 8.0.09.001
6
  *
7
  */
8
 
@@ -113,7 +113,7 @@ global $wppa_current_shortcode_atts;
113
  $ajax = false;
114
  if ( $first_pla ) {
115
  $first_pla = false;
116
- $mocc = isset( $_REQUEST['page'] ) ? $_REQUEST['page'] : '4711'; // ; wppa_get( 'page', '4711', 'int' ); // Kind of random
117
  }
118
  }
119
 
@@ -329,7 +329,7 @@ global $wppa_randseed_modified;
329
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
330
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
331
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
332
- if ( wppa_get( 'page' ) ) $renew = false; // A subsequent wppa page needs the same sequence
333
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
334
 
335
  // Still renew if the current wp page differs from the last
@@ -982,7 +982,7 @@ function wppa_get_minisize() {
982
  }
983
 
984
 
985
- function wppa_test_for_search( $at_session_start = false ) {
986
  global $wppa;
987
  global $wppa_session;
988
 
@@ -1028,7 +1028,7 @@ global $wppa_session;
1028
  while ( strpos ( $str, ' ,' ) !== false ) $str = str_replace ( ' ,', ',', $str ); // trim commas
1029
 
1030
  // Did we do wppa_initialize_runtime() ?
1031
- if ( is_array( $wppa ) && ! $at_session_start ) {
1032
  $wppa['searchstring'] = $str;
1033
  if ( $wppa['searchstring'] && $wppa['mocc'] == wppa_opt( 'search_oc' ) && ! wppa_in_widget() ) $wppa['src'] = true;
1034
  else $wppa['src'] = false;
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 8.1.00.008
6
  *
7
  */
8
 
113
  $ajax = false;
114
  if ( $first_pla ) {
115
  $first_pla = false;
116
+ $mocc = wppa_get( 'page', '4711', 'int' ); // Kind of random
117
  }
118
  }
119
 
329
  if ( $wppa_randseed_modified ) $renew = false; // Already renewed this pageload
330
  if ( wppa( 'ajax' ) ) $renew = false; // Not during ajax call
331
  if ( strpos( $_SERVER['REQUEST_URI'], 'wp-content' ) !== false ) $renew = false; // Url to a content item needs no renew
332
+ if ( wppa_get( 'wppa-page', '0' ) ) $renew = false; // A subsequent wppa page needs the same sequence
333
  if ( isset( $wppa_session['randseedtime'] ) && $wppa_session['randseedtime'] > ( time() - 10 ) ) $renew = false; // Not within 10 seconds
334
 
335
  // Still renew if the current wp page differs from the last
982
  }
983
 
984
 
985
+ function wppa_test_for_search( $at_begin_session = false ) {
986
  global $wppa;
987
  global $wppa_session;
988
 
1028
  while ( strpos ( $str, ' ,' ) !== false ) $str = str_replace ( ' ,', ',', $str ); // trim commas
1029
 
1030
  // Did we do wppa_initialize_runtime() ?
1031
+ if ( is_array( $wppa ) && ! $at_begin_session ) {
1032
  $wppa['searchstring'] = $str;
1033
  if ( $wppa['searchstring'] && $wppa['mocc'] == wppa_opt( 'search_oc' ) && ! wppa_in_widget() ) $wppa['src'] = true;
1034
  else $wppa['src'] = false;
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 8.0.08.005
7
  *
8
  *
9
  */
@@ -157,8 +157,6 @@ global $wppa_endtime;
157
  return;
158
  }
159
 
160
- ob_start();
161
-
162
  wppa_log( 'Cron', '{b}wppa_cleanup{/b} started.' );
163
 
164
  // Fix invalid ratings
@@ -363,10 +361,6 @@ global $wppa_endtime;
363
 
364
  wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
365
 
366
- $outbuf = ob_get_clean();
367
- if ( $outbuf ) {
368
- wppa_log( 'dbg', 'Cron unexpected output: ' . $outbuf );
369
- }
370
  }
371
 
372
  // Activate treecount update proc
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 8.1.00.008
7
  *
8
  *
9
  */
157
  return;
158
  }
159
 
 
 
160
  wppa_log( 'Cron', '{b}wppa_cleanup{/b} started.' );
161
 
162
  // Fix invalid ratings
361
 
362
  wppa_log( 'Cron', '{b}wppa_cleanup{/b} completed.' );
363
 
 
 
 
 
364
  }
365
 
366
  // Activate treecount update proc
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 7.7.05.002
7
  *
8
  */
9
 
@@ -153,7 +153,7 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
153
  $sel = $val_days[$key] == $cur_day ? 'selected="selected"' : '';
154
  $result .= '<option value="'.$val_days[$key].'" '.$sel.' >'.$opt_days[$key].'</option>';
155
  }
156
- $result .= '</select >';
157
 
158
  // Month
159
  if ( $type == 'Photo' ) {
@@ -173,7 +173,7 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
173
  $sel = $val_months[$key] == $cur_month ? 'selected="selected"' : '';
174
  $result .= '<option value="'.$val_months[$key].'" '.$sel.' >'.$opt_months[$key].'</option>';
175
  }
176
- $result .= '</select >';
177
 
178
  // Year
179
  if ( $type == 'Photo' ) {
@@ -193,7 +193,7 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
193
  $sel = $val_years[$key] == $cur_year ? 'selected="selected"' : '';
194
  $result .= '<option value="'.$val_years[$key].'" '.$sel.' >'.$opt_years[$key].'</option>';
195
  }
196
- $result .= '</select >';
197
  $result .= '<span class="'.$class.'" >@</span>';
198
 
199
  // Hour
@@ -214,7 +214,7 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
214
  $sel = $val_hours[$key] == $cur_hour ? 'selected="selected"' : '';
215
  $result .= '<option value="'.$val_hours[$key].'" '.$sel.' >'.$opt_hours[$key].'</option>';
216
  }
217
- $result .= '</select >';
218
  $result .= '<span class="'.$class.'" >:</span>';
219
 
220
  // Min
@@ -235,7 +235,7 @@ function wppa_get_date_time_select_html( $type, $id, $selectable = true ) {
235
  $sel = $val_mins[$key] == $cur_min ? 'selected="selected"' : '';
236
  $result .= '<option value="'.$val_mins[$key].'" '.$sel.' >'.$opt_mins[$key].'</option>';
237
  }
238
- $result .= '</select >';
239
 
240
  }
241
  else {
@@ -261,32 +261,7 @@ function wppa_local_date( $format, $timestamp = false ) {
261
  $time = time();
262
  }
263
 
264
- // wp >= 5.3 ?
265
- if ( function_exists( 'wp_date' ) ) {
266
- return wp_date( $format, $time );
267
- }
268
-
269
- // Find timezonestring
270
- $tzstring = wppa_get_option( 'timezone_string' );
271
- if ( empty( $tzstring ) ) {
272
-
273
- // Correct $time according to gmt_offset
274
- $current_offset = wppa_get_option( 'gmt_offset', 0 );
275
-
276
- $tzstring = 'UTC';
277
-
278
- if ( is_numeric( $current_offset ) ) {
279
- $time += $current_offset * 3600;
280
- }
281
- }
282
-
283
- // Get the right output
284
- date_default_timezone_set( $tzstring );
285
- $result = date_i18n( $format, $time );
286
-
287
- // Reset default timezone to wp standard
288
- date_default_timezone_set( 'GMT' );
289
- return $result;
290
  }
291
 
292
  // Return unix timestamp computed from readable date/time, corrected for timezone.
@@ -298,18 +273,10 @@ function wppa_local_strtotime( $str ) {
298
  // Find timezonestring
299
  $tzstring = wppa_get_option( 'timezone_string' );
300
 
301
- if ( $tzstring ) {
302
- date_default_timezone_set( "UTC" );
303
- $current_offset = timezone_offset_get( timezone_open( $tzstring ), new DateTime() );
304
- }
305
- else {
306
-
307
- // Correct $time according to gmt_offset
308
- $current_offset = wppa_get_option( 'gmt_offset', 0 ) * 3600;
309
- }
310
-
311
  $result -= $current_offset;
312
- date_default_timezone_set( 'GMT' );
313
  return $result;
314
  }
315
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
153
  $sel = $val_days[$key] == $cur_day ? 'selected="selected"' : '';
154
  $result .= '<option value="'.$val_days[$key].'" '.$sel.' >'.$opt_days[$key].'</option>';
155
  }
156
+ $result .= '</select>';
157
 
158
  // Month
159
  if ( $type == 'Photo' ) {
173
  $sel = $val_months[$key] == $cur_month ? 'selected="selected"' : '';
174
  $result .= '<option value="'.$val_months[$key].'" '.$sel.' >'.$opt_months[$key].'</option>';
175
  }
176
+ $result .= '</select>';
177
 
178
  // Year
179
  if ( $type == 'Photo' ) {
193
  $sel = $val_years[$key] == $cur_year ? 'selected="selected"' : '';
194
  $result .= '<option value="'.$val_years[$key].'" '.$sel.' >'.$opt_years[$key].'</option>';
195
  }
196
+ $result .= '</select>';
197
  $result .= '<span class="'.$class.'" >@</span>';
198
 
199
  // Hour
214
  $sel = $val_hours[$key] == $cur_hour ? 'selected="selected"' : '';
215
  $result .= '<option value="'.$val_hours[$key].'" '.$sel.' >'.$opt_hours[$key].'</option>';
216
  }
217
+ $result .= '</select>';
218
  $result .= '<span class="'.$class.'" >:</span>';
219
 
220
  // Min
235
  $sel = $val_mins[$key] == $cur_min ? 'selected="selected"' : '';
236
  $result .= '<option value="'.$val_mins[$key].'" '.$sel.' >'.$opt_mins[$key].'</option>';
237
  }
238
+ $result .= '</select>';
239
 
240
  }
241
  else {
261
  $time = time();
262
  }
263
 
264
+ return wp_date( $format, $time );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
  }
266
 
267
  // Return unix timestamp computed from readable date/time, corrected for timezone.
273
  // Find timezonestring
274
  $tzstring = wppa_get_option( 'timezone_string' );
275
 
276
+ // Correct $time according to gmt_offset
277
+ $current_offset = wppa_get_option( 'gmt_offset', 0 ) * 3600;
 
 
 
 
 
 
 
 
278
  $result -= $current_offset;
279
+
280
  return $result;
281
  }
282
 
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 8.0.10.004
7
  *
8
  */
9
 
@@ -238,11 +238,12 @@ horizrailenabled:false,";
238
  'wppa_share_qr' => 'no',
239
  'wppa_share_facebook' => 'yes',
240
  'wppa_share_twitter' => 'yes',
 
241
  'wppa_twitter_account' => '',
242
- 'wppa_share_google' => 'yes',
243
  'wppa_share_pinterest' => 'yes',
 
244
  'wppa_share_linkedin' => 'yes',
245
-
246
  'wppa_facebook_comments' => 'yes',
247
  'wppa_facebook_like' => 'yes',
248
  'wppa_fb_display' => 'standard',
@@ -482,14 +483,14 @@ horizrailenabled:false,";
482
  'wppa_auto_page' => 'no',
483
  'wppa_auto_page_type' => 'photo',
484
  'wppa_auto_page_links' => 'bottom',
485
- 'wppa_defer_javascript' => 'yes',
486
- 'wppa_custom_style' => '',
487
- 'wppa_custom_style_chrome' => '',
488
- 'wppa_custom_style_firefox' => '',
489
- 'wppa_custom_style_safari' => '',
490
- 'wppa_custom_style_edge' => '',
491
- 'wppa_custom_style_ie' => '',
492
- 'wppa_custom_style_opera' => '',
493
  'wppa_use_custom_style_file' => 'no',
494
  'wppa_enable_pdf' => 'yes', // IV-A30
495
  'wppa_use_custom_theme_file' => 'no',
@@ -611,7 +612,6 @@ horizrailenabled:false,";
611
  'wppa_comten_alt_thumbsize' => '75',
612
  'wppa_comment_smiley_picker' => 'no',
613
  'wppa_comment_clickable' => 'no',
614
- 'wppa_comment_need_db_agree' => 'no',
615
  'wppa_comment_need_vote' => 'no',
616
 
617
  // G Overlay
@@ -948,7 +948,6 @@ horizrailenabled:false,";
948
  'wppa_allow_foreign_shortcodes_thumbs' => 'no',
949
  'wppa_meta_page' => 'yes', // 9
950
  'wppa_meta_all' => 'yes', // 10
951
- 'wppa_use_wp_editor' => 'no',
952
  'wppa_alt_type' => 'fullname',
953
  'wppa_album_admin_pagesize' => '100',
954
  'wppa_photo_admin_pagesize' => '20',
@@ -1151,11 +1150,10 @@ horizrailenabled:false,";
1151
  'wppa_gpx_shortcode' => '[map style="width: auto; height:300px; margin:0; " marker="yes" lat="w#lat" lon="w#lon"]',
1152
  'wppa_geo_zoom' => '10',
1153
  'wppa_fotomoto_on' => 'no',
1154
- 'wppa_fotomoto_fontsize' => '',
1155
  'wppa_fotomoto_hide_when_running' => 'no',
1156
  'wppa_fotomoto_min_width' => '400',
1157
  'wppa_image_magick' => '',
1158
- 'wppa_image_magick_ratio' => 'free',
1159
 
1160
  // L photo shortcode
1161
  'wppa_photo_shortcode_enabled' => 'yes',
@@ -1226,6 +1224,8 @@ horizrailenabled:false,";
1226
 
1227
  'wppa_heartbeat' => '0',
1228
 
 
 
1229
  );
1230
 
1231
  if ( $force ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
238
  'wppa_share_qr' => 'no',
239
  'wppa_share_facebook' => 'yes',
240
  'wppa_share_twitter' => 'yes',
241
+ 'wppa_twitter_black' => 'no',
242
  'wppa_twitter_account' => '',
 
243
  'wppa_share_pinterest' => 'yes',
244
+ 'wppa_pinterest_black' => 'no',
245
  'wppa_share_linkedin' => 'yes',
246
+ 'wppa_linkedin_black' => 'no',
247
  'wppa_facebook_comments' => 'yes',
248
  'wppa_facebook_like' => 'yes',
249
  'wppa_fb_display' => 'standard',
483
  'wppa_auto_page' => 'no',
484
  'wppa_auto_page_type' => 'photo',
485
  'wppa_auto_page_links' => 'bottom',
486
+ // 'wppa_defer_javascript' => 'yes',
487
+ // 'wppa_custom_style' => '',
488
+ // 'wppa_custom_style_chrome' => '',
489
+ // 'wppa_custom_style_firefox' => '',
490
+ // 'wppa_custom_style_safari' => '',
491
+ // 'wppa_custom_style_edge' => '',
492
+ // 'wppa_custom_style_ie' => '',
493
+ // 'wppa_custom_style_opera' => '',
494
  'wppa_use_custom_style_file' => 'no',
495
  'wppa_enable_pdf' => 'yes', // IV-A30
496
  'wppa_use_custom_theme_file' => 'no',
612
  'wppa_comten_alt_thumbsize' => '75',
613
  'wppa_comment_smiley_picker' => 'no',
614
  'wppa_comment_clickable' => 'no',
 
615
  'wppa_comment_need_vote' => 'no',
616
 
617
  // G Overlay
948
  'wppa_allow_foreign_shortcodes_thumbs' => 'no',
949
  'wppa_meta_page' => 'yes', // 9
950
  'wppa_meta_all' => 'yes', // 10
 
951
  'wppa_alt_type' => 'fullname',
952
  'wppa_album_admin_pagesize' => '100',
953
  'wppa_photo_admin_pagesize' => '20',
1150
  'wppa_gpx_shortcode' => '[map style="width: auto; height:300px; margin:0; " marker="yes" lat="w#lat" lon="w#lon"]',
1151
  'wppa_geo_zoom' => '10',
1152
  'wppa_fotomoto_on' => 'no',
 
1153
  'wppa_fotomoto_hide_when_running' => 'no',
1154
  'wppa_fotomoto_min_width' => '400',
1155
  'wppa_image_magick' => '',
1156
+ 'wppa_image_magick_ratio' => 'NaN',
1157
 
1158
  // L photo shortcode
1159
  'wppa_photo_shortcode_enabled' => 'yes',
1224
 
1225
  'wppa_heartbeat' => '0',
1226
 
1227
+ 'wppa_use_wp_upload_dir_locations' => 'no',
1228
+
1229
  );
1230
 
1231
  if ( $force ) {
wppa-encrypt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
- * Version 8.0.07.009
7
  *
8
  */
9
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
+ * Version 8.1.00.001
7
  *
8
  */
9
 
wppa-export.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
- * Version 7.3.00
7
  *
8
  */
9
 
@@ -13,7 +13,7 @@ global $wpdb;
13
  // Export Photos admin page
14
 
15
  // Do the export if requested
16
- if (isset($_POST['wppa-export-submit'])) {
17
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
18
  wppa_export_photos();
19
  } ?>
@@ -99,13 +99,13 @@ global $wppa_temp_idx;
99
  if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus'));
100
  }
101
 
102
- if (isset($_POST['high'])) $high = $_POST['high']; else $high = 0;
103
 
104
  if ( $high ) {
105
  $id = 0;
106
  $cnt = 0;
107
  while ( $id <= $high ) {
108
- if (isset($_POST['album-'.$id])) {
109
  _e('<br/>Processing album', 'wp-photo-album-plus'); echo(' '.$id.'....');
110
  wppa_write_album_file_by_id($id);
111
  $photos = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the export functions
6
+ * Version 8.1.00.001
7
  *
8
  */
9
 
13
  // Export Photos admin page
14
 
15
  // Do the export if requested
16
+ if ( wppa_get( 'export-submit' ) ) {
17
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
18
  wppa_export_photos();
19
  } ?>
99
  if ( ! class_exists('ZipArchive') ) wppa_warning_message(__('Can export albums and photos, but cannot make a zipfile. Your php version does not support ZipArchive.', 'wp-photo-album-plus'));
100
  }
101
 
102
+ $high = wppa_get( 'high', '0' );
103
 
104
  if ( $high ) {
105
  $id = 0;
106
  $cnt = 0;
107
  while ( $id <= $high ) {
108
+ if ( wppa_get( 'album-' . $id, '0', 'text' ) ) {
109
  _e('<br/>Processing album', 'wp-photo-album-plus'); echo(' '.$id.'....');
110
  wppa_write_album_file_by_id($id);
111
  $photos = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 8.0.09.001
7
  *
8
  */
9
 
@@ -101,14 +101,10 @@ global $wppa_current_shortcode_atts;
101
  ( $nices ? '</div>': '' ) .
102
  '</div>';
103
 
104
- if ( $nices ) {
105
- $result .= '
106
- <script>
107
- jQuery(document).ready(function(){
108
- jQuery("#wppa-div-' . $seqno . '").niceScroll(".wppa-divnicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' .
109
- '});
110
- </script>';
111
- }
112
 
113
  return $result;
114
  }
@@ -297,7 +293,7 @@ global $other_deps;
297
  $unam = '';
298
  }
299
  $atts['album'] = '#tags,' . $unam;
300
- }
301
 
302
  // Displatch on type
303
  switch ( $type ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.1.00.004
7
  *
8
  */
9
 
101
  ( $nices ? '</div>': '' ) .
102
  '</div>';
103
 
104
+ if ( $nices ) {
105
+ $the_js = 'jQuery(document).ready(function(){jQuery("#wppa-div-' . $seqno . '").niceScroll(".wppa-divnicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});' . '});';
106
+ wp_add_inline_script( 'wppa', $the_js );
107
+ }
 
 
 
 
108
 
109
  return $result;
110
  }
293
  $unam = '';
294
  }
295
  $atts['album'] = '#tags,' . $unam;
296
+ }
297
 
298
  // Displatch on type
299
  switch ( $type ) {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.0.10.002
7
  *
8
  */
9
 
@@ -136,7 +136,7 @@ global $other_deps;
136
 
137
  if ( wppa( 'is_tag' ) ) wppa_dbg_msg( 'Is Tag: ' . wppa( 'is_tag' ) );
138
  else wppa_dbg_msg( 'Is NOT Tag' );
139
- wppa( 'page', wppa_get( 'page' ) );
140
 
141
  if ( wppa_get( 'superview' ) ) {
142
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
@@ -2516,6 +2516,8 @@ static $unique_ids;
2516
  // Filename
2517
  if ( wppa_looks_equal( $it1['filename'], $it2['filename'] ) && $it1['filename'] ) $score++; // equal and not empty
2518
 
 
 
2519
  // Equal source filesize?
2520
  $s1 = wppa_get_source_path( $it1['id'] );
2521
  $s2 = wppa_get_source_path( $it2['id'] );
@@ -3175,7 +3177,6 @@ global $wppa_done;
3175
 
3176
  // Editing a comment?
3177
  $cedit = wppa_get( 'comment-edit', '0' );
3178
- if ( ! wppa_is_int( $cedit ) ) wp_die( 'Security check failure 14' );
3179
 
3180
  // Check captcha
3181
  $wrong_captcha = false;
@@ -3823,7 +3824,7 @@ function wppa_get_curpage() {
3823
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3824
 
3825
  // page may be in qstring
3826
- $curpage = wppa_get( 'page', '1', 'int' );
3827
  }
3828
  else {
3829
 
@@ -3933,7 +3934,7 @@ global $blog_id;
3933
  }
3934
  }
3935
 
3936
- wppa_out( wppa_nonce_field( 'wppa-check', 'wppa-nonce', false, false ) );
3937
 
3938
  if ( wppa_page( 'oneofone' ) ) wppa( 'portrait_only', true );
3939
 
@@ -5101,7 +5102,7 @@ global $wppa_upload_succes_id;
5101
  if ( $done ) {
5102
 
5103
  // SUCCESSFUL UPLOAD, Blog It?
5104
- if ( current_user_can( 'edit_posts' ) && isset( $_POST['wppa-blogit'] ) ) {
5105
 
5106
  $title = wppa_get( 'post-title' );
5107
  if ( ! $title ) {
@@ -5241,8 +5242,9 @@ global $wppa_upload_succes_id;
5241
 
5242
  $idx = '0';
5243
  while ( $idx < '10' ) {
5244
- if ( isset( $_POST['custom_' . $idx] ) ) {
5245
- $value = wppa_get( 'custom_' . $idx );
 
5246
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5247
  }
5248
  $idx++;
@@ -5338,7 +5340,7 @@ global $wppa_alert;
5338
  // Add new entry
5339
  if ( ! $id ) {
5340
 
5341
- $desc = isset( $_POST['user-desc'] ) ? balanceTags( wppa_get( 'user-desc' ), true ) : '';
5342
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5343
  $desc = wppa_opt( 'newphoto_description' );
5344
  }
@@ -5464,7 +5466,7 @@ global $wppa_alert;
5464
  $desc = balanceTags( wppa_get( 'user-desc' ), true );
5465
 
5466
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5467
- if ( ! $desc && isset( $_POST['wppa-blogit'] ) ) {
5468
  $desc = 'w#name';
5469
  }
5470
 
@@ -5555,8 +5557,9 @@ function wppa_fe_add_tags( $id ) {
5555
  $tags = wppa_get_photo_item( $id, 'tags' );
5556
  $oldt = $tags;
5557
  for ( $i = '1'; $i < '4'; $i++ ) {
5558
- if ( isset( $_POST['wppa-user-tags-'.$i] ) ) { // Existing tags
5559
- $tags .= ','.implode( ',', $_POST['wppa-user-tags-'.$i] );
 
5560
  }
5561
  }
5562
  if ( wppa_get( 'new-tags' ) ) { // New tags
@@ -5582,8 +5585,9 @@ function wppa_fe_add_custom( $id ) {
5582
  if ( wppa_switch( 'fe_custom_fields' ) ) {
5583
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
5584
  for ( $i = '0'; $i < '10' ; $i++ ) {
5585
- if ( isset( $_POST['wppa-user-custom-'.$i] ) ) {
5586
- $custom_data[$i] = strip_tags( $_POST['wppa-user-custom-'.$i] );
 
5587
  }
5588
  }
5589
  wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
136
 
137
  if ( wppa( 'is_tag' ) ) wppa_dbg_msg( 'Is Tag: ' . wppa( 'is_tag' ) );
138
  else wppa_dbg_msg( 'Is NOT Tag' );
139
+ wppa( 'page', wppa_get( 'wppa-page', '1' ) );
140
 
141
  if ( wppa_get( 'superview' ) ) {
142
  $wppa_session['superview'] = wppa( 'is_slide' ) ? 'slide': 'thumbs';
2516
  // Filename
2517
  if ( wppa_looks_equal( $it1['filename'], $it2['filename'] ) && $it1['filename'] ) $score++; // equal and not empty
2518
 
2519
+ if ( $score == 3 ) return true;
2520
+
2521
  // Equal source filesize?
2522
  $s1 = wppa_get_source_path( $it1['id'] );
2523
  $s2 = wppa_get_source_path( $it2['id'] );
3177
 
3178
  // Editing a comment?
3179
  $cedit = wppa_get( 'comment-edit', '0' );
 
3180
 
3181
  // Check captcha
3182
  $wrong_captcha = false;
3824
  if ( wppa( 'mocc' ) == wppa_get( 'occur', '1' ) ) {
3825
 
3826
  // page may be in qstring
3827
+ $curpage = wppa_get( 'page', '1' );
3828
  }
3829
  else {
3830
 
3934
  }
3935
  }
3936
 
3937
+ wppa_out( wppa_nonce_field( 'wppa-check', 'wppa-nonce', false ) );
3938
 
3939
  if ( wppa_page( 'oneofone' ) ) wppa( 'portrait_only', true );
3940
 
5102
  if ( $done ) {
5103
 
5104
  // SUCCESSFUL UPLOAD, Blog It?
5105
+ if ( current_user_can( 'edit_posts' ) && wppa_get( 'blogit' ) ) {
5106
 
5107
  $title = wppa_get( 'post-title' );
5108
  if ( ! $title ) {
5242
 
5243
  $idx = '0';
5244
  while ( $idx < '10' ) {
5245
+ $value = wppa_get( 'custom_' . $idx, '', 'html' );
5246
+ if ( $value ) {
5247
+
5248
  $custom_data[$idx] = wppa_sanitize_custom_field( $value );
5249
  }
5250
  $idx++;
5340
  // Add new entry
5341
  if ( ! $id ) {
5342
 
5343
+ $desc = wppa_get( 'user-desc', '', 'html' );
5344
  if ( ! $desc && wppa_switch( 'apply_newphoto_desc_user' ) ) {
5345
  $desc = wppa_opt( 'newphoto_description' );
5346
  }
5466
  $desc = balanceTags( wppa_get( 'user-desc' ), true );
5467
 
5468
  // If BlogIt! and no descrption given, use name field - this is for the shortcode used: typ"mphoto"
5469
+ if ( ! $desc && wppa_get( 'blogit' ) ) {
5470
  $desc = 'w#name';
5471
  }
5472
 
5557
  $tags = wppa_get_photo_item( $id, 'tags' );
5558
  $oldt = $tags;
5559
  for ( $i = '1'; $i < '4'; $i++ ) {
5560
+ $dt = wppa_get( 'user-tags-' . $i, null, 'arraytxt' );
5561
+ if ( $dt ) { // A (multi) selection out of 4 selectionboxes of existing tags
5562
+ $tags .= ',' . implode( ',', $dt );
5563
  }
5564
  }
5565
  if ( wppa_get( 'new-tags' ) ) { // New tags
5585
  if ( wppa_switch( 'fe_custom_fields' ) ) {
5586
  $custom_data = array( '', '', '', '', '', '', '', '', '', '' );
5587
  for ( $i = '0'; $i < '10' ; $i++ ) {
5588
+ $cd = wppa_get( 'wppa-user-custom-' . $i, '', 'html' );
5589
+ if ( $cd ) {
5590
+ $custom_data[$i] = strip_tags( $cd );
5591
  }
5592
  }
5593
  wppa_update_photo( array( 'id' => $id, 'custom' => serialize( $custom_data ) ) );
wppa-gutenberg-photo.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-photo.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.0.02.006
6
  */
7
 
8
  function wppa_gutenberg_photo_block() {
@@ -119,7 +119,7 @@ global $wpdb;
119
  ' method="post"' .
120
  ' enctype="multipart/form-data"' .
121
  ' >' .
122
- wppa_nonce_field( 'wppa-check' , 'wppa-nonce', false, false ) .
123
 
124
  // Single album
125
  ( ( count( $albums ) == 1 ) ?
2
  /* wppa-gutenberg-photo.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.008
6
  */
7
 
8
  function wppa_gutenberg_photo_block() {
119
  ' method="post"' .
120
  ' enctype="multipart/form-data"' .
121
  ' >' .
122
+ wppa_nonce_field( 'wppa-check' , 'wppa-nonce', false ) .
123
 
124
  // Single album
125
  ( ( count( $albums ) == 1 ) ?
wppa-gutenberg-wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.0.02.006
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
@@ -201,16 +201,16 @@ global $wpdb;
201
  '<td>'.
202
  '<select id="wppagallery-album-virt" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
203
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
204
- '<option value="#last" >'.__('The most recently added album', 'wp-photo-album-plus').'</option>'.
205
- '<option value="#topten" >'.__('The top rated photos', 'wp-photo-album-plus').'</option>'.
206
- '<option value="#lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
207
- '<option value="#featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
208
- '<option value="#comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
209
- '<option value="#tags" >'.__('Photos tagged with certain tags', 'wp-photo-album-plus').'</option>'.
210
- '<option value="#cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
211
- '<option value="#owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
212
- '<option value="#upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
213
- '<option value="#all" >'.__('All photos in the system', 'wp-photo-album-plus').'</option>'.
214
  '</select>'.
215
  '</td>'.
216
  '</tr>'.
@@ -221,10 +221,10 @@ global $wpdb;
221
  '<td>'.
222
  '<select id="wppagallery-album-virt-cover" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
223
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
224
- '<option value="#last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
225
- '<option value="#owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
226
- '<option value="#cat" >'.__('Albums tagged with certain categories', 'wp-photo-album-plus').'</option>'.
227
- '<option value="#all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
228
  '</select>'.
229
  '</td>'.
230
  '</tr>'.
2
  /* wppa-gutenberg-wppa.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.007
6
  */
7
 
8
  function wppa_gutenberg_wppa_block() {
201
  '<td>'.
202
  '<select id="wppagallery-album-virt" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
203
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
204
+ '<option value="@last" >'.__('The most recently added album', 'wp-photo-album-plus').'</option>'.
205
+ '<option value="@topten" >'.__('The top rated photos', 'wp-photo-album-plus').'</option>'.
206
+ '<option value="@lasten" >'.__('The most recently uploaded photos', 'wp-photo-album-plus').'</option>'.
207
+ '<option value="@featen" >'.__('A random selection of featured photos', 'wp-photo-album-plus').'</option>'.
208
+ '<option value="@comten" >'.__('The most recently commented photos', 'wp-photo-album-plus').'</option>'.
209
+ '<option value="@tags" >'.__('Photos tagged with certain tags', 'wp-photo-album-plus').'</option>'.
210
+ '<option value="@cat" >'.__('Albums tagged with a certain category', 'wp-photo-album-plus').'</option>'.
211
+ '<option value="@owner" >'.__('Photos in albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
212
+ '<option value="@upldr" >'.__('Photos uploaded by a certain user', 'wp-photo-album-plus').'</option>'.
213
+ '<option value="@all" >'.__('All photos in the system', 'wp-photo-album-plus').'</option>'.
214
  '</select>'.
215
  '</td>'.
216
  '</tr>'.
221
  '<td>'.
222
  '<select id="wppagallery-album-virt-cover" name="album" class="wppagallery-album" onchange="wppaGutenbergGalleryEvaluate()">'.
223
  '<option value="" disabled="disabled" selected="selected" style="color:#700 !important;" >-- '.__('Please select a virtual album', 'wp-photo-album-plus').' --</option>'.
224
+ '<option value="@last" >'.__('The most recently modified album', 'wp-photo-album-plus').'</option>'.
225
+ '<option value="@owner" >'.__('Albums owned by a certain user', 'wp-photo-album-plus').'</option>'.
226
+ '<option value="@cat" >'.__('Albums tagged with certain categories', 'wp-photo-album-plus').'</option>'.
227
+ '<option value="@all" >'.__('All albums in the system', 'wp-photo-album-plus').'</option>'.
228
  '</select>'.
229
  '</td>'.
230
  '</tr>'.
wppa-import.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
- * Version 8.0.08.001
7
  *
8
  */
9
 
@@ -19,8 +19,6 @@ global $wppa_supported_audio_extensions;
19
  global $wppa_supported_document_extensions;
20
  global $wppa_session;
21
 
22
- if ( wppa( 'ajax' ) ) ob_start(); // Suppress output if ajax operation
23
-
24
  // Init
25
  $ngg_opts = wppa_get_option( 'ngg_options', false );
26
  $user = wppa_get_user();
@@ -164,7 +162,7 @@ global $wppa_session;
164
 
165
  // If we did this by ajax, setup reporting results for it
166
  if ( wppa( 'ajax' ) ) {
167
- ob_end_clean();
168
  if ( wppa( 'ajax_import_files_done' ) ) {
169
  echo '<span style="color:green" >' . wppa( 'ajax_import_files' ) . ' ' . __( 'Done!', 'wp-photo-album-plus' ) . '</span>';
170
  }
@@ -191,12 +189,7 @@ global $wppa_session;
191
  'wp-photo-album-plus' ), WPPA_DEPOT_PATH ) );
192
  }
193
 
194
- // See if remote is possible
195
- $can_remote = ini_get( 'allow_url_fopen' ) && function_exists( 'curl_init' );
196
- if ( ! $can_remote ) {
197
- update_option( 'wppa_import_source_type_'.$user, 'local' );
198
- }
199
-
200
  // Get this users current source type setting ( local/remote )
201
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
202
 
@@ -1727,14 +1720,12 @@ global $wppa_session;
1727
  $files = array();
1728
 
1729
  // Get page content
1730
- $curl = curl_init();
1731
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
1732
- curl_setopt( $curl, CURLOPT_URL, $setting );
1733
- $contents = curl_exec( $curl );
1734
- curl_close( $curl );
1735
 
1736
  // Process result
1737
- if ( $contents ) {
1738
 
1739
  // Preprocess
1740
  $contents = str_replace( '\'', '"', $contents );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the import pages and functions
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
19
  global $wppa_supported_document_extensions;
20
  global $wppa_session;
21
 
 
 
22
  // Init
23
  $ngg_opts = wppa_get_option( 'ngg_options', false );
24
  $user = wppa_get_user();
162
 
163
  // If we did this by ajax, setup reporting results for it
164
  if ( wppa( 'ajax' ) ) {
165
+
166
  if ( wppa( 'ajax_import_files_done' ) ) {
167
  echo '<span style="color:green" >' . wppa( 'ajax_import_files' ) . ' ' . __( 'Done!', 'wp-photo-album-plus' ) . '</span>';
168
  }
189
  'wp-photo-album-plus' ), WPPA_DEPOT_PATH ) );
190
  }
191
 
192
+ $can_remote = true;
 
 
 
 
 
193
  // Get this users current source type setting ( local/remote )
194
  $source_type = wppa_get_option( 'wppa_import_source_type_'.$user, 'local' );
195
 
1720
  $files = array();
1721
 
1722
  // Get page content
1723
+ $response = wp_remote_get( $setting );
1724
+ $contents = wp_remote_retrieve_body( $response );
1725
+ $httpcode = wp_remote_retrieve_response_code( $response );
 
 
1726
 
1727
  // Process result
1728
+ if ( $httpcode == 200 ) {
1729
 
1730
  // Preprocess
1731
  $contents = str_replace( '\'', '"', $contents );
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 8.0.08.005
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -181,6 +181,19 @@ global $blog_id;
181
  define( 'WPPA_DEPOT_URL', site_url() . '/' . WPPA_DEPOT );
182
  }
183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  else { // Single site or multisite global
185
  define( 'WPPA_UPLOAD', $rel_uploads_path );
186
  if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) {
@@ -266,19 +279,19 @@ function wppa_maintenance_messages() {
266
 
267
  // Check for pending actions
268
  if ( wppa_get_option( 'wppa_remove_empty_albums_status' ) && wppa_get_option( 'wppa_remove_empty_albums_user', wppa_get_user() ) == wppa_get_user() ) {
269
- wppa_warning_message( __( 'Remove empty albums needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '31', '', '', true ) );
270
  }
271
  if ( wppa_get_option( 'wppa_apply_new_photodesc_all_status' ) && wppa_get_option( 'wppa_apply_new_photodesc_all_user', wppa_get_user() ) == wppa_get_user() ) {
272
- wppa_warning_message( __( 'Applying new photo description needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '28', '', '', true ) );
273
  }
274
  if ( wppa_get_option( 'wppa_append_to_photodesc_status' ) && wppa_get_option( 'wppa_append_to_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
275
- wppa_warning_message( __( 'Appending to photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '29', '', '', true ) );
276
  }
277
  if ( wppa_get_option( 'wppa_remove_from_photodesc_status' ) && wppa_get_option( 'wppa_remove_from_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
278
- wppa_warning_message( __( 'Removing from photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '30', '', '', true ) );
279
  }
280
  if ( wppa_get_option( 'wppa_remove_file_extensions_status' ) && wppa_get_option( 'wppa_remove_file_extensions_user', wppa_get_user() ) == wppa_get_user() ) {
281
- wppa_warning_message( __( 'Removing file extensions needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '32', '', '', true ) );
282
  }
283
  if ( wppa_get_option( 'wppa_regen_thumbs_status' ) && wppa_get_option( 'wppa_regen_thumbs_user', wppa_get_user() ) == wppa_get_user() ) {
284
  wppa_warning_message( __( 'Regenerating the Thumbnails needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '4', '', '', true ) );
@@ -306,6 +319,7 @@ global $wpdb;
306
  }
307
  }
308
  }
 
309
  function wppa_tag_message() {
310
  wppa_error_message( __('The tags system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 22</i>' , 'wp-photo-album-plus') );
311
  }
@@ -328,6 +342,7 @@ global $wpdb;
328
  }
329
  }
330
  }
 
331
  function wppa_cat_message() {
332
  wppa_error_message( __('The cats system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 23</i>' , 'wp-photo-album-plus') );
333
  }
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.1.00.008
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
181
  define( 'WPPA_DEPOT_URL', site_url() . '/' . WPPA_DEPOT );
182
  }
183
  }
184
+ // This is for sites where wp_upload_dir() returns valid output and having non standard file locations
185
+ elseif ( get_option( 'wppa_use_wp_upload_dir_locations', 'no' ) == 'yes' ) {
186
+ $user = is_user_logged_in() ? '/' . wppa_get_user() : '';
187
+ $dir = wp_upload_dir();
188
+ $basedir = $dir['basedir'];
189
+ $baseurl = $dir['baseurl'];
190
+ define( 'WPPA_UPLOAD_PATH', $basedir . '/wppa' );
191
+ define( 'WPPA_UPLOAD_URL', $baseurl . '/wppa' );
192
+ define( 'WPPA_UPLOAD', str_replace( ABSPATH, '', $basedir ) );
193
+ define( 'WPPA_DEPOT_PATH', dirname( $basedir ) . '/wppa-depot' . $user );
194
+ define( 'WPPA_DEPOT_URL', dirname( $baseurl ) . '/wppa-depot' . $user );
195
+ define( 'WPPA_DEPOT', str_replace( ABSPATH, '', WPPA_DEPOT_PATH ) );
196
+ }
197
  else { // Single site or multisite global
198
  define( 'WPPA_UPLOAD', $rel_uploads_path );
199
  if ( ! defined( 'WPPA_UPLOAD_PATH' ) ) {
279
 
280
  // Check for pending actions
281
  if ( wppa_get_option( 'wppa_remove_empty_albums_status' ) && wppa_get_option( 'wppa_remove_empty_albums_user', wppa_get_user() ) == wppa_get_user() ) {
282
+ wppa_warning_message( __( 'Remove empty albums needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '9', '', '', true ) );
283
  }
284
  if ( wppa_get_option( 'wppa_apply_new_photodesc_all_status' ) && wppa_get_option( 'wppa_apply_new_photodesc_all_user', wppa_get_user() ) == wppa_get_user() ) {
285
+ wppa_warning_message( __( 'Applying new photo description needs completion.', 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '6', '', '', true ) );
286
  }
287
  if ( wppa_get_option( 'wppa_append_to_photodesc_status' ) && wppa_get_option( 'wppa_append_to_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
288
+ wppa_warning_message( __( 'Appending to photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '7', '', '', true ) );
289
  }
290
  if ( wppa_get_option( 'wppa_remove_from_photodesc_status' ) && wppa_get_option( 'wppa_remove_from_photodesc_user', wppa_get_user() ) == wppa_get_user() ) {
291
+ wppa_warning_message( __( 'Removing from photo description needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '8', '', '', true ) );
292
  }
293
  if ( wppa_get_option( 'wppa_remove_file_extensions_status' ) && wppa_get_option( 'wppa_remove_file_extensions_user', wppa_get_user() ) == wppa_get_user() ) {
294
+ wppa_warning_message( __( 'Removing file extensions needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '2', '10', '', '', true ) );
295
  }
296
  if ( wppa_get_option( 'wppa_regen_thumbs_status' ) && wppa_get_option( 'wppa_regen_thumbs_user', wppa_get_user() ) == wppa_get_user() ) {
297
  wppa_warning_message( __( 'Regenerating the Thumbnails needs completion.' , 'wp-photo-album-plus') . wppa_see_also( 'maintenance', '1', '4', '', '', true ) );
319
  }
320
  }
321
  }
322
+
323
  function wppa_tag_message() {
324
  wppa_error_message( __('The tags system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 22</i>' , 'wp-photo-album-plus') );
325
  }
342
  }
343
  }
344
  }
345
+
346
  function wppa_cat_message() {
347
  wppa_error_message( __('The cats system needs to be converted. Please run <i>Photo Albums -> Settings -> Advanced settings -> Maintenance -> II -> Item 23</i>' , 'wp-photo-album-plus') );
348
  }
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.0.10.005
7
  *
8
  */
9
 
@@ -132,6 +132,10 @@ function wppa_get_get_filter( $name ) {
132
  case 'applynewdesc':
133
  case 'remakealbum':
134
  case 'search-submit':
 
 
 
 
135
  $result = 'bool';
136
  break;
137
 
@@ -216,6 +220,7 @@ function wppa_get_get_filter( $name ) {
216
  case 'delete':
217
  case 'cache':
218
  case 'item':
 
219
  case 'list':
220
  case 'onoff':
221
  case 'albumeditnonce':
@@ -253,7 +258,7 @@ function wppa_get_get_filter( $name ) {
253
  case 'bulk-photo':
254
  $result = 'arraytxt';
255
  break;
256
-
257
  default:
258
  $result = 'raw';
259
  break;
@@ -265,15 +270,35 @@ function wppa_get_get_filter( $name ) {
265
  // Retrieve a get- or post- variable, sanitized and post-processed
266
  function wppa_get( $xname, $default = false, $filter = false ) {
267
  global $wpdb;
 
 
 
 
 
 
268
 
269
- // Save orig xname for debug
270
- $oxname = $xname;
 
 
 
 
 
271
 
272
- // Ajax call?
273
- if ( $xname == 'action' ) {
274
  if ( isset( $_REQUEST['wppa-action'] ) ) {
275
  return sanitize_text_field( $_REQUEST['wppa-action'] );
276
  }
 
 
 
 
 
 
 
 
 
277
  }
278
 
279
  // Normalize $name and $xname
@@ -285,48 +310,49 @@ global $wpdb;
285
  $xname = 'wppa-' . $name;
286
  }
287
 
288
- // Get the value
289
- if ( $name == 'page' ) { // Admin page is not the wppa pageno
290
- if ( isset( $_REQUEST[$xname] ) ) {
291
- $value = $_REQUEST[$xname];
292
- }
293
  }
294
- else {
295
- $value = isset( $_REQUEST[$name] ) ? $_REQUEST[$name] : null;
 
 
 
296
  }
297
- if ( ! isset( $value ) ) $value = isset( $_REQUEST[$xname] ) ? $_REQUEST[$xname] : null;
298
- if ( ! isset( $value ) ) return $default;
299
 
300
  // Get the right filter
301
  if ( ! $filter ) {
302
  $filter = wppa_get_get_filter( $name );
303
  }
304
 
 
305
  // Do the filtering
306
  switch ( $filter ) {
307
 
308
  case 'int':
309
- $result = strval( intval ( $value ) );
310
  break;
311
 
312
  case 'posint':
313
- $result = max( '1', strval( intval ( $value ) ) );
314
  break;
315
 
316
  case 'intarr':
317
- if ( is_array( $value ) ) {
318
- foreach( array_keys( $value ) as $i ) {
319
- $value[$i] = strval( intval( $value[$i] ) );
 
320
  }
321
  }
322
  else {
323
- $value = strval( intval( $value ) );
324
  }
325
  $result = $value;
326
  break;
327
 
328
  case 'bool':
329
- if ( $value !== '0' && $value != 'nil' && $value != 'no' ) {
330
  $result = '1';
331
  }
332
  else {
@@ -335,58 +361,58 @@ global $wpdb;
335
  break;
336
 
337
  case 'src':
338
- $result = wppa_sanitize_searchstring( $value );
339
  break;
340
 
341
  case 'html':
342
- $result = force_balance_tags( $value );
343
  break;
344
 
345
  case 'tag':
346
  case 'tags':
347
  case 'cat':
348
- $result = trim( wppa_sanitize_tags( $value ), ',' );
349
  break;
350
 
351
  case 'custom':
352
- $result = wppa_sanitize_custom_field( $value );
353
  break;
354
 
355
  case 'text':
356
- $result = $value;
357
  break;
358
 
359
  case 'pcrypt':
360
- $result = wppa_decode_photo( trim( $value, '/' ) );
361
  break;
362
 
363
  case 'acrypt':
364
- $result = wppa_decode_album( trim( $value, '/' ) );
365
  break;
366
 
367
  case 'email':
368
- $result = sanitize_email( $value );
369
  break;
370
 
371
  case 'url':
372
- $result = esc_url_raw( $value );
373
  break;
374
-
375
  case 'arraytxt':
376
  $result = array();
377
- foreach ( array_keys( $value ) as $key ) {
378
- $result[$key] = sanitize_text_field( $value[$key] );
379
  }
380
  break;
381
 
382
  case 'raw':
383
- wppa_log( 'obs', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
384
- $result = $value ? '1' : '0';
385
  break;
386
 
387
  default:
388
- wppa_log( 'obs', 'Unknown filter for querystring arg = ' . $name . ', value = ' . var_export( $value, true ) );
389
- $result = $value ? '1' : '0';
390
  break;
391
  }
392
 
@@ -406,5 +432,24 @@ function wppa_sanitize_searchstring( $str ) {
406
  }
407
  $result = implode( ',', $temp );
408
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  return $result;
410
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
132
  case 'applynewdesc':
133
  case 'remakealbum':
134
  case 'search-submit':
135
+ case 'export-submit':
136
+ case 'blogit':
137
+ case 'cron':
138
+ case 'seq':
139
  $result = 'bool';
140
  break;
141
 
220
  case 'delete':
221
  case 'cache':
222
  case 'item':
223
+ case 'error':
224
  case 'list':
225
  case 'onoff':
226
  case 'albumeditnonce':
258
  case 'bulk-photo':
259
  $result = 'arraytxt';
260
  break;
261
+
262
  default:
263
  $result = 'raw';
264
  break;
270
  // Retrieve a get- or post- variable, sanitized and post-processed
271
  function wppa_get( $xname, $default = false, $filter = false ) {
272
  global $wpdb;
273
+ global $wppa_kses_maxi;
274
+
275
+ // Sanitize
276
+ $xname = sanitize_text_field( $xname );
277
+ $default = $default ? sanitize_text_field( $default ) : false;
278
+ $filter = sanitize_text_field( $filter );
279
 
280
+ // Check for wppa page no first
281
+ if ( $xname == 'wppa-page' ) {
282
+ if ( isset( $_REQUEST['wppa-page'] ) ) {
283
+ return strval( intval( $_REQUEST['wppa-page'] ) );
284
+ }
285
+ else return $default;
286
+ }
287
 
288
+ // Ajax call ?
289
+ if ( $xname == 'wppa-action' ) {
290
  if ( isset( $_REQUEST['wppa-action'] ) ) {
291
  return sanitize_text_field( $_REQUEST['wppa-action'] );
292
  }
293
+ else return $default;
294
+ }
295
+
296
+ // Admin page ?
297
+ if ( $xname == 'page' ) {
298
+ if ( isset( $_REQUEST['page'] ) ) {
299
+ return sanitize_text_field( $_REQUEST['page'] );
300
+ }
301
+ else return $default;
302
  }
303
 
304
  // Normalize $name and $xname
310
  $xname = 'wppa-' . $name;
311
  }
312
 
313
+ // Find the key if any
314
+ if ( isset( $_REQUEST[$xname] ) ) { // with prefix wppa-
315
+ $key = $xname;
 
 
316
  }
317
+ elseif ( isset( $_REQUEST[$name] ) ) { // without prefix wppa-
318
+ $key = $name;
319
+ }
320
+ else { // neither
321
+ return $default;
322
  }
 
 
323
 
324
  // Get the right filter
325
  if ( ! $filter ) {
326
  $filter = wppa_get_get_filter( $name );
327
  }
328
 
329
+ // Now we have the right key for $request and the right sanitize / validate scheme
330
  // Do the filtering
331
  switch ( $filter ) {
332
 
333
  case 'int':
334
+ $result = strval( intval ( $_REQUEST[$key] ) );
335
  break;
336
 
337
  case 'posint':
338
+ $result = max( '1', strval( intval ( $_REQUEST[$key] ) ) );
339
  break;
340
 
341
  case 'intarr':
342
+ if ( is_array( $_REQUEST[$key] ) ) {
343
+ $value = array();
344
+ foreach( array_keys( $_REQUEST[$key] ) as $i ) {
345
+ $value[$i] = strval( intval( $_REQUEST[$key][$i] ) );
346
  }
347
  }
348
  else {
349
+ $value = strval( intval( $_REQUEST[$key] ) );
350
  }
351
  $result = $value;
352
  break;
353
 
354
  case 'bool':
355
+ if ( $_REQUEST[$key] !== '0' && $_REQUEST[$key] != 'nil' && $_REQUEST[$key] != 'no' ) {
356
  $result = '1';
357
  }
358
  else {
361
  break;
362
 
363
  case 'src':
364
+ $result = wppa_sanitize_searchstring( sanitize_text_field( $_REQUEST[$key] ) );
365
  break;
366
 
367
  case 'html':
368
+ $result = wp_kses( force_balance_tags( $_REQUEST[$key] ), $wppa_kses_maxi );
369
  break;
370
 
371
  case 'tag':
372
  case 'tags':
373
  case 'cat':
374
+ $result = trim( wppa_sanitize_tags( sanitize_text_field( $_REQUEST[$key] ), ',' ) );
375
  break;
376
 
377
  case 'custom':
378
+ $result = wppa_sanitize_custom_field( $_REQUEST[$key] );
379
  break;
380
 
381
  case 'text':
382
+ $result = sanitize_text_field( $_REQUEST[$key] );
383
  break;
384
 
385
  case 'pcrypt':
386
+ $result = wppa_decode_photo( sanitize_text_field( trim( $_REQUEST[$key], '/' ) ) );
387
  break;
388
 
389
  case 'acrypt':
390
+ $result = wppa_decode_album( sanitize_text_field( trim( $_REQUEST[$key], '/' ) ) );
391
  break;
392
 
393
  case 'email':
394
+ $result = sanitize_email( $_REQUEST[$key] );
395
  break;
396
 
397
  case 'url':
398
+ $result = esc_url_raw( $_REQUEST[$key] );
399
  break;
400
+
401
  case 'arraytxt':
402
  $result = array();
403
+ foreach ( array_keys( $_REQUEST[$key] ) as $i ) {
404
+ $result[$i] = sanitize_text_field( $_REQUEST[$key][$i] );
405
  }
406
  break;
407
 
408
  case 'raw':
409
+ wppa_log( 'err', 'Unfiltered (raw) querystring arg = ' . $name . ', value = ' . sanitize_text_field( var_export( $_REQUEST[$key], true ) ) );
410
+ $result = sanitize_text_field( $_REQUEST[$key] );
411
  break;
412
 
413
  default:
414
+ wppa_log( 'err', 'Unknown filter for querystring arg = ' . $name . ', value = ' . sanitize_text_field( var_export( $_REQUEST[$key], true ) ) );
415
+ $result = sanitize_text_field( $_REQUEST[$key] );
416
  break;
417
  }
418
 
432
  }
433
  $result = implode( ',', $temp );
434
 
435
+ return $result;
436
+ }
437
+
438
+ // Retrieve a cookie, sanitized and verified
439
+ function wppa_get_cookie( $name, $default = '' ) {
440
+
441
+ // Sanitize
442
+ $name = sanitize_text_field( $name );
443
+ $default = sanitize_text_field( $default );
444
+
445
+ // Validate
446
+ if ( isset( $_COOKIE[$name] ) ) {
447
+
448
+ $result = sanitize_text_field( $_COOKIE[$name] );
449
+ }
450
+ else {
451
+ $result = $default;
452
+ }
453
+
454
  return $result;
455
  }
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 7.7.02.005
7
  *
8
  */
9
 
@@ -339,7 +339,7 @@ function wppa_get_photo_desc( $id, $xargs = array() ) {
339
  // To prevent recursive rendering of scripts or shortcodes:
340
  $desc = str_replace( array( '%%wppa%%', '[wppa', '[/wppa]' ), array( '%-wppa-%', '{wppa', '{/wppa}' ), $desc );
341
 
342
- // Geo
343
  if ( $thumb['location'] && ! wppa_in_widget() && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false && $args['dogeo'] ) {
344
  wppa_do_geo( $id, $thumb['location'] );
345
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions to retrieve album and photo items
6
+ * Version 8.1.00.004
7
  *
8
  */
9
 
339
  // To prevent recursive rendering of scripts or shortcodes:
340
  $desc = str_replace( array( '%%wppa%%', '[wppa', '[/wppa]' ), array( '%-wppa-%', '{wppa', '{/wppa}' ), $desc );
341
 
342
+ // Geo. This is only in a slideshow
343
  if ( $thumb['location'] && ! wppa_in_widget() && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false && $args['dogeo'] ) {
344
  wppa_do_geo( $id, $thumb['location'] );
345
  }
wppa-links.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Frontend links
6
 
7
- * Version 8.0.10.001
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
@@ -117,33 +117,23 @@ global $wppa_runtime_settings;
117
 
118
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
119
 
120
- switch ( wppa_opt( 'ajax_method' ) ) {
121
- case 'normal':
122
- if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
123
- else $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
124
- break;
125
- case 'wppaajax':
126
- $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
127
- break;
128
  case 'admin':
 
129
  $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
130
  break;
131
- case 'extern':
132
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
133
- else $al = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=render';
134
- break;
135
- case 'none':
136
- $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
137
  break;
138
  }
139
- /*
140
- if ( ! is_admin() ) {
141
- $al = site_url() . '/wppaajax/?action=wppa&amp;wppa-action=render';
142
- }
143
- else {
144
- $al = admin_url( 'admin-ajax.php' ).'?action=wppa&amp;wppa-action=render';
145
- }
146
- */
147
  // See if this call is from an ajax operation or...
148
  if ( wppa( 'ajax' ) ) {
149
  if ( wppa_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get( 'size' );
@@ -516,8 +506,8 @@ function wppa_convert_to_pretty( $xuri, $no_names = false, $overrule = false ) {
516
  return $uri;
517
  }
518
 
519
- // Not during search. Otherwise wppa_test_for_search('at_session_start') returns '';
520
- // and this will destroy use and display searchstrings in wppa_session_start()
521
  // Fix in 6.3.9
522
  if ( strpos( $uri, 'searchstring' ) ) {
523
  return $uri;
4
  *
5
  * Frontend links
6
 
7
+ * Version 8.1.00.008
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
117
 
118
  if ( ! $key && is_search() ) $key = wppa_opt( 'search_linkpage' );
119
 
120
+ $method = wppa_opt( 'ajax_method' );
121
+
122
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) && $method == 'extern' ) {
123
+ if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
124
+ else $al = WPPA_URL . '/wppa-ajax-front.php?action=wppa&amp;wppa-action=render';
125
+ }
126
+ else switch ( $method ) {
 
127
  case 'admin':
128
+ case 'none':
129
  $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
130
  break;
131
+ default: // 'normal'
132
  if ( is_admin() ) $al = site_url() . '/wp-admin/admin-ajax.php?action=wppa&amp;wppa-action=render';
133
+ else $al = site_url() . '/wppaajax?action=wppa&amp;wppa-action=render';
 
 
 
134
  break;
135
  }
136
+
 
 
 
 
 
 
 
137
  // See if this call is from an ajax operation or...
138
  if ( wppa( 'ajax' ) ) {
139
  if ( wppa_get( 'size' ) ) $al .= '&amp;wppa-size=' . wppa_get( 'size' );
506
  return $uri;
507
  }
508
 
509
+ // Not during search. Otherwise wppa_test_for_search('at_begin_session') returns '';
510
+ // and this will destroy use and display searchstrings in wppa_begin_session()
511
  // Fix in 6.3.9
512
  if ( strpos( $uri, 'searchstring' ) ) {
513
  return $uri;
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 8.0.10.004
7
  *
8
  */
9
 
@@ -113,24 +113,6 @@ global $wppa_endtime;
113
  }
114
  }
115
 
116
- /*
117
- // Check for multiple maintenance procs
118
- if ( ! wppa_switch( 'maint_ignore_concurrency_error' ) && ! wppa_is_cron() ) {
119
-
120
- foreach ( array_keys( $wppa_all_maintenance_slugs ) as $key ) {
121
- if ( $wppa_all_maintenance_slugs[$key] != $slug ) {
122
- if ( wppa_get_option( $wppa_all_maintenance_slugs[$key].'_togo', '0') ) { // Process running
123
- return __('You can run only one maintenance procedure at a time', 'wp-photo-album-plus').'||'.$slug.'||'.__('Error', 'wp-photo-album-plus').'||'.''.'||'.'';
124
- }
125
- }
126
- }
127
- }
128
- */
129
- // Open output buffering if cron
130
- if ( wppa_is_cron() ) {
131
- ob_start();
132
- }
133
-
134
  // Lock this proc
135
  if ( wppa_is_cron() ) {
136
  update_option( $slug.'_user', 'cron-job' );
@@ -946,13 +928,9 @@ global $wppa_endtime;
946
  // Test for timeout / ready
947
  $lastid = $id;
948
  update_option( $slug.'_last', $lastid );
949
- if ( wppa_is_cron() ) {
950
- $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_photos WHERE id > %s ", $lastid ) );
951
- if ( $togo ) {
952
- update_option( $slug.'_togo', $togo );
953
- update_option( $slug.'_status', 'Cron job' );
954
- }
955
- }
956
  if ( wppa_is_time_up() ) break; // Time out
957
  }
958
  else { // Nothing to do, Done anyway
@@ -1078,13 +1056,7 @@ global $wppa_endtime;
1078
  }
1079
 
1080
  // Update status
1081
- if ( wppa_is_cron() ) {
1082
- $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_index WHERE id > %s ", $lastid ) );
1083
- if ( $togo ) {
1084
- update_option( $slug.'_togo', $togo );
1085
- update_option( $slug.'_status', 'Cron job' );
1086
- }
1087
- }
1088
 
1089
  if ( wppa_is_time_up() ) break;
1090
  if ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) break;
@@ -1253,12 +1225,6 @@ global $wppa_endtime;
1253
  if ( wppa_get_option( $slug . '_ad_inf' ) == 'yes' ) {
1254
  wppa_schedule_maintenance_proc( $slug );
1255
  }
1256
-
1257
- // Log any unexpected output
1258
- $outbuf = ob_get_clean();
1259
- if ( $outbuf ) {
1260
- wppa_log( 'dbg', 'Cron ' . $slug . ' unexpected output: ' . $outbuf );
1261
- }
1262
  }
1263
  else {
1264
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
@@ -1267,6 +1233,25 @@ global $wppa_endtime;
1267
  wppa_exit();
1268
  }
1269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1270
  function wppa_do_maintenance_popup( $slug ) {
1271
  global $wpdb;
1272
  global $wppa_log_file;
@@ -1279,18 +1264,7 @@ global $wppa_log_file;
1279
  '<div' .
1280
  ' id="wppa-maintenance-list"' .
1281
  ( strpos( $_SERVER['REQUEST_URI'], 'page=wppa_log' ) !== false || wppa_get( 'raw' ) ? '' : ' style="max-height:500px; overflow:hidden;width:100%;"' ) .
1282
- ' >' .
1283
- '<style type="text/css" >' .
1284
- '#wppa-maintenance-list h2 {' .
1285
- 'margin-top:0;' .
1286
- '}' .
1287
- '#wppa-maintenance-list div {' .
1288
- 'background-color:#f1f1f1; border:1px solid #ddd;' .
1289
- '}' .
1290
- '#wppa-maintenance-list td, #wppa-maintenance-list th {' .
1291
- 'border-right: 1px solid darkgray;' .
1292
- '}' .
1293
- '</style>';
1294
 
1295
  // Open nicescroller wrapper
1296
  $result .= '<div class="wppa-nicewrap" >';
@@ -1608,19 +1582,12 @@ global $wppa_log_file;
1608
  $result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
1609
  }
1610
 
1611
- // End nicescroller wrapper
1612
  $result .= '
1613
- <script type="text/javascript" >
1614
- if ( jQuery("#wppa-maintenance-list").niceScroll ) {
1615
- jQuery(document).ready(function(){
1616
- jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});
1617
- });
1618
- }
1619
- </script>
1620
- </div>';
1621
 
1622
- $result .=
1623
- '</div>';
 
1624
 
1625
  return htmlspecialchars( $header ) . '|' . $result;
1626
  }
@@ -1733,8 +1700,9 @@ function wppa_log_page() {
1733
  ' onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"' .
1734
  ' type="button" >' .
1735
  '</h1>' .
 
1736
  wp_nonce_field('wppa-nonce', 'wppa-nonce') .
1737
- '<style type="text/css" >h2 { display:none; }</style>' .
1738
  '&nbsp;<img' .
1739
  ' id="wppa-spinner"' .
1740
  ' src="' . wppa_get_imgdir( 'spinner.gif' ) . '"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains (not yet, but in the future maybe) all the maintenance routines
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
113
  }
114
  }
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  // Lock this proc
117
  if ( wppa_is_cron() ) {
118
  update_option( $slug.'_user', 'cron-job' );
928
  // Test for timeout / ready
929
  $lastid = $id;
930
  update_option( $slug.'_last', $lastid );
931
+
932
+ wppa_maintenance_update_status( $slug, $lastid, $wpdb->wppa_photos );
933
+
 
 
 
 
934
  if ( wppa_is_time_up() ) break; // Time out
935
  }
936
  else { // Nothing to do, Done anyway
1056
  }
1057
 
1058
  // Update status
1059
+ wppa_maintenance_update_status( $slug, $lastid, $wpdb->wppa_index );
 
 
 
 
 
 
1060
 
1061
  if ( wppa_is_time_up() ) break;
1062
  if ( memory_get_usage() >= ( 0.9 * wppa_memry_limit() ) ) break;
1225
  if ( wppa_get_option( $slug . '_ad_inf' ) == 'yes' ) {
1226
  wppa_schedule_maintenance_proc( $slug );
1227
  }
 
 
 
 
 
 
1228
  }
1229
  else {
1230
  return $errtxt.'||'.$slug.'||'.$status.'||'.$togo.'||'.$reload;
1233
  wppa_exit();
1234
  }
1235
 
1236
+ // Stutus update
1237
+ function wppa_maintenance_update_status( $slug, $lastid, $table ) {
1238
+ global $wpdb;
1239
+
1240
+ if ( $slug == 'wppa_cleanup' ) return;
1241
+
1242
+ $togo = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $table WHERE id > %s ", $lastid ) );
1243
+ if ( $togo ) {
1244
+ update_option( $slug.'_togo', $togo );
1245
+ if ( wppa_is_cron() ) {
1246
+ update_option( $slug.'_status', 'Cron job' );
1247
+ }
1248
+ else {
1249
+ update_option( $slug.'_status', 'Working' );
1250
+ }
1251
+ }
1252
+ // wppa_log( 'obs', "Maint did $lastid for $slug" );
1253
+ }
1254
+
1255
  function wppa_do_maintenance_popup( $slug ) {
1256
  global $wpdb;
1257
  global $wppa_log_file;
1264
  '<div' .
1265
  ' id="wppa-maintenance-list"' .
1266
  ( strpos( $_SERVER['REQUEST_URI'], 'page=wppa_log' ) !== false || wppa_get( 'raw' ) ? '' : ' style="max-height:500px; overflow:hidden;width:100%;"' ) .
1267
+ ' >';
 
 
 
 
 
 
 
 
 
 
 
1268
 
1269
  // Open nicescroller wrapper
1270
  $result .= '<div class="wppa-nicewrap" >';
1582
  $result = 'Error: Unimplemented slug: ' . $slug . ' in wppa_do_maintenance_popup()';
1583
  }
1584
 
 
1585
  $result .= '
1586
+ </div></div>';
 
 
 
 
 
 
 
1587
 
1588
+ // Activate nicescroller on wrapper
1589
+ // $the_js = 'if (jQuery("#wppa-maintenance-list").niceScroll) {jQuery(document).ready(function(){jQuery("#wppa-maintenance-list").niceScroll(".wppa-nicewrap",{' . wppa_opt( 'nicescroll_opts' ) . '});});};';
1590
+ // wp_add_inline_script( 'wppa-admin', $the_js );
1591
 
1592
  return htmlspecialchars( $header ) . '|' . $result;
1593
  }
1700
  ' onclick="wppaAjaxUpdateOptionValue(\'errorlog_purge\', 0);jQuery(\'#wppa-maintenance-list\').fadeOut(2000);"' .
1701
  ' type="button" >' .
1702
  '</h1>' .
1703
+
1704
  wp_nonce_field('wppa-nonce', 'wppa-nonce') .
1705
+
1706
  '&nbsp;<img' .
1707
  ' id="wppa-spinner"' .
1708
  ' src="' . wppa_get_imgdir( 'spinner.gif' ) . '"' .
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 8.0.07.001
7
  *
8
  */
9
 
@@ -32,6 +32,7 @@ global $wppa_api_version;
32
  if ( is_file($userstyle) ) {
33
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
34
  wp_enqueue_style('wppa_style');
 
35
  return;
36
  }
37
 
@@ -40,6 +41,7 @@ global $wppa_api_version;
40
  if ( is_file($userstyle) ) {
41
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
42
  wp_enqueue_style('wppa_style');
 
43
  return;
44
  }
45
  }
@@ -55,6 +57,46 @@ global $wppa_api_version;
55
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $ver);
56
  wp_enqueue_style('wppa_style');
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  }
59
 
60
  /* SEO META TAGS AND SM SHARE DATA */
@@ -398,72 +440,7 @@ global $wppa_lang;
398
  global $wppa_api_version;
399
 
400
  // dynamic css
401
- echo wppa_create_wppa_dynamic_css();
402
-
403
- // Inline styles?
404
- if ( wppa_opt( 'custom_style' ) ) {
405
- echo '
406
- <!-- WPPA+ Custom styles -->
407
- <style type="text/css" >';
408
- echo wppa_opt( 'custom_style' ) . '
409
- </style>';
410
- }
411
-
412
- // Browser dependant css
413
- if ( wppa_is_edge() ) {
414
- if ( wppa_opt( 'custom_style_edge' ) ) {
415
- echo '
416
- <!-- WPPA+ Custom styles Edge -->
417
- <style type="text/css" >
418
- ' . wppa_opt( 'custom_style_edge' ) . '
419
- </style>';
420
- }
421
- }
422
- elseif ( wppa_is_chrome() ) {
423
- if ( wppa_opt( 'custom_style_chrome' ) ) {
424
- echo '
425
- <!-- WPPA+ Custom styles Chrome -->
426
- <style type="text/css" >
427
- ' . wppa_opt( 'custom_style_chrome' ) . '
428
- </style>';
429
- }
430
- }
431
- elseif ( wppa_is_firefox() ) {
432
- if ( wppa_opt( 'custom_style_firefox' ) ) {
433
- echo '
434
- <!-- WPPA+ Custom styles Firefox -->
435
- <style type="text/css" >
436
- ' . wppa_opt( 'custom_style_firefox' ) . '
437
- </style>';
438
- }
439
- }
440
- elseif ( wppa_is_safari() ) {
441
- if ( wppa_opt( 'custom_style_safari' ) ) {
442
- echo '
443
- <!-- WPPA+ Custom styles Safari -->
444
- <style type="text/css" >
445
- ' . wppa_opt( 'custom_style_safari' ) . '
446
- </style>';
447
- }
448
- }
449
- elseif ( wppa_is_ie() ) {
450
- if ( wppa_opt( 'custom_style_ie' ) ) {
451
- echo '
452
- <!-- WPPA+ Custom styles IE -->
453
- <style type="text/css" >
454
- ' . wppa_opt( 'custom_style_ie' ) . '
455
- </style>';
456
- }
457
- }
458
- elseif ( wppa_is_opera() ) {
459
- if ( wppa_opt( 'custom_style_opera' ) ) {
460
- echo '
461
- <!-- WPPA+ Custom styles Opera -->
462
- <style type="text/css" >
463
- ' . wppa_opt( 'custom_style_opera' ) . '
464
- </style>';
465
- }
466
- }
467
 
468
  // Pinterest js
469
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
@@ -477,7 +454,6 @@ global $wppa_api_version;
477
 
478
  echo '
479
  <script type="text/javascript" >
480
- wppaDebug = true;
481
  </script>';
482
  }
483
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the non admin stuff
6
+ * Version 8.1.00.006
7
  *
8
  */
9
 
32
  if ( is_file($userstyle) ) {
33
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('stylesheet') . '/wppa-style.css', array(), $wppa_api_version);
34
  wp_enqueue_style('wppa_style');
35
+ wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
36
  return;
37
  }
38
 
41
  if ( is_file($userstyle) ) {
42
  wp_register_style('wppa_style', get_theme_root_uri() . '/' . wppa_get_option('template') . '/wppa-style.css', array(), $wppa_api_version);
43
  wp_enqueue_style('wppa_style');
44
+ wp_add_inline_style( 'wppa_style', wppa_create_wppa_dynamic_css() );
45
  return;
46
  }
47
  }
57
  wp_register_style('wppa_style', WPPA_URL.'/theme/wppa-style.css', array(), $ver);
58
  wp_enqueue_style('wppa_style');
59
 
60
+ $the_css = wppa_create_wppa_dynamic_css();
61
+ $the_css .= '
62
+ #wppaphoto-table {
63
+ box-sizing:border-box; width:100% !important;
64
+ }
65
+ .wppa-bar {
66
+ background-color: #7f7;
67
+ width:0%;
68
+ height:18px;
69
+ border-radius: 3px;
70
+ line-height: 18px;
71
+ margin: 0;
72
+ }
73
+ .wppa-percent {
74
+ position:relative;
75
+ display:inline-block;
76
+ top:-19px;
77
+ font-size: 12px;
78
+ line-height: 18px;
79
+ margin: 0;
80
+ }
81
+ .wppa-message {
82
+ clear: both;
83
+ }
84
+ #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
85
+ padding: 2px; 0;
86
+ }
87
+ #wppaphoto-table th {
88
+ width:200px;
89
+ }
90
+ #wppaphoto-table input {
91
+ padding:4px;
92
+ }
93
+ #wppaphoto-table th, #wppaphoto-table td {
94
+ border:none;
95
+ }
96
+ #wppaphoto-shortcode-preview-container {
97
+ width:500px !important;
98
+ }';
99
+ wp_add_inline_style( 'wppa_style', $the_css );
100
  }
101
 
102
  /* SEO META TAGS AND SM SHARE DATA */
440
  global $wppa_api_version;
441
 
442
  // dynamic css
443
+ // echo wppa_create_wppa_dynamic_css();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
444
 
445
  // Pinterest js
446
  if ( ( wppa_switch( 'share_on') || wppa_switch( 'share_on_widget') ) && wppa_switch( 'share_pinterest') ) {
454
 
455
  echo '
456
  <script type="text/javascript" >
 
457
  </script>';
458
  }
459
 
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 8.0.07.018
7
  *
8
  */
9
 
@@ -20,12 +20,9 @@ function _wppa_edit_photo() {
20
  $photo = wppa_get( 'photo', '0', 'int' );
21
  $thumb = wppa_cache_thumb( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
- echo '
24
- <div class="wrap" >
25
- <h2>' . __( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>';
26
  wppa_album_photos( '', $photo );
27
- echo '
28
- </div>';
29
  }
30
  else {
31
  wp_die( 'You do not have the rights to do this' );
@@ -34,12 +31,9 @@ function _wppa_edit_photo() {
34
 
35
  // Edit all photos owned by current user
36
  else {
37
- echo '
38
- <div class="wrap" >
39
- <h2>' . __( 'Edit photos', 'wp-photo-album-plus' ) . '</h2>';
40
  wppa_album_photos( '', '', wppa_get_user() );
41
- echo '
42
- </div>';
43
  }
44
  }
45
 
@@ -51,26 +45,19 @@ function _wppa_moderate_photos() {
51
  $just_edit = wppa_get( 'just-edit' );
52
 
53
  if ( $photo && $just_edit && wppa_user_is( 'administrator' ) ) {
54
- echo '
55
- <div class="wrap" >
56
- <h2>' . __( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>';
57
- echo wppa_get( 'just-edit' );
58
  wppa_album_photos( '', $photo, '', false );
59
- echo '
60
- </div>';
61
  }
62
  else {
63
- echo '
64
- <div class="wrap" >
65
- <h2>' . __( 'Moderate photos' , 'wp-photo-album-plus') . '</h2>';
66
  if ( wppa_switch( 'moderate_bulk' ) ) {
67
  wppa_album_photos_bulk( 'moderate' );
68
  }
69
  else {
70
  wppa_album_photos( '', $photo, '', true );
71
  }
72
- echo '
73
- </div>';
74
  }
75
  }
76
 
@@ -79,7 +66,7 @@ function wppa_album_photos( $album = '', $photo = '', $owner = '', $moderate = f
79
  global $wpdb;
80
 
81
  $pagesize = wppa_opt( 'photo_admin_pagesize' );
82
- $page = wppa_get( 'page' );
83
  if ( ! is_numeric( $page ) ) $page = 1;
84
  $skip = ( $page - '1' ) * $pagesize;
85
 
@@ -211,26 +198,17 @@ global $wpdb;
211
 
212
  // Single photo moderate requested
213
  if ( $photo ) {
214
- echo '
215
- <p>' .
216
- __( 'This photo is no longer awaiting moderation.' , 'wp-photo-album-plus' ) . '
217
- </p>';
218
  }
219
 
220
  // Multiple photos to moderate requested
221
  else {
222
- echo '
223
- <p>' .
224
- __( 'There are no photos awaiting moderation at this time.', 'wp-photo-album-plus' ) . '
225
- </p>';
226
  }
227
 
228
  // If i am admin, i can edit all photos here, sorted by timestamp desc
229
  if ( wppa_user_is( 'administrator' ) ) {
230
- echo '
231
- <h3>' .
232
- __( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '
233
- </h3>';
234
 
235
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
236
  ORDER BY timestamp DESC
@@ -266,12 +244,12 @@ global $wpdb;
266
  // A specific photo requested
267
  if ( $photo ) {
268
  $photo = strval( intval( $photo ) );
269
- echo '
270
- <div id="photoitem-' . $photo . '" class="photoitem" style="width:100%; background-color: rgb( 255, 255, 224 ); border-color: rgb( 230, 219, 85 );" >
271
- <span style="color:red;" >' .
272
- sprintf( __( 'Photo %s has been removed.', 'wp-photo-album-plus' ), $photo ) . '
273
  </span>
274
- </div>';
275
  }
276
 
277
  // A collection of photos requested
@@ -279,18 +257,12 @@ global $wpdb;
279
 
280
  // Search
281
  if ( wppa_get( 'searchstring' ) ) {
282
- echo '
283
- <h3>' .
284
- __( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '
285
- </h3>';
286
  }
287
 
288
  // Album
289
  else {
290
- echo '
291
- <h3>' .
292
- __( 'No photos yet in this album.', 'wp-photo-album-plus' ) . '
293
- </h3>';
294
  }
295
  }
296
 
@@ -300,23 +272,22 @@ global $wpdb;
300
  // There are photos to display for editing
301
  else {
302
 
303
- // Local js functions placed here as long as there is not yet a possibility to translate texts in js files
304
- ?>
305
- <script>
306
  function wppaTryMove( id, video ) {
307
 
308
  var query;
309
 
310
  if ( ! jQuery( '#target-' + id ).val() ) {
311
- alert( '<?php echo esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) ?>' );
312
  return false;
313
  }
314
 
315
  if ( video ) {
316
- query = '<?php echo esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) ?>';
317
  }
318
  else {
319
- query = '<?php echo esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) ?>';
320
  }
321
 
322
  if ( confirm( query ) ) {
@@ -329,15 +300,15 @@ function wppaTryCopy( id, video ) {
329
  var query;
330
 
331
  if ( ! jQuery( '#target-' + id ).val() ) {
332
- alert( '<?php echo esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) ?>' );
333
  return false;
334
  }
335
 
336
  if ( video ) {
337
- query = '<?php echo esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) ?>';
338
  }
339
  else {
340
- query = '<?php echo esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) ?>';
341
  }
342
 
343
  if ( confirm( query ) ) {
@@ -350,10 +321,10 @@ function wppaTryDelete( id, video ) {
350
  var query;
351
 
352
  if ( video ) {
353
- query = '<?php echo esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) ?>';
354
  }
355
  else {
356
- query = '<?php echo esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) ?>';
357
  }
358
 
359
  if ( confirm( query ) ) {
@@ -368,7 +339,7 @@ function wppaTryUndelete ( id ) {
368
 
369
  function wppaTryRotLeft( id ) {
370
 
371
- var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) ?>';
372
 
373
  if ( confirm( query ) ) {
374
  wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
@@ -377,7 +348,7 @@ function wppaTryRotLeft( id ) {
377
 
378
  function wppaTryRot180( id ) {
379
 
380
- var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) ?>';
381
 
382
  if ( confirm( query ) ) {
383
  wppaAjaxUpdatePhoto( id, 'rot180', 0 );
@@ -386,7 +357,7 @@ function wppaTryRot180( id ) {
386
 
387
  function wppaTryRotRight( id ) {
388
 
389
- var query = '<?php echo esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) ?>';
390
 
391
  if ( confirm( query ) ) {
392
  wppaAjaxUpdatePhoto( id, 'rotright', 0 );
@@ -395,7 +366,7 @@ function wppaTryRotRight( id ) {
395
 
396
  function wppaTryFlip( id ) {
397
 
398
- var query = '<?php echo esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) ?>';
399
 
400
  if ( confirm( query ) ) {
401
  wppaAjaxUpdatePhoto( id, 'flip', 0 );
@@ -404,7 +375,7 @@ function wppaTryFlip( id ) {
404
 
405
  function wppaTryFlop( id ) {
406
 
407
- var query = '<?php echo esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) ?>';
408
 
409
  if ( confirm( query ) ) {
410
  wppaAjaxUpdatePhoto( id, 'flop', 0 );
@@ -416,22 +387,22 @@ function wppaTryWatermark( id, hasSource, canRemove ) {
416
  var query;
417
  var wmFile = jQuery( '#wmfsel_' + id ).val();
418
  if ( wmFile == '--- none ---' ) {
419
- alert( '<?php echo esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) ?>' );
420
  return;
421
  }
422
  if ( hasSource ) {
423
- query = '<?php echo esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) ?>';
424
- query += '\n';
425
- query += '<?php echo esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) ?>';
426
  if ( canRemove ) {
427
- query += '\n';
428
- query += '<?php echo esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) ?>';
429
  }
430
  }
431
  else {
432
- query = '<?php echo esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) ?>';
433
- query += '\n';
434
- query += '<?php echo esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) ?>';
435
  }
436
 
437
  if ( confirm( query ) ) {
@@ -445,7 +416,7 @@ function wppaTryMagick( id, slug, value ) {
445
  value = 0;
446
  }
447
 
448
- var query = '<?php echo esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) ?>';
449
 
450
  if ( true || confirm( query ) ) {
451
  jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
@@ -456,11 +427,11 @@ function wppaTryMagick( id, slug, value ) {
456
  wppaHor = false;
457
  function wppaToggleHorizon() {
458
  if ( wppaHor ) {
459
- jQuery( '#horizon' ).css( 'display', 'none' );
460
  wppaHor = false;
461
  }
462
  else {
463
- jQuery( '#horizon' ).css( 'display', 'inline' );
464
  wppaHor = true;
465
  }
466
  }
@@ -476,11 +447,11 @@ function wppaToggleIptc( id, count ) {
476
 
477
  if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
478
  jQuery( '#wppa-iptc-' + id ).show();
479
- jQuery( '#wppa-iptc-button-' + id ).val( '<?php _e( 'Hide', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'IPTC items', 'wp-photo-album-plus' ) ?>' );
480
  }
481
  else {
482
  jQuery( '#wppa-iptc-' + id ).hide();
483
- jQuery( '#wppa-iptc-button-' + id ).val( '<?php _e( 'Show', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'IPTC items', 'wp-photo-album-plus' ) ?>' );
484
  }
485
  }
486
 
@@ -488,17 +459,15 @@ function wppaToggleExif( id, count ) {
488
 
489
  if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
490
  jQuery( '#wppa-exif-' + id ).show();
491
- jQuery( '#wppa-exif-button-' + id ).val( '<?php _e( 'Hide', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
492
  }
493
  else {
494
  jQuery( '#wppa-exif-' + id ).hide();
495
- jQuery( '#wppa-exif-button-' + id ).val( '<?php _e( 'Show', 'wp-photo-album-plus' ) ?> ' + count + ' <?php _e( 'EXIF items', 'wp-photo-album-plus' ) ?>' );
496
  }
497
- }
498
-
499
- </script>
500
- <?php
501
 
 
502
 
503
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
504
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
@@ -510,18 +479,9 @@ function wppaToggleExif( id, count ) {
510
  wppa_admin_page_links( $page, $pagesize, $count, $link );
511
 
512
  // Horizon
513
- echo '
514
- <div
515
- id="horizon"
516
- style="background-color:transparent;height:11px;position:fixed;width:100%;top:500px;z-index:100000;display:none;cursor:ns-resize;"
517
- >
518
- <hr
519
- style="position:relative;top:5px;left:0px;border:none;background-color:black;height:1px;width:100%;"
520
- />
521
- </div>
522
- <script>
523
- wppaDragHorizon(document.getElementById("horizon"));
524
- </script>';
525
 
526
  // Albun name if moderate
527
  static $modalbum;
@@ -592,44 +552,40 @@ function wppaToggleExif( id, count ) {
592
 
593
  // Album for moderate
594
  if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' ) != 'trash' ) {
595
- echo '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
596
  '<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
597
- '<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h3>';
598
  $modalbum = $album;
599
  }
600
 
601
  // Anchor for scroll to
602
- echo '<a id="photo_' . $id . '" ></a>';
603
 
604
  // The photo data
605
- echo '
606
  <div
607
  id="photoitem-' . $id . '"
608
  class="wppa-table-wrap"
609
- style="width:100%;position:relative;"
610
- >';
611
 
612
  // Photo specific nonce field
613
- echo '
614
  <input
615
  type="hidden"
616
  id="photo-nonce-' . $id . '"
617
  value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
618
- />';
619
 
620
  // Section 1
621
- echo '
622
- <!-- Section 1 -->
623
  <table
624
  class="wppa-table wppa-photo-table"
625
- style="width:100%;"
626
  >
627
  <tbody>
628
- <tr>';
629
-
630
- // -- Preview thumbnail ---
631
- echo '
632
- <td>';
633
  // If ImageMagick is enabled...
634
  // Fake 'for social media' to use the local file here, not cloudinary.
635
  // Files from cloudinary do not reload, even with ?ver=...
@@ -647,7 +603,7 @@ function wppaToggleExif( id, count ) {
647
  if ( $is_video ) {
648
  reset( $is_video );
649
  $big = str_replace( 'xxx', current( $is_video ), $big );
650
- echo '
651
  <a
652
  href="' . esc_attr( $big ) . '"
653
  target="_blank"
@@ -660,14 +616,14 @@ function wppaToggleExif( id, count ) {
660
  'controls' => false,
661
  'use_thumb' => true
662
  ) ) . '
663
- </a>';
664
  }
665
  else {
666
  if ( $has_audio ) {
667
  $src = wppa_get_thumb_url( $id );
668
  $big = wppa_get_photo_url( $id );
669
  }
670
- echo '
671
  <a
672
  id="thumba-' . $id . '"
673
  href="' . esc_attr( $big ) . '"
@@ -676,11 +632,11 @@ function wppaToggleExif( id, count ) {
676
  >
677
  <img
678
  id="thumburl-' . $id . '"' .
679
- ( wppa_lazy() && $count > '1' ? 'data-' : '' ) . 'src="' . $src . '"
680
  alt="' . esc_attr( $name ) . '"
681
- style="max-width: 160px; vertical-align:middle;"' .
682
- ' />
683
- </a>';
684
 
685
  if ( $has_audio ) {
686
  $audio = wppa_get_audio_html( array( 'id' => $id,
@@ -688,19 +644,19 @@ function wppaToggleExif( id, count ) {
688
  'width' => '160',
689
  'controls' => true
690
  ) );
691
- echo '
692
  <br />' .
693
  ( $audio ? $audio :
694
- '<span style="color:red;">' .
695
- __( 'Audio disabled', 'wp-photo-album-plus' ) .
696
- '</span>' );
697
  }
698
  }
699
- echo '
700
- </td>';
701
 
702
  // --- More or less static data ---
703
- echo '
704
  <td>' .
705
 
706
  // ID
@@ -714,21 +670,20 @@ function wppaToggleExif( id, count ) {
714
 
715
  // Upload
716
  __( 'Upload:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( wppa_local_date( '', $timestamp ) ) . ' ' .
717
- __( 'local time', 'wp-photo-album-plus' ) . '. ';
718
 
719
  // Owner
720
  if ( $owner_editable ) {
721
- echo
722
  __( 'Owned by:', 'wp-photo-album-plus' ) . '
723
  <input
724
  type="text"
725
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
726
  value="' . esc_attr( $owner ) . '"
727
- /> ';
728
  }
729
  else {
730
- echo
731
- __( 'By:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $owner ) . '. ';
732
  }
733
 
734
  // Album
@@ -737,165 +692,154 @@ function wppaToggleExif( id, count ) {
737
  $album = - ( $album + '9' );
738
  $deleted = true;
739
  }
740
- echo
741
- sprintf( __( 'Album: %d (%s).', 'wp-photo-album-plus' ), strval( intval( $album ) ), htmlspecialchars( wppa_get_album_name( $album ) ) ) . ' ';
742
 
743
  // Modified
744
  if ( $deleted ) {
745
- echo '
746
- <span style="color:red;" >' .
747
  __( 'Trashed', 'wp-photo-album-plus' ) . '
748
- </span>';
749
  }
750
  else {
751
  if ( $modified > $timestamp ) {
752
- echo
753
  __( 'Modified:', 'wp-photo-album-plus' ) . '
754
- <span id="modified-' . $id . '" >' .
755
  wppa_local_date( '', $modified ) . '
756
  </span>' .
757
- __( 'local time', 'wp-photo-album-plus' );
758
  }
759
  else {
760
- echo
761
- __( 'Not modified', 'wp-photo-album-plus' );
762
  }
763
  }
764
- echo
765
- '. ' .
766
 
767
  // Exif
768
- __( 'EXIF Date:', 'wp-photo-album-plus' );
769
  if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
770
- echo '
771
  <input
772
  type="text"
773
- style="width:125px;"
774
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
775
  value="' . esc_attr( $exifdtm ) . '"
776
- />';
777
  }
778
  else {
779
- echo htmlspecialchars( $exifdtm ) . '.';
780
  }
781
- echo
782
- ' ';
783
 
784
  // Location
785
  if ( $photo['location'] || wppa_switch( 'geo_edit' ) ) {
786
- echo
787
- __( 'Location:' , 'wp-photo-album-plus' ) . ' ';
788
  $loc = $location ? $location : '///';
789
  $geo = explode( '/', $loc );
790
 
791
- // To prevent double encoding ( of &deg; etc ) use esc_html instead of htmlspecialchars
792
- echo esc_html( $geo['0'].' '.$geo['1'].'. ' );
793
 
794
  if ( wppa_switch( 'geo_edit' ) ) {
795
- echo
796
  __( 'Lat:', 'wp-photo-album-plus' ) . '
797
  <input
798
  type="text"
799
- style="width:100px;"
800
  id="lat-' . $id . '"
801
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value);"
802
  value="' . esc_attr( $geo['2'] ) . '"
803
  />' .
804
  __( 'Lon:', 'wp-photo-album-plus' ) . '
805
  <input type="text"
806
- style="width:100px;"
807
  id="lon-' . $id . '"
808
- onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value);"
809
  value="' . esc_attr( $geo['3'] ) . '"
810
- />';
811
  }
812
  }
813
 
814
  // Changeable p_order
815
- echo
816
- __( 'Photo sort order #:', 'wp-photo-album-plus' );
817
  if ( $sortby_orderno && ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
818
- echo '
819
  <input
820
  type="text"
821
  id="porder-' . $id . '"
822
  value="' . esc_attr( $p_order ) . '"
823
- style="width:30px;"
824
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
825
- />' .
826
- ' ';
827
  }
828
  else {
829
- echo
830
- ' ' . htmlspecialchars( $p_order ) . '. ';
831
  }
832
 
833
- /*HBI*/ // Rating
834
  $entries = wppa_get_rating_count_by_id( $id );
835
  if ( $entries ) {
836
 
837
  if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
838
- echo __( 'Likes:', 'wp-photo-album-plus' ) . ' ' .
839
- strval( intval( $entries ) ) .
840
- '. ';
841
  }
842
  else {
843
- echo
844
  __( 'Rating:', 'wp-photo-album-plus' ) . ' ' .
845
- __( 'Entries:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $entries ) .
846
  ', ' .
847
  __( 'Mean value:', 'wp-photo-album-plus' ) .
848
  ' ' .
849
  wppa_get_rating_by_id( $id, 'nolabel' ) .
850
- '. ';
851
  }
852
  }
853
  else {
854
- echo
855
- __( 'No ratings for this photo.', 'wp-photo-album-plus' ) . ' ';
856
  }
857
  $dislikes = wppa_dislike_get( $id );
858
  if ( $dislikes ) {
859
- echo
860
- '<span style="color:red" >' .
861
  sprintf( _n( 'Disliked by %d visitor', 'Disliked by %d visitors', $dislikes, 'wp-photo-album-plus' ), $dislikes ) . '. ' .
862
- '</span>';
863
  }
864
  $pending = wppa_pendrat_get( $id );
865
  if ( $pending ) {
866
- echo
867
- '<span style="color:orange" >' .
868
  sprintf( __( '%d pending votes.', 'wp-photo-album-plus' ), $pending ) . ' ' .
869
- '</span>';
870
  }
871
 
872
  // Views
873
  if ( wppa_switch( 'track_viewcounts' ) ) {
874
- echo
875
  __( 'Views' , 'wp-photo-album-plus' ) . ': ' .
876
  htmlspecialchars( $views ) .
877
- '. ';
878
  }
879
 
880
  // Clicks
881
  if ( wppa_switch( 'track_clickcounts' ) ) {
882
- echo
883
  __( 'Clicks', 'wp-photo-album-plus' ) . ': ' .
884
  htmlspecialchars( $clicks ) .
885
- '. ';
886
  }
887
 
888
  // Downloads
889
  // if ( true ) {
890
- echo
891
  __( 'Downloads', 'wp-photo-album-plus' ) . ': ' .
892
  htmlspecialchars( $dlcount ) .
893
- '. ';
894
  // }
895
 
896
  // Status
897
- echo '<br />' .
898
- __( 'Status:' , 'wp-photo-album-plus') . ' ';
899
  if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
900
  if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
901
  $dis = ' disabled="disabled"';
@@ -904,10 +848,10 @@ function wppaToggleExif( id, count ) {
904
  $dis = '';
905
  }
906
  $sel = ' selected="selected"';
907
- echo
908
  '<select' .
909
  ' id="status-' . $id . '"' .
910
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' );"' .
911
  ' >' .
912
  '<option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
913
  __( 'Pending', 'wp-photo-album-plus' ) .
@@ -934,15 +878,15 @@ function wppaToggleExif( id, count ) {
934
  __( 'Private', 'wp-photo-album-plus' ) .
935
  '</option>' .
936
  '</select>' .
937
- wppa_get_date_time_select_html( 'photo', $id, true );
938
  }
939
  else {
940
- echo
941
  '<input' .
942
  ' type="hidden"' .
943
  ' id="status-' . $id . '"' .
944
  ' value="' . esc_attr( $status ) . '"' .
945
- ' />';
946
  if ( $status == 'pending' ) _e( 'Pending', 'wp-photo-album-plus' );
947
  elseif ( $status == 'publish' ) _e( 'Publish', 'wp-photo-album-plus' );
948
  elseif ( $status == 'featured' ) _e( 'Featured', 'wp-photo-album-plus' );
@@ -951,19 +895,19 @@ function wppaToggleExif( id, count ) {
951
  elseif ( $status == 'bronze' ) _e( 'Bronze', 'wp-photo-album-plus' );
952
  elseif ( $status == 'scheduled' ) _e( 'Scheduled', 'wp-photo-album-plus' );
953
  elseif ( $status == 'private' ) _e( 'Private', 'wp-photo-album-plus' );
954
- echo
955
  wppa_get_date_time_select_html( 'photo', $id, false ) .
956
- '<span id="psdesc-' . $id . '" class="description" style="display:none;" >' .
957
  __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) .
958
- '</span>';
959
  }
960
- echo ' ';
961
 
962
  // Schedule for delete
963
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
964
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
965
 
966
- echo
967
  __( 'Delete at', 'wp-photo-album-plus' ) .
968
  ' ' .
969
  '<input' .
@@ -971,42 +915,40 @@ function wppaToggleExif( id, count ) {
971
  ' id="scheduledel-' . $id . '"' .
972
  ( $scheduledel ? ' checked="checked"' : '' ) .
973
  ( $may_change ? '' : ' disabled="disabled"' ) .
974
- ' onchange="wppaTryScheduledel( ' . $id . ' );"' .
975
  ' />' .
976
  ' ' .
977
  wppa_get_date_time_select_html( 'delphoto', $id, $may_change ) .
978
- ' ';
979
  }
980
 
981
  // Update status field
982
- echo
983
  __( 'Remark:', 'wp-photo-album-plus' ) . ' ' .
984
  '<span' .
985
  ' id="remark-' . $id . '"' .
986
- ' style="font-weight:bold;color:#00AA00;"' .
987
  ' >' .
988
  ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
989
  sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) .
990
- '</span>';
991
 
992
  // New Line
993
- echo '<br />';
994
 
995
  // --- Available files ---
996
- echo
997
- __( 'Available files:', 'wp-photo-album-plus' ) . ' ';
998
 
999
  // Pdf
1000
  if ( wppa_is_pdf( $id ) ) {
1001
  $sp = wppa_get_source_path( $id );
1002
  $fs = wppa_get_filesize( $sp );
1003
- echo
1004
- __( 'Document file:', 'wp-photo-album-plus' ) . ' ' . $fs . ' ';
1005
  }
1006
 
1007
  // Source
1008
- echo
1009
- __( 'Source file:', 'wp-photo-album-plus' ) . ' ';
1010
  $sp = wppa_get_o1_source_path( $id );
1011
  if ( ! wppa_is_file( $sp ) ) {
1012
  $sp = wppa_get_source_path( $id );
@@ -1019,73 +961,63 @@ function wppaToggleExif( id, count ) {
1019
  }
1020
  if ( is_file( $sp ) ) {
1021
  $ima = getimagesize( $sp );
1022
- echo
1023
  $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' .
1024
- wppa_get_filesize( $sp ) . '. ';
1025
  }
1026
  else {
1027
- echo
1028
- __( 'Unavailable', 'wp-photo-album-plus' ) . '. ';
1029
  }
1030
 
1031
  // Display
1032
- echo
1033
- ( $is_video || $has_audio ? __( 'Poster file:', 'wp-photo-album-plus' ) : __( 'Display file:', 'wp-photo-album-plus' ) ) . ' ';
1034
  $dp = wppa_get_photo_path( $id );
1035
  if ( is_file( $dp ) ) {
1036
- echo
1037
- '<span id="photox-'.$id.'" >'.wppa_get_photox( $id ).'</span>' .
1038
  ' x ' .
1039
- '<span id="photoy-'.$id.'" >'.wppa_get_photoy( $id ).'</span>' .
1040
- ' ' . '<span id="photofilesize-' . $id . '" >' . wppa_get_filesize( $dp ) . '</span>. ';
1041
-
1042
- /* echo
1043
- '<span id="dispfileinfo-' . $id . '" >' .
1044
- floor( wppa_get_photox( $id ) ) . ' x ' . floor( wppa_get_photoy( $id ) ).' px, ' .
1045
- wppa_get_filesize( $dp ) . '.' .
1046
- '</span> ';
1047
- */
1048
  }
1049
  else {
1050
- echo
1051
- '<span style="color:red;" >' .
1052
  __( 'Unavailable', 'wp-photo-album-plus' ) . '. ' .
1053
- '</span>. ';
1054
  }
1055
 
1056
  // Thumbnail
1057
  if ( ! $is_video ) {
1058
- echo
1059
- __( 'Thumbnail file:', 'wp-photo-album-plus') . ' ';
1060
  $tp = wppa_get_thumb_path( $id );
1061
  if ( is_file( $tp ) ) {
1062
 
1063
- echo
1064
- '<span id="thumbx-'.$id.'" >'.wppa_get_thumbx( $id ).'</span>' .
1065
  ' x ' .
1066
- '<span id="thumby-'.$id.'" >'.wppa_get_thumby( $id ).'</span>';
1067
- ' ' . '<span id="thumbfilesize-' . $id . '" >' . wppa_get_filesize( $tp ) . '</span>. ';
1068
 
1069
- echo
1070
  ' <input' .
1071
  ' type="checkbox"' .
1072
  ( $thumblock ? ' checked="checked"' : '' ) .
1073
- ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 );"' .
1074
  ' /> ' .
1075
- __( 'Locked', 'wp-photo-album-plus' ) . '. ';
1076
 
1077
  }
1078
  else {
1079
- echo
1080
- '<span style="color:red;" >' .
1081
  __( 'Unavailable', 'wp-photo-album-plus' ) . '. ' .
1082
- '</span>. ';
1083
  }
1084
  }
1085
 
1086
  // Local CDN
1087
  if ( wppa_cdn( 'admin' ) == 'local' ) {
1088
- echo __( 'Local CDN files', 'wp-photo-album-plus' ) . ':<span id="cdnfiles-' . $id . '" >';
1089
  $files = wppa_cdn_files( $id );
1090
  if ( is_array( $files ) ) {
1091
  foreach( $files as $file ) {
@@ -1095,119 +1027,115 @@ function wppaToggleExif( id, count ) {
1095
  $x = $t[0];
1096
  $y = $t[1];
1097
  $size = filesize( $file );
1098
- echo '
1099
  <a
1100
  href="' . wppa_cdn_url( $id, $x, $y ) . '"
1101
  target="_blank"
1102
  >' .
1103
  basename( $file ) .
1104
  ' </a>' .
1105
- sprintf( '%4.2fkB', $size / 1024 ) . ' ';
1106
  }
1107
  }
1108
  }
1109
- echo '</span>';
1110
  }
1111
 
1112
  // New line
1113
- echo '<br />';
1114
 
1115
  // Video
1116
  if ( $b_is_video ) {
1117
- echo
1118
  __( 'Video size:', 'wp-photo-album-plus' ) . ' ' .
1119
  __( 'Width:', 'wp-photo-album-plus' ) .
1120
  '<input' .
1121
- ' style="width:50px;margin:0 4px;"' .
1122
  ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"' .
1123
  ' value="' . esc_attr( $videox ) . '"' .
1124
  ' />' .
1125
  sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) .
1126
  __( 'Height:', 'wp-photo-album-plus' ) .
1127
  '<input' .
1128
- ' style="width:50px;margin:0 4px;"' .
1129
  ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"' .
1130
  ' value="' . esc_attr( $videoy ) . '"' .
1131
  ' />' .
1132
  sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) .
1133
- '. ';
1134
  if ( $duration ) {
1135
  $duration = intval( $duration * 100 ) / 100;
1136
  if ( $duration < 120.0 ) {
1137
- echo sprintf( __( 'Duration: %s seconds', 'wp-photo-album-plus' ) ,$duration ) .
1138
- '. ';
1139
  }
1140
  else {
1141
- echo sprintf( __( 'Duration: %s minutes and %s seconds', 'wp-photo-album-plus' ),
1142
  sprintf( '%d', floor( $duration / 60 ) ),
1143
  sprintf( '%4.2f', $duration % 60 ) ) .
1144
- '. ';
1145
  }
1146
  }
1147
 
1148
- echo
1149
- __( 'Formats:', 'wp-photo-album-plus' ) . ' ';
1150
  $c = 0;
1151
  foreach ( $is_video as $fmt ) {
1152
- echo
1153
  $fmt . ' ' .
1154
  __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1155
- wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
1156
  $c++;
1157
  if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1158
- echo '. ';
1159
  }
1160
  else {
1161
- echo ', ';
1162
  }
1163
  }
1164
  }
1165
 
1166
  // Audio
1167
  if ( $b_has_audio ) {
1168
- echo
1169
- __( 'Formats:', 'wp-photo-album-plus' ) . ' ';
1170
  $c = 0;
1171
  foreach ( $has_audio as $fmt ) {
1172
- echo
1173
  $fmt . ' ' .
1174
  __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1175
- wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) );
1176
  $c++;
1177
  if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1178
- echo '. ';
1179
  }
1180
  else {
1181
- echo ', ';
1182
  }
1183
  }
1184
  }
1185
 
1186
- echo
1187
  '</td>' .
1188
  '</tr>' .
1189
  '</tbody>' .
1190
- '</table>';
1191
 
1192
- echo // Section 2
1193
- "\n" . '<!-- Section 2 -->';
1194
 
1195
  if ( ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) ||
1196
  ( wppa_switch( 'enable_panorama' ) ) ||
1197
  ( is_file( wppa_get_photo_path( $id ) ) && wppa_switch( 'watermark_on' ) )
1198
  ) {
1199
- echo
1200
  '<table' .
1201
  ' class="wppa-table wppa-photo-table"' .
1202
- ' style="width:100%;"' .
1203
  ' >' .
1204
  '<tbody>' .
1205
  '<tr>' .
1206
- '<td>';
1207
 
1208
  // Stereo
1209
  if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
1210
- echo
1211
  __( 'Stereophoto:', 'wp-photo-album-plus' ) . ' ' .
1212
  '<select' .
1213
  ' id="stereo-' . $id . '"' .
@@ -1224,27 +1152,26 @@ function wppaToggleExif( id, count ) {
1224
  '</option>' .
1225
  '</select>' .
1226
  ' ' .
1227
- __( 'Images:', 'wp-photo-album-plus' ) . ' ';
1228
  $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1229
 
1230
  if ( empty( $files ) ) {
1231
- echo
1232
- __( 'None', 'wp-photo-album-plus' ) . '. ';
1233
  }
1234
  else {
1235
  sort( $files );
1236
  $c = 0;
1237
  foreach ( $files as $file ) {
1238
- echo
1239
- '<a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank" >' .
1240
  basename( $file ) .
1241
- '</a>';
1242
  $c++;
1243
  if ( $c == count( $files ) ) {
1244
- echo '. ';
1245
  }
1246
  else {
1247
- echo ', ';
1248
  }
1249
  }
1250
  }
@@ -1254,39 +1181,38 @@ function wppaToggleExif( id, count ) {
1254
  if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1255
  $can_panorama = $photoy && $photox / $photoy >= 1.999;
1256
  if ( $can_panorama ) {
1257
- echo
1258
  __( 'Panorama' ) . ': ' .
1259
- '<select onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )" >' .
1260
  '<option value="0"' . ( $panorama == '0' ? ' selected="selected"' : '' ) . ' >' . __( '- none -', 'wp-photo-album-plus' ) . '</option>' .
1261
  '<option value="1"' . ( $panorama == '1' ? ' selected="selected"' : '' ) . ' >' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>' .
1262
  '<option value="2"' . ( $panorama == '2' ? ' selected="selected"' : '' ) . ' >' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>' .
1263
- '</select>';
1264
 
1265
  $source_file = wppa_get_source_path( $id );
1266
  if ( wppa_is_file( $source_file ) ) {
1267
  $source_file_sizes = wppa_getimagesize( $source_file );
1268
 
1269
  if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1270
- echo
1271
  '. ' . __( 'Make 360 from', 'wp-photo-album-plus' ) . ': ' . '
1272
  <select
1273
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1274
  title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '"
1275
  >
1276
- <option value="" >'.__('Select', 'wp-photo-album-plus').'</option>';
1277
  $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
1278
  foreach( $t as $v ) {
1279
- echo '<option value="'.$v.'" '.($v==$angle?'selected="selected" ':' ').'>'.$v.'&deg;</option>';
1280
  }
1281
- echo '
1282
- <option value="0" >'.__('Undo', 'wp-photo-album-plus').'</option>
1283
- </select>';
1284
  }
1285
  }
1286
  }
1287
  else {
1288
- echo
1289
- __( 'Too narrow for panorama.', 'wp-photo-album-plus' );
1290
  }
1291
  }
1292
 
@@ -1302,19 +1228,18 @@ function wppaToggleExif( id, count ) {
1302
  $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1303
  $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1304
  if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1305
- echo
1306
- ' ' . __( 'Watermark:', 'wp-photo-album-plus') . ' ';
1307
- echo
1308
  '<select' .
1309
  ' id="wmfsel_' . $id . '"' .
1310
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value);"' .
1311
  ' >' .
1312
  wppa_watermark_file_select( 'user', $album ) .
1313
  '</select>' .
1314
  ' ' . __( 'Pos:', 'wp-photo-album-plus' ) . ' ' .
1315
  '<select' .
1316
  ' id="wmpsel_' . $id . '"' .
1317
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value);"' .
1318
  ' >' .
1319
  wppa_watermark_pos_select( 'user', $album ) .
1320
  '</select>' .
@@ -1330,98 +1255,88 @@ function wppaToggleExif( id, count ) {
1330
  ' src="' . wppa_get_imgdir() . 'spinner.gif"' .
1331
  ' alt="Spin"' .
1332
  ' style="visibility:hidden"' .
1333
- ' />';
1334
  }
1335
  elseif ( basename( $wmfile ) != '--- none ---' ) {
1336
- echo
1337
- __( 'Watermark:', 'wp-photo-album-plus') . ' ';
1338
- echo
1339
  __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1340
- __( 'Pos:', 'wp-photo-album-plus') . ' ' . strip_tags( $wmpos );
1341
  }
1342
- echo ' ';
1343
  }
1344
 
1345
- echo
1346
  '</td>' .
1347
  '</tr>' .
1348
  '</tbody>' .
1349
- '</table>';
1350
  }
1351
 
1352
 
1353
- echo // Section 3
1354
- "\n" . '<!-- Section 3 -->' .
1355
-
1356
- '<table' .
1357
- ' class="wppa-table wppa-photo-table"' .
1358
- ' style="width:100%;"' .
1359
- ' >' .
1360
- '<tbody>' .
1361
- '<tr>' .
1362
- '<td>';
1363
 
1364
  // --- Actions ---
1365
 
1366
  // Rotate
1367
  if ( ! $b_is_video ) {
1368
  if ( ! wppa_can_admin_magick( $id ) ) {
1369
- echo
1370
- '<input' .
1371
- ' type="button"' .
1372
- ' onclick="wppaTryRotLeft( ' . $id . ' )"' .
1373
- ' value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus') ) . '"' .
1374
- ' />' .
1375
- ' ' .
1376
- '<input' .
1377
- ' type="button"' .
1378
- ' onclick="wppaTryRot180( ' . $id . ' )"' .
1379
- ' value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus') ) . '"' .
1380
- ' />' .
1381
- ' ' .
1382
- '<input' .
1383
- ' type="button"' .
1384
- ' onclick="wppaTryRotRight( ' . $id . ' )"' .
1385
- ' value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus') ) . '"' .
1386
- ' />' .
1387
- ' ' .
1388
- '<input' .
1389
- ' type="button"' .
1390
- ' onclick="wppaTryFlip( ' . $id . ' )"' .
1391
- ' value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . '&thinsp;&#8212;"' .
1392
- ' />' .
1393
- ' ' .
1394
- '<input' .
1395
- ' type="button"' .
1396
- ' onclick="wppaTryFlop( ' . $id . ' )"' .
1397
- ' value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . ' |"' .
1398
- ' />' .
1399
- ' ';
1400
  }
1401
  }
1402
 
1403
  // Remake displayfiles
1404
  if ( ! $is_video ) {
1405
- echo
1406
- '<input' .
1407
- ' type="button"' .
1408
- ' title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"' .
1409
- ' onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"' .
1410
- ' value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"' .
1411
- ' />' .
1412
- ' ';
1413
  }
1414
 
1415
  // Remake thumbnail
1416
  if ( ! $is_video ) {
1417
- echo
1418
- '<input' .
1419
- ' type="button"' .
1420
- ' title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"' .
1421
- ' onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"' .
1422
- ' value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"' .
1423
- ' />' .
1424
- ' ';
1425
  }
1426
 
1427
  // Move/copy
@@ -1442,29 +1357,28 @@ function wppaToggleExif( id, count ) {
1442
  );
1443
  }
1444
 
1445
- echo
1446
- __( 'Target album for copy/move:', 'wp-photo-album-plus' ) .
1447
- '<select' .
1448
- ' id="target-' . $id . '"' .
1449
- ' style="max-width:350px;"' .
1450
- ' >' .
1451
- $album_select[$album] .
1452
- '</select>';
1453
  }
1454
  else {
1455
- echo
1456
- __( 'Target album for copy/move:', 'wp-photo-album-plus' ) .
1457
- '<input' .
1458
- ' id="target-' . $id . '"' .
1459
- ' type="number"' .
1460
- ' style="height:20px;"' .
1461
- ' placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"' .
1462
- ' />';
1463
  }
1464
- echo
1465
- ' ';
1466
 
1467
- echo
1468
  '<input' .
1469
  ' type="button"' .
1470
  ' onclick="wppaTryMove( ' . $id . ', ' . $b_is_video . ' )"' .
@@ -1476,35 +1390,35 @@ function wppaToggleExif( id, count ) {
1476
  ' onclick="wppaTryCopy( ' . $id . ', ' . $b_is_video . ' )"' .
1477
  ' value="' . ( $b_is_video ? $cvt : $cpt ) . '"' .
1478
  ' />' .
1479
- ' ';
1480
  }
1481
 
1482
  // Delete
1483
  if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1484
  if ( ! wppa( 'front_edit' ) ) {
1485
- echo
1486
  '<input' .
1487
  ' type="button"' .
1488
- ' style="color:red;"' .
1489
  ' onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1490
  ( $deleted ?
1491
  ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1492
  ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) .
1493
  ' />' .
1494
- ' ';
1495
- }
1496
  }
1497
 
1498
  // Re-upload
1499
  if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'reup_is_restricted' ) ) {
1500
- echo
1501
  '<input' .
1502
  ' type="button"' .
1503
  ' onclick="jQuery( \'#re-up-' . $id . '\' ).css( \'display\', \'inline-block\' )"' .
1504
  ' value="' . esc_attr( __( 'Re-upload file', 'wp-photo-album-plus' ) ) . '"' .
1505
  ' />' .
1506
 
1507
- '<div id="re-up-' . $id . '" style="display:none" >' .
1508
  '<form' .
1509
  ' id="wppa-re-up-form-' . $id . '"' .
1510
  ' onsubmit="wppaReUpload( event, ' . $id . ', \'' . $filename . '\' )"' .
@@ -1519,36 +1433,21 @@ function wppaToggleExif( id, count ) {
1519
  ' value="' . esc_attr( __( 'Upload', 'wp-photo-album-plus' ) ) . '"' .
1520
  ' />' .
1521
  '</form>' .
1522
- '</div>';
1523
- }
1524
-
1525
- // Refresh
1526
- /*
1527
- if ( ! wppa( 'front_edit' ) ) {
1528
- echo
1529
- '<input' .
1530
- ' type="button"' .
1531
- ' onclick="wppaReload( \'#photo_' . $id . '\')"' .
1532
- ' value="' . esc_attr( __( 'Refresh page', 'wp-photo-album-plus' ) ) . '"' .
1533
- ' />';
1534
  }
1535
- */
1536
 
1537
-
1538
-
1539
- echo
1540
  '</td>' .
1541
  '</tr>' .
1542
  '</tbody>' .
1543
- '</table>';
1544
 
1545
  // Section 3a ImageMagick editing commands
1546
  if ( wppa_can_admin_magick( $id ) && ! $quick ) {
1547
 
1548
- echo
1549
  '<table' .
1550
  ' class="wppa-table wppa-photo-table"' .
1551
- ' style="width:100%;"' .
1552
  ' >' .
1553
  '<tbody>' .
1554
  '<tr>' .
@@ -1558,253 +1457,229 @@ function wppaToggleExif( id, count ) {
1558
  '</td>' .
1559
  '</tr>' .
1560
  '<tr>' .
1561
- '<td>';
1562
 
1563
  // --- Actions ---
1564
 
1565
  // Rotate left
1566
- echo
1567
- '<input' .
1568
- ' type="button"' .
1569
- ' onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"' .
1570
- ' value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus') ) . '"' .
1571
- ' />' .
1572
- ' ';
1573
 
1574
  // Rotat 180
1575
- echo
1576
- '<input' .
1577
- ' type="button"' .
1578
- ' onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"' .
1579
- ' value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus') ) . '"' .
1580
- ' />' .
1581
- ' ';
1582
 
1583
  // Rotate right
1584
- echo
1585
- '<input' .
1586
- ' type="button"' .
1587
- ' onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"' .
1588
- ' value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus') ) . '"' .
1589
- ' />' .
1590
- ' ';
1591
 
1592
  // Flip
1593
- echo
1594
- '<input' .
1595
- ' type="button"' .
1596
- ' onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"' .
1597
- ' value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . '&thinsp;&#8212;"' .
1598
- ' title="-flip"' .
1599
- ' />' .
1600
- ' ';
1601
 
1602
  // Flop
1603
- echo
1604
- '<input' .
1605
- ' type="button"' .
1606
- ' onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"' .
1607
- ' value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus') ) . ' |"' .
1608
- ' title="-flop"' .
1609
- ' />' .
1610
- ' ';
1611
 
1612
  // Enhance
1613
- echo
1614
- '<input' .
1615
- ' type="button"' .
1616
- ' onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"' .
1617
- ' value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus') ) . '"' .
1618
- ' title="-enhance"' .
1619
- ' />' .
1620
- ' ';
1621
 
1622
  // Sharpen
1623
- echo
1624
- '<input' .
1625
- ' type="button"' .
1626
- ' onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"' .
1627
- ' value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"' .
1628
- ' title="-sharpen 0x1"' .
1629
- ' />' .
1630
- ' ';
1631
 
1632
  // Blur
1633
- echo
1634
- '<input' .
1635
- ' type="button"' .
1636
- ' onclick="wppaTryMagick( ' . $id . ', \'blur\' )"' .
1637
- ' value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"' .
1638
- ' title="-blur 0x1"' .
1639
- ' />' .
1640
- ' ';
1641
 
1642
  // Auto gamma
1643
- echo
1644
- '<input' .
1645
- ' type="button"' .
1646
- ' onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"' .
1647
- ' value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"' .
1648
- ' title="-auto-gamma"' .
1649
- ' />' .
1650
- ' ';
1651
 
1652
  // Auto level
1653
- echo
1654
- '<input' .
1655
- ' type="button"' .
1656
- ' onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"' .
1657
- ' value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"' .
1658
- ' title="-auto-level"' .
1659
- ' />' .
1660
- ' ';
1661
 
1662
  // Contrast+
1663
- echo
1664
- '<input' .
1665
- ' type="button"' .
1666
- ' onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"' .
1667
- ' value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"' .
1668
- ' title="-brightness-contrast 0x5"' .
1669
- ' />' .
1670
- ' ';
1671
 
1672
  // Contrast-
1673
- echo
1674
- '<input' .
1675
- ' type="button"' .
1676
- ' onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"' .
1677
- ' value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"' .
1678
- ' title="-brightness-contrast 0x-5"' .
1679
- ' />' .
1680
- ' ';
1681
 
1682
  // Brightness+
1683
- echo
1684
- '<input' .
1685
- ' type="button"' .
1686
- ' onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"' .
1687
- ' value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"' .
1688
- ' title="-brightness-contrast 5"' .
1689
- ' />' .
1690
- ' ';
1691
 
1692
  // Brightness-
1693
- echo
1694
- '<input' .
1695
- ' type="button"' .
1696
- ' onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"' .
1697
- ' value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"' .
1698
- ' title="-brightness-contrast -5"' .
1699
- ' />' .
1700
- ' ';
1701
 
1702
  // Despeckle
1703
- echo
1704
- '<input' .
1705
- ' type="button"' .
1706
- ' onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"' .
1707
- ' value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"' .
1708
- ' title="-despeckle"' .
1709
- ' />' .
1710
- ' ';
1711
 
1712
  // Lenear gray
1713
- echo
1714
- '<input' .
1715
- ' type="button"' .
1716
- ' onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"' .
1717
- ' value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"' .
1718
- ' title="-colorspace gray"' .
1719
- ' />' .
1720
- ' ';
1721
 
1722
  // Non-linear gray
1723
- echo
1724
- '<input' .
1725
- ' type="button"' .
1726
- ' onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"' .
1727
- ' value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"' .
1728
- ' title="-grayscale Rec709Luma"' .
1729
- ' />' .
1730
- ' ';
1731
 
1732
  // Charcoal
1733
- echo
1734
- '<input' .
1735
- ' type="button"' .
1736
- ' onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"' .
1737
- ' value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"' .
1738
- ' title="-charcoal"' .
1739
- ' />' .
1740
- ' ';
1741
 
1742
  // Paint
1743
- echo
1744
- '<input' .
1745
- ' type="button"' .
1746
- ' onclick="wppaTryMagick( ' . $id . ', \'paint\' )"' .
1747
- ' value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"' .
1748
- ' title="-paint"' .
1749
- ' />' .
1750
- ' ';
1751
 
1752
  // Sepia
1753
- echo
1754
- '<input' .
1755
- ' type="button"' .
1756
- ' onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"' .
1757
- ' value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"' .
1758
- ' title="-sepia-tone 80%"' .
1759
- ' />' .
1760
- ' ';
1761
-
1762
- // Show/hide horizon
1763
- echo
1764
- '<input' .
1765
- ' type="button"' .
1766
- ' onclick="wppaToggleHorizon()"' .
1767
- ' value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"' .
1768
- ' title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"' .
1769
- ' />' .
1770
- ' ';
1771
 
1772
  // Anticlock 0.5 deg
1773
- echo
1774
- '<input' .
1775
- ' type="button"' .
1776
- ' onclick="wppaTryMagick( ' . $id . ', \'skyleft\' );"' .
1777
- ' value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1778
- ' title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"' .
1779
- ' />' .
1780
- ' ';
1781
 
1782
  // Clockwise 0.5 deg
1783
- echo
1784
- '<input' .
1785
- ' type="button"' .
1786
- ' onclick="wppaTryMagick( ' . $id . ', \'skyright\' );"' .
1787
- ' value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"' .
1788
- ' title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"' .
1789
- ' />' .
1790
- ' ';
1791
 
1792
  // Crop
1793
- echo
1794
- '<input' .
1795
- ' type="button"' .
1796
- ' id="button-' . $id . '"' .
1797
- ' value="Crop"' .
1798
- ' title=""' .
1799
- ' />' .
1800
- ' ';
1801
 
1802
  // Set cropbox aspect ratio
1803
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
1804
  $dflt = wppa_opt( 'image_magick_ratio' );
1805
- echo
1806
- '<select' .
1807
- ' onchange="wppaCropper[' . $id . '].setAspectRatio(this.value);"' .
1808
  ' title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"' .
1809
  '>' .
1810
  '<option value="NaN" ' . ( $dflt == 'NaN' ? 'selected' : '' ) . ' >' . __( 'free', 'wp-photo-album-plus' ) . '</option>' .
@@ -1822,7 +1697,7 @@ function wppaToggleExif( id, count ) {
1822
  '<option value="0.625" ' . ( $dflt == '0.625' ? 'selected' : '' ) . ' >5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1823
  '<option value="0.5625" ' . ( $dflt == '0.5625' ? 'selected' : '' ) . ' >9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1824
  '<option value="0.5" ' . ( $dflt == '0.5' ? 'selected' : '' ) . ' >1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1825
- '</select>';
1826
 
1827
  if ( $dflt == 'ratio' ) {
1828
  $value = $ratio;
@@ -1833,10 +1708,11 @@ function wppaToggleExif( id, count ) {
1833
  else {
1834
  $value = $dflt;
1835
  }
1836
- echo
1837
- '<script>jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});</script>';
1838
 
1839
- echo
 
 
 
1840
  '</td>' .
1841
  '</tr>' .
1842
  '<tr>' .
@@ -1845,7 +1721,7 @@ function wppaToggleExif( id, count ) {
1845
  ': ' .
1846
  '<span' .
1847
  ' id="magickstack-' . strval( intval( $id ) ). '"' .
1848
- ' style="color:blue;"' .
1849
  ' >' .
1850
  sanitize_text_field( $magickstack ) .
1851
  '</span>' .
@@ -1859,26 +1735,27 @@ function wppaToggleExif( id, count ) {
1859
  ' style="' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"' .
1860
  ' />' .
1861
  '</td>' .
1862
- '</tr>';
1863
 
1864
  // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
1865
  wppa( 'for_sm', true );
1866
- echo
1867
  '<tr>' .
1868
  '<td>' .
1869
- '<div style="display:inline-block;margin-left:25%;width:50%;" >' .
 
1870
  '<img' .
1871
  ' id="fs-img-' . $id . '"' .
1872
  ' src="' . esc_url( wppa_get_photo_url( $id ) ) . '"' .
1873
- ' style="float:left;max-width:100%;" ' .
1874
- ' />';
1875
 
1876
- echo
1877
- '<script>
1878
  window.addEventListener("DOMContentLoaded", function () {
1879
 
1880
  /* Responive does not always works correcly, */
1881
- /* so we do a manual relace after resizing the window */
1882
  window.addEventListener("resize", function(){
1883
  var c = wppaCropper[' . $id . '];
1884
  var url = document.getElementById("fs-img-' . $id . '").src;
@@ -1902,34 +1779,30 @@ function wppaToggleExif( id, count ) {
1902
  var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
1903
  wppaTryMagick( "' . $id . '", \'crop\', value );
1904
  };
1905
- });
1906
-
1907
- </script>';
1908
-
1909
- echo
1910
- '<style>.cropper-drag-box{background-color:transparent;}img{max-width:100%}</style>';
1911
 
1912
- echo
1913
  '</div>' .
1914
  '</td>' .
1915
  '</tr>' .
1916
  '</tbody>' .
1917
- '</table>';
1918
  }
1919
 
1920
  // Reset switch
1921
  wppa( 'for_sm', false );
1922
 
1923
- echo // Section 4
1924
  "\n" . '<!-- Section 4 -->' .
1925
  '<table' .
1926
  ' class="wppa-table wppa-photo-table"' .
1927
- ' style="width:100%;"' .
1928
  ' >' .
1929
- '<tbody>';
1930
 
1931
  // Name
1932
- echo
1933
  '<tr>' .
1934
  '<td>' .
1935
  __( 'Photoname:' , 'wp-photo-album-plus') . '
@@ -1937,73 +1810,44 @@ function wppaToggleExif( id, count ) {
1937
  <td>' .
1938
  '<input' .
1939
  ' type="text"' .
1940
- ' style="width:100%;"' .
1941
  ' id="pname-' . $id . '"' .
1942
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value);"' .
1943
  ' value="' . esc_attr( stripslashes( $name ) ) . '"' .
1944
  ' />
1945
  <br />
1946
- <span style="float:right;" >' .
1947
  __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1948
  </span>
1949
  </td>' .
1950
  '<td>' .
1951
  '</td>' .
1952
- '</tr>';
1953
 
1954
  // Description
1955
  if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1956
- echo
1957
  '<tr>' .
1958
  '<td>' .
1959
  __( 'Description:', 'wp-photo-album-plus' ) .
1960
- '</td>';
1961
- if ( wppa_switch( 'use_wp_editor' ) ) {
1962
- $alfaid = wppa_alfa_id( $id );
1963
- echo
1964
- '<td>';
1965
- wp_editor( $description,
1966
- 'wppaphotodesc'.$alfaid,
1967
- array( 'wpautop' => true,
1968
- 'media_buttons' => false,
1969
- 'textarea_rows' => '6',
1970
- 'tinymce' => false
1971
- )
1972
- );
1973
- echo
1974
- '</td>' .
1975
- '<td>' .
1976
- '<input' .
1977
- ' type="button"' .
1978
- ' class="button-secundary"' .
1979
- ' value="' . esc_attr( __( 'Update Photo description', 'wp-photo-album-plus' ) ) . '"' .
1980
- ' onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', document.getElementById( \'wppaphotodesc' . $alfaid . '\' ).value )"' .
1981
- ' />' .
1982
- '<img' .
1983
- ' id="wppa-photo-spin-' . $id . '"' .
1984
- ' src="' . wppa_get_imgdir() . 'spinner.gif"' .
1985
- ' style="visibility:hidden"' .
1986
- ' />' .
1987
- '</td>';
1988
- }
1989
- else {
1990
- echo
1991
- '<td>' .
1992
- '<textarea' .
1993
- ' style="width:100%;height:60px;"' .
1994
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"' .
1995
- ' >' .
1996
- esc_textarea( stripslashes( $description ) ) .
1997
- '</textarea>' .
1998
- '</td>' .
1999
- '<td>' .
2000
- '</td>';
2001
- }
2002
- echo
2003
- '</tr>';
2004
  }
2005
  else {
2006
- echo
2007
  '<tr>' .
2008
  '<td>' .
2009
  __( 'Description:', 'wp-photo-album-plus') .
@@ -2013,35 +1857,33 @@ function wppaToggleExif( id, count ) {
2013
  '</td>' .
2014
  '<td>' .
2015
  '</td>' .
2016
- '</tr>';
2017
  }
2018
 
2019
  // Tags
2020
  $allowed = ! wppa_switch( 'newtags_is_restricted' ) || wppa_user_is( 'administrator' );
2021
- echo
2022
  '<tr>' .
2023
  '<td>' .
2024
  __( 'Tags:', 'wp-photo-album-plus' ) .
2025
- '</td>';
2026
-
2027
- echo
2028
  '<td>' .
2029
  '<input' .
2030
  ' id="tags-' . $id . '"' .
2031
  ' type="text"' .
2032
- ' style="width:100%;"' .
2033
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', this.value)"' .
2034
  ' value="' . $tags . '"' .
2035
  ( $allowed ? '' : ' readonly="readonly"' ) .
2036
  ' />' .
2037
  ( $allowed ?
2038
  '<br />' .
2039
- '<span class="description" >' .
2040
  __( 'Separate tags with commas.', 'wp-photo-album-plus') .
2041
  '</span>' : '' ) .
2042
  '<select' .
2043
  ' onchange="wppaAddTag( this.value, \'tags-' . $id . '\' ); wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', document.getElementById( \'tags-' . $id . '\' ).value )"' .
2044
- ' >';
2045
 
2046
  if ( wppa_switch( 'predef_tags_only' ) ) {
2047
  $keys = explode( ',', trim( wppa_opt( 'minimum_tags' ) ) );
@@ -2055,23 +1897,23 @@ function wppaToggleExif( id, count ) {
2055
  }
2056
 
2057
  if ( is_array( $taglist ) ) {
2058
- echo '<option value="" >' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>';
2059
  foreach ( $taglist as $tag ) {
2060
- echo '<option value="' . esc_attr( $tag['tag'] ) . '" >' . htmlspecialchars( $tag['tag'] ) . '</option>';
2061
  }
2062
  if ( ! $allowed ) {
2063
- echo '<option value="-clear-" >' . __( '- clear -', 'wp-photo-album-plus' ) . '</option>';
2064
  }
2065
  }
2066
  else {
2067
- echo '<option value="0" >' . __( 'No tags yet', 'wp-photo-album-plus' ) . '</option>';
2068
  }
2069
- echo
2070
  '</select>' .
2071
  '</td>' .
2072
  '<td>' .
2073
- '</td>';
2074
- '</tr>';
2075
 
2076
  // Custom
2077
  if ( wppa_switch( 'custom_fields' ) ) {
@@ -2084,27 +1926,27 @@ function wppaToggleExif( id, count ) {
2084
  }
2085
  foreach( array_keys( $custom_data ) as $key ) {
2086
  if ( wppa_opt( 'custom_caption_' . $key ) ) {
2087
- echo
2088
  '<tr>' .
2089
  '<td>' .
2090
  apply_filters( 'translate_text', wppa_opt( 'custom_caption_' . $key ) ) .
2091
- '<small style="float:right" >' .
2092
  '(w#cc'.$key.')' .
2093
  '</small>:' .
2094
  '</td>' .
2095
  '<td>' .
2096
  '<input' .
2097
  ' type="text"' .
2098
- ' style="width:100%;"' .
2099
  ' id="custom_' . $key . '-' . $id . '"' .
2100
- ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'custom_' . $key . '\', this.value);"' .
2101
  ' value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"' .
2102
  '/>' .
2103
  '</td>' .
2104
  '<td>' .
2105
  '<small>(w#cd'.$key.')</small>' .
2106
  '</td> ' .
2107
- '</tr>';
2108
  }
2109
  }
2110
  }
@@ -2112,24 +1954,24 @@ function wppaToggleExif( id, count ) {
2112
  // -- Auto Page --
2113
  if ( wppa_switch( 'auto_page' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
2114
  $appl = get_permalink( wppa_get_the_auto_page( $id ) );
2115
- echo
2116
  '<tr>' .
2117
  '<td>' .
2118
  __( 'Autopage Permalink:', 'wp-photo-album-plus' ) .
2119
  '</td>' .
2120
  '<td>' .
2121
- '<a href="' . $appl . '" target="_blank" >' .
2122
  $appl .
2123
  '</a>' .
2124
  '</td>' .
2125
  '<td>' .
2126
  '</td>' .
2127
- '</tr>';
2128
  }
2129
 
2130
  // -- Link url --
2131
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
2132
- echo
2133
  '<tr>' .
2134
  '<td>' .
2135
  __( 'Photo specific link url:', 'wp-photo-album-plus' ) .
@@ -2138,7 +1980,7 @@ function wppaToggleExif( id, count ) {
2138
  '<input' .
2139
  ' type="text"' .
2140
  ' id="pislink-' . $id . '"' .
2141
- ' style="width:100%;"' .
2142
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linkurl\', this.value)"' .
2143
  ' value="' . esc_attr( $linkurl ) . '"' .
2144
  ' />' .
@@ -2163,14 +2005,14 @@ function wppaToggleExif( id, count ) {
2163
  '</select>' .
2164
  '<input' .
2165
  ' type="button"' .
2166
- ' onclick="window.open( jQuery( \'#pislink-' . $id . '\' ).val(), jQuery( \'#pistarget-' . $id . '\' ).val() );"' .
2167
  ' value="' . __( 'Tryit!', 'wp-photo-album-plus' ) . '"' .
2168
  ' />' .
2169
  '</td>' .
2170
- '</tr>';
2171
 
2172
  // -- Link title --
2173
- echo
2174
  '<tr>' .
2175
  '<td>' .
2176
  __( 'Photo specific link title:', 'wp-photo-album-plus' ) .
@@ -2178,27 +2020,27 @@ function wppaToggleExif( id, count ) {
2178
  '<td>' .
2179
  '<input' .
2180
  ' type="text"' .
2181
- ' style="width:100%;"' .
2182
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktitle\', this.value)"' .
2183
  ' value="' . esc_attr( $linktitle ) . '"' .
2184
- ' />';
2185
  if ( current_user_can( 'wppa_settings' ) ) {
2186
- echo
2187
  '<br />' .
2188
- '<span class="description" >' .
2189
  __( 'If you want this link to be used, check \'PS Overrule\' checkbox in table VI.' , 'wp-photo-album-plus') .
2190
- '</span>';
2191
  }
2192
- echo
2193
  '</td>' .
2194
  '<td>' .
2195
  '</td>' .
2196
- '</tr>';
2197
  }
2198
 
2199
  // -- Custom ALT field --
2200
  if ( wppa_opt( 'alt_type' ) == 'custom' ) {
2201
- echo
2202
  '<tr>' .
2203
  '<td>' .
2204
  __( 'HTML Alt attribute:' , 'wp-photo-album-plus') .
@@ -2206,14 +2048,14 @@ function wppaToggleExif( id, count ) {
2206
  '<td>' .
2207
  '<input' .
2208
  ' type="text"' .
2209
- ' style="width:100%;"' .
2210
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'alt\', this.value)"' .
2211
  ' value="' . esc_attr( $alt ) . '"' .
2212
  ' />' .
2213
  '</td>' .
2214
  '<td>' .
2215
  '</td>' .
2216
- '</tr>';
2217
  }
2218
 
2219
  // If Quick, skip the following items for speed and space
@@ -2221,7 +2063,7 @@ function wppaToggleExif( id, count ) {
2221
 
2222
  // Shortcode
2223
  if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
2224
- echo
2225
  '<tr>' .
2226
  '<td>' .
2227
  __( 'Single image shortcode', 'wp-photo-album-plus' ) . ':' .
@@ -2232,82 +2074,81 @@ function wppaToggleExif( id, count ) {
2232
  '<td>' .
2233
  '<small>' .
2234
  sprintf( __( 'See %s The documentation %s for more shortcode options.', 'wp-photo-album-plus' ),
2235
- '<a href="https://wppa.nl/shortcode-reference/" target="_blank" >',
2236
  '</a>'
2237
  ) .
2238
  '</small>' .
2239
  '</td>' .
2240
- '</tr>';
2241
  }
2242
 
2243
  // Source permalink
2244
  if ( is_file( wppa_get_source_path( $id ) ) ) {
2245
  $spl = wppa_get_source_pl( $id );
2246
- echo
2247
  '<tr>' .
2248
  '<td>' .
2249
  __( 'Permalink', 'wp-photo-album-plus' ) . ':' .
2250
  '</td>' .
2251
  '<td>' .
2252
- '<a href="' . esc_attr( $spl ) . '" target="_blank" >' . htmlspecialchars( $spl ) . '</a>' .
2253
  '</td>' .
2254
  '<td>' .
2255
  '</td>' .
2256
- '</tr>';
2257
  }
2258
 
2259
  // High resolution url
2260
  $hru = htmlspecialchars( wppa_get_hires_url( $id ) );
2261
- echo
2262
  '<tr>' .
2263
  '<td>' .
2264
  __( 'High resolution url', 'wp-photo-album-plus') . ':' .
2265
  '</td>' .
2266
  '<td>' .
2267
- '<a href="' . esc_attr( $hru ) . '" target="_blank" >' . $hru . '</a>' .
2268
  '</td>' .
2269
  '<td>' .
2270
  '</td>' .
2271
- '</tr>';
2272
 
2273
  // Display file
2274
  if ( is_file( wppa_get_photo_path( $id ) ) ) {
2275
  $lru = wppa_fix_poster_ext( wppa_get_lores_url( $id ), $id );
2276
- echo
2277
  '<tr>' .
2278
  '<td>' .
2279
  __( 'Display file url', 'wp-photo-album-plus') . ':' .
2280
  '</td>' .
2281
  '<td>' .
2282
- '<a href="' . esc_attr( $lru ) . '" target="_blank" >' . $lru . '</a>' .
2283
  '</td>' .
2284
  '<td>' .
2285
  '</td>' .
2286
- '</tr>';
2287
  }
2288
 
2289
  // Thumbnail
2290
  if ( is_file( wppa_get_thumb_path( $id ) ) ) {
2291
  $tnu = wppa_fix_poster_ext( wppa_get_tnres_url( $id ), $id );
2292
- echo
2293
  '<tr>' .
2294
  '<td>' .
2295
  __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':' .
2296
  '</td>' .
2297
  '<td>' .
2298
- '<a href="' . esc_attr( $tnu ) . '" target="_blank" >' . $tnu . '</a>' .
2299
  '</td>' .
2300
  '<td>' .
2301
  '</td>' .
2302
- '</tr>';
2303
  }
2304
  }
2305
- echo
2306
  '</tbody>' .
2307
- '</table>';
2308
 
2309
- echo // Section 5
2310
- "\n" . '<!-- Section 5 -->';
2311
 
2312
  // IPTC
2313
  if ( ! $quick ) {
@@ -2315,48 +2156,48 @@ function wppaToggleExif( id, count ) {
2315
  WHERE photo = %s
2316
  ORDER BY tag, id", $id ), ARRAY_A );
2317
  if ( ! empty( $iptcs ) ) {
2318
- echo
2319
  '<table><tbody><tr><td><input' .
2320
  ' type="button"' .
2321
  ' id="wppa-iptc-button-' . $id . '"' .
2322
  ' class="button-secundary"' .
2323
  ' value="' . esc_attr( sprintf( __( 'Show %d IPTC items', 'wp-photo-album-plus' ), count( $iptcs ) ) ) . '"' .
2324
- ' onclick="wppaToggleIptc( ' . $id . ', ' . count( $iptcs ) . ' );"' .
2325
  ' /></td></tr></tbody></table>' .
2326
  '<table' .
2327
  ' id="wppa-iptc-' . $id . '"' .
2328
  ' class="wppa-table wppa-photo-table"' .
2329
- ' style="clear:both;width:99%;display:none;"' .
2330
  ' >' .
2331
  '<thead>' .
2332
- '<tr style="font-weight:bold;" >' .
2333
- '<td style="padding:0 4px;" >' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>' .
2334
- '<td style="padding:0 4px;" >' . __( 'Description', 'wp-photo-album-plus' ) . '</td>' .
2335
- '<td style="padding:0 4px;" >' . __( 'Value', 'wp-photo-album-plus' ) . '</td>' .
2336
  '</tr>' .
2337
  '</thead>' .
2338
- '<tbody>';
2339
 
2340
  foreach ( $iptcs as $iptc ) {
2341
 
2342
- echo '
2343
- <tr id="iptc-tr-' . $iptc['id'] . '" >
2344
- <td style="padding:0 4px;" >' . $iptc['tag'] . '</td>
2345
- <td style="padding:0 4px;" >' . esc_attr( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2346
- <td style="padding:0 4px;" >
2347
  <input
2348
  type="text"
2349
- style="width:500px;"
2350
- value="' . $iptc['description'] . '"
2351
  onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2352
  />
2353
  </td>
2354
- </tr>';
2355
  }
2356
 
2357
- echo
2358
  '</tbody>' .
2359
- '</table>';
2360
  }
2361
  }
2362
 
@@ -2367,65 +2208,64 @@ function wppaToggleExif( id, count ) {
2367
  ORDER BY tag, id", $id ), ARRAY_A );
2368
  if ( ! empty( $exifs ) ) {
2369
  $brand = wppa_get_camera_brand( $id );
2370
- echo
2371
  '<table><tbody><tr><td><input' .
2372
  ' type="button"' .
2373
  ' id="wppa-exif-button-' . $id . '"' .
2374
  ' class="button-secundary"' .
2375
  ' value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"' .
2376
- ' onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' );"' .
2377
  ' /></td></tr></tbody></table>' .
2378
  '<table' .
2379
  ' id="wppa-exif-' . $id . '"' .
2380
  ' class="wppa-table wppa-photo-table"' .
2381
- ' style="clear:both;width:99%;display:none;"' .
2382
  ' >' .
2383
  '<thead>' .
2384
- '<tr style="font-weight:bold;" >' .
2385
- '<td style="padding:0 4px;" >' . __( 'Exif tag', 'wp-photo-album-plus' ) . '</td>' .
2386
- '<td style="padding:0 4px;" >' . __( 'Brand', 'wp-photo-album-plus' ) . '</td>' .
2387
- '<td style="padding:0 4px;" >' . __( 'Description', 'wp-photo-album-plus' ) . '</td>' .
2388
- '<td style="padding:0 4px;" >' . __( 'Raw value', 'wp-photo-album-plus' ) . '</td>' .
2389
- '<td style="padding:0 4px;" >' . __( 'Formatted value', 'wp-photo-album-plus' ) . '</td>' .
2390
  '</tr>' .
2391
  '</thead>' .
2392
- '<tbody>';
2393
 
2394
  foreach ( $exifs as $exif ) {
2395
  $desc = $exif['description'];
2396
  if ( is_serialized( $desc ) ) {
2397
  $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
2398
  }
2399
- echo '
2400
- <tr id="exif-tr-' . $exif['id'] . '" >
2401
- <td style="padding:0 4px;" >'.$exif['tag'].'</td>';
2402
 
2403
  if ( $brand && $exif['brand'] ) {
2404
- echo '
2405
- <td style="padding:0 4px;" >' . $brand . '</td>
2406
- <td style="padding:0 4px;" >' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>';
2407
  }
2408
  else {
2409
- echo '
2410
- <td style="padding:0 4px;" ></td>
2411
- <td style="padding:0 4px;" >' . wppa_exif_tagname( $exif['tag'] ) . ':</td>';
2412
  }
2413
 
2414
- echo '
2415
- <td style="padding:0 4px;" >' . $desc . '</td>
2416
- <td style="padding:0 4px;" >' . wppa_format_exif( $exif['tag'], $exif['description'], $brand ) . '</td>
2417
- </tr>';
2418
 
2419
  }
2420
 
2421
- echo
2422
  '</tbody>' .
2423
- '</table>';
2424
  }
2425
  }
2426
 
2427
- echo // Section 6
2428
- "\n" . '<!-- Section 6 -->';
2429
 
2430
  // Comments
2431
  if ( ! $quick ) {
@@ -2433,70 +2273,71 @@ function wppaToggleExif( id, count ) {
2433
  WHERE photo = %s
2434
  ORDER BY timestamp DESC ", $id ), ARRAY_A );
2435
  if ( ! empty( $comments ) ) {
2436
- echo
2437
  '<table' .
2438
  ' class="wppa-table wppa-photo-table"' .
2439
- ' style="width:100%;"' .
2440
  ' >' .
2441
  '<thead>' .
2442
- '<tr style="font-weight:bold;" >' .
2443
- '<td style="padding:0 4px;" >#</td>' .
2444
- '<td style="padding:0 4px;" >User</td>' .
2445
- '<td style="padding:0 4px;" >Time since</td>' .
2446
- '<td style="padding:0 4px;" >Status</td>' .
2447
- '<td style="padding:0 4px;" >Comment</td>' .
2448
  '</tr>' .
2449
  '</thead>' .
2450
- '<tbody>';
2451
 
2452
  foreach ( $comments as $comment ) {
2453
- echo '
2454
- <tr id="com-tr-' . $comment['id'] . '" >
2455
- <td style="padding:0 4px;" >'.$comment['id'].'</td>
2456
- <td style="padding:0 4px;" >'.$comment['user'].'</td>
2457
- <td style="padding:0 4px;" >'.wppa_get_time_since( $comment['timestamp'] ).'</td>';
2458
  if ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) {
2459
  $p = ( $comment['status'] == 'pending' ) ? 'selected="selected" ' : '';
2460
  $a = ( $comment['status'] == 'approved' ) ? 'selected="selected" ' : '';
2461
  $s = ( $comment['status'] == 'spam' ) ? 'selected="selected" ' : '';
2462
  $t = ( $comment['status'] == 'trash' ) ? 'selected="selected" ' : '';
2463
- echo
2464
- '<td style="padding:0 4px;" >' .
2465
  '<select' .
2466
  ' id="com-stat-' . $comment['id'] . '"' .
2467
- ' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ');"' .
 
2468
  ' >' .
2469
  '<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
2470
  '<option value="approved" '.$a.'>'.__( 'Approved' , 'wp-photo-album-plus').'</option>' .
2471
  '<option value="spam" '.$s.'>'.__( 'Spam' , 'wp-photo-album-plus').'</option>' .
2472
  '<option value="trash" '.$t.'>'.__( 'Trash' , 'wp-photo-album-plus').'</option>' .
2473
  '</select >' .
2474
- '</td>';
2475
  }
2476
  else {
2477
- echo '<td style="padding:0 4px;" >';
2478
  if ( $comment['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
2479
  elseif ( $comment['status'] == 'approved' ) _e( 'Approved' , 'wp-photo-album-plus');
2480
  elseif ( $comment['status'] == 'spam' ) _e( 'Spam' , 'wp-photo-album-plus');
2481
  elseif ( $comment['status'] == 'trash' ) _e( 'Trash' , 'wp-photo-album-plus');
2482
- echo '</td>';
2483
  }
2484
- echo '<td style="padding:0 4px;" >'.$comment['comment'].'</td>
2485
- </tr>' .
2486
- '<script>wppaSetComBgCol(' . $comment['id'] . ')</script>';
2487
  }
2488
 
2489
- echo
2490
  '</tbody>' .
2491
- '</table>';
2492
  }
2493
  }
2494
 
2495
- echo
2496
- '<script>wppaPhotoStatusChange( ' . $id . ' )</script>' .
2497
- '<div style="clear:both;"></div>' .
 
2498
  '</div>' .
2499
- '<div style="clear:both;margin-top:7px;"></div>';
2500
 
2501
  } /* foreach photo */
2502
 
@@ -2522,12 +2363,12 @@ function wppa_album_photos_bulk( $album ) {
2522
  if ( wppa_get( 'bulk-action' ) ) {
2523
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2524
  if ( wppa_get( 'bulk-photo' ) ) {
2525
- $ids = wppa_get( 'bulk-photo' );
2526
  $newalb = wppa_get( 'bulk-album' );
2527
  $status = wppa_get( 'bulk-status' );
2528
  $owner = wppa_get( 'bulk-owner' );
2529
  $totcount = count( $ids );
2530
- if ( $newalb && ! is_numeric( $newalb ) ) wp_die( 'Security check failure 1' );
2531
  if ( is_array( $ids ) ) {
2532
  foreach ( array_keys( $ids ) as $id ) {
2533
  $skip = false;
@@ -2651,11 +2492,10 @@ function wppa_album_photos_bulk( $album ) {
2651
  }
2652
 
2653
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2654
- $next_after = wppa_get( 'next-after', '0' );
2655
- $p = wppa_get( 'page' );
2656
- if ( ! is_numeric( $p ) ) $p = 0;
2657
- $page = ( $p ? max( wppa_get( 'page' ), '1' ) : '1' ) + wppa_get( 'next-after' );
2658
- $skip = ( $page > '0' ? ( $page - '1' ) * $pagesize : '0' );
2659
 
2660
  if ( $album ) {
2661
  if ( $album == 'moderate' ) {
@@ -2690,169 +2530,63 @@ function wppa_album_photos_bulk( $album ) {
2690
  if ( $photos ) {
2691
  $plink = $link . '&next-after=' . $next_after;
2692
  wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
2693
- ?>
2694
- <script type="text/javascript" >
2695
- function wppaBulkActionChange( elm, id ) {
2696
- wppa_setCookie( 'wppa_bulk_action',elm.value,365 );
2697
- if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' );
2698
- else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' );
2699
- if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' );
2700
- else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' );
2701
- if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' );
2702
- else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' );
2703
- }
2704
- function wppaBulkDoitOnClick() {
2705
- var photos = jQuery( '.wppa-bulk-photo' );
2706
- var count=0;
2707
- for ( i=0; i< photos.length; i++ ) {
2708
- var photo = photos[i];
2709
- if ( photo.checked ) count++;
2710
- }
2711
- if ( count == 0 ) {
2712
- alert( 'No photos selected' );
2713
- return false;
2714
- }
2715
- var action = document.getElementById( 'wppa-bulk-action' ).value;
2716
- switch ( action ) {
2717
- case '':
2718
- alert( 'No action selected' );
2719
- return false;
2720
- break;
2721
- case 'wppa-bulk-delete':
2722
- break;
2723
- case 'wppa-bulk-move-to':
2724
- case 'wppa-bulk-copy-to':
2725
- var album = document.getElementById( 'wppa-bulk-album' ).value;
2726
- if ( album == 0 ) {
2727
- alert( 'No album selected' );
2728
- return false;
2729
- }
2730
- break;
2731
- case 'wppa-bulk-status':
2732
- var status = document.getElementById( 'wppa-bulk-status' ).value;
2733
- if ( status == 0 ) {
2734
- alert( 'No status selected' );
2735
- return false;
2736
- }
2737
- break;
2738
- case 'wppa-bulk-owner':
2739
- var owner = documnet.getElementById( 'wppa-bulk-owner' ).value;
2740
- if ( owner == 0 ) {
2741
- alert( 'No new owner selected' );
2742
- return false;
2743
- }
2744
- break;
2745
- default:
2746
- alert( 'Unimplemented action requested: '+action );
2747
- return false;
2748
- break;
2749
 
2750
- }
2751
- return true;
2752
- }
2753
- function wppaSetThumbsize( elm ) {
2754
- var thumbsize = elm.value;
2755
- wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 );
2756
- jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' );
2757
- jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' );
2758
- jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' );
2759
- }
2760
- jQuery(document).ready( function() {
2761
- var action = wppa_getCookie( 'wppa_bulk_action' );
2762
- document.getElementById( 'wppa-bulk-action' ).value = action;
2763
- if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) {
2764
- jQuery( '#wppa-bulk-album' ).css( 'display','inline' );
2765
- document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' );
2766
- }
2767
- if ( action == 'wppa-bulk-status' ) {
2768
- jQuery( '#wppa-bulk-status' ).css( 'display','inline' );
2769
- document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' );
2770
- }
2771
- if ( action == 'wppa-bulk-owner' ) {
2772
- jQuery( '#wppa-bulk-owner' ).css( 'display','inline' );
2773
- document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' );
2774
- }
2775
- } );
2776
  function wppaTryMove( id, video ) {
2777
 
2778
  var query;
2779
 
2780
  if ( ! jQuery( '#target-' + id ).val() ) {
2781
- alert( '<?php echo esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) ?>' );
2782
  return false;
2783
  }
2784
 
2785
  if ( video ) {
2786
- query = '<?php echo esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) ?>';
2787
  }
2788
  else {
2789
- query = '<?php echo esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) ?>';
2790
  }
2791
 
2792
  if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
2793
- jQuery( '#moving-' + id ).html( '<?php _e( 'Moving...', 'wp-photo-album-plus' ) ?>' );
2794
- wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan="8" >', '</td>' );
2795
- }
2796
- }
 
 
 
 
 
 
 
 
 
 
 
2797
 
2798
- function wppaToggleConfirmDelete( elm ) {
2799
- var status = jQuery( elm ).prop( 'checked' );
2800
- if ( status ) {
2801
- wppa_setCookie( 'wppaConfirmDelete', 'checked', 365 );
2802
- }
2803
- else {
2804
- wppa_setCookie( 'wppaConfirmDelete', 'unchecked', 365 );
2805
- }
2806
- }
2807
- function wppaToggleConfirmMove( elm ) {
2808
- var status = jQuery( elm ).prop( 'checked' );
2809
- if ( status ) {
2810
- wppa_setCookie( 'wppaConfirmMove', 'checked', 365 );
2811
- }
2812
- else {
2813
- wppa_setCookie( 'wppaConfirmMove', 'unchecked', 365 );
2814
- }
2815
- }
2816
- function wppaSetConfirmDelete( id ) {
2817
- var status = wppa_getCookie( 'wppaConfirmDelete' );
2818
- if ( status == 'checked' ) {
2819
- jQuery( '#' + id ).prop( 'checked', true );
2820
- }
2821
- else {
2822
- jQuery( '#' + id ).prop( 'checked', false );
2823
- }
2824
- }
2825
- function wppaSetConfirmMove( id ) {
2826
- var status = wppa_getCookie( 'wppaConfirmMove' );
2827
- if ( status == 'checked' ) {
2828
- jQuery( '#' + id ).prop( 'checked', true );
2829
- }
2830
- else {
2831
- jQuery( '#' + id ).prop( 'checked', false );
2832
- }
2833
- }
2834
 
2835
- </script>
2836
- <?php /**/ ?>
2837
- <form action="<?php echo $link.'&wppa-page='.$page.'#manage-photos' ?>" method="post" >
2838
  <?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
2839
  <h3>
2840
- <span style="font-weight:bold;" ><?php _e( 'Bulk action:' , 'wp-photo-album-plus') ?></span>
2841
- <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, 'bulk-album' )" >
2842
- <option value="" ></option>
2843
- <option value="wppa-bulk-delete" ><?php _e( 'Delete' , 'wp-photo-album-plus') ?></option>
2844
- <option value="wppa-bulk-move-to" ><?php _e( 'Move to' , 'wp-photo-album-plus') ?></option>
2845
- <option value="wppa-bulk-copy-to" ><?php _e( 'Copy to' , 'wp-photo-album-plus') ?></option>
2846
  <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
2847
- <option value="wppa-bulk-status" ><?php _e( 'Set status to' , 'wp-photo-album-plus') ?></option>
2848
  <?php } ?>
2849
  <?php if ( wppa_user_is( 'administrator' ) && wppa_switch( 'photo_owner_change' ) ) { ?>
2850
- <option value="wppa-bulk-owner" ><?php _e( 'Set owner to' , 'wp-photo-album-plus') ?></option>
2851
  <?php } ?>
2852
  </select>
2853
  <?php
2854
- // <select name="wppa-bulk-album" id="wppa-bulk-album" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_album',this.value,365 );" >
2855
- echo wppa_album_select_a( array( 'checkaccess' => true,
2856
  'path' => true,
2857
  'exclude' => $album,
2858
  'selected' => '0',
@@ -2861,58 +2595,58 @@ function wppaSetConfirmMove( id ) {
2861
  'tagopen' => '<select' .
2862
  ' name="wppa-bulk-album"' .
2863
  ' id="wppa-bulk-album"' .
2864
- ' style="display:none;"' .
2865
- ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 );"' .
2866
  ' >',
2867
  'tagname' => 'wppa-bulk-album',
2868
  'tagid' => 'wppa-bulk-album',
2869
  'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
2870
  'tagstyle' => 'display:none;cursor:pointer;',
2871
- ) );
2872
  ?>
2873
- <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 );" >
2874
- <option value="" ><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
2875
- <option value="pending" ><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
2876
- <option value="publish" ><?php _e( 'Publish' , 'wp-photo-album-plus') ?></option>
2877
  <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) $dis = ' disabled'; else $dis = ''; ?>
2878
- <option value="featured"<?php echo $dis?> ><?php _e( 'Featured' , 'wp-photo-album-plus') ?></option>
2879
- <option value="gold" <?php echo $dis?> ><?php _e( 'Gold' , 'wp-photo-album-plus') ?></option>
2880
- <option value="silver" <?php echo $dis?> ><?php _e( 'Silver' , 'wp-photo-album-plus') ?></option>
2881
- <option value="bronze" <?php echo $dis?> ><?php _e( 'Bronze' , 'wp-photo-album-plus') ?></option>
2882
- <option value="scheduled" <?php echo $dis?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus') ?></option>
2883
- <option value="private" <?php echo $dis ?> ><?php _e( 'Private' , 'wp-photo-album-plus') ?></option>
2884
  </select>
2885
  <!-- Owner -->
2886
  <?php $users = wppa_get_users();
2887
  if ( count( $users ) ) { ?>
2888
- <select name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 );">
2889
- <option value="" ><?php _e( '- select an owner -' , 'wp-photo-album-plus') ?></option>
2890
  <?php
2891
 
2892
  foreach ( $users as $user ) {
2893
- echo '<option value="' . esc_attr( $user['user_login'] ) . '" >' . htmlspecialchars( $user['display_name'] ) . ' (' . htmlspecialchars( $user['user_login'] ) . ')</option>';
2894
  }
2895
  ?>
2896
  </select>
2897
  <?php } else { ?>
2898
- <input name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 );" />
2899
  <?php } ?>
2900
  <!-- Submit -->
2901
  <input type="submit" onclick="return wppaBulkDoitOnClick()" class="button-primary" value="<?php _e( 'Doit!' , 'wp-photo-album-plus') ?>" />
2902
  <?php
2903
  if ( wppa_is_mobile() ) {
2904
- echo '<br />';
2905
  }
2906
  ?>
2907
  <?php $nextafterselhtml =
2908
- '<select name="next-after" >' .
2909
  '<option value="-1" ' . ( $next_after == '-1' ? 'selected="selected"' : '' ) . ' >' . __( 'the previous page', 'wp-photo-album-plus' ) . '</option>' .
2910
  '<option value="0" ' . ( $next_after == '0' ? 'selected="selected"' : '' ) . ' >' . __( 'the same page', 'wp-photo-album-plus' ) . '</option>' .
2911
  '<option value="1" ' . ( $next_after == '1' ? 'selected="selected"' : '' ) . ' >' . __( 'the next page', 'wp-photo-album-plus' ) . '</option>' .
2912
  '</select>';
2913
- echo sprintf( __( 'Go to %s after Doit!.', 'wp-photo-album-plus'), $nextafterselhtml );
2914
  if ( wppa_is_mobile() ) {
2915
- echo '<br />';
2916
  }
2917
  ?>
2918
 
@@ -2921,7 +2655,7 @@ function wppaSetConfirmMove( id ) {
2921
  id="confirm-delete"
2922
  name="confirm-delete"
2923
  checked="checked"
2924
- onchange="wppaToggleConfirmDelete( this );"
2925
  />
2926
  <?php _e('Confirm delete', 'wp-photo-album-plus') ?>
2927
 
@@ -2930,22 +2664,18 @@ function wppaSetConfirmMove( id ) {
2930
  id="confirm-move"
2931
  name="confirm-move"
2932
  checked="checked"
2933
- onchange="wppaToggleConfirmMove(this);"
2934
  />
2935
  <?php _e('Confirm move', 'wp-photo-album-plus') ?>
2936
 
2937
- <?php echo '<small style="float:right;" > (' . count( $photos ) . ')</small>'; ?>
2938
- <script>
2939
- jQuery(document).ready( function() {
2940
- wppaSetConfirmDelete( 'confirm-delete' );
2941
- wppaSetConfirmMove( 'confirm-move' );
2942
- });
2943
- </script>
2944
  </h3>
2945
  <?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
2946
- <table class="widefat" >
2947
- <thead style="font-weight:bold;" >
2948
- <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked );" /></td>
2949
  <td><?php _e( 'ID' , 'wp-photo-album-plus') ?></td>
2950
  <td><?php _e( 'Preview' , 'wp-photo-album-plus') ?></td>
2951
  <td><?php _e( 'Name' , 'wp-photo-album-plus') ?></td>
@@ -2955,198 +2685,190 @@ function wppaSetConfirmMove( id ) {
2955
  <td><?php _e( 'Remark' , 'wp-photo-album-plus') ?></td>
2956
  </thead>
2957
  <tbody>
2958
- <?php foreach ( $photos as $photo ) { ?>
2959
- <?php $id = $photo['id']; ?>
2960
-
2961
- <?php // Album for moderate
2962
- static $modalbum;
2963
- if ( $album == 'moderate' ) {
2964
- if ( $modalbum != $photo['album'] ) {
2965
- echo '
2966
- <tr>
2967
- <td colspan="8" style="background-color:lightgreen;" >
2968
- <h3 style="margin:0;" >' .
2969
- sprintf( __( 'Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
2970
- '<i>' . htmlspecialchars( wppa_get_album_name( $photo['album'] ) ) . '</i>',
2971
- '<i>' . htmlspecialchars( wppa_get_album_item( $photo['album'], 'owner' ) ) . '</i>' ) .
2972
- '</h3>
2973
- </td>
2974
- </tr>';
2975
- $modalbum = $photo['album'];
 
 
2976
  }
2977
- }
2978
- ?>
2979
-
2980
- <?php $maxsize = wppa_get_minisize(); ?>
2981
- <tr id="photoitem-<?php echo $photo['id'] ?>" >
2982
- <!-- Checkbox -->
2983
- <td>
2984
- <input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa-nonce_'.$photo['id'] ); ?>" />
2985
- <input type="checkbox" name="wppa-bulk-photo[<?php echo $photo['id'] ?>]" class="wppa-bulk-photo" />
2986
- </td>
2987
- <!-- ID and delete link -->
2988
- <td><?php
2989
- echo
2990
- '<a' .
2991
- ' href="' . $edit_link . '&photo=' . $photo['id'] . '"' .
2992
- ' target="_blank"' .
2993
- ' >' .
2994
- $photo['id'] .
2995
- '</a>' .
2996
- '<br />' .
2997
- '<a' .
2998
- ' id="wppa-delete-' . $photo['id'] . '"' .
2999
- ' onclick="if ( ! jQuery(\'#confirm-delete\').prop(\'checked\') ||
3000
- confirm( \'' . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . '\' ) ) {
3001
- jQuery(this).html( \'' . esc_js( __('Deleting...', 'wp-photo-album-plus') ) . '\' );
3002
- wppaAjaxDeletePhoto( \'' . $photo['id'] . '\', \'<td colspan=8 >\', \'</td>\' ) }"' .
3003
- ' style="color:red;font-weight:bold;cursor:pointer;"' .
3004
- ' >' .
3005
- __( 'Delete', 'wp-photo-album-plus' ) .
3006
- '</a>';
3007
- ?>
3008
- </td>
3009
- <!-- Preview -->
3010
- <td style="min-width:240px; text-align:center;" >
3011
- <?php if ( wppa_is_video( $photo['id'] ) ) { ?>
3012
- <a href="<?php echo esc_url( str_replace( 'xxx', 'mp4', wppa_get_photo_url( $photo['id'] ) ) ) ?>" target="_blank" title="<?php esc_attr( __('Click to see fullsize', 'wp-photo-album-plus') ) ?>" >
3013
- <?php // Animating size changes of a video tag is not a good idea. It will rapidly screw up browser cache and cpu ?>
3014
- <?php echo wppa_get_video_html( array(
3015
- 'id' => $id,
3016
- // 'width' => $imgwidth,
3017
- 'height' => '60',
3018
- 'controls' => false,
3019
- // 'margin_top' => '0',
3020
- // 'margin_bottom' => '0',
3021
- 'tagid' => 'pa-id-'.$id,
3022
- // 'cursor' => 'cursor:pointer;',
3023
- 'events' => ' onmouseover="jQuery( this ).css( \'height\', \'160\' )" onmouseout="jQuery( this ).css( \'height\', \'60\' )"',
3024
- // 'title' => $title,
3025
- 'preload' => 'metadata',
3026
- // 'onclick' => $onclick,
3027
- // 'lb' => false,
3028
- // 'class' => '',
3029
- // 'style' => $imgstyle,
3030
- 'use_thumb' => true
3031
- ));
3032
-
3033
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3034
  ?>
3035
- <!-- <video preload="metadata" style="height:60px;" onmouseover="jQuery( this ).css( 'height', '160' )" onmouseout="jQuery( this ).css( 'height', '60' )" >
3036
- <?php // echo wppa_get_video_body( $photo['id'] ) ?>
3037
- </video> -->
3038
- </a>
3039
- <?php }
3040
- else {
3041
- echo
3042
- '<a' .
3043
- ' href="' . esc_url( wppa_get_photo_url( $photo['id'] ) ) . '"' .
3044
- ' target="_blank"' .
3045
- ' title="' . esc_attr( __( 'Click to see fullsize', 'wp-photo-album-plus' ) ) . '"' .
3046
- ' >' .
3047
- '<img' .
3048
- ' class="wppa-bulk-thumb"' .
3049
- ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
3050
- ' style="max-width:' . $maxsize . 'max-height:' . $maxsize . 'px;"' .
3051
- ' />' .
3052
- '</a>';
3053
- }
3054
- ?>
3055
- </td>
3056
- <!-- Name, size, move -->
3057
- <!-- Name -->
3058
- <td style="width:25%;" >
3059
- <input type="text" style="width:300px;" id="pname-<?php echo $photo['id'] ?>" onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'name', this.value);" value="<?php echo esc_attr( stripslashes( $photo['name'] ) ) ?>" />
3060
- <!-- Size -->
3061
- <?php
3062
- if ( wppa_is_video( $photo['id'] ) ) {
3063
- echo '<br />'.strval(intval(wppa_get_videox( $photo['id'] ))).' x '.strval(intval(wppa_get_videoy( $photo['id'] ))).' px.';
3064
  }
3065
  else {
3066
- $sp = wppa_get_source_path( $photo['id'] );
3067
- if ( is_file( $sp ) ) {
3068
- $ima = getimagesize( $sp );
3069
- if ( is_array( $ima ) ) {
3070
- echo '<br />'.$ima['0'].' x '.$ima['1'].' px.';
3071
- }
3072
- }
 
 
 
 
 
3073
  }
3074
  ?>
3075
- <!-- Move -->
3076
- <?php
3077
- $max = wppa_opt( 'photo_admin_max_albums' );
3078
- if ( ! $max || wppa_get_total_album_count() < $max ) {
3079
-
3080
- // If not done yet, get the album options html with the current album excluded
3081
- if ( ! isset( $album_select[$album] ) ) {
3082
- $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
3083
- 'path' => true,
3084
- 'exclude' => $album,
3085
- 'selected' => '0',
3086
- 'addpleaseselect' => true,
3087
- 'sort' => true,
3088
- )
3089
- );
 
 
3090
  }
3091
-
3092
- echo
3093
- '<br />' . __( 'Target album for move to:', 'wp-photo-album-plus' ) . '<br />' .
3094
- '<select' .
3095
- ' id="target-' . $id . '"' .
3096
- ' onchange="wppaTryMove(' . $id . ', ' . ( wppa_is_video( $id ) ? 'true' : 'false' ) . ');"' .
3097
- ' style="max-width:300px;"' .
3098
- ' >' .
3099
- $album_select[$album] .
3100
- '</select>' .
3101
- '<span id="moving-' . $id . '" style="color:red;font-weight:bold;" ></span>';
3102
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3103
 
3104
- ?>
3105
- </td>
3106
- <!-- Description -->
3107
- <td style="width:25%;" >
3108
- <textarea class="wppa-bulk-dec" style="height:50px; width:100%" onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'description', this.value)" ><?php echo( esc_textarea( stripslashes( $photo['description'] ) ) ) ?></textarea>
3109
- </td>
3110
- <!-- Status -->
3111
- <td>
3112
- <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
3113
- <select id="status-<?php echo $photo['id'] ?>" onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id'] ?>, 'status', this.value); wppaPhotoStatusChange( <?php echo $photo['id'] ?> ); ">
3114
- <option value="pending" <?php if ( $photo['status']=='pending' ) echo 'selected="selected"'?> ><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
3115
- <option value="publish" <?php if ( $photo['status']=='publish' ) echo 'selected="selected"'?> ><?php _e( 'Publish' , 'wp-photo-album-plus') ?></option>
3116
- <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) $dis = ' disabled'; else $dis = ''; ?>
3117
- <option value="featured" <?php if ( $photo['status']=='featured' ) echo 'selected="selected"'; echo $dis?> ><?php _e( 'Featured' , 'wp-photo-album-plus') ?></option>
3118
- <option value="gold" <?php if ( $photo['status'] == 'gold' ) echo 'selected="selected"'; echo $dis?> ><?php _e( 'Gold' , 'wp-photo-album-plus') ?></option>
3119
- <option value="silver" <?php if ( $photo['status'] == 'silver' ) echo 'selected="selected"'; echo $dis?> ><?php _e( 'Silver' , 'wp-photo-album-plus') ?></option>
3120
- <option value="bronze" <?php if ( $photo['status'] == 'bronze' ) echo 'selected="selected"'; echo $dis?> ><?php _e( 'Bronze' , 'wp-photo-album-plus') ?></option>
3121
- <option value="scheduled" <?php if ( $photo['status'] == 'scheduled' ) echo 'selected="selected"'; echo $dis?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus') ?></option>
3122
- <option value="private" <?php if ( $photo['status'] == 'private' ) echo 'selected="selected"'; echo $dis ?> ><?php _e( 'Private' , 'wp-photo-album-plus') ?></option>
3123
- </select>
3124
- <?php }
3125
- else {
3126
- if ( $photo['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
3127
- elseif ( $photo['status'] == 'publish' ) _e( 'Publish' , 'wp-photo-album-plus');
3128
- elseif ( $photo['status'] == 'featured' ) e( 'Featured' );
3129
- elseif ( $photo['status'] == 'gold' ) _e( 'Gold' , 'wp-photo-album-plus');
3130
- elseif ( $photo['status'] == 'silver' ) _e( 'Silver' , 'wp-photo-album-plus');
3131
- elseif ( $photo['status'] == 'bronze' ) _e( 'Bronze' , 'wp-photo-album-plus');
3132
- elseif ( $photo['status'] == 'scheduled' ) _e( 'Scheduled' , 'wp-photo-album-plus');
3133
- elseif ( $photo['status'] == 'private' ) _e( 'Private' , 'wp-photo-album-plus');
3134
- } ?>
3135
- </td>
3136
- <!-- Owner -->
3137
- <td>
3138
- <?php echo $photo['owner'] ?>
3139
- </td>
3140
- <!-- Remark -->
3141
- <td id="remark-<?php echo $photo['id'] ?>" style="width:25%;" >
3142
- <?php _e( 'Not modified' , 'wp-photo-album-plus') ?>
3143
- <script type="text/javascript" >wppaPhotoStatusChange( <?php echo $photo['id'] ?> )</script>
3144
- </td>
3145
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
3146
  <?php } ?>
3147
  </tbody>
3148
- <tfoot style="font-weight:bold;" >
3149
- <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked );" /></td>
3150
  <td><?php _e( 'ID' , 'wp-photo-album-plus') ?></td>
3151
  <td><?php _e( 'Preview' , 'wp-photo-album-plus') ?></td>
3152
  <td><?php _e( 'Name' , 'wp-photo-album-plus') ?></td>
@@ -3163,18 +2885,18 @@ function wppaSetConfirmMove( id ) {
3163
  else {
3164
  if ( $page == '1' ) {
3165
  if ( wppa_get( 'searchstring' ) ) {
3166
- echo '<h3>'.__( 'No photos matching your search criteria.' , 'wp-photo-album-plus').'</h3>';
3167
  }
3168
  elseif ( $album == 'moderate' ) {
3169
- echo '<h3>'.__( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h3>';
3170
  }
3171
  else {
3172
- echo '<h3>'.__( 'No photos yet in this album.' , 'wp-photo-album-plus' ).'</h3>';
3173
  }
3174
  }
3175
  else {
3176
  $page_1 = $page - '1';
3177
- echo sprintf( __( 'Page %d is empty, try <a href="%s" >page %d</a>.' , 'wp-photo-album-plus'), $page, $link.'&wppa-page='.$page_1.'#manage-photos', $page_1 );
3178
  }
3179
  }
3180
  }
@@ -3199,54 +2921,7 @@ global $wpdb;
3199
 
3200
  if ( $photos ) {
3201
  ?>
3202
- <style>
3203
- .sortable-placeholder {
3204
- width: <?php echo $size ?>px;
3205
- height: <?php echo $size ?>px;
3206
- margin: 5px;
3207
- border: 1px solid #cccccc;
3208
- border-radius:3px;
3209
- float: left;
3210
- }
3211
- .ui-state-default {
3212
- position: relative;
3213
- width: <?php echo $size ?>px;
3214
- height: <?php echo $size ?>px;
3215
- margin: 5px;
3216
- border-radius:3px;
3217
- float: left;
3218
- }
3219
- .wppa-publish {
3220
- border: 1px solid;
3221
- background-color: rgb( 255, 255, 224 );
3222
- border-color: rgb( 230, 219, 85 );
3223
- }
3224
- .wppa-featured {
3225
- border: 1px solid;
3226
- background-color: rgb( 224, 255, 224 );
3227
- border-color: rgb( 85, 238, 85 );
3228
- }
3229
- .wppa-pending, .wppa-scheduled, .wppa-private {
3230
- border: 1px solid;
3231
- background-color: rgb( 255, 235, 232 );
3232
- border-color: rgb( 204, 0, 0 );
3233
- }
3234
- .wppa-bronze {
3235
- border: 1px solid;
3236
- background-color: rgb( 221, 221, 187 );
3237
- border-color: rgb( 204, 204, 170 );
3238
- }
3239
- .wppa-silver {
3240
- border: 1px solid;
3241
- background-color: rgb( 255, 255, 255 );
3242
- border-color: rgb( 238, 238, 238 );
3243
- }
3244
- .wppa-gold {
3245
- border: 1px solid;
3246
- background-color: rgb( 238, 238, 204 );
3247
- border-color: rgb( 221, 221, 187 );
3248
- }
3249
- </style>
3250
  <script>
3251
  jQuery( function() {
3252
  jQuery( "#sortable" ).sortable( {
@@ -3256,7 +2931,7 @@ global $wpdb;
3256
  var ids = jQuery( ".wppa-sort-item" );
3257
  var seq = jQuery( ".wppa-sort-seqn" );
3258
  var idx = 0;
3259
- var descend = <?php if ( $is_descending ) echo 'true'; else echo 'false' ?>;
3260
  while ( idx < ids.length ) {
3261
  var newvalue;
3262
  if ( descend ) newvalue = ids.length - idx;
@@ -3291,10 +2966,10 @@ global $wpdb;
3291
  jQuery( '#wppa-seqno-'+photo ).html( seqno );
3292
  break;
3293
  case '99': // Photo is gone
3294
- jQuery( '#wppa-seqno-'+photo ).html( '<span style="color"red" >deleted</span>' );
3295
  break;
3296
  default: // Any error
3297
- jQuery( '#wppa-seqno-'+photo ).html( '<span style="color"red" >Err:'+ArrValues[1]+'</span>' );
3298
  break;
3299
  }
3300
  wppaAjaxRequests--;
@@ -3312,7 +2987,7 @@ global $wpdb;
3312
  }
3313
  </script>
3314
  <?php if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence order has only effect if the photo order method is set to <b>Order#</b>' , 'wp-photo-album-plus') ) ?>
3315
- <div class="widefat" style="border-color:#cccccc" >
3316
  <div id="sortable">
3317
  <?php foreach ( $photos as $photo ) {
3318
  if ( wppa_is_video( $photo['id'] ) ) {
@@ -3336,11 +3011,11 @@ global $wpdb;
3336
  $mt = ( $mh - ( $imgs[1]/$imgs[0] * $mw ) ) / '2' + '15';
3337
  }
3338
  ?>
3339
- <div id="photoitem-<?php echo $photo['id'] ?>" class="ui-state-default wppa-<?php echo $photo['status'] ?>" style="background-image:none; text-align:center; cursor:move;" >
3340
  <?php if ( wppa_is_video( $photo['id'] ) ) { ?>
3341
  <?php $id = $photo['id'] ?>
3342
- <?php $imgstyle = 'max-width:'.$mw.'px; max-height:'.$mh.'px; margin-top:'.$mt.'px;' ?>
3343
- <?php echo wppa_get_video_html( array(
3344
  'id' => $id,
3345
  // 'width' => $imgwidth,
3346
  // 'height' => '60',
@@ -3357,39 +3032,36 @@ global $wpdb;
3357
  'class' => 'wppa-bulk-thumb',
3358
  'style' => $imgstyle,
3359
  'use_thumb' => true
3360
- ));
3361
- ?>
3362
- <!-- <video preload="metadata" class="wppa-bulk-thumb" style="max-width:<?php echo $mw ?>px; max-height:<?php echo $mh ?>px; margin-top: <?php echo $mt ?>px;" >
3363
- // echo //wppa_get_video_body( $photo['id'] ) ?>
3364
- </video>
3365
- -->
3366
- <?php }
3367
  else {
3368
- echo
3369
  '<img' .
3370
  ' class="wppa-bulk-thumb"' .
3371
  ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
3372
- ' style="max-width:' . $mw . 'px; max-height:' . $mh . 'px; margin-top:' . $mt . 'px;" />';
3373
  } ?>
3374
- <div style="font-size:9px; position:absolute; bottom:24px; text-align:center; width:<?php echo $size ?>px;" ><?php echo wppa_get_photo_name( $photo['id'] ) ?></div>
3375
- <div style="text-align: center; width: <?php echo $size ?>px; position:absolute; bottom:8px;" >
3376
- <span style="margin-left:15px;float:left"><?php echo __( 'Id: ' , 'wp-photo-album-plus').$photo['id']?></span>
3377
  <?php if ( wppa_is_video( $photo['id'] ) )_e('Video', 'wp-photo-album-plus'); ?>
3378
  <?php if ( wppa_has_audio( $photo['id'] ) ) _e('Audio', 'wp-photo-album-plus'); ?>
3379
- <span style="float:right; margin-right:15px;"><?php echo __( 'Ord: ' , 'wp-photo-album-plus').'<span id="wppa-seqno-'.$photo['id'].'" >'.$photo['p_order'] ?></span>
3380
  </div>
3381
- <input type="hidden" id="photo-nonce-<?php echo $photo['id'] ?>" value="<?php echo wp_create_nonce( 'wppa-nonce_'.$photo['id'] ); ?>" />
3382
- <input type="hidden" class="wppa-sort-item" value="<?php echo $photo['id'] ?>" />
3383
- <input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php echo $photo['id'] ?>" value="<?php echo $photo['p_order'] ?>" />
3384
  </div>
3385
  <?php } ?>
3386
  </div>
3387
- <div style="clear:both;"></div>
3388
  </div>
3389
  <?php
3390
  }
3391
  else {
3392
- echo '<h3>'.__( 'The album is empty.' , 'wp-photo-album-plus').'</h3>';
3393
  }
3394
  }
3395
  else {
@@ -3521,7 +3193,7 @@ function wppa_show_search_statistics() {
3521
  global $wppa_search_stats;
3522
 
3523
  if ( wppa_get( 'searchstring' ) ) {
3524
- echo '
3525
  <table>
3526
  <thead>
3527
  <tr>
@@ -3537,18 +3209,18 @@ global $wppa_search_stats;
3537
  <td><hr /></td>
3538
  </tr>
3539
  </thead>
3540
- <tbody>';
3541
  $count = empty( $wppa_search_stats ) ? '0' : count( $wppa_search_stats );
3542
  $c = '0';
3543
  $s = '';
3544
  foreach( $wppa_search_stats as $search_item ) {
3545
  $c++;
3546
  if ( $c == ( $count - 1 ) ) {
3547
- echo '<tr><td><hr /></td><td><hr /></td></tr>';
3548
- $s = 'style="font-weight:bold;"';
3549
  }
3550
  if ( $search_item['word'] ) {
3551
- echo '
3552
  <tr>
3553
  <td '.$s.'>' .
3554
  $search_item['word'] . '
@@ -3556,16 +3228,15 @@ global $wppa_search_stats;
3556
  <td '.$s.'>' .
3557
  $search_item['count'] . '
3558
  </td>
3559
- </tr>';
3560
  }
3561
  }
3562
- echo '
3563
- </table>';
3564
  }
3565
  }
3566
 
3567
  // New style fron-end edit photo
3568
- function wppa_fe_edit_new_style( $photo ) {
3569
 
3570
  $items = array( 'upn-name',
3571
  'upn-description',
@@ -3625,21 +3296,21 @@ function wppa_fe_edit_new_style( $photo ) {
3625
  );
3626
 
3627
  // Open page
3628
- echo
3629
  '<div' .
3630
- ' style="width:100%;margin-top:8px;padding:8px;display:block;box-sizing:border-box;background-color:#fff;"' .
3631
  ' >' .
3632
  '<h3>' .
3633
  '<img' .
3634
- ' style="height:50px;"' .
3635
  ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo ) ) . '"' .
3636
  wppa_get_imgalt( $photo ) .
3637
  ' />' .
3638
  '&nbsp;&nbsp;' .
3639
- wppa_opt( 'fe_edit_caption' ) . '</h3>';
3640
 
3641
  // Open form
3642
- echo
3643
  '<form' .
3644
  ' >' .
3645
  '<input' .
@@ -3647,7 +3318,7 @@ function wppa_fe_edit_new_style( $photo ) {
3647
  ' id="wppa-nonce-' . wppa_encrypt_photo( $photo ) . '"' .
3648
  ' name="wppa-nonce"' .
3649
  ' value="' . wp_create_nonce( 'wppa-nonce-' . $photo ) . '"' .
3650
- ' />';
3651
 
3652
  // Get custom data
3653
  $custom = wppa_get_photo_item( $photo, 'custom' );
@@ -3661,8 +3332,7 @@ function wppa_fe_edit_new_style( $photo ) {
3661
  // Items
3662
  foreach ( array_keys( $items ) as $idx ) {
3663
  if ( $titles[$idx] && $doit[$idx] ) {
3664
- echo
3665
- '<h6>' . $titles[$idx] . '</h6>';
3666
 
3667
  if ( wppa_is_int( substr( $items[$idx], -1 ) ) ) {
3668
  $value = stripslashes( $custom_data[substr( $items[$idx], -1 )] );
@@ -3674,53 +3344,51 @@ function wppa_fe_edit_new_style( $photo ) {
3674
  }
3675
  }
3676
  if ( $types[$idx] == 'text' ) {
3677
- echo
3678
  '<input' .
3679
  ' type="text"' .
3680
- ' style="width:100%;"' .
3681
  ' id="' . $items[$idx] . '"' .
3682
  ' name="' . $items[$idx] . '"' .
3683
  ' value="' . esc_attr( $value ) . '"' .
3684
- ' />';
3685
  }
3686
  if ( $types[$idx] == 'textarea' ) {
3687
- echo
3688
  '<textarea' .
3689
- ' style="width:100%;min-width:100%;max-width:100%;"' .
3690
  ' id="' . $items[$idx] . '"' .
3691
  ' name="' . $items[$idx] . '"' .
3692
  ' >' .
3693
  esc_textarea( stripslashes( $value ) ) .
3694
- '</textarea>';
3695
  }
3696
  }
3697
  }
3698
 
3699
  // Submit
3700
- echo
3701
  '<input' .
3702
  ' type="button"' .
3703
- ' style="margin-top:8px;margin-right:8px;"' .
3704
  ' value="' . esc_attr( __( 'Send', 'wp-photo-album-plus' ) ) . '"' .
3705
- ' onclick="wppaUpdatePhotoNew(\'' . wppa_encrypt_photo( $photo ) . '\',\'' . wppa_get( 'occur' ) . '\');"' . //document.location.reload(true);"' .
3706
- ' />';
3707
 
3708
  // Cancel
3709
- echo
3710
  '<input' .
3711
  ' type="button"' .
3712
- ' style="margin-top:8px;"' .
3713
  ' value="' . esc_attr( __( 'Cancel', 'wp-photo-album-plus' ) ) . '"' .
3714
  ' onclick="jQuery( \'#wppa-modal-container-' . wppa_get( 'occur' ) . '\').dialog(\'close\')"' .
3715
- ' />';
3716
 
3717
  // Close form
3718
- echo
3719
- '</form>';
3720
 
3721
  // Close page
3722
- echo
3723
- '</div>';
3724
 
3725
  }
3726
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
20
  $photo = wppa_get( 'photo', '0', 'int' );
21
  $thumb = wppa_cache_thumb( $photo );
22
  if ( $thumb['owner'] == wppa_get_user() ) {
23
+ wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>', 'post' );
 
 
24
  wppa_album_photos( '', $photo );
25
+ wppa_echo( '</div>', 'post' );
 
26
  }
27
  else {
28
  wp_die( 'You do not have the rights to do this' );
31
 
32
  // Edit all photos owned by current user
33
  else {
34
+ wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photos', 'wp-photo-album-plus' ) . '</h2>', 'post' );
 
 
35
  wppa_album_photos( '', '', wppa_get_user() );
36
+ wppa_echo( '</div>', 'post' );
 
37
  }
38
  }
39
 
45
  $just_edit = wppa_get( 'just-edit' );
46
 
47
  if ( $photo && $just_edit && wppa_user_is( 'administrator' ) ) {
48
+ wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Edit photo', 'wp-photo-album-plus' ) . '</h2>' . wppa_get( 'just-edit' ), 'post' );
 
 
 
49
  wppa_album_photos( '', $photo, '', false );
50
+ wppa_echo( '</div>', 'post' );
 
51
  }
52
  else {
53
+ wppa_echo( '<div class="wrap"><h2>' . esc_html__( 'Moderate photos' , 'wp-photo-album-plus') . '</h2>', 'post' );
 
 
54
  if ( wppa_switch( 'moderate_bulk' ) ) {
55
  wppa_album_photos_bulk( 'moderate' );
56
  }
57
  else {
58
  wppa_album_photos( '', $photo, '', true );
59
  }
60
+ wppa_echo( '</div>', 'post' );
 
61
  }
62
  }
63
 
66
  global $wpdb;
67
 
68
  $pagesize = wppa_opt( 'photo_admin_pagesize' );
69
+ $page = wppa_get( 'wppa-page', '1' );
70
  if ( ! is_numeric( $page ) ) $page = 1;
71
  $skip = ( $page - '1' ) * $pagesize;
72
 
198
 
199
  // Single photo moderate requested
200
  if ( $photo ) {
201
+ wppa_echo( '<p>' . esc_html__( 'This photo is no longer awaiting moderation.' , 'wp-photo-album-plus' ) . '</p>', 'post' );
 
 
 
202
  }
203
 
204
  // Multiple photos to moderate requested
205
  else {
206
+ wppa_echo( '<p>' . esc_html__( 'There are no photos awaiting moderation at this time.', 'wp-photo-album-plus' ) . '</p>', 'post' );
 
 
 
207
  }
208
 
209
  // If i am admin, i can edit all photos here, sorted by timestamp desc
210
  if ( wppa_user_is( 'administrator' ) ) {
211
+ wppa_echo( '<h3>' . esc_html__( 'Manage all photos by timestamp', 'wp-photo-album-plus' ) . '</h3>', 'post' );
 
 
 
212
 
213
  $photos = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
214
  ORDER BY timestamp DESC
244
  // A specific photo requested
245
  if ( $photo ) {
246
  $photo = strval( intval( $photo ) );
247
+ wppa_echo( '
248
+ <div id="photoitem-' . $photo . '" class="photoitem" style="width:100%; background-color: rgb( 255, 255, 224 ); border-color: rgb( 230, 219, 85 )">
249
+ <span style="color:red">' .
250
+ sprintf( esc_html__( 'Photo %s has been removed.', 'wp-photo-album-plus' ), $photo ) . '
251
  </span>
252
+ </div>', 'post' );
253
  }
254
 
255
  // A collection of photos requested
257
 
258
  // Search
259
  if ( wppa_get( 'searchstring' ) ) {
260
+ wppa_echo( '<h3>' . esc_html__( 'No photos matching your search criteria.', 'wp-photo-album-plus' ) . '</h3>', 'post' );
 
 
 
261
  }
262
 
263
  // Album
264
  else {
265
+ wppa_echo( '<h3>' . esc_html__( 'No photos yet in this album.', 'wp-photo-album-plus' ) . '</h3>', 'post' );
 
 
 
266
  }
267
  }
268
 
272
  // There are photos to display for editing
273
  else {
274
 
275
+ // Local js functions
276
+ $the_js = "
 
277
  function wppaTryMove( id, video ) {
278
 
279
  var query;
280
 
281
  if ( ! jQuery( '#target-' + id ).val() ) {
282
+ alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
283
  return false;
284
  }
285
 
286
  if ( video ) {
287
+ query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
288
  }
289
  else {
290
+ query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
291
  }
292
 
293
  if ( confirm( query ) ) {
300
  var query;
301
 
302
  if ( ! jQuery( '#target-' + id ).val() ) {
303
+ alert( '" . esc_js( __( 'Please select an album to copy to first.', 'wp-photo-album-plus' ) ) . "' );
304
  return false;
305
  }
306
 
307
  if ( video ) {
308
+ query = '" . esc_js( __( 'Are you sure you want to copy this video?', 'wp-photo-album-plus' ) ) . "';
309
  }
310
  else {
311
+ query = '" . esc_js( __( 'Are you sure you want to copy this photo?', 'wp-photo-album-plus' ) ) . "';
312
  }
313
 
314
  if ( confirm( query ) ) {
321
  var query;
322
 
323
  if ( video ) {
324
+ query = '" . esc_js( __( 'Are you sure you want to delete this video?', 'wp-photo-album-plus' ) ) . "';
325
  }
326
  else {
327
+ query = '" . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . "';
328
  }
329
 
330
  if ( confirm( query ) ) {
339
 
340
  function wppaTryRotLeft( id ) {
341
 
342
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo left?', 'wp-photo-album-plus' ) ) . "';
343
 
344
  if ( confirm( query ) ) {
345
  wppaAjaxUpdatePhoto( id, 'rotleft', 0 );
348
 
349
  function wppaTryRot180( id ) {
350
 
351
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo 180&deg;?', 'wp-photo-album-plus' ) ) . "';
352
 
353
  if ( confirm( query ) ) {
354
  wppaAjaxUpdatePhoto( id, 'rot180', 0 );
357
 
358
  function wppaTryRotRight( id ) {
359
 
360
+ var query = '" . esc_js( __( 'Are you sure you want to rotate this photo right?', 'wp-photo-album-plus' ) ) . "';
361
 
362
  if ( confirm( query ) ) {
363
  wppaAjaxUpdatePhoto( id, 'rotright', 0 );
366
 
367
  function wppaTryFlip( id ) {
368
 
369
+ var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
370
 
371
  if ( confirm( query ) ) {
372
  wppaAjaxUpdatePhoto( id, 'flip', 0 );
375
 
376
  function wppaTryFlop( id ) {
377
 
378
+ var query = '" . esc_js( __( 'Are you sure you want to flip this photo?', 'wp-photo-album-plus' ) ) . "';
379
 
380
  if ( confirm( query ) ) {
381
  wppaAjaxUpdatePhoto( id, 'flop', 0 );
387
  var query;
388
  var wmFile = jQuery( '#wmfsel_' + id ).val();
389
  if ( wmFile == '--- none ---' ) {
390
+ alert( '" . esc_js( __( 'No watermark selected', 'wp-photo-album-plus' ) ) . "' );
391
  return;
392
  }
393
  if ( hasSource ) {
394
+ query = '" . esc_js( __( 'Are you sure?', 'wp-photo-album-plus' ) ) . "';
395
+ query += '. ';
396
+ query += '" . esc_js( __( 'To revert to the default watermark setting afterwards: select Watermark: --- default --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
397
  if ( canRemove ) {
398
+ query += '. ';
399
+ query += '" . esc_js( __( 'To remove: select Watermark: --- none --- and press the Remake files button', 'wp-photo-album-plus' ) ) . "';
400
  }
401
  }
402
  else {
403
+ query = '" . esc_js( __( 'Are you sure? Once applied it can not be removed!', 'wp-photo-album-plus' ) ) . "';
404
+ query += '. ';
405
+ query += '" . esc_js( __( 'And I do not know if there is already a watermark on this photo', 'wp-photo-album-plus' ) ) . "';
406
  }
407
 
408
  if ( confirm( query ) ) {
416
  value = 0;
417
  }
418
 
419
+ var query = '" . esc_js( __( 'Are you sure you want to magically process this photo?', 'wp-photo-album-plus' ) ) . "';
420
 
421
  if ( true || confirm( query ) ) {
422
  jQuery( '#wppa-admin-spinner' ).css( 'display', 'inline' );
427
  wppaHor = false;
428
  function wppaToggleHorizon() {
429
  if ( wppaHor ) {
430
+ jQuery( '#wppa-horizon' ).css( 'display', 'none' );
431
  wppaHor = false;
432
  }
433
  else {
434
+ jQuery( '#wppa-horizon' ).css( 'display', 'inline' );
435
  wppaHor = true;
436
  }
437
  }
447
 
448
  if ( jQuery( '#wppa-iptc-' + id ).css( 'display' ) == 'none' ) {
449
  jQuery( '#wppa-iptc-' + id ).show();
450
+ jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
451
  }
452
  else {
453
  jQuery( '#wppa-iptc-' + id ).hide();
454
+ jQuery( '#wppa-iptc-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'IPTC items', 'wp-photo-album-plus' ) ) . "' );
455
  }
456
  }
457
 
459
 
460
  if ( jQuery( '#wppa-exif-' + id ).css( 'display' ) == 'none' ) {
461
  jQuery( '#wppa-exif-' + id ).show();
462
+ jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Hide', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
463
  }
464
  else {
465
  jQuery( '#wppa-exif-' + id ).hide();
466
+ jQuery( '#wppa-exif-button-' + id ).val( '" . esc_js( __( 'Show', 'wp-photo-album-plus' ) ) . " ' + count + ' " . esc_js( __( 'EXIF items', 'wp-photo-album-plus' ) ) . "' );
467
  }
468
+ }";
 
 
 
469
 
470
+ wp_add_inline_script( 'wppa-admin', $the_js );
471
 
472
  $mvt = esc_attr( __( 'Move video', 'wp-photo-album-plus' ) );
473
  $mpt = esc_attr( __( 'Move photo', 'wp-photo-album-plus' ) );
479
  wppa_admin_page_links( $page, $pagesize, $count, $link );
480
 
481
  // Horizon
482
+ wppa_echo( '<div id="wppa-horizon"><hr /></div>', 'post' );
483
+
484
+ wp_add_inline_script( 'wppa-admin', 'wppaDragHorizon(document.getElementById("wppa-horizon"))' );
 
 
 
 
 
 
 
 
 
485
 
486
  // Albun name if moderate
487
  static $modalbum;
552
 
553
  // Album for moderate
554
  if ( $modalbum != $album && $album && ! wppa_get( 'just-edit' ) && wppa_get( 'edit-id' ) != 'trash' ) {
555
+ wppa_echo( '<h3>' . sprintf( __( 'Edit/Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
556
  '<i>' . sanitize_text_field( wppa_get_album_name( $album ) ) . '</i>',
557
+ '<i>' . sanitize_user( wppa_get_album_item( $album, 'owner' ) ) . '</i>' ) . '</h3>', 'post' );
558
  $modalbum = $album;
559
  }
560
 
561
  // Anchor for scroll to
562
+ wppa_echo( '<a id="photo_' . $id . '"></a>', 'post' );
563
 
564
  // The photo data
565
+ wppa_echo( '
566
  <div
567
  id="photoitem-' . $id . '"
568
  class="wppa-table-wrap"
569
+ style="width:100%"
570
+ >' .
571
 
572
  // Photo specific nonce field
573
+ '
574
  <input
575
  type="hidden"
576
  id="photo-nonce-' . $id . '"
577
  value="' . wp_create_nonce( 'wppa-nonce_' . $id ) . '"
578
+ />' );
579
 
580
  // Section 1
581
+ wppa_echo( '
 
582
  <table
583
  class="wppa-table wppa-photo-table"
 
584
  >
585
  <tbody>
586
+ <tr>
587
+ <td>' );
588
+ // -- Preview thumbnail ---
 
 
589
  // If ImageMagick is enabled...
590
  // Fake 'for social media' to use the local file here, not cloudinary.
591
  // Files from cloudinary do not reload, even with ?ver=...
603
  if ( $is_video ) {
604
  reset( $is_video );
605
  $big = str_replace( 'xxx', current( $is_video ), $big );
606
+ wppa_echo( '
607
  <a
608
  href="' . esc_attr( $big ) . '"
609
  target="_blank"
616
  'controls' => false,
617
  'use_thumb' => true
618
  ) ) . '
619
+ </a>' );
620
  }
621
  else {
622
  if ( $has_audio ) {
623
  $src = wppa_get_thumb_url( $id );
624
  $big = wppa_get_photo_url( $id );
625
  }
626
+ wppa_echo( '
627
  <a
628
  id="thumba-' . $id . '"
629
  href="' . esc_attr( $big ) . '"
632
  >
633
  <img
634
  id="thumburl-' . $id . '"' .
635
+ ( wppa_lazy() && $count > '1' ? ' data-' : ' ' ) . 'src="' . esc_url( $src ) . '"
636
  alt="' . esc_attr( $name ) . '"
637
+ style="max-width:160px;vertical-align:middle"
638
+ />
639
+ </a>' );
640
 
641
  if ( $has_audio ) {
642
  $audio = wppa_get_audio_html( array( 'id' => $id,
644
  'width' => '160',
645
  'controls' => true
646
  ) );
647
+ wppa_echo( '
648
  <br />' .
649
  ( $audio ? $audio :
650
+ '<span style="color:red">' .
651
+ esc_html__( 'Audio disabled', 'wp-photo-album-plus' ) .
652
+ '</span>' ) );
653
  }
654
  }
655
+ wppa_echo( '
656
+ </td>' );
657
 
658
  // --- More or less static data ---
659
+ wppa_echo( '
660
  <td>' .
661
 
662
  // ID
670
 
671
  // Upload
672
  __( 'Upload:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( wppa_local_date( '', $timestamp ) ) . ' ' .
673
+ __( 'local time', 'wp-photo-album-plus' ) . '. ' );
674
 
675
  // Owner
676
  if ( $owner_editable ) {
677
+ wppa_echo(
678
  __( 'Owned by:', 'wp-photo-album-plus' ) . '
679
  <input
680
  type="text"
681
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'owner\', this.value )"
682
  value="' . esc_attr( $owner ) . '"
683
+ /> ' );
684
  }
685
  else {
686
+ wppa_echo( __( 'By:', 'wp-photo-album-plus' ) . ' ' . htmlspecialchars( $owner ) . '. ', 'post' );
 
687
  }
688
 
689
  // Album
692
  $album = - ( $album + '9' );
693
  $deleted = true;
694
  }
695
+ wppa_echo( sprintf( __( 'Album: %d (%s).', 'wp-photo-album-plus' ), strval( intval( $album ) ), htmlspecialchars( wppa_get_album_name( $album ) ) ) . ' ', 'post' );
 
696
 
697
  // Modified
698
  if ( $deleted ) {
699
+ wppa_echo( '
700
+ <span style="color:red">' .
701
  __( 'Trashed', 'wp-photo-album-plus' ) . '
702
+ </span>', 'post' );
703
  }
704
  else {
705
  if ( $modified > $timestamp ) {
706
+ wppa_echo(
707
  __( 'Modified:', 'wp-photo-album-plus' ) . '
708
+ <span id="modified-' . $id . '">' .
709
  wppa_local_date( '', $modified ) . '
710
  </span>' .
711
+ __( 'local time', 'wp-photo-album-plus' ), 'post' );
712
  }
713
  else {
714
+ wppa_echo( __( 'Not modified', 'wp-photo-album-plus' ), 'post' );
 
715
  }
716
  }
717
+ wppa_echo( '. ', 'post' );
 
718
 
719
  // Exif
720
+ wppa_echo( __( 'EXIF Date:', 'wp-photo-album-plus' ), 'post' );
721
  if ( wppa_user_is( 'administrator' ) ) { // Admin may edit exif date
722
+ wppa_echo( '
723
  <input
724
  type="text"
725
+ style="width:125px"
726
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'exifdtm\', this.value)"
727
  value="' . esc_attr( $exifdtm ) . '"
728
+ />' );
729
  }
730
  else {
731
+ wppa_echo( esc_html( $exifdtm ) . '.', 'post' );
732
  }
733
+ wppa_echo( ' ', 'post' );
 
734
 
735
  // Location
736
  if ( $photo['location'] || wppa_switch( 'geo_edit' ) ) {
737
+ wppa_echo(
738
+ __( 'Location:' , 'wp-photo-album-plus' ) . ' ', 'post' );
739
  $loc = $location ? $location : '///';
740
  $geo = explode( '/', $loc );
741
 
742
+ wppa_echo( esc_html( $geo['0'].' '.$geo['1'].'. ' ), 'post' );
 
743
 
744
  if ( wppa_switch( 'geo_edit' ) ) {
745
+ wppa_echo(
746
  __( 'Lat:', 'wp-photo-album-plus' ) . '
747
  <input
748
  type="text"
749
+ style="width:100px"
750
  id="lat-' . $id . '"
751
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lat\', this.value)"
752
  value="' . esc_attr( $geo['2'] ) . '"
753
  />' .
754
  __( 'Lon:', 'wp-photo-album-plus' ) . '
755
  <input type="text"
756
+ style="width:100px"
757
  id="lon-' . $id . '"
758
+ onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'lon\', this.value)"
759
  value="' . esc_attr( $geo['3'] ) . '"
760
+ />' );
761
  }
762
  }
763
 
764
  // Changeable p_order
765
+ wppa_echo( __( 'Photo sort order #:', 'wp-photo-album-plus' ), 'post' );
 
766
  if ( $sortby_orderno && ( ! wppa_switch( 'porder_restricted' ) || wppa_user_is( 'administrator' ) ) ) {
767
+ wppa_echo( '
768
  <input
769
  type="text"
770
  id="porder-' . $id . '"
771
  value="' . esc_attr( $p_order ) . '"
772
+ style="width:30px"
773
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'p_order\', this.value)"
774
+ /> ' );
 
775
  }
776
  else {
777
+ wppa_echo( ' ' . $p_order . '. ' );
 
778
  }
779
 
780
+ // Rating
781
  $entries = wppa_get_rating_count_by_id( $id );
782
  if ( $entries ) {
783
 
784
  if ( wppa_opt( 'rating_display_type' ) == 'likes' ) {
785
+ wppa_echo( __( 'Likes:', 'wp-photo-album-plus' ) . ' ' . strval( intval( $entries ) ) . '. ', 'post' );
 
 
786
  }
787
  else {
788
+ wppa_echo(
789
  __( 'Rating:', 'wp-photo-album-plus' ) . ' ' .
790
+ __( 'Entries:', 'wp-photo-album-plus' ) . ' ' . strval( intval( $entries ) ) .
791
  ', ' .
792
  __( 'Mean value:', 'wp-photo-album-plus' ) .
793
  ' ' .
794
  wppa_get_rating_by_id( $id, 'nolabel' ) .
795
+ '. ', 'post' );
796
  }
797
  }
798
  else {
799
+ wppa_echo( __( 'No ratings for this photo.', 'wp-photo-album-plus' ) . ' ', 'post' );
 
800
  }
801
  $dislikes = wppa_dislike_get( $id );
802
  if ( $dislikes ) {
803
+ wppa_echo(
804
+ '<span style="color:red">' .
805
  sprintf( _n( 'Disliked by %d visitor', 'Disliked by %d visitors', $dislikes, 'wp-photo-album-plus' ), $dislikes ) . '. ' .
806
+ '</span>', 'post' );
807
  }
808
  $pending = wppa_pendrat_get( $id );
809
  if ( $pending ) {
810
+ wppa_echo(
811
+ '<span style="color:orange">' .
812
  sprintf( __( '%d pending votes.', 'wp-photo-album-plus' ), $pending ) . ' ' .
813
+ '</span>', 'post' );
814
  }
815
 
816
  // Views
817
  if ( wppa_switch( 'track_viewcounts' ) ) {
818
+ wppa_echo(
819
  __( 'Views' , 'wp-photo-album-plus' ) . ': ' .
820
  htmlspecialchars( $views ) .
821
+ '. ', 'post' );
822
  }
823
 
824
  // Clicks
825
  if ( wppa_switch( 'track_clickcounts' ) ) {
826
+ wppa_echo(
827
  __( 'Clicks', 'wp-photo-album-plus' ) . ': ' .
828
  htmlspecialchars( $clicks ) .
829
+ '. ', 'post' );
830
  }
831
 
832
  // Downloads
833
  // if ( true ) {
834
+ wppa_echo(
835
  __( 'Downloads', 'wp-photo-album-plus' ) . ': ' .
836
  htmlspecialchars( $dlcount ) .
837
+ '. ', 'post' );
838
  // }
839
 
840
  // Status
841
+ wppa_echo( '<br />' .
842
+ __( 'Status:' , 'wp-photo-album-plus') . ' ', 'post' );
843
  if ( ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) ) {
844
  if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) {
845
  $dis = ' disabled="disabled"';
848
  $dis = '';
849
  }
850
  $sel = ' selected="selected"';
851
+ wppa_echo(
852
  '<select' .
853
  ' id="status-' . $id . '"' .
854
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'status\', this.value); wppaPhotoStatusChange( ' . $id . ' )"' .
855
  ' >' .
856
  '<option value="pending"' . ( $status == 'pending' ? $sel : '' ) . ' >' .
857
  __( 'Pending', 'wp-photo-album-plus' ) .
878
  __( 'Private', 'wp-photo-album-plus' ) .
879
  '</option>' .
880
  '</select>' .
881
+ wppa_get_date_time_select_html( 'photo', $id, true ) );
882
  }
883
  else {
884
+ wppa_echo(
885
  '<input' .
886
  ' type="hidden"' .
887
  ' id="status-' . $id . '"' .
888
  ' value="' . esc_attr( $status ) . '"' .
889
+ ' />', 'post' );
890
  if ( $status == 'pending' ) _e( 'Pending', 'wp-photo-album-plus' );
891
  elseif ( $status == 'publish' ) _e( 'Publish', 'wp-photo-album-plus' );
892
  elseif ( $status == 'featured' ) _e( 'Featured', 'wp-photo-album-plus' );
895
  elseif ( $status == 'bronze' ) _e( 'Bronze', 'wp-photo-album-plus' );
896
  elseif ( $status == 'scheduled' ) _e( 'Scheduled', 'wp-photo-album-plus' );
897
  elseif ( $status == 'private' ) _e( 'Private', 'wp-photo-album-plus' );
898
+ wppa_echo(
899
  wppa_get_date_time_select_html( 'photo', $id, false ) .
900
+ '<span id="psdesc-' . $id . '" class="description" style="display:none">' .
901
  __( 'Note: Featured photos should have a descriptive name; a name a search engine will look for!', 'wp-photo-album-plus' ) .
902
+ '</span>' );
903
  }
904
+ wppa_echo( ' ', 'post' );
905
 
906
  // Schedule for delete
907
  if ( wppa_user_is( 'administrator' ) || $owner == wppa_get_user() ) {
908
  $may_change = wppa_user_is( 'administrator' ) || current_user_can( 'wppa_moderate' );
909
 
910
+ wppa_echo(
911
  __( 'Delete at', 'wp-photo-album-plus' ) .
912
  ' ' .
913
  '<input' .
915
  ' id="scheduledel-' . $id . '"' .
916
  ( $scheduledel ? ' checked="checked"' : '' ) .
917
  ( $may_change ? '' : ' disabled="disabled"' ) .
918
+ ' onchange="wppaTryScheduledel( ' . $id . ' )"' .
919
  ' />' .
920
  ' ' .
921
  wppa_get_date_time_select_html( 'delphoto', $id, $may_change ) .
922
+ ' ' );
923
  }
924
 
925
  // Update status field
926
+ wppa_echo(
927
  __( 'Remark:', 'wp-photo-album-plus' ) . ' ' .
928
  '<span' .
929
  ' id="remark-' . $id . '"' .
930
+ ' style="font-weight:bold;color:#00AA00"' .
931
  ' >' .
932
  ( $is_video ? sprintf( __( 'Video %s is not modified yet', 'wp-photo-album-plus' ), $id ) :
933
  sprintf( __( 'Photo %s is not modified yet', 'wp-photo-album-plus' ), $id ) ) .
934
+ '</span>', 'post' );
935
 
936
  // New Line
937
+ wppa_echo( '<br />', 'post' );
938
 
939
  // --- Available files ---
940
+ wppa_echo(
941
+ __( 'Available files:', 'wp-photo-album-plus' ) . ' ', 'post' );
942
 
943
  // Pdf
944
  if ( wppa_is_pdf( $id ) ) {
945
  $sp = wppa_get_source_path( $id );
946
  $fs = wppa_get_filesize( $sp );
947
+ wppa_echo( __( 'Document file:', 'wp-photo-album-plus' ) . ' ' . $fs . ' ', 'post' );
 
948
  }
949
 
950
  // Source
951
+ wppa_echo( __( 'Source file:', 'wp-photo-album-plus' ) . ' ', 'post' );
 
952
  $sp = wppa_get_o1_source_path( $id );
953
  if ( ! wppa_is_file( $sp ) ) {
954
  $sp = wppa_get_source_path( $id );
961
  }
962
  if ( is_file( $sp ) ) {
963
  $ima = getimagesize( $sp );
964
+ wppa_echo(
965
  $ima['0'] . ' x ' . $ima['1'] . ' (' . sprintf('%4.2fMp', ( $ima['0'] * $ima['1'] ) / ( 1024 * 1024 ) ) . ') ' .
966
+ wppa_get_filesize( $sp ) . '. ', 'post' );
967
  }
968
  else {
969
+ wppa_echo( __( 'Unavailable', 'wp-photo-album-plus' ) . '. ', 'post' );
 
970
  }
971
 
972
  // Display
973
+ wppa_echo(
974
+ ( $is_video || $has_audio ? __( 'Poster file:', 'wp-photo-album-plus' ) : __( 'Display file:', 'wp-photo-album-plus' ) ) . ' ', 'post' );
975
  $dp = wppa_get_photo_path( $id );
976
  if ( is_file( $dp ) ) {
977
+ wppa_echo(
978
+ '<span id="photox-'.$id.'">'.wppa_get_photox( $id ).'</span>' .
979
  ' x ' .
980
+ '<span id="photoy-'.$id.'">'.wppa_get_photoy( $id ).'</span>' .
981
+ ' ' . '<span id="photofilesize-' . $id . '">' . wppa_get_filesize( $dp ) . '</span>. ', 'post' );
 
 
 
 
 
 
 
982
  }
983
  else {
984
+ wppa_echo(
985
+ '<span style="color:red">' .
986
  __( 'Unavailable', 'wp-photo-album-plus' ) . '. ' .
987
+ '</span>. ', 'post' );
988
  }
989
 
990
  // Thumbnail
991
  if ( ! $is_video ) {
992
+ wppa_echo( __( 'Thumbnail file:', 'wp-photo-album-plus') . ' ', 'post' );
 
993
  $tp = wppa_get_thumb_path( $id );
994
  if ( is_file( $tp ) ) {
995
 
996
+ wppa_echo(
997
+ '<span id="thumbx-'.$id.'">'.wppa_get_thumbx( $id ).'</span>' .
998
  ' x ' .
999
+ '<span id="thumby-'.$id.'">'.wppa_get_thumby( $id ).'</span>' .
1000
+ ' ' . '<span id="thumbfilesize-' . $id . '">' . wppa_get_filesize( $tp ) . '</span>. ' .
1001
 
 
1002
  ' <input' .
1003
  ' type="checkbox"' .
1004
  ( $thumblock ? ' checked="checked"' : '' ) .
1005
+ ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'thumblock\', jQuery(this).prop(\'checked\') ? 1 : 0 )"' .
1006
  ' /> ' .
1007
+ __( 'Locked', 'wp-photo-album-plus' ) . '. ' );
1008
 
1009
  }
1010
  else {
1011
+ wppa_echo(
1012
+ '<span style="color:red">' .
1013
  __( 'Unavailable', 'wp-photo-album-plus' ) . '. ' .
1014
+ '</span>. ', 'post' );
1015
  }
1016
  }
1017
 
1018
  // Local CDN
1019
  if ( wppa_cdn( 'admin' ) == 'local' ) {
1020
+ wppa_echo( __( 'Local CDN files', 'wp-photo-album-plus' ) . ':<span id="cdnfiles-' . $id . '">', 'post' );
1021
  $files = wppa_cdn_files( $id );
1022
  if ( is_array( $files ) ) {
1023
  foreach( $files as $file ) {
1027
  $x = $t[0];
1028
  $y = $t[1];
1029
  $size = filesize( $file );
1030
+ wppa_echo( '
1031
  <a
1032
  href="' . wppa_cdn_url( $id, $x, $y ) . '"
1033
  target="_blank"
1034
  >' .
1035
  basename( $file ) .
1036
  ' </a>' .
1037
+ sprintf( '%4.2fkB', $size / 1024 ) . ' ', 'post' );
1038
  }
1039
  }
1040
  }
1041
+ wppa_echo( '</span>', 'post' );
1042
  }
1043
 
1044
  // New line
1045
+ wppa_echo( '<br />', 'post' );
1046
 
1047
  // Video
1048
  if ( $b_is_video ) {
1049
+ wppa_echo(
1050
  __( 'Video size:', 'wp-photo-album-plus' ) . ' ' .
1051
  __( 'Width:', 'wp-photo-album-plus' ) .
1052
  '<input' .
1053
+ ' style="width:50px;margin:0 4px"' .
1054
  ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videox\', this.value)"' .
1055
  ' value="' . esc_attr( $videox ) . '"' .
1056
  ' />' .
1057
  sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_width' ) ) .
1058
  __( 'Height:', 'wp-photo-album-plus' ) .
1059
  '<input' .
1060
+ ' style="width:50px;margin:0 4px"' .
1061
  ' onchange="wppaAjaxUpdatePhoto( ' . strval( intval( $id ) ) . ', \'videoy\', this.value)"' .
1062
  ' value="' . esc_attr( $videoy ) . '"' .
1063
  ' />' .
1064
  sprintf( __( 'pix, (0=default:%s)', 'wp-photo-album-plus' ), wppa_opt( 'video_height' ) ) .
1065
+ '. ' );
1066
  if ( $duration ) {
1067
  $duration = intval( $duration * 100 ) / 100;
1068
  if ( $duration < 120.0 ) {
1069
+ wppa_echo( sprintf( __( 'Duration: %s seconds', 'wp-photo-album-plus' ) ,$duration ) . '. ', 'post' );
 
1070
  }
1071
  else {
1072
+ wppa_echo( sprintf( __( 'Duration: %s minutes and %s seconds', 'wp-photo-album-plus' ),
1073
  sprintf( '%d', floor( $duration / 60 ) ),
1074
  sprintf( '%4.2f', $duration % 60 ) ) .
1075
+ '. ', 'post' );
1076
  }
1077
  }
1078
 
1079
+ wppa_echo( __( 'Formats:', 'wp-photo-album-plus' ) . ' ', 'post' );
 
1080
  $c = 0;
1081
  foreach ( $is_video as $fmt ) {
1082
+ wppa_echo(
1083
  $fmt . ' ' .
1084
  __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1085
+ wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ), 'post' );
1086
  $c++;
1087
  if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1088
+ wppa_echo( '. ', 'post' );
1089
  }
1090
  else {
1091
+ wppa_echo( ', ', 'post' );
1092
  }
1093
  }
1094
  }
1095
 
1096
  // Audio
1097
  if ( $b_has_audio ) {
1098
+ wppa_echo( __( 'Formats:', 'wp-photo-album-plus' ) . ' ', 'post' );
 
1099
  $c = 0;
1100
  foreach ( $has_audio as $fmt ) {
1101
+ wppa_echo(
1102
  $fmt . ' ' .
1103
  __( 'Filesize:', 'wp-photo-album-plus' ) . ' ' .
1104
+ wppa_get_filesize( str_replace( 'xxx', $fmt, wppa_get_photo_path( $id, false ) ) ), 'post' );
1105
  $c++;
1106
  if ( is_array( $is_video ) && $c == count( $is_video ) ) {
1107
+ wppa_echo( '. ', 'post' );
1108
  }
1109
  else {
1110
+ wppa_echo( ', ', 'post' );
1111
  }
1112
  }
1113
  }
1114
 
1115
+ wppa_echo(
1116
  '</td>' .
1117
  '</tr>' .
1118
  '</tbody>' .
1119
+ '</table>' );
1120
 
1121
+ wppa_echo( '<!-- Section 2 -->', 'post' );
 
1122
 
1123
  if ( ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) ||
1124
  ( wppa_switch( 'enable_panorama' ) ) ||
1125
  ( is_file( wppa_get_photo_path( $id ) ) && wppa_switch( 'watermark_on' ) )
1126
  ) {
1127
+ wppa_echo(
1128
  '<table' .
1129
  ' class="wppa-table wppa-photo-table"' .
1130
+ ' style="width:100%"' .
1131
  ' >' .
1132
  '<tbody>' .
1133
  '<tr>' .
1134
+ '<td>' );
1135
 
1136
  // Stereo
1137
  if ( wppa_switch( 'enable_stereo' ) && ! $is_multi ) {
1138
+ wppa_echo(
1139
  __( 'Stereophoto:', 'wp-photo-album-plus' ) . ' ' .
1140
  '<select' .
1141
  ' id="stereo-' . $id . '"' .
1152
  '</option>' .
1153
  '</select>' .
1154
  ' ' .
1155
+ __( 'Images:', 'wp-photo-album-plus' ) . ' ' );
1156
  $files = wppa_glob( WPPA_UPLOAD_PATH . '/stereo/' . $id . '-*.*' );
1157
 
1158
  if ( empty( $files ) ) {
1159
+ wppa_echo( __( 'None', 'wp-photo-album-plus' ) . '. ', 'post' );
 
1160
  }
1161
  else {
1162
  sort( $files );
1163
  $c = 0;
1164
  foreach ( $files as $file ) {
1165
+ wppa_echo(
1166
+ '<a href="' . str_replace( WPPA_UPLOAD_PATH, WPPA_UPLOAD_URL, $file ) . '" target="_blank">' .
1167
  basename( $file ) .
1168
+ '</a>', 'post' );
1169
  $c++;
1170
  if ( $c == count( $files ) ) {
1171
+ wppa_echo( '. ', 'post' );
1172
  }
1173
  else {
1174
+ wppa_echo( ', ', 'post' );
1175
  }
1176
  }
1177
  }
1181
  if ( wppa_switch( 'enable_panorama' ) && ! $b_is_video ) {
1182
  $can_panorama = $photoy && $photox / $photoy >= 1.999;
1183
  if ( $can_panorama ) {
1184
+ wppa_echo(
1185
  __( 'Panorama' ) . ': ' .
1186
+ '<select onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'panorama\', this.value, true )">' .
1187
  '<option value="0"' . ( $panorama == '0' ? ' selected="selected"' : '' ) . ' >' . __( '- none -', 'wp-photo-album-plus' ) . '</option>' .
1188
  '<option value="1"' . ( $panorama == '1' ? ' selected="selected"' : '' ) . ' >' . __( '360&deg; Spheric', 'wp-photo-album-plus' ) . '</option>' .
1189
  '<option value="2"' . ( $panorama == '2' ? ' selected="selected"' : '' ) . ' >' . __( 'Non 360&deg; Flat', 'wp-photo-album-plus' ) . '</option>' .
1190
+ '</select>' );
1191
 
1192
  $source_file = wppa_get_source_path( $id );
1193
  if ( wppa_is_file( $source_file ) ) {
1194
  $source_file_sizes = wppa_getimagesize( $source_file );
1195
 
1196
  if ( $panorama == '1' && $source_file_sizes[0] / $source_file_sizes[1] > 2.001 ) {
1197
+ wppa_echo(
1198
  '. ' . __( 'Make 360 from', 'wp-photo-album-plus' ) . ': ' . '
1199
  <select
1200
  onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'make360\', this.value, true)"
1201
  title="' . esc_attr( __( 'Select the closest angle you originally made the panorama', 'wp-photo-album-plus' ) ) . '"
1202
  >
1203
+ <option value="">'.__('Select', 'wp-photo-album-plus').'</option>' );
1204
  $t = array( 120, 150, 180, 210, 240, 270, 300, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450 );
1205
  foreach( $t as $v ) {
1206
+ wppa_echo( '<option value="'.$v.'" '.($v==$angle?'selected="selected" ':' ').'>'.$v.'&deg;</option>' );
1207
  }
1208
+ wppa_echo( '
1209
+ <option value="0">'.__('Undo', 'wp-photo-album-plus').'</option>
1210
+ </select>' );
1211
  }
1212
  }
1213
  }
1214
  else {
1215
+ wppa_echo( __( 'Too narrow for panorama.', 'wp-photo-album-plus' ), 'post' );
 
1216
  }
1217
  }
1218
 
1228
  $has_source = wppa_is_file( wppa_get_source_path( $id ) );
1229
  $can_remove = ( wppa_opt( 'watermark_file' ) == '--- none ---' ) ? '1' : '0';
1230
  if ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) {
1231
+ wppa_echo( ' ' . __( 'Watermark:', 'wp-photo-album-plus') . ' ', 'post' );
1232
+ wppa_echo(
 
1233
  '<select' .
1234
  ' id="wmfsel_' . $id . '"' .
1235
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_file_' . $user . '\', this.value)"' .
1236
  ' >' .
1237
  wppa_watermark_file_select( 'user', $album ) .
1238
  '</select>' .
1239
  ' ' . __( 'Pos:', 'wp-photo-album-plus' ) . ' ' .
1240
  '<select' .
1241
  ' id="wmpsel_' . $id . '"' .
1242
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'wppa_watermark_pos_' . $user . '\', this.value)"' .
1243
  ' >' .
1244
  wppa_watermark_pos_select( 'user', $album ) .
1245
  '</select>' .
1255
  ' src="' . wppa_get_imgdir() . 'spinner.gif"' .
1256
  ' alt="Spin"' .
1257
  ' style="visibility:hidden"' .
1258
+ ' />' );
1259
  }
1260
  elseif ( basename( $wmfile ) != '--- none ---' ) {
1261
+ wppa_echo(
1262
+ __( 'Watermark:', 'wp-photo-album-plus') . ' ' .
 
1263
  __( 'File:', 'wp-photo-album-plus' ) . ' ' . strip_tags( basename( $wmfile ) ) . ' ' .
1264
+ __( 'Pos:', 'wp-photo-album-plus') . ' ' . strip_tags( $wmpos ), 'post' );
1265
  }
1266
+ wppa_echo( ' ', 'post' );
1267
  }
1268
 
1269
+ wppa_echo(
1270
  '</td>' .
1271
  '</tr>' .
1272
  '</tbody>' .
1273
+ '</table>' );
1274
  }
1275
 
1276
 
1277
+ wppa_echo( '
1278
+ <!-- Section 3 -->
1279
+ <table
1280
+ class="wppa-table wppa-photo-table"
1281
+ style="width:100%">
1282
+ <tbody>
1283
+ <tr>
1284
+ <td>' );
 
 
1285
 
1286
  // --- Actions ---
1287
 
1288
  // Rotate
1289
  if ( ! $b_is_video ) {
1290
  if ( ! wppa_can_admin_magick( $id ) ) {
1291
+ wppa_echo( '
1292
+ <input
1293
+ type="button"
1294
+ onclick="wppaTryRotLeft( ' . $id . ' )"
1295
+ value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus') ) . '"
1296
+ />
1297
+ <input
1298
+ type="button"
1299
+ onclick="wppaTryRot180( ' . $id . ' )"
1300
+ value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus') ) . '"
1301
+ />
1302
+ <input
1303
+ type="button"
1304
+ onclick="wppaTryRotRight( ' . $id . ' )"
1305
+ value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus') ) . '"
1306
+ />
1307
+ <input
1308
+ type="button"
1309
+ onclick="wppaTryFlip( ' . $id . ' )"
1310
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . '&thinsp;&#8212"
1311
+ />
1312
+ <input
1313
+ type="button"
1314
+ onclick="wppaTryFlop( ' . $id . ' )"
1315
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . ' |"
1316
+ />' );
 
 
 
 
 
1317
  }
1318
  }
1319
 
1320
  // Remake displayfiles
1321
  if ( ! $is_video ) {
1322
+ wppa_echo( '
1323
+ <input
1324
+ type="button"
1325
+ title="' . esc_attr( __( 'Remake display file and thumbnail file', 'wp-photo-album-plus' ) ) . '"
1326
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remake\', 0 )"
1327
+ value="' . esc_attr( __( 'Remake files', 'wp-photo-album-plus' ) ) . '"
1328
+ />' );
 
1329
  }
1330
 
1331
  // Remake thumbnail
1332
  if ( ! $is_video ) {
1333
+ wppa_echo( '
1334
+ <input
1335
+ type="button"
1336
+ title="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1337
+ onclick="wppaAjaxUpdatePhoto( ' . $id . ', \'remakethumb\', 0 )"
1338
+ value="' . esc_attr( __( 'Remake thumbnail file', 'wp-photo-album-plus' ) ) . '"
1339
+ />' );
 
1340
  }
1341
 
1342
  // Move/copy
1357
  );
1358
  }
1359
 
1360
+ wppa_echo(
1361
+ __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1362
+ <select
1363
+ id="target-' . $id . '"
1364
+ style="max-width:350px">' .
1365
+ $album_select[$album] . '
1366
+ </select>' );
 
1367
  }
1368
  else {
1369
+ wppa_echo(
1370
+ __( 'Target album for copy/move:', 'wp-photo-album-plus' ) . '
1371
+ <input
1372
+ id="target-' . $id . '"
1373
+ type="number"
1374
+ style="height:20px"
1375
+ placeholder="' . __( 'Album id', 'wp-photo-album-plus' ) . '"
1376
+ />' );
1377
  }
1378
+ wppa_echo(
1379
+ ' ', 'post' );
1380
 
1381
+ wppa_echo(
1382
  '<input' .
1383
  ' type="button"' .
1384
  ' onclick="wppaTryMove( ' . $id . ', ' . $b_is_video . ' )"' .
1390
  ' onclick="wppaTryCopy( ' . $id . ', ' . $b_is_video . ' )"' .
1391
  ' value="' . ( $b_is_video ? $cvt : $cpt ) . '"' .
1392
  ' />' .
1393
+ ' ' );
1394
  }
1395
 
1396
  // Delete
1397
  if ( wppa_user_is( 'administrator' ) || wppa_get_photo_item( $id, 'owner' ) == wppa_get_user() ) {
1398
  if ( ! wppa( 'front_edit' ) ) {
1399
+ wppa_echo(
1400
  '<input' .
1401
  ' type="button"' .
1402
+ ' style="color:red"' .
1403
  ' onclick="wppaTry' . ( $deleted ? 'Undelete' : 'Delete' ) . '( ' . $id . ', ' . $b_is_video . ' )"' .
1404
  ( $deleted ?
1405
  ' value="' . ( $b_is_video ? esc_attr( __( 'Undelete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Undelete photo', 'wp-photo-album-plus' ) ) ) .'"' :
1406
  ' value="' . ( $b_is_video ? esc_attr( __( 'Delete video', 'wp-photo-album-plus' ) ) : esc_attr( __( 'Delete photo', 'wp-photo-album-plus' ) ) ) . '"' ) .
1407
  ' />' .
1408
+ ' ' );
1409
+ }
1410
  }
1411
 
1412
  // Re-upload
1413
  if ( wppa_user_is( 'administrator' ) || ! wppa_switch( 'reup_is_restricted' ) ) {
1414
+ wppa_echo(
1415
  '<input' .
1416
  ' type="button"' .
1417
  ' onclick="jQuery( \'#re-up-' . $id . '\' ).css( \'display\', \'inline-block\' )"' .
1418
  ' value="' . esc_attr( __( 'Re-upload file', 'wp-photo-album-plus' ) ) . '"' .
1419
  ' />' .
1420
 
1421
+ '<div id="re-up-' . $id . '" style="display:none">' .
1422
  '<form' .
1423
  ' id="wppa-re-up-form-' . $id . '"' .
1424
  ' onsubmit="wppaReUpload( event, ' . $id . ', \'' . $filename . '\' )"' .
1433
  ' value="' . esc_attr( __( 'Upload', 'wp-photo-album-plus' ) ) . '"' .
1434
  ' />' .
1435
  '</form>' .
1436
+ '</div>' );
 
 
 
 
 
 
 
 
 
 
 
1437
  }
 
1438
 
1439
+ wppa_echo(
 
 
1440
  '</td>' .
1441
  '</tr>' .
1442
  '</tbody>' .
1443
+ '</table>' );
1444
 
1445
  // Section 3a ImageMagick editing commands
1446
  if ( wppa_can_admin_magick( $id ) && ! $quick ) {
1447
 
1448
+ wppa_echo(
1449
  '<table' .
1450
  ' class="wppa-table wppa-photo-table"' .
 
1451
  ' >' .
1452
  '<tbody>' .
1453
  '<tr>' .
1457
  '</td>' .
1458
  '</tr>' .
1459
  '<tr>' .
1460
+ '<td>' );
1461
 
1462
  // --- Actions ---
1463
 
1464
  // Rotate left
1465
+ wppa_echo( '
1466
+ <input
1467
+ type="button"
1468
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotleft\' )"
1469
+ value="' . esc_attr( __( 'Rotate left', 'wp-photo-album-plus' ) ) . '"
1470
+ /> ' );
 
1471
 
1472
  // Rotat 180
1473
+ wppa_echo( '
1474
+ <input
1475
+ type="button"
1476
+ onclick="wppaTryMagick( ' . $id . ', \'magickrot180\' )"
1477
+ value="' . esc_attr( __( 'Rotate 180&deg;', 'wp-photo-album-plus') ) . '"
1478
+ /> ' );
 
1479
 
1480
  // Rotate right
1481
+ wppa_echo( '
1482
+ <input
1483
+ type="button"
1484
+ onclick="wppaTryMagick( ' . $id . ', \'magickrotright\' )"
1485
+ value="' . esc_attr( __( 'Rotate right', 'wp-photo-album-plus') ) . '"
1486
+ /> ' );
 
1487
 
1488
  // Flip
1489
+ wppa_echo( '
1490
+ <input
1491
+ type="button"
1492
+ onclick="wppaTryMagick( ' . $id . ', \'magickflip\' )"
1493
+ value="' . esc_attr( __( 'Flip', 'wp-photo-album-plus') ) . '&thinsp;&#8212"
1494
+ title="-flip"
1495
+ /> ' );
 
1496
 
1497
  // Flop
1498
+ wppa_echo( '
1499
+ <input
1500
+ type="button"
1501
+ onclick="wppaTryMagick( ' . $id . ', \'magickflop\' )"
1502
+ value="' . esc_attr( __( 'Flop', 'wp-photo-album-plus') ) . ' |"
1503
+ title="-flop"
1504
+ /> ' );
 
1505
 
1506
  // Enhance
1507
+ wppa_echo( '
1508
+ <input
1509
+ type="button"
1510
+ onclick="wppaTryMagick( ' . $id . ', \'enhance\' )"
1511
+ value="' . esc_attr( __( 'Enhance', 'wp-photo-album-plus') ) . '"
1512
+ title="-enhance"
1513
+ /> ' );
 
1514
 
1515
  // Sharpen
1516
+ wppa_echo( '
1517
+ <input
1518
+ type="button"
1519
+ onclick="wppaTryMagick( ' . $id . ', \'sharpen\' )"
1520
+ value="' . esc_attr( __( 'Sharpen', 'wp-photo-album-plus' ) ) . '"
1521
+ title="-sharpen 0x1"
1522
+ /> ' );
 
1523
 
1524
  // Blur
1525
+ wppa_echo( '
1526
+ <input
1527
+ type="button"
1528
+ onclick="wppaTryMagick( ' . $id . ', \'blur\' )"
1529
+ value="' . esc_attr( __( 'Blur', 'wp-photo-album-plus' ) ) . '"
1530
+ title="-blur 0x1"
1531
+ /> ' );
 
1532
 
1533
  // Auto gamma
1534
+ wppa_echo( '
1535
+ <input
1536
+ type="button"
1537
+ onclick="wppaTryMagick( ' . $id . ', \'auto-gamma\' )"
1538
+ value="' . esc_attr( __( 'Auto Gamma', 'wp-photo-album-plus' ) ) . '"
1539
+ title="-auto-gamma"
1540
+ /> ' );
 
1541
 
1542
  // Auto level
1543
+ wppa_echo( '
1544
+ <input
1545
+ type="button"
1546
+ onclick="wppaTryMagick( ' . $id . ', \'auto-level\' )"
1547
+ value="' . esc_attr( __( 'Auto Level', 'wp-photo-album-plus' ) ) . '"
1548
+ title="-auto-level"
1549
+ /> ' );
 
1550
 
1551
  // Contrast+
1552
+ wppa_echo( '
1553
+ <input
1554
+ type="button"
1555
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-p\' )"
1556
+ value="' . esc_attr( __( 'Contrast+', 'wp-photo-album-plus' ) ) . '"
1557
+ title="-brightness-contrast 0x5"
1558
+ /> ' );
 
1559
 
1560
  // Contrast-
1561
+ wppa_echo( '
1562
+ <input
1563
+ type="button"
1564
+ onclick="wppaTryMagick( ' . $id . ', \'contrast-m\' )"
1565
+ value="' . esc_attr( __( 'Contrast-', 'wp-photo-album-plus' ) ) . '"
1566
+ title="-brightness-contrast 0x-5"
1567
+ />' );
 
1568
 
1569
  // Brightness+
1570
+ wppa_echo( '
1571
+ <input
1572
+ type="button"
1573
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-p\' )"
1574
+ value="' . esc_attr( __( 'Brightness+', 'wp-photo-album-plus' ) ) . '"
1575
+ title="-brightness-contrast 5"
1576
+ />' );
 
1577
 
1578
  // Brightness-
1579
+ wppa_echo( '
1580
+ <input
1581
+ type="button"
1582
+ onclick="wppaTryMagick( ' . $id . ', \'brightness-m\' )"
1583
+ value="' . esc_attr( __( 'Brightness-', 'wp-photo-album-plus' ) ) . '"
1584
+ title="-brightness-contrast -5"
1585
+ />' );
 
1586
 
1587
  // Despeckle
1588
+ wppa_echo( '
1589
+ <input
1590
+ type="button"
1591
+ onclick="wppaTryMagick( ' . $id . ', \'despeckle\' )"
1592
+ value="' . esc_attr( __( 'Despeckle', 'wp-photo-album-plus' ) ) . '"
1593
+ title="-despeckle"
1594
+ />' );
 
1595
 
1596
  // Lenear gray
1597
+ wppa_echo( '
1598
+ <input
1599
+ type="button"
1600
+ onclick="wppaTryMagick( ' . $id . ', \'lineargray\' )"
1601
+ value="' . esc_attr( __( 'Linear gray', 'wp-photo-album-plus' ) ) . '"
1602
+ title="-colorspace gray"
1603
+ />' );
 
1604
 
1605
  // Non-linear gray
1606
+ wppa_echo( '
1607
+ <input
1608
+ type="button"
1609
+ onclick="wppaTryMagick( ' . $id . ', \'nonlineargray\' )"
1610
+ value="' . esc_attr( __( 'Non-linear gray', 'wp-photo-album-plus' ) ) . '"
1611
+ title="-grayscale Rec709Luma"
1612
+ />' );
 
1613
 
1614
  // Charcoal
1615
+ wppa_echo( '
1616
+ <input
1617
+ type="button"
1618
+ onclick="wppaTryMagick( ' . $id . ', \'charcoal\' )"
1619
+ value="' . esc_attr( __( 'Charcoal', 'wp-photo-album-plus' ) ) . '"
1620
+ title="-charcoal"
1621
+ />' );
 
1622
 
1623
  // Paint
1624
+ wppa_echo( '
1625
+ <input
1626
+ type="button"
1627
+ onclick="wppaTryMagick( ' . $id . ', \'paint\' )"
1628
+ value="' . esc_attr( __( 'Paint', 'wp-photo-album-plus' ) ) . '"
1629
+ title="-paint"
1630
+ />' );
 
1631
 
1632
  // Sepia
1633
+ wppa_echo( '
1634
+ <input
1635
+ type="button"
1636
+ onclick="wppaTryMagick( ' . $id . ', \'sepia\' )"
1637
+ value="' . esc_attr( __( 'Sepia', 'wp-photo-album-plus' ) ) . '"
1638
+ title="-sepia-tone 80%"
1639
+ />' );
1640
+
1641
+ // Show/hide wppa-horizon
1642
+ wppa_echo( '
1643
+ <input
1644
+ type="button"
1645
+ onclick="wppaToggleHorizon()"
1646
+ value="' . esc_attr( 'Show/hide horizon', 'wp-photo-album-plus' ) . '"
1647
+ title="' . esc_attr( 'Toggle horizon reference line on/off', 'wp-photo-album-plus' ) . '"
1648
+ />' );
 
 
1649
 
1650
  // Anticlock 0.5 deg
1651
+ wppa_echo( '
1652
+ <input
1653
+ type="button"
1654
+ onclick="wppaTryMagick( ' . $id . ', \'skyleft\' )"
1655
+ value="' . esc_attr( '0.5&deg;', 'wp-photo-album-plus' ) . '"
1656
+ title="' . esc_attr( 'Rotate image by 0.5&deg; anticlockwise', 'wp-photo-album-plus' ) . '"
1657
+ />' );
 
1658
 
1659
  // Clockwise 0.5 deg
1660
+ wppa_echo( '
1661
+ <input
1662
+ type="button"
1663
+ onclick="wppaTryMagick( ' . $id . ', \'skyright\' )"
1664
+ value="' . esc_attr( '-0.5&deg;', 'wp-photo-album-plus' ) . '"
1665
+ title="' . esc_attr( 'Rotate image by 0.5&deg; clockwise', 'wp-photo-album-plus' ) . '"
1666
+ />' );
 
1667
 
1668
  // Crop
1669
+ wppa_echo( '
1670
+ <input
1671
+ type="button"
1672
+ id="button-' . $id . '"
1673
+ value="Crop"
1674
+ title=""
1675
+ />' );
 
1676
 
1677
  // Set cropbox aspect ratio
1678
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
1679
  $dflt = wppa_opt( 'image_magick_ratio' );
1680
+ wppa_echo( '
1681
+ <select' .
1682
+ ' onchange="wppaCropper[' . $id . '].setAspectRatio(this.value)"' .
1683
  ' title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"' .
1684
  '>' .
1685
  '<option value="NaN" ' . ( $dflt == 'NaN' ? 'selected' : '' ) . ' >' . __( 'free', 'wp-photo-album-plus' ) . '</option>' .
1697
  '<option value="0.625" ' . ( $dflt == '0.625' ? 'selected' : '' ) . ' >5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1698
  '<option value="0.5625" ' . ( $dflt == '0.5625' ? 'selected' : '' ) . ' >9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1699
  '<option value="0.5" ' . ( $dflt == '0.5' ? 'selected' : '' ) . ' >1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1700
+ '</select>' );
1701
 
1702
  if ( $dflt == 'ratio' ) {
1703
  $value = $ratio;
1708
  else {
1709
  $value = $dflt;
1710
  }
 
 
1711
 
1712
+ $the_js = 'jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});';
1713
+ wp_add_inline_script( 'wppa-admin', $the_js );
1714
+
1715
+ wppa_echo(
1716
  '</td>' .
1717
  '</tr>' .
1718
  '<tr>' .
1721
  ': ' .
1722
  '<span' .
1723
  ' id="magickstack-' . strval( intval( $id ) ). '"' .
1724
+ ' style="color:blue"' .
1725
  ' >' .
1726
  sanitize_text_field( $magickstack ) .
1727
  '</span>' .
1735
  ' style="' . ( $magickstack ? 'display:inline;' : 'display:none;' ) . '"' .
1736
  ' />' .
1737
  '</td>' .
1738
+ '</tr>' );
1739
 
1740
  // Fake 'for social media' to use the local file here, not cloudinary. Files from cloudinary do not reload, even with ?ver=...
1741
  wppa( 'for_sm', true );
1742
+ wppa_echo(
1743
  '<tr>' .
1744
  '<td>' .
1745
+ '<div
1746
+ class="wppa-cropper-container-wrapper">' .
1747
  '<img' .
1748
  ' id="fs-img-' . $id . '"' .
1749
  ' src="' . esc_url( wppa_get_photo_url( $id ) ) . '"' .
1750
+ ' style="float:left;max-width:100%" ' .
1751
+ ' />' );
1752
 
1753
+ $the_js =
1754
+ '
1755
  window.addEventListener("DOMContentLoaded", function () {
1756
 
1757
  /* Responive does not always works correcly, */
1758
+ /* so we do a manual replace after resizing the window */
1759
  window.addEventListener("resize", function(){
1760
  var c = wppaCropper[' . $id . '];
1761
  var url = document.getElementById("fs-img-' . $id . '").src;
1779
  var value=data.width+"x"+data.height+(data.x<0?"-":"+")+data.x+(data.y<0?"-":"+")+data.y;
1780
  wppaTryMagick( "' . $id . '", \'crop\', value );
1781
  };
1782
+ });';
1783
+ wp_add_inline_script( 'wppa-admin', $the_js );
 
 
 
 
1784
 
1785
+ wppa_echo(
1786
  '</div>' .
1787
  '</td>' .
1788
  '</tr>' .
1789
  '</tbody>' .
1790
+ '</table>' );
1791
  }
1792
 
1793
  // Reset switch
1794
  wppa( 'for_sm', false );
1795
 
1796
+ wppa_echo( // Section 4
1797
  "\n" . '<!-- Section 4 -->' .
1798
  '<table' .
1799
  ' class="wppa-table wppa-photo-table"' .
1800
+ ' style="width:100%"' .
1801
  ' >' .
1802
+ '<tbody>' );
1803
 
1804
  // Name
1805
+ wppa_echo(
1806
  '<tr>' .
1807
  '<td>' .
1808
  __( 'Photoname:' , 'wp-photo-album-plus') . '
1810
  <td>' .
1811
  '<input' .
1812
  ' type="text"' .
1813
+ ' style="width:100%"' .
1814
  ' id="pname-' . $id . '"' .
1815
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'name\', this.value)"' .
1816
  ' value="' . esc_attr( stripslashes( $name ) ) . '"' .
1817
  ' />
1818
  <br />
1819
+ <span style="float:right">' .
1820
  __( 'Name slug', 'wp-photo-album-plus' ) . ': ' . $sname . '
1821
  </span>
1822
  </td>' .
1823
  '<td>' .
1824
  '</td>' .
1825
+ '</tr>' );
1826
 
1827
  // Description
1828
  if ( ! wppa_switch( 'desc_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1829
+ wppa_echo(
1830
  '<tr>' .
1831
  '<td>' .
1832
  __( 'Description:', 'wp-photo-album-plus' ) .
1833
+ '</td>' );
1834
+
1835
+ wppa_echo(
1836
+ '<td>' .
1837
+ '<textarea' .
1838
+ ' style="width:100%;height:60px"' .
1839
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'description\', this.value)"' .
1840
+ ' >' .
1841
+ esc_textarea( stripslashes( $description ) ) .
1842
+ '</textarea>' .
1843
+ '</td>' .
1844
+ '<td>' .
1845
+ '</td>' );
1846
+
1847
+ wppa_echo( '</tr>' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1848
  }
1849
  else {
1850
+ wppa_echo(
1851
  '<tr>' .
1852
  '<td>' .
1853
  __( 'Description:', 'wp-photo-album-plus') .
1857
  '</td>' .
1858
  '<td>' .
1859
  '</td>' .
1860
+ '</tr>' );
1861
  }
1862
 
1863
  // Tags
1864
  $allowed = ! wppa_switch( 'newtags_is_restricted' ) || wppa_user_is( 'administrator' );
1865
+ wppa_echo(
1866
  '<tr>' .
1867
  '<td>' .
1868
  __( 'Tags:', 'wp-photo-album-plus' ) .
1869
+ '</td>' .
 
 
1870
  '<td>' .
1871
  '<input' .
1872
  ' id="tags-' . $id . '"' .
1873
  ' type="text"' .
1874
+ ' style="width:100%"' .
1875
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', this.value)"' .
1876
  ' value="' . $tags . '"' .
1877
  ( $allowed ? '' : ' readonly="readonly"' ) .
1878
  ' />' .
1879
  ( $allowed ?
1880
  '<br />' .
1881
+ '<span class="description">' .
1882
  __( 'Separate tags with commas.', 'wp-photo-album-plus') .
1883
  '</span>' : '' ) .
1884
  '<select' .
1885
  ' onchange="wppaAddTag( this.value, \'tags-' . $id . '\' ); wppaAjaxUpdatePhoto( ' . $id . ', \'tags\', document.getElementById( \'tags-' . $id . '\' ).value )"' .
1886
+ ' >' );
1887
 
1888
  if ( wppa_switch( 'predef_tags_only' ) ) {
1889
  $keys = explode( ',', trim( wppa_opt( 'minimum_tags' ) ) );
1897
  }
1898
 
1899
  if ( is_array( $taglist ) ) {
1900
+ wppa_echo( '<option value="">' . __( '- select to add -', 'wp-photo-album-plus' ) . '</option>' );
1901
  foreach ( $taglist as $tag ) {
1902
+ wppa_echo( '<option value="' . esc_attr( $tag['tag'] ) . '">' . htmlspecialchars( $tag['tag'] ) . '</option>' );
1903
  }
1904
  if ( ! $allowed ) {
1905
+ wppa_echo( '<option value="-clear-">' . __( '- clear -', 'wp-photo-album-plus' ) . '</option>' );
1906
  }
1907
  }
1908
  else {
1909
+ wppa_echo( '<option value="0">' . __( 'No tags yet', 'wp-photo-album-plus' ) . '</option>' );
1910
  }
1911
+ wppa_echo(
1912
  '</select>' .
1913
  '</td>' .
1914
  '<td>' .
1915
+ '</td>' .
1916
+ '</tr>' );
1917
 
1918
  // Custom
1919
  if ( wppa_switch( 'custom_fields' ) ) {
1926
  }
1927
  foreach( array_keys( $custom_data ) as $key ) {
1928
  if ( wppa_opt( 'custom_caption_' . $key ) ) {
1929
+ wppa_echo(
1930
  '<tr>' .
1931
  '<td>' .
1932
  apply_filters( 'translate_text', wppa_opt( 'custom_caption_' . $key ) ) .
1933
+ '<small style="float:right">' .
1934
  '(w#cc'.$key.')' .
1935
  '</small>:' .
1936
  '</td>' .
1937
  '<td>' .
1938
  '<input' .
1939
  ' type="text"' .
1940
+ ' style="width:100%"' .
1941
  ' id="custom_' . $key . '-' . $id . '"' .
1942
+ ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'custom_' . $key . '\', this.value)"' .
1943
  ' value="' . esc_attr( stripslashes( $custom_data[$key] ) ) . '"' .
1944
  '/>' .
1945
  '</td>' .
1946
  '<td>' .
1947
  '<small>(w#cd'.$key.')</small>' .
1948
  '</td> ' .
1949
+ '</tr>' );
1950
  }
1951
  }
1952
  }
1954
  // -- Auto Page --
1955
  if ( wppa_switch( 'auto_page' ) && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) ) {
1956
  $appl = get_permalink( wppa_get_the_auto_page( $id ) );
1957
+ wppa_echo(
1958
  '<tr>' .
1959
  '<td>' .
1960
  __( 'Autopage Permalink:', 'wp-photo-album-plus' ) .
1961
  '</td>' .
1962
  '<td>' .
1963
+ '<a href="' . $appl . '" target="_blank">' .
1964
  $appl .
1965
  '</a>' .
1966
  '</td>' .
1967
  '<td>' .
1968
  '</td>' .
1969
+ '</tr>' );
1970
  }
1971
 
1972
  // -- Link url --
1973
  if ( ! wppa_switch( 'link_is_restricted' ) || wppa_user_is( 'administrator' ) ) {
1974
+ wppa_echo(
1975
  '<tr>' .
1976
  '<td>' .
1977
  __( 'Photo specific link url:', 'wp-photo-album-plus' ) .
1980
  '<input' .
1981
  ' type="text"' .
1982
  ' id="pislink-' . $id . '"' .
1983
+ ' style="width:100%"' .
1984
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linkurl\', this.value)"' .
1985
  ' value="' . esc_attr( $linkurl ) . '"' .
1986
  ' />' .
2005
  '</select>' .
2006
  '<input' .
2007
  ' type="button"' .
2008
+ ' onclick="window.open( jQuery( \'#pislink-' . $id . '\' ).val(), jQuery( \'#pistarget-' . $id . '\' ).val() )"' .
2009
  ' value="' . __( 'Tryit!', 'wp-photo-album-plus' ) . '"' .
2010
  ' />' .
2011
  '</td>' .
2012
+ '</tr>' );
2013
 
2014
  // -- Link title --
2015
+ wppa_echo(
2016
  '<tr>' .
2017
  '<td>' .
2018
  __( 'Photo specific link title:', 'wp-photo-album-plus' ) .
2020
  '<td>' .
2021
  '<input' .
2022
  ' type="text"' .
2023
+ ' style="width:100%"' .
2024
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'linktitle\', this.value)"' .
2025
  ' value="' . esc_attr( $linktitle ) . '"' .
2026
+ ' />' );
2027
  if ( current_user_can( 'wppa_settings' ) ) {
2028
+ wppa_echo(
2029
  '<br />' .
2030
+ '<span class="description">' .
2031
  __( 'If you want this link to be used, check \'PS Overrule\' checkbox in table VI.' , 'wp-photo-album-plus') .
2032
+ '</span>', 'post' );
2033
  }
2034
+ wppa_echo(
2035
  '</td>' .
2036
  '<td>' .
2037
  '</td>' .
2038
+ '</tr>' );
2039
  }
2040
 
2041
  // -- Custom ALT field --
2042
  if ( wppa_opt( 'alt_type' ) == 'custom' ) {
2043
+ wppa_echo(
2044
  '<tr>' .
2045
  '<td>' .
2046
  __( 'HTML Alt attribute:' , 'wp-photo-album-plus') .
2048
  '<td>' .
2049
  '<input' .
2050
  ' type="text"' .
2051
+ ' style="width:100%"' .
2052
  ' onchange="wppaAjaxUpdatePhoto( ' . $id . ', \'alt\', this.value)"' .
2053
  ' value="' . esc_attr( $alt ) . '"' .
2054
  ' />' .
2055
  '</td>' .
2056
  '<td>' .
2057
  '</td>' .
2058
+ '</tr>' );
2059
  }
2060
 
2061
  // If Quick, skip the following items for speed and space
2063
 
2064
  // Shortcode
2065
  if ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ) ) {
2066
+ wppa_echo(
2067
  '<tr>' .
2068
  '<td>' .
2069
  __( 'Single image shortcode', 'wp-photo-album-plus' ) . ':' .
2074
  '<td>' .
2075
  '<small>' .
2076
  sprintf( __( 'See %s The documentation %s for more shortcode options.', 'wp-photo-album-plus' ),
2077
+ '<a href="https://wppa.nl/shortcode-reference/" target="_blank">',
2078
  '</a>'
2079
  ) .
2080
  '</small>' .
2081
  '</td>' .
2082
+ '</tr>' );
2083
  }
2084
 
2085
  // Source permalink
2086
  if ( is_file( wppa_get_source_path( $id ) ) ) {
2087
  $spl = wppa_get_source_pl( $id );
2088
+ wppa_echo(
2089
  '<tr>' .
2090
  '<td>' .
2091
  __( 'Permalink', 'wp-photo-album-plus' ) . ':' .
2092
  '</td>' .
2093
  '<td>' .
2094
+ '<a href="' . esc_attr( $spl ) . '" target="_blank">' . htmlspecialchars( $spl ) . '</a>' .
2095
  '</td>' .
2096
  '<td>' .
2097
  '</td>' .
2098
+ '</tr>' );
2099
  }
2100
 
2101
  // High resolution url
2102
  $hru = htmlspecialchars( wppa_get_hires_url( $id ) );
2103
+ wppa_echo(
2104
  '<tr>' .
2105
  '<td>' .
2106
  __( 'High resolution url', 'wp-photo-album-plus') . ':' .
2107
  '</td>' .
2108
  '<td>' .
2109
+ '<a href="' . esc_attr( $hru ) . '" target="_blank">' . $hru . '</a>' .
2110
  '</td>' .
2111
  '<td>' .
2112
  '</td>' .
2113
+ '</tr>' );
2114
 
2115
  // Display file
2116
  if ( is_file( wppa_get_photo_path( $id ) ) ) {
2117
  $lru = wppa_fix_poster_ext( wppa_get_lores_url( $id ), $id );
2118
+ wppa_echo(
2119
  '<tr>' .
2120
  '<td>' .
2121
  __( 'Display file url', 'wp-photo-album-plus') . ':' .
2122
  '</td>' .
2123
  '<td>' .
2124
+ '<a href="' . esc_attr( $lru ) . '" target="_blank">' . $lru . '</a>' .
2125
  '</td>' .
2126
  '<td>' .
2127
  '</td>' .
2128
+ '</tr>' );
2129
  }
2130
 
2131
  // Thumbnail
2132
  if ( is_file( wppa_get_thumb_path( $id ) ) ) {
2133
  $tnu = wppa_fix_poster_ext( wppa_get_tnres_url( $id ), $id );
2134
+ wppa_echo(
2135
  '<tr>' .
2136
  '<td>' .
2137
  __( 'Thumbnail file url', 'wp-photo-album-plus' ) . ':' .
2138
  '</td>' .
2139
  '<td>' .
2140
+ '<a href="' . esc_attr( $tnu ) . '" target="_blank">' . $tnu . '</a>' .
2141
  '</td>' .
2142
  '<td>' .
2143
  '</td>' .
2144
+ '</tr>' );
2145
  }
2146
  }
2147
+ wppa_echo(
2148
  '</tbody>' .
2149
+ '</table>' );
2150
 
2151
+ wppa_echo( '<!-- Section 5 -->', 'post' );
 
2152
 
2153
  // IPTC
2154
  if ( ! $quick ) {
2156
  WHERE photo = %s
2157
  ORDER BY tag, id", $id ), ARRAY_A );
2158
  if ( ! empty( $iptcs ) ) {
2159
+ wppa_echo(
2160
  '<table><tbody><tr><td><input' .
2161
  ' type="button"' .
2162
  ' id="wppa-iptc-button-' . $id . '"' .
2163
  ' class="button-secundary"' .
2164
  ' value="' . esc_attr( sprintf( __( 'Show %d IPTC items', 'wp-photo-album-plus' ), count( $iptcs ) ) ) . '"' .
2165
+ ' onclick="wppaToggleIptc( ' . $id . ', ' . count( $iptcs ) . ' )"' .
2166
  ' /></td></tr></tbody></table>' .
2167
  '<table' .
2168
  ' id="wppa-iptc-' . $id . '"' .
2169
  ' class="wppa-table wppa-photo-table"' .
2170
+ ' style="clear:both;width:99%;display:none"' .
2171
  ' >' .
2172
  '<thead>' .
2173
+ '<tr style="font-weight:bold">' .
2174
+ '<td style="padding:0 4px">' . __( 'IPTC tag', 'wp-photo-album-plus' ) . '</td>' .
2175
+ '<td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>' .
2176
+ '<td style="padding:0 4px">' . __( 'Value', 'wp-photo-album-plus' ) . '</td>' .
2177
  '</tr>' .
2178
  '</thead>' .
2179
+ '<tbody>' );
2180
 
2181
  foreach ( $iptcs as $iptc ) {
2182
 
2183
+ wppa_echo( '
2184
+ <tr id="iptc-tr-' . $iptc['id'] . '">
2185
+ <td style="padding:0 4px">' . $iptc['tag'] . '</td>
2186
+ <td style="padding:0 4px">' . esc_attr( wppa_iptc_tagname( $iptc['tag'] ) ) . ':</td>
2187
+ <td style="padding:0 4px">
2188
  <input
2189
  type="text"
2190
+ style="width:500px"
2191
+ value="' . esc_attr( $iptc['description'] ) . '"
2192
  onchange="wppaAjaxUpdateIptc(\'' . $id . '\', \'' . $iptc['id'] . '\', this.value, \'' . $iptc['tag'] . '\')"
2193
  />
2194
  </td>
2195
+ </tr>' );
2196
  }
2197
 
2198
+ wppa_echo(
2199
  '</tbody>' .
2200
+ '</table>' );
2201
  }
2202
  }
2203
 
2208
  ORDER BY tag, id", $id ), ARRAY_A );
2209
  if ( ! empty( $exifs ) ) {
2210
  $brand = wppa_get_camera_brand( $id );
2211
+ wppa_echo(
2212
  '<table><tbody><tr><td><input' .
2213
  ' type="button"' .
2214
  ' id="wppa-exif-button-' . $id . '"' .
2215
  ' class="button-secundary"' .
2216
  ' value="' . esc_attr( sprintf( __( 'Show %d EXIF items', 'wp-photo-album-plus' ), count( $exifs ) ) ) . '"' .
2217
+ ' onclick="wppaToggleExif( ' . $id . ', ' . count( $exifs ) . ' )"' .
2218
  ' /></td></tr></tbody></table>' .
2219
  '<table' .
2220
  ' id="wppa-exif-' . $id . '"' .
2221
  ' class="wppa-table wppa-photo-table"' .
2222
+ ' style="clear:both;width:99%;display:none"' .
2223
  ' >' .
2224
  '<thead>' .
2225
+ '<tr style="font-weight:bold">' .
2226
+ '<td style="padding:0 4px">' . __( 'Exif tag', 'wp-photo-album-plus' ) . '</td>' .
2227
+ '<td style="padding:0 4px">' . __( 'Brand', 'wp-photo-album-plus' ) . '</td>' .
2228
+ '<td style="padding:0 4px">' . __( 'Description', 'wp-photo-album-plus' ) . '</td>' .
2229
+ '<td style="padding:0 4px">' . __( 'Raw value', 'wp-photo-album-plus' ) . '</td>' .
2230
+ '<td style="padding:0 4px">' . __( 'Formatted value', 'wp-photo-album-plus' ) . '</td>' .
2231
  '</tr>' .
2232
  '</thead>' .
2233
+ '<tbody>' );
2234
 
2235
  foreach ( $exifs as $exif ) {
2236
  $desc = $exif['description'];
2237
  if ( is_serialized( $desc ) ) {
2238
  $desc = 'Array(' . count( wppa_unserialize( $desc ) ) . ')';
2239
  }
2240
+ wppa_echo( '
2241
+ <tr id="exif-tr-' . $exif['id'] . '">
2242
+ <td style="padding:0 4px">'.$exif['tag'].'</td>' );
2243
 
2244
  if ( $brand && $exif['brand'] ) {
2245
+ wppa_echo( '
2246
+ <td style="padding:0 4px">' . $brand . '</td>
2247
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'], $brand, 'brandonly' ) . ':</td>' );
2248
  }
2249
  else {
2250
+ wppa_echo( '
2251
+ <td style="padding:0 4px"></td>
2252
+ <td style="padding:0 4px">' . wppa_exif_tagname( $exif['tag'] ) . ':</td>' );
2253
  }
2254
 
2255
+ wppa_echo( '
2256
+ <td style="padding:0 4px">' . $desc . '</td>
2257
+ <td style="padding:0 4px">' . wppa_format_exif( $exif['tag'], $exif['description'], $brand ) . '</td>
2258
+ </tr>' );
2259
 
2260
  }
2261
 
2262
+ wppa_echo(
2263
  '</tbody>' .
2264
+ '</table>' );
2265
  }
2266
  }
2267
 
2268
+ wppa_echo( '<!-- Section 6 -->', 'post' );
 
2269
 
2270
  // Comments
2271
  if ( ! $quick ) {
2273
  WHERE photo = %s
2274
  ORDER BY timestamp DESC ", $id ), ARRAY_A );
2275
  if ( ! empty( $comments ) ) {
2276
+ wppa_echo(
2277
  '<table' .
2278
  ' class="wppa-table wppa-photo-table"' .
2279
+ ' style="width:100%"' .
2280
  ' >' .
2281
  '<thead>' .
2282
+ '<tr style="font-weight:bold">' .
2283
+ '<td style="padding:0 4px">#</td>' .
2284
+ '<td style="padding:0 4px">User</td>' .
2285
+ '<td style="padding:0 4px">Time since</td>' .
2286
+ '<td style="padding:0 4px">Status</td>' .
2287
+ '<td style="padding:0 4px">Comment</td>' .
2288
  '</tr>' .
2289
  '</thead>' .
2290
+ '<tbody>' );
2291
 
2292
  foreach ( $comments as $comment ) {
2293
+ wppa_echo( '
2294
+ <tr id="com-tr-' . $comment['id'] . '">
2295
+ <td style="padding:0 4px">'.$comment['id'].'</td>
2296
+ <td style="padding:0 4px">'.$comment['user'].'</td>
2297
+ <td style="padding:0 4px">'.wppa_get_time_since( $comment['timestamp'] ).'</td>' );
2298
  if ( current_user_can( 'wppa_comments' ) || current_user_can( 'wppa_moderate' ) || ( wppa_get_user() == $photo['owner'] && wppa_switch( 'owner_moderate_comment' ) ) ) {
2299
  $p = ( $comment['status'] == 'pending' ) ? 'selected="selected" ' : '';
2300
  $a = ( $comment['status'] == 'approved' ) ? 'selected="selected" ' : '';
2301
  $s = ( $comment['status'] == 'spam' ) ? 'selected="selected" ' : '';
2302
  $t = ( $comment['status'] == 'trash' ) ? 'selected="selected" ' : '';
2303
+ wppa_echo(
2304
+ '<td style="padding:0 4px">' .
2305
  '<select' .
2306
  ' id="com-stat-' . $comment['id'] . '"' .
2307
+ ' style="background-color:' . ( $comment['status'] == 'approved' ? '#ffffe0' : '#ffebe8' ) . '"' .
2308
+ ' onchange="wppaAjaxUpdateCommentStatus( '.$id.', '.$comment['id'].', this.value );wppaSetComBgCol(' . $comment['id'] . ')"' .
2309
  ' >' .
2310
  '<option value="pending" '.$p.'>'.__( 'Pending' , 'wp-photo-album-plus').'</option>' .
2311
  '<option value="approved" '.$a.'>'.__( 'Approved' , 'wp-photo-album-plus').'</option>' .
2312
  '<option value="spam" '.$s.'>'.__( 'Spam' , 'wp-photo-album-plus').'</option>' .
2313
  '<option value="trash" '.$t.'>'.__( 'Trash' , 'wp-photo-album-plus').'</option>' .
2314
  '</select >' .
2315
+ '</td>' );
2316
  }
2317
  else {
2318
+ wppa_echo( '<td style="padding:0 4px">' );
2319
  if ( $comment['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
2320
  elseif ( $comment['status'] == 'approved' ) _e( 'Approved' , 'wp-photo-album-plus');
2321
  elseif ( $comment['status'] == 'spam' ) _e( 'Spam' , 'wp-photo-album-plus');
2322
  elseif ( $comment['status'] == 'trash' ) _e( 'Trash' , 'wp-photo-album-plus');
2323
+ wppa_echo( '</td>', 'post' );
2324
  }
2325
+ wppa_echo( '<td style="padding:0 4px">'.$comment['comment'].'</td>
2326
+ </tr>' );
 
2327
  }
2328
 
2329
+ wppa_echo(
2330
  '</tbody>' .
2331
+ '</table>' );
2332
  }
2333
  }
2334
 
2335
+ wp_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$id.');' );
2336
+
2337
+ wppa_echo(
2338
+ '<div style="clear:both"></div>' .
2339
  '</div>' .
2340
+ '<div style="clear:both;margin-top:7px"></div>' );
2341
 
2342
  } /* foreach photo */
2343
 
2363
  if ( wppa_get( 'bulk-action' ) ) {
2364
  check_admin_referer( 'wppa-bulk', 'wppa-bulk' );
2365
  if ( wppa_get( 'bulk-photo' ) ) {
2366
+ $ids = (array) wppa_get( 'bulk-photo' );
2367
  $newalb = wppa_get( 'bulk-album' );
2368
  $status = wppa_get( 'bulk-status' );
2369
  $owner = wppa_get( 'bulk-owner' );
2370
  $totcount = count( $ids );
2371
+
2372
  if ( is_array( $ids ) ) {
2373
  foreach ( array_keys( $ids ) as $id ) {
2374
  $skip = false;
2492
  }
2493
 
2494
  $pagesize = wppa_opt( 'photo_admin_pagesize' ) ? wppa_opt( 'photo_admin_pagesize' ) : '20';
2495
+ $next_after = wppa_get( 'next-after', '0' ) ? '1' : '0';
2496
+ $p = wppa_get( 'wppa-page', '1' );
2497
+ $page = $p + $next_after;
2498
+ $skip = ( $page - '1' ) * $pagesize;
 
2499
 
2500
  if ( $album ) {
2501
  if ( $album == 'moderate' ) {
2530
  if ( $photos ) {
2531
  $plink = $link . '&next-after=' . $next_after;
2532
  wppa_admin_page_links( $page, $pagesize, $count, $plink, '#manage-photos' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2533
 
2534
+ $the_js = "
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2535
  function wppaTryMove( id, video ) {
2536
 
2537
  var query;
2538
 
2539
  if ( ! jQuery( '#target-' + id ).val() ) {
2540
+ alert( '" . esc_js( __( 'Please select an album to move to first.', 'wp-photo-album-plus' ) ) . "' );
2541
  return false;
2542
  }
2543
 
2544
  if ( video ) {
2545
+ query = '" . esc_js( __( 'Are you sure you want to move this video?', 'wp-photo-album-plus' ) ) . "';
2546
  }
2547
  else {
2548
+ query = '" . esc_js( __( 'Are you sure you want to move this photo?', 'wp-photo-album-plus' ) ) . "';
2549
  }
2550
 
2551
  if ( ! jQuery('#confirm-move').prop('checked') || confirm( query ) ) {
2552
+ jQuery( '#moving-' + id ).html( '". __( 'Moving...', 'wp-photo-album-plus' ) . "' );
2553
+ wppaAjaxUpdatePhoto( id, 'moveto', jQuery( '#target-' + id ).val(), false, '<td colspan=\'8\' >', '</td>' );
2554
+ }
2555
+ }" . '
2556
+ jQuery(document).ready( function() {
2557
+ wppaSetConfirmDelete( "confirm-delete" );
2558
+ wppaSetConfirmMove( "confirm-move" );
2559
+ });
2560
+ function wppaConfirmAndDelete(id) {
2561
+ if ( ! jQuery("#confirm-delete").prop("checked") ||
2562
+ confirm( "' . esc_js( __( 'Are you sure you want to delete this photo?', 'wp-photo-album-plus' ) ) . '" ) ) {
2563
+ jQuery("#wppa-delete-"+id).html( "' . esc_js( __('Deleting...', 'wp-photo-album-plus') ) . '" );
2564
+ wppaAjaxDeletePhoto(id, "<td colspan=8 >", "</td>");
2565
+ }
2566
+ }';
2567
 
2568
+ wp_add_inline_script( 'wppa-admin', $the_js );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2569
 
2570
+ ?>
2571
+ <form action="<?php wppa_echo( $link.'&wppa-page='.$page.'#manage-photos', 'post' ) ?>" method="post">
 
2572
  <?php wp_nonce_field( 'wppa-bulk','wppa-bulk' ) ?>
2573
  <h3>
2574
+ <span style="font-weight:bold"><?php _e( 'Bulk action:' , 'wp-photo-album-plus') ?></span>
2575
+ <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, 'bulk-album' )">
2576
+ <option value=""></option>
2577
+ <option value="wppa-bulk-delete"><?php _e( 'Delete' , 'wp-photo-album-plus') ?></option>
2578
+ <option value="wppa-bulk-move-to"><?php _e( 'Move to' , 'wp-photo-album-plus') ?></option>
2579
+ <option value="wppa-bulk-copy-to"><?php _e( 'Copy to' , 'wp-photo-album-plus') ?></option>
2580
  <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
2581
+ <option value="wppa-bulk-status"><?php _e( 'Set status to' , 'wp-photo-album-plus') ?></option>
2582
  <?php } ?>
2583
  <?php if ( wppa_user_is( 'administrator' ) && wppa_switch( 'photo_owner_change' ) ) { ?>
2584
+ <option value="wppa-bulk-owner"><?php _e( 'Set owner to' , 'wp-photo-album-plus') ?></option>
2585
  <?php } ?>
2586
  </select>
2587
  <?php
2588
+ // <select name="wppa-bulk-album" id="wppa-bulk-album" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_album',this.value,365 )">
2589
+ wppa_echo( wppa_album_select_a( array( 'checkaccess' => true,
2590
  'path' => true,
2591
  'exclude' => $album,
2592
  'selected' => '0',
2595
  'tagopen' => '<select' .
2596
  ' name="wppa-bulk-album"' .
2597
  ' id="wppa-bulk-album"' .
2598
+ ' style="display:none"' .
2599
+ ' onchange="wppa_setCookie( \'wppa_bulk_album\',this.value,365 )"' .
2600
  ' >',
2601
  'tagname' => 'wppa-bulk-album',
2602
  'tagid' => 'wppa-bulk-album',
2603
  'tagonchange' => 'wppa_setCookie( \'wppa_bulk_album\',this.value,365 );',
2604
  'tagstyle' => 'display:none;cursor:pointer;',
2605
+ ) ) );
2606
  ?>
2607
+ <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 )">
2608
+ <option value=""><?php _e( '- select a status -' , 'wp-photo-album-plus') ?></option>
2609
+ <option value="pending"><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
2610
+ <option value="publish"><?php _e( 'Publish' , 'wp-photo-album-plus') ?></option>
2611
  <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) $dis = ' disabled'; else $dis = ''; ?>
2612
+ <option value="featured"<?php wppa_echo( $dis, 'post' )?> ><?php _e( 'Featured' , 'wp-photo-album-plus') ?></option>
2613
+ <option value="gold" <?php wppa_echo( $dis, 'post' )?> ><?php _e( 'Gold' , 'wp-photo-album-plus') ?></option>
2614
+ <option value="silver" <?php wppa_echo( $dis, 'post' )?> ><?php _e( 'Silver' , 'wp-photo-album-plus') ?></option>
2615
+ <option value="bronze" <?php wppa_echo( $dis, 'post' )?> ><?php _e( 'Bronze' , 'wp-photo-album-plus') ?></option>
2616
+ <option value="scheduled" <?php wppa_echo( $dis, 'post' )?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus') ?></option>
2617
+ <option value="private" <?php wppa_echo( $dis, 'post' ) ?> ><?php _e( 'Private' , 'wp-photo-album-plus') ?></option>
2618
  </select>
2619
  <!-- Owner -->
2620
  <?php $users = wppa_get_users();
2621
  if ( count( $users ) ) { ?>
2622
+ <select name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 )">
2623
+ <option value=""><?php _e( '- select an owner -' , 'wp-photo-album-plus') ?></option>
2624
  <?php
2625
 
2626
  foreach ( $users as $user ) {
2627
+ wppa_echo( '<option value="' . esc_attr( $user['user_login'] ) . '">' . htmlspecialchars( $user['display_name'] ) . ' (' . htmlspecialchars( $user['user_login'] ) . ')</option>' );
2628
  }
2629
  ?>
2630
  </select>
2631
  <?php } else { ?>
2632
+ <input name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 )" />
2633
  <?php } ?>
2634
  <!-- Submit -->
2635
  <input type="submit" onclick="return wppaBulkDoitOnClick()" class="button-primary" value="<?php _e( 'Doit!' , 'wp-photo-album-plus') ?>" />
2636
  <?php
2637
  if ( wppa_is_mobile() ) {
2638
+ wppa_echo( '<br />', 'post' );
2639
  }
2640
  ?>
2641
  <?php $nextafterselhtml =
2642
+ '<select name="next-after">' .
2643
  '<option value="-1" ' . ( $next_after == '-1' ? 'selected="selected"' : '' ) . ' >' . __( 'the previous page', 'wp-photo-album-plus' ) . '</option>' .
2644
  '<option value="0" ' . ( $next_after == '0' ? 'selected="selected"' : '' ) . ' >' . __( 'the same page', 'wp-photo-album-plus' ) . '</option>' .
2645
  '<option value="1" ' . ( $next_after == '1' ? 'selected="selected"' : '' ) . ' >' . __( 'the next page', 'wp-photo-album-plus' ) . '</option>' .
2646
  '</select>';
2647
+ wppa_echo( sprintf( __( 'Go to %s after Doit!.', 'wp-photo-album-plus'), $nextafterselhtml ) );
2648
  if ( wppa_is_mobile() ) {
2649
+ wppa_echo( '<br />', 'post' );
2650
  }
2651
  ?>
2652
 
2655
  id="confirm-delete"
2656
  name="confirm-delete"
2657
  checked="checked"
2658
+ onchange="wppaToggleConfirmDelete( this )"
2659
  />
2660
  <?php _e('Confirm delete', 'wp-photo-album-plus') ?>
2661
 
2664
  id="confirm-move"
2665
  name="confirm-move"
2666
  checked="checked"
2667
+ onchange="wppaToggleConfirmMove(this)"
2668
  />
2669
  <?php _e('Confirm move', 'wp-photo-album-plus') ?>
2670
 
2671
+ <?php wppa_echo( '<small style="float:right"> (' . count( $photos ) . ')</small>', 'post' );
2672
+
2673
+ ?>
 
 
 
 
2674
  </h3>
2675
  <?php $edit_link = wppa_ea_url( 'single', 'edit' ) ?>
2676
+ <table class="widefat">
2677
+ <thead style="font-weight:bold">
2678
+ <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked )" /></td>
2679
  <td><?php _e( 'ID' , 'wp-photo-album-plus') ?></td>
2680
  <td><?php _e( 'Preview' , 'wp-photo-album-plus') ?></td>
2681
  <td><?php _e( 'Name' , 'wp-photo-album-plus') ?></td>
2685
  <td><?php _e( 'Remark' , 'wp-photo-album-plus') ?></td>
2686
  </thead>
2687
  <tbody>
2688
+ <?php
2689
+ foreach ( $photos as $photo ) {
2690
+ $id = $photo['id'];
2691
+
2692
+ // Album for moderate
2693
+ static $modalbum;
2694
+ if ( $album == 'moderate' ) {
2695
+ if ( $modalbum != $photo['album'] ) {
2696
+ wppa_echo( '
2697
+ <tr>
2698
+ <td colspan="8" style="background-color:lightgreen">
2699
+ <h3 style="margin:0">' .
2700
+ sprintf( __( 'Moderate photos from album %s by %s', 'wp-photo-album-plus' ),
2701
+ '<i>' . htmlspecialchars( wppa_get_album_name( $photo['album'] ) ) . '</i>',
2702
+ '<i>' . htmlspecialchars( wppa_get_album_item( $photo['album'], 'owner' ) ) . '</i>' ) .
2703
+ '</h3>
2704
+ </td>
2705
+ </tr>' );
2706
+ $modalbum = $photo['album'];
2707
+ }
2708
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2709
 
2710
+ $maxsize = wppa_get_minisize(); ?>
2711
+ <tr id="photoitem-<?php wppa_echo( $photo['id'], 'post' ) ?>">
2712
+ <!-- Checkbox -->
2713
+ <td>
2714
+ <input type="hidden" id="photo-nonce-<?php wppa_echo( $photo['id'], 'post' ) ?>" value="<?php wppa_echo( wp_create_nonce( 'wppa-nonce_'.$photo['id'] ), 'post' ) ?>" />
2715
+ <input type="checkbox" name="wppa-bulk-photo[<?php wppa_echo( $photo['id'], 'post' ) ?>]" class="wppa-bulk-photo" />
2716
+ </td>
2717
+ <!-- ID and delete link -->
2718
+ <td><?php
2719
+ wppa_echo(
2720
+ '<a
2721
+ href="' . $edit_link . '&photo=' . $photo['id'] . '"
2722
+ target="_blank"
2723
+ >' .
2724
+ $photo['id'] . '
2725
+ </a>
2726
+ <br />
2727
+ <a
2728
+ id="wppa-delete-' . $photo['id'] . '"
2729
+ onclick="wppaConfirmAndDelete(' . $photo['id'] . ')"
2730
+ style="color:red;font-weight:bold;cursor:pointer"
2731
+ >' .
2732
+ __( 'Delete', 'wp-photo-album-plus' ) . '
2733
+ </a>' );
2734
  ?>
2735
+ </td>
2736
+ <!-- Preview -->
2737
+ <td style="min-width:240px; text-align:center">
2738
+ <?php if ( wppa_is_video( $photo['id'] ) ) {
2739
+ $a = false;
2740
+ if ( wppa_is_file( wppa_strip_ext( wppa_get_photo_path( $id ) ) . '.mp4' ) ) {
2741
+ $a = true;
2742
+ wppa_echo( '
2743
+ <a
2744
+ href="' . esc_url( str_replace( '.jpg', '.mp4', wppa_get_photo_url( $id ) ) ) . '"
2745
+ target="_blank"
2746
+ title="' . esc_attr( __('Click to see fullsize video', 'wp-photo-album-plus') ) . '"
2747
+ >' );
2748
+ }
2749
+
2750
+ wppa_echo( wppa_get_video_html( array(
2751
+ 'id' => $id,
2752
+ 'height' => '160',
2753
+ 'controls' => false,
2754
+ 'tagid' => 'pa-id-' . $id,
2755
+ 'preload' => 'metadata',
2756
+ 'use_thumb' => true,
2757
+ ) ) );
2758
+ if ( $a ) {
2759
+ wppa_echo( '</a>' );
2760
+ }
 
 
 
2761
  }
2762
  else {
2763
+ wppa_echo(
2764
+ '<a' .
2765
+ ' href="' . esc_url( wppa_get_photo_url( $photo['id'] ) ) . '"' .
2766
+ ' target="_blank"' .
2767
+ ' title="' . esc_attr( __( 'Click to see fullsize', 'wp-photo-album-plus' ) ) . '"' .
2768
+ ' >' .
2769
+ '<img' .
2770
+ ' class="wppa-bulk-thumb"' .
2771
+ ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
2772
+ ' style="max-width:' . $maxsize . 'px;max-height:' . $maxsize . 'px"' .
2773
+ ' />' .
2774
+ '</a>', 'post' );
2775
  }
2776
  ?>
2777
+ </td>
2778
+ <!-- Name, size, move -->
2779
+ <!-- Name -->
2780
+ <td style="width:25%">
2781
+ <input type="text" style="width:300px" id="pname-<?php wppa_echo( $photo['id'], 'post' ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'], 'post' ) ?>, 'name', this.value)" value="<?php wppa_echo( esc_attr( stripslashes( $photo['name'] ) ), 'post' ) ?>" />
2782
+ <!-- Size -->
2783
+ <?php
2784
+ if ( wppa_is_video( $photo['id'] ) ) {
2785
+ wppa_echo( '<br />'.strval(intval(wppa_get_videox( $photo['id'] ))).' x '.strval(intval(wppa_get_videoy( $photo['id'] ))).' px.', 'post' );
2786
+ }
2787
+ else {
2788
+ $sp = wppa_get_source_path( $photo['id'] );
2789
+ if ( is_file( $sp ) ) {
2790
+ $ima = getimagesize( $sp );
2791
+ if ( is_array( $ima ) ) {
2792
+ wppa_echo( '<br />'.$ima['0'].' x '.$ima['1'].' px.', 'post' );
2793
+ }
2794
  }
 
 
 
 
 
 
 
 
 
 
 
2795
  }
2796
+ ?>
2797
+ <!-- Move -->
2798
+ <?php
2799
+ $max = wppa_opt( 'photo_admin_max_albums' );
2800
+ if ( ! $max || wppa_get_total_album_count() < $max ) {
2801
+
2802
+ // If not done yet, get the album options html with the current album excluded
2803
+ if ( ! isset( $album_select[$album] ) ) {
2804
+ $album_select[$album] = wppa_album_select_a( array( 'checkaccess' => true,
2805
+ 'path' => true,
2806
+ 'exclude' => $album,
2807
+ 'selected' => '0',
2808
+ 'addpleaseselect' => true,
2809
+ 'sort' => true,
2810
+ )
2811
+ );
2812
+ }
2813
 
2814
+ wppa_echo(
2815
+ '<br />' . __( 'Target album for move to:', 'wp-photo-album-plus' ) . '<br />' .
2816
+ '<select' .
2817
+ ' id="target-' . $id . '"' .
2818
+ ' onchange="wppaTryMove(' . $id . ', ' . ( wppa_is_video( $id ) ? 'true' : 'false' ) . ')"' .
2819
+ ' style="max-width:300px"' .
2820
+ ' >' .
2821
+ $album_select[$album] .
2822
+ '</select>' .
2823
+ '<span id="moving-' . $id . '" style="color:red;font-weight:bold"></span>' );
2824
+ }
2825
+
2826
+ ?>
2827
+ </td>
2828
+ <!-- Description -->
2829
+ <td style="width:25%">
2830
+ <textarea class="wppa-bulk-dec" style="height:50px; width:100%" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'], 'post' ) ?>, 'description', this.value)"><?php wppa_echo( ( esc_textarea( stripslashes( $photo['description'] ) ) ) ) ?></textarea>
2831
+ </td>
2832
+ <!-- Status -->
2833
+ <td>
2834
+ <?php if ( current_user_can( 'wppa_admin' ) || current_user_can( 'wppa_moderate' ) ) { ?>
2835
+ <select id="status-<?php wppa_echo( $photo['id'], 'post' ) ?>" onchange="wppaAjaxUpdatePhoto( <?php wppa_echo( $photo['id'], 'post' ) ?>, 'status', this.value); wppaPhotoStatusChange( <?php wppa_echo( $photo['id'], 'post' ) ?> ); ">
2836
+ <option value="pending" <?php if ( $photo['status']=='pending' ) wppa_echo( 'selected="selected"', 'post' )?> ><?php _e( 'Pending' , 'wp-photo-album-plus') ?></option>
2837
+ <option value="publish" <?php if ( $photo['status']=='publish' ) wppa_echo( 'selected="selected"', 'post' )?> ><?php _e( 'Publish' , 'wp-photo-album-plus') ?></option>
2838
+ <?php if ( wppa_switch( 'ext_status_restricted' ) && ! wppa_user_is( 'administrator' ) ) $dis = ' disabled'; else $dis = ''; ?>
2839
+ <option value="featured" <?php if ( $photo['status']=='featured' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis, 'post' )?> ><?php _e( 'Featured' , 'wp-photo-album-plus') ?></option>
2840
+ <option value="gold" <?php if ( $photo['status'] == 'gold' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis, 'post' )?> ><?php _e( 'Gold' , 'wp-photo-album-plus') ?></option>
2841
+ <option value="silver" <?php if ( $photo['status'] == 'silver' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis, 'post' )?> ><?php _e( 'Silver' , 'wp-photo-album-plus') ?></option>
2842
+ <option value="bronze" <?php if ( $photo['status'] == 'bronze' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis, 'post' )?> ><?php _e( 'Bronze' , 'wp-photo-album-plus') ?></option>
2843
+ <option value="scheduled" <?php if ( $photo['status'] == 'scheduled' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis, 'post' )?> ><?php _e( 'Scheduled' , 'wp-photo-album-plus') ?></option>
2844
+ <option value="private" <?php if ( $photo['status'] == 'private' ) wppa_echo( 'selected="selected"', 'post' ); wppa_echo( $dis , 'post' )?> ><?php _e( 'Private' , 'wp-photo-album-plus') ?></option>
2845
+ </select>
2846
+ <?php }
2847
+ else {
2848
+ if ( $photo['status'] == 'pending' ) _e( 'Pending' , 'wp-photo-album-plus');
2849
+ elseif ( $photo['status'] == 'publish' ) _e( 'Publish' , 'wp-photo-album-plus');
2850
+ elseif ( $photo['status'] == 'featured' ) e( 'Featured' );
2851
+ elseif ( $photo['status'] == 'gold' ) _e( 'Gold' , 'wp-photo-album-plus');
2852
+ elseif ( $photo['status'] == 'silver' ) _e( 'Silver' , 'wp-photo-album-plus');
2853
+ elseif ( $photo['status'] == 'bronze' ) _e( 'Bronze' , 'wp-photo-album-plus');
2854
+ elseif ( $photo['status'] == 'scheduled' ) _e( 'Scheduled' , 'wp-photo-album-plus');
2855
+ elseif ( $photo['status'] == 'private' ) _e( 'Private' , 'wp-photo-album-plus');
2856
+ } ?>
2857
+ </td>
2858
+ <!-- Owner -->
2859
+ <td>
2860
+ <?php wppa_echo( $photo['owner'], 'post' ) ?>
2861
+ </td>
2862
+ <!-- Remark -->
2863
+ <td id="remark-<?php wppa_echo( $photo['id'], 'post' ) ?>" style="width:25%">
2864
+ <?php _e( 'Not modified' , 'wp-photo-album-plus') ?>
2865
+ <?php wp_add_inline_script( 'wppa-admin', 'wppaPhotoStatusChange('.$photo['id'].');' ); ?>
2866
+ </td>
2867
+ </tr>
2868
  <?php } ?>
2869
  </tbody>
2870
+ <tfoot style="font-weight:bold">
2871
+ <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).prop( 'checked', this.checked )" /></td>
2872
  <td><?php _e( 'ID' , 'wp-photo-album-plus') ?></td>
2873
  <td><?php _e( 'Preview' , 'wp-photo-album-plus') ?></td>
2874
  <td><?php _e( 'Name' , 'wp-photo-album-plus') ?></td>
2885
  else {
2886
  if ( $page == '1' ) {
2887
  if ( wppa_get( 'searchstring' ) ) {
2888
+ wppa_echo( '<h3>'.__( 'No photos matching your search criteria.' , 'wp-photo-album-plus').'</h3>', 'post' );
2889
  }
2890
  elseif ( $album == 'moderate' ) {
2891
+ wppa_echo( '<h3>'.__( 'No photos to moderate', 'wp-photo-album-plus' ) . '</h3>', 'post' );
2892
  }
2893
  else {
2894
+ wppa_echo( '<h3>'.__( 'No photos yet in this album.' , 'wp-photo-album-plus' ).'</h3>', 'post' );
2895
  }
2896
  }
2897
  else {
2898
  $page_1 = $page - '1';
2899
+ wppa_echo( sprintf( __( 'Page %d is empty, try <a href="%s">page %d</a>.' , 'wp-photo-album-plus'), $page, $link.'&wppa-page='.$page_1.'#manage-photos', $page_1 ), 'post' );
2900
  }
2901
  }
2902
  }
2921
 
2922
  if ( $photos ) {
2923
  ?>
2924
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2925
  <script>
2926
  jQuery( function() {
2927
  jQuery( "#sortable" ).sortable( {
2931
  var ids = jQuery( ".wppa-sort-item" );
2932
  var seq = jQuery( ".wppa-sort-seqn" );
2933
  var idx = 0;
2934
+ var descend = <?php if ( $is_descending ) wppa_echo( 'true', 'post' ); else wppa_echo( 'false', 'post' ) ?>;
2935
  while ( idx < ids.length ) {
2936
  var newvalue;
2937
  if ( descend ) newvalue = ids.length - idx;
2966
  jQuery( '#wppa-seqno-'+photo ).html( seqno );
2967
  break;
2968
  case '99': // Photo is gone
2969
+ jQuery( '#wppa-seqno-'+photo ).html( '<span style="color"red">deleted</span>' );
2970
  break;
2971
  default: // Any error
2972
+ jQuery( '#wppa-seqno-'+photo ).html( '<span style="color"red">Err:'+ArrValues[1]+'</span>' );
2973
  break;
2974
  }
2975
  wppaAjaxRequests--;
2987
  }
2988
  </script>
2989
  <?php if ( ! $is_p_order ) wppa_warning_message( __( 'Setting photo sequence order has only effect if the photo order method is set to <b>Order#</b>' , 'wp-photo-album-plus') ) ?>
2990
+ <div class="widefat wppa-photo-admin-sortable" style="border-color:#cccccc">
2991
  <div id="sortable">
2992
  <?php foreach ( $photos as $photo ) {
2993
  if ( wppa_is_video( $photo['id'] ) ) {
3011
  $mt = ( $mh - ( $imgs[1]/$imgs[0] * $mw ) ) / '2' + '15';
3012
  }
3013
  ?>
3014
+ <div id="photoitem-<?php wppa_echo( $photo['id'], 'post' ) ?>" class="ui-state-default wppa-<?php wppa_echo( $photo['status'], 'post' ) ?>" style="background-image:none; text-align:center; cursor:move">
3015
  <?php if ( wppa_is_video( $photo['id'] ) ) { ?>
3016
  <?php $id = $photo['id'] ?>
3017
+ <?php $imgstyle = 'max-width:'.$mw.'px;max-height:'.$mh.'px;margin-top:'.$mt.'px;' ?>
3018
+ <?php wppa_echo( wppa_get_video_html( array(
3019
  'id' => $id,
3020
  // 'width' => $imgwidth,
3021
  // 'height' => '60',
3032
  'class' => 'wppa-bulk-thumb',
3033
  'style' => $imgstyle,
3034
  'use_thumb' => true
3035
+ )) );
3036
+
3037
+
3038
+ }
 
 
 
3039
  else {
3040
+ wppa_echo(
3041
  '<img' .
3042
  ' class="wppa-bulk-thumb"' .
3043
  ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo['id'] ) ) . '"' .
3044
+ ' style="max-width:' . $mw . 'px;max-height:' . $mh . 'px;margin-top:' . $mt . 'px" />', 'post' );
3045
  } ?>
3046
+ <div style="font-size:9px; position:absolute; bottom:24px; text-align:center; width:<?php wppa_echo( $size, 'post' ) ?>px"><?php wppa_echo( wppa_get_photo_name( $photo['id'] ), 'post' ) ?></div>
3047
+ <div style="text-align: center; width: <?php wppa_echo( $size, 'post' ) ?>px; position:absolute; bottom:8px">
3048
+ <span style="margin-left:15px;float:left"><?php wppa_echo( __( 'Id: ' , 'wp-photo-album-plus').$photo['id'], 'post' )?></span>
3049
  <?php if ( wppa_is_video( $photo['id'] ) )_e('Video', 'wp-photo-album-plus'); ?>
3050
  <?php if ( wppa_has_audio( $photo['id'] ) ) _e('Audio', 'wp-photo-album-plus'); ?>
3051
+ <span style="float:right; margin-right:15px"><?php wppa_echo( __( 'Ord: ' , 'wp-photo-album-plus').'<span id="wppa-seqno-'.$photo['id'].'">'.$photo['p_order'], 'post' ) ?></span>
3052
  </div>
3053
+ <input type="hidden" id="photo-nonce-<?php wppa_echo( $photo['id'], 'post' ) ?>" value="<?php wppa_echo( wp_create_nonce( 'wppa-nonce_'.$photo['id'] ), 'post' ); ?>" />
3054
+ <input type="hidden" class="wppa-sort-item" value="<?php wppa_echo( $photo['id'], 'post' ) ?>" />
3055
+ <input type="hidden" class="wppa-sort-seqn" id="wppa-sort-seqn-<?php wppa_echo( $photo['id'], 'post' ) ?>" value="<?php wppa_echo( $photo['p_order'], 'post' ) ?>" />
3056
  </div>
3057
  <?php } ?>
3058
  </div>
3059
+ <div style="clear:both"></div>
3060
  </div>
3061
  <?php
3062
  }
3063
  else {
3064
+ wppa_echo( '<h3>'.__( 'The album is empty.' , 'wp-photo-album-plus').'</h3>', 'post' );
3065
  }
3066
  }
3067
  else {
3193
  global $wppa_search_stats;
3194
 
3195
  if ( wppa_get( 'searchstring' ) ) {
3196
+ wppa_echo( '
3197
  <table>
3198
  <thead>
3199
  <tr>
3209
  <td><hr /></td>
3210
  </tr>
3211
  </thead>
3212
+ <tbody>' );
3213
  $count = empty( $wppa_search_stats ) ? '0' : count( $wppa_search_stats );
3214
  $c = '0';
3215
  $s = '';
3216
  foreach( $wppa_search_stats as $search_item ) {
3217
  $c++;
3218
  if ( $c == ( $count - 1 ) ) {
3219
+ wppa_echo( '<tr><td><hr /></td><td><hr /></td></tr>' );
3220
+ $s = 'style="font-weight:bold"';
3221
  }
3222
  if ( $search_item['word'] ) {
3223
+ wppa_echo( '
3224
  <tr>
3225
  <td '.$s.'>' .
3226
  $search_item['word'] . '
3228
  <td '.$s.'>' .
3229
  $search_item['count'] . '
3230
  </td>
3231
+ </tr>' );
3232
  }
3233
  }
3234
+ wppa_echo( '</table>' );
 
3235
  }
3236
  }
3237
 
3238
  // New style fron-end edit photo
3239
+ function wppa_fe_edit_photo( $photo ) {
3240
 
3241
  $items = array( 'upn-name',
3242
  'upn-description',
3296
  );
3297
 
3298
  // Open page
3299
+ wppa_echo(
3300
  '<div' .
3301
+ ' style="width:100%;margin-top:8px;padding:8px;display:block;box-sizing:border-box;background-color:#fff"' .
3302
  ' >' .
3303
  '<h3>' .
3304
  '<img' .
3305
+ ' style="height:50px"' .
3306
  ' ' . ( wppa_lazy() ? 'data-' : '' ) . 'src="' . esc_url( wppa_get_thumb_url( $photo ) ) . '"' .
3307
  wppa_get_imgalt( $photo ) .
3308
  ' />' .
3309
  '&nbsp;&nbsp;' .
3310
+ wppa_opt( 'fe_edit_caption' ) . '</h3>', 'post' );
3311
 
3312
  // Open form
3313
+ wppa_echo(
3314
  '<form' .
3315
  ' >' .
3316
  '<input' .
3318
  ' id="wppa-nonce-' . wppa_encrypt_photo( $photo ) . '"' .
3319
  ' name="wppa-nonce"' .
3320
  ' value="' . wp_create_nonce( 'wppa-nonce-' . $photo ) . '"' .
3321
+ ' />' );
3322
 
3323
  // Get custom data
3324
  $custom = wppa_get_photo_item( $photo, 'custom' );
3332
  // Items
3333
  foreach ( array_keys( $items ) as $idx ) {
3334
  if ( $titles[$idx] && $doit[$idx] ) {
3335
+ wppa_echo( '<h6>' . $titles[$idx] . '</h6>', 'post' );
 
3336
 
3337
  if ( wppa_is_int( substr( $items[$idx], -1 ) ) ) {
3338
  $value = stripslashes( $custom_data[substr( $items[$idx], -1 )] );
3344
  }
3345
  }
3346
  if ( $types[$idx] == 'text' ) {
3347
+ wppa_echo(
3348
  '<input' .
3349
  ' type="text"' .
3350
+ ' style="width:100%"' .
3351
  ' id="' . $items[$idx] . '"' .
3352
  ' name="' . $items[$idx] . '"' .
3353
  ' value="' . esc_attr( $value ) . '"' .
3354
+ ' />' );
3355
  }
3356
  if ( $types[$idx] == 'textarea' ) {
3357
+ wppa_echo(
3358
  '<textarea' .
3359
+ ' style="width:100%;min-width:100%;max-width:100%"' .
3360
  ' id="' . $items[$idx] . '"' .
3361
  ' name="' . $items[$idx] . '"' .
3362
  ' >' .
3363
  esc_textarea( stripslashes( $value ) ) .
3364
+ '</textarea>' );
3365
  }
3366
  }
3367
  }
3368
 
3369
  // Submit
3370
+ wppa_echo(
3371
  '<input' .
3372
  ' type="button"' .
3373
+ ' style="margin-top:8px;margin-right:8px"' .
3374
  ' value="' . esc_attr( __( 'Send', 'wp-photo-album-plus' ) ) . '"' .
3375
+ ' onclick="wppaUpdatePhotoNew(\'' . wppa_encrypt_photo( $photo ) . '\',\'' . wppa_get( 'occur' ) . '\')"' . //document.location.reload(true)"' .
3376
+ ' />' );
3377
 
3378
  // Cancel
3379
+ wppa_echo(
3380
  '<input' .
3381
  ' type="button"' .
3382
+ ' style="margin-top:8px"' .
3383
  ' value="' . esc_attr( __( 'Cancel', 'wp-photo-album-plus' ) ) . '"' .
3384
  ' onclick="jQuery( \'#wppa-modal-container-' . wppa_get( 'occur' ) . '\').dialog(\'close\')"' .
3385
+ ' />' );
3386
 
3387
  // Close form
3388
+ wppa_echo( '</form>', 'post' );
 
3389
 
3390
  // Close page
3391
+ wppa_echo( '</div>', 'post' );
 
3392
 
3393
  }
3394
 
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.0.10.001
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -14,514 +14,517 @@ global $wppa_lang;
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
- /* wppa-utils.js */
18
- $result = '
19
- wppaDebugCounter = 0,';
20
-
21
- /* wppa.js */
22
- $result .= '
23
- wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
- wppaOvlActivePanorama = 0,';
25
-
26
- /* Global and slideshow vars */
27
- $result .= '
28
- wppaFullValign = [],
29
- wppaFullHalign = [],
30
- wppaFullFrameDelta = [],
31
- wppaAutoColumnWidth = [],
32
- wppaAutoColumnFrac = [],
33
- wppaFadeInAfterFadeOut = false,
34
- wppaPreambule = [],
35
- wppaThumbnailPitch = [],
36
- wppaFilmStripLength = [],
37
- wppaFilmStripMargin = [],
38
- wppaFilmStripAreaDelta = [],
39
- wppaIsMini = [],
40
- wppaPortraitOnly = [],
41
- wppaLightBox = [],
42
- wppaSlideInitRunning = [],
43
- wppaSlidePause = [],
44
- wppaSlideBlank = [],
45
- wppaFilmPageSize = [],
46
- wppaAspectRatio = [],
47
- wppaFullSize = [],
48
- wppaLightboxSingle = [],
49
- wppaSiteUrl = "' . site_url() . '",
50
- wppaMasonryCols = [],
51
- wppaVideoPlaying = [],
52
- wppaAudioPlaying = [],
53
- wppaHis = 0,
54
- wppaStartHtml = [],
55
- wppaCanAjaxRender = false,
56
- wppaCanPushState = false,
57
- wppaMaxOccur = 0,
58
- wppaFirstOccur = 0,
59
- wppaUsePhotoNamesInUrls = false,
60
- wppaShareHideWhenRunning = false,
61
- wppaCommentRequiredAfterVote = true,
62
- wppaTopMoc = 0,
63
- wppaColWidth = [],
64
- wppaMCRWidth = [],
65
- wppaFotomotoHideWhenRunning = false,
66
- wppaFotomotoMinWidth = 400,
67
- wppaPhotoView = [],
68
- wppaBackgroundColorImage = "",
69
- wppaPopupLinkType = "",
70
- wppaPopupOnclick = [],
71
- wppaThumbTargetBlank = false,
72
- wppaRel = "rel",
73
- wppaEditPhotoWidth = "960",
74
- wppaThemeStyles = "",
75
- wppaStickyHeaderHeight = 0,
76
- wppaModalBgColor = "#ffffff",
77
- wppaBoxRadius = 0,
78
- wppaUploadEdit = "none",
79
- wppaPageArg = "",
80
- wppaCoverImageResponsive = [],
81
- wppaSearchBoxSelItems = [],
82
- wppaSlideWrap = [],
83
- wppaHideRightClick = false,
84
- wppaGeoZoom = 10,
85
- wppaAreaMaxFrac = 1.0,
86
- wppaNiceScroll = false,
87
- wppaIconSizeNormal = "default",
88
- wppaIconSizeStars = 24,
89
- wppaFilmInit = [],
90
- wppaResizeEndDelay = 200,
91
- wppaScrollEndDelay = 200,
92
- wppaArtmonkeyFileNotSource = false,
93
- wppaRequestInfoDialogText = "Please specify your question",
94
- wppaGlobalFsIconSize = 32,
95
- wppaFsFillcolor = "#999999",
96
- wppaFsBgcolor = "transparent",
97
- wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
- _wppaId = [],
99
- _wppaRealId = [],
100
- _wppaAvg = [],
101
- _wppaDisc = [],
102
- _wppaMyr = [],
103
- _wppaVRU = [],
104
- _wppaLinkUrl = [],
105
- _wppaLinkTitle = [],
106
- _wppaLinkTarget = [],
107
- _wppaCommentHtml = [],
108
- _wppaIptcHtml = [],
109
- _wppaExifHtml = [],
110
- _wppaToTheSame = false,
111
- _wppaSlides = [],
112
- _wppaNames = [],
113
- _wppaFilmThumbTitles = [],
114
- _wppaFullNames = [],
115
- _wppaDsc = [],
116
- _wppaOgDsc = [],
117
- _wppaCurIdx = [],
118
- _wppaNxtIdx = [],
119
- _wppaTimeOut = [],
120
- _wppaSSRuns = [],
121
- _wppaFg = [],
122
- _wppaTP = [],
123
- _wppaIsBusy = [],
124
- _wppaFirst = [],
125
- _wppaVoteInProgress = false,
126
- _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
- _wppaUrl = [],
128
- _wppaSkipRated = [],
129
- _wppaLbTitle = [],
130
- _wppaStateCount = 0,
131
- _wppaDidGoto = [],
132
- _wppaShareUrl = [],
133
- _wppaShareHtml = [],
134
- _wppaFilmNoMove = [],
135
- _wppaHiresUrl = [],
136
- _wppaIsVideo = [],
137
- _wppaVideoHtml = [],
138
- _wppaAudioHtml = [],
139
- _wppaVideoNatWidth = [],
140
- _wppaVideoNatHeight = [],
141
- _wppaWaitTexts = [],
142
- _wppaImageAlt = [],
143
- _wppaLastIdx = [],
144
- _wppaStopping = [],
145
- _wppaFilename = [],
146
- __wppaOverruleRun = false,
147
- wppaOvlIdx = 0,
148
- wppaOvlFirst = true,
149
- wppaOvlKbHandler = "",
150
- wppaOvlSizeHandler = "",
151
- wppaOvlPadTop = 5,
152
- wppaOvlRunning = false,
153
- wppaOvlVideoPlaying = false,
154
- wppaOvlAudioPlaying = false,
155
- wppaOvlShowLegenda = true,
156
- wppaOvlShowStartStop = true,
157
- wppaOvlRadius = 0,
158
- wppaOvlBorderWidth = 16,
159
- wppaOvlOpen = false,
160
- wppaOvlClosing = false,
161
- wppaThumbSize = 100,
162
- wppaTfMargin = 4,
163
- wppaZoomData = [],
164
- wppaSphericData = [],
165
- wppaOvlTxtHeight = 36,
166
- wppaOvlOpacity = 0.8,
167
- wppaOvlOnclickType = "none",
168
- wppaOvlTheme = "black",
169
- wppaOvlAnimSpeed = 300,
170
- wppaOvlSlideSpeed = 3000,
171
- wppaOvlFontFamily = "Helvetica",
172
- wppaOvlFontSize = "10",
173
- wppaOvlFontColor = "",
174
- wppaOvlFontWeight = "bold",
175
- wppaOvlLineHeight = "12",
176
- wppaOvlShowCounter = true,
177
- wppaOvlIsVideo = false,
178
- wppaShowLegenda = "",
179
- wppaOvlFsPhotoId = 0,
180
- wppaPhotoId = 0,
181
- wppaOvlVideoStart = false,
182
- wppaOvlAudioStart = false,
183
- wppaLastIptc = "",
184
- wppaLastExif = "",
185
- wppaIsIpad = false,
186
- wppaSvgFillcolor = "gray",
187
- wppaSvgBgcolor = "transparent",
188
- wppaSvgCornerStyle = "light",
189
- wppaCoverSpacing = 8,
190
- wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
191
- wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
192
- wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
193
- wppaEasingDefault = "swing",';
194
-
195
- /* wppa-ajax-front.js */
196
- $result .= '
197
- wppaRenderAdd = false,
198
- wppaWaitForCounter = 0,';
199
-
200
- /* wppa-lightbox.js */
201
- $result .= '
202
- wppaIsVideo = false,
203
- wppaHasAudio = false,
204
- wppaOvlIsPdf = false,
205
- wppaOvlImgs = [],
206
- wppaKbHandlerInstalled = false,
207
- wppaOvlCurIdx = 0,
208
- wppaOvlSvgInverse = false,
209
- wppaOvlHasPanoramas = false,
210
- wppaGlobalOvlPanoramaId = 0,
211
- wppaOvlBrowseOnClick = false,
212
- wppaOvlGlobal = false,
213
- wppaWppaOverlayActivated = false,
214
- wppaOvlTimer = 0,
215
- wppaSavedContainerWidth = 0,
216
- wppaSavedContainerHeight = 0,';
217
-
218
- /* wppa-touch.js */
219
- $result .= '
220
- wppaTriggerElementID = null,
221
- wppaFingerCount = 0,
222
- wppaStartX = 0,
223
- wppaStartY = 0,
224
- wppaCurX = 0,
225
- wppaCurY = 0,
226
- wppaDeltaX = 0,
227
- wppaDeltaY = 0,
228
- wppaHorzDiff = 0,
229
- wppaVertDiff = 0,
230
- wppaMinLength = 72,
231
- wppaSwipeLength = 0,
232
- wppaSwipeAngle = null,
233
- wppaSwipeDirection = null,
234
- wppaSwipeOnLightbox = false,
235
- wppaSwipeMocc = 0,
236
- wppaMobileTimeStart = 0,';
237
-
238
- /* admin-scripts.js */
239
- $result .= '
240
- wppa_moveup_url = "#",
241
- wppa_import = "Import",
242
- wppa_update = "Update",
243
- wppaUploadToThisAlbum = "Upload to this album",
244
- wppaCloseText = "' . __( 'Close!', 'wp-photo-album-plus' ) . '",
245
- wppaCropper = [],';
246
-
247
- // Find ajax url
248
- $can_ajax = 'true';
249
- switch ( wppa_opt( 'ajax_method' ) ) {
250
- case 'normal':
251
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
252
- else $ajax_url = site_url() . '/wppaajax';
253
- break;
254
- case 'wppaajax':
255
- $ajax_url = site_url() . '/wppaajax';
256
- break;
257
- case 'admin':
258
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
259
- break;
260
- case 'extern':
261
- if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
262
- else $ajax_url = WPPA_URL . '/wppa-ajax-front.php';
263
- break;
264
- case 'none':
265
- $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
266
- $can_ajax = 'false'; // works on frontend only
267
- break;
268
- }
269
-
270
- /* Language and config specific inits */
271
- $result .= '
272
- wppaImageDirectory = "' . wppa_get_imgdir() . '",
273
- wppaWppaUrl = "' . wppa_get_wppa_url() . '",
274
- wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
275
- wppaAjaxUrl = "' . $ajax_url . '",
276
- wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
277
- wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
278
- wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
279
- wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
280
- wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
281
- wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
282
- wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
283
- wppaLang = "' . $wppa_lang . '",
284
- wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
285
- wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
286
- wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
287
- wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
288
- wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
289
- wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
290
- wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
291
- wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
292
- wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
293
- wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
294
- wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
295
- wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
296
- wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
297
- wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
298
- wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
299
- wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
300
- wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
301
- wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
302
- wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
303
- wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
304
- wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
305
- wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
306
- wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
307
- wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
308
- wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
309
- wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
310
- wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
311
- wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
312
- wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
313
- wppaVersion = "'.$wppa_api_version.'",
314
- wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
315
- wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
316
- wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
317
- wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
318
- wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
319
- wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
320
- wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
321
- wppaBoxDelta = '.wppa_get_box_delta() . ',
322
- wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
323
- wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
324
- wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
325
- wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
326
- wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
327
- wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
328
- wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
329
- wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
330
- wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
331
- wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
332
- wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
333
- wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
334
- wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
335
- wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
336
- wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
337
- wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
338
- wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
339
- wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
340
- wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
341
- wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
342
- wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
343
- wppaSlideBorderWidth = '.wppa_fbw().',
344
- wppaAllowAjax = '.$can_ajax.',
345
- wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
346
- wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
347
- wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
348
- wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
349
- wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
350
- wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
351
- wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
352
- wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
353
- wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
354
- wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
355
- wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
356
- wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
357
- wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
358
- wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
359
- wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
360
- wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
361
- wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
362
- wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
363
- wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
364
- wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
365
- wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
366
- wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
367
- wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
368
- wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
369
- wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
370
- wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
371
- wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
372
- wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
373
- wppaRel = "data-rel",
374
- wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
375
- wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
376
- wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
377
- wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
378
- wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
379
- wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
380
- wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
381
- wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
382
- wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
383
- wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
384
- wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
385
- wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
386
- wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
387
- wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
388
- wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
389
- wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
390
- wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
391
- wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
392
- wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
393
- wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
394
- wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
395
- wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
396
- wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
397
- wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
398
- wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
399
- wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
400
- wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
401
- wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
402
- wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
403
- wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
404
- wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
405
- wppa_opt( 'art_monkey_display' ) == 'text' &&
406
- ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
407
- wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
408
- wppaThumbAspect = ' . wppa_thumb_asp() . ',';
409
-
410
- /* Lightbox vars */
411
- $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
412
- $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
413
- $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
414
- $lb_global = '';
415
- if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
416
- if ( wppa_switch( 'lightbox_global_set' ) ) {
417
- $lb_global = 'wppa[single]';
418
- }
419
- else {
420
- $lb_global = 'wppa';
421
- }
422
- }
423
-
424
- $result .= '
425
- wppaOvlTxtHeight = "'.$ovlh.'",
426
- wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
427
- wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
428
- wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
429
- wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
430
- wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
431
- wppaVer4WindowWidth = 800,
432
- wppaVer4WindowHeight = 600,
433
- wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
434
- '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
435
- wppaOvlFontSize = "'.$fontsize_lightbox.'",
436
- '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
437
- '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
438
- '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
439
- wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
440
- wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
441
- wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
442
- wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
443
- wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
444
- wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
445
- wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
446
- wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
447
- wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
448
- wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
449
- wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
450
- wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
451
- wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
452
- wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
453
- wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
454
- wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
455
- wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
456
- wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
457
-
458
- // Tinymce photo
459
- if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
460
- $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
461
- WHERE ext <> 'xxx'
462
- AND panorama = 0
463
- ORDER BY timestamp DESC
464
- LIMIT 1" );
465
-
466
- // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
467
- wppa( 'in_widget', true );
468
-
469
- $result .= '
470
- wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
471
- wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
472
-
473
- // Reset faked widget
474
- wppa( 'in_widget', false );
475
- }
476
-
477
- // The photo views cache
478
- if ( isset( $wppa_session['photo'] ) ) {
479
- foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
480
- $result .= '
481
- wppaPhotoView[' . $p . '] = true;';
482
- }
483
- }
484
-
485
- // Format
486
- $result = wppa_compress_js( $result );
487
- $result = '
 
 
 
488
  <!-- wppa js inits -->
489
  <script>
490
  ' . $result . '
491
  </script>
492
  <!-- End wppa js inits -->
493
  ';
494
- echo $result;
495
  }
496
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
497
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
498
 
499
  function wppa_thumb_asp() {
500
 
501
- $aspect = 1;
502
- if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
503
- $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
504
- $aspect = $t[0] / $t[1];
505
- }
506
- elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
507
- $t = explode( 'x', wppa_opt( 'resize_to' ) );
508
- $aspect = $t[1] / $t[0];
509
- }
510
- else {
511
- $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
512
- }
513
- return $aspect;
514
  }
515
 
516
  function wppa_fbw() {
517
 
518
- if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
519
- $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
520
- }
521
- else {
522
- $fbw = '0';
523
- }
524
- return $fbw;
525
  }
526
 
527
  /* LOAD JAVASCRIPT */
@@ -533,89 +536,84 @@ global $wppa_api_version;
533
  global $wppa_lang;
534
  global $wppa_opt;
535
 
536
- $footer = wppa_is_defer();
537
-
538
- // WPPA+ Javascript files.
539
- // All wppa+ js files come in 2 flavours: the normal version and a minified version.
540
- // If the minified version is available, it will be loaded, else the normal version.
541
- // If you want to debug js, just delete the minified version; this will cause the normal
542
- // - readable - version to be loaded.
543
-
544
- // The js dependancies
545
- $js_depts = array( 'jquery',
546
- 'jquery-form',
547
- 'jquery-masonry',
548
- 'jquery-ui-dialog',
549
- );
550
-
551
- // First see if an 'all' file is present. This is to save http requests
552
- $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
553
- if ( wppa_is_file( $all_file ) ) {
554
- $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
555
- wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, false );
556
- }
557
-
558
- // No all file, do them one by one
559
- else {
560
- $js_files = array(
561
- 'wppa-utils',
562
- 'wppa',
563
- 'wppa-slideshow',
564
- 'wppa-ajax-front',
565
- 'wppa-lightbox',
566
- 'wppa-popup',
567
- 'wppa-touch',
568
- 'wppa-zoom',
569
- 'wppa-spheric',
570
- );
571
-
572
- foreach ( array_keys( $js_files ) as $idx ) {
573
- if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
574
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
575
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
576
- }
577
- else {
578
- $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
579
- wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
580
- }
581
- }
582
- }
583
-
584
- // Start other (vendor) js files
585
- $footer = false;
586
-
587
- // google maps
588
- if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
589
- $key = wppa_opt( 'map_apikey' );
590
- wp_enqueue_script( 'wppa-geo',
591
- 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
592
- '',
593
- $wppa_api_version,
594
- $footer );
595
- }
596
-
597
- // Nicescroller
598
- if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
599
- $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
600
- wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, array( 'jquery', 'nicescrollr-easing-min-js' ), 'all' );
601
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
602
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
603
- }
604
-
605
- // Easing we need, borrow it from nicescroller if not already loaded
606
- else {
607
- $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
608
- wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, array( 'jquery' ), 'all' );
609
- }
610
-
611
- // Panorama
612
- if ( wppa_switch( 'enable_panorama' ) ) {
613
- $three_url = WPPA_URL . '/vendor/three/three.min.js';
614
- $ver = '122';
615
- wp_enqueue_script( 'wppa-three-min-js', $three_url, array(), $ver );
616
- }
617
-
618
- // End other (vendor) js files
619
 
620
  }
621
 
@@ -625,42 +623,42 @@ function wppa_js( $txt ) {
625
  global $wppa_js_page_data;
626
  global $wppa_script_open;
627
 
628
- // Validate input
629
- if ( wppa_switch( 'allow_debug' ) ) {
630
- $i = 0;
631
- $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
632
- $t = array_keys( $arr );
633
- while ( $i < strlen( $txt ) ) {
634
- $c = substr( $txt, $i, 1 );
635
- if ( in_array( $c, $t ) ) $arr[$c]++;
636
- $i++;
637
- }
638
- for ( $i = 0; $i < 6; $i += 2 ) {
639
- if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
640
- wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
641
- }
642
- }
643
- if ( substr( $txt, -1 ) != ';' ) {
644
- wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
645
- $txt .= ';';
646
- }
647
- }
648
-
649
- // Do it
650
- if ( ! wppa_is_defer() || wppa_is_caching() ) {
651
- wppa_out( '
652
  <script>' . $txt . '</script>' );
653
- return;
654
- }
655
-
656
- if ( ! $wppa_script_open ) {
657
- $wppa_js_page_data = $txt;
658
- $wppa_script_open = true;
659
- }
660
- else {
661
- $wppa_js_page_data .= '
662
  ' . $txt;
663
- }
664
  }
665
 
666
  // Output page specific script in the footer.
@@ -671,39 +669,41 @@ function wppa_print_psjs() {
671
  global $wppa_js_page_data;
672
  global $wppa_script_open;
673
 
674
- if ( $wppa_js_page_data ) {
675
- echo '
676
  <!-- WPPA Page specific js -->
677
  <script>' . wppa_compress_js( $wppa_js_page_data ) . '
678
  </script>
679
  <!-- End WPPA Page specific js -->
680
  ';
681
 
682
- $wppa_js_page_data = '';
683
- $wppa_script_open = false;
684
- }
685
  }
686
 
687
  // Compress javascript
688
  function wppa_compress_js( $txt ) {
689
 
690
- $result = $txt;
691
- $result = str_replace( "\t", "", $result );
692
- $result = str_replace( "\r\n", "", $result );
693
- $result = str_replace( " = ", "=", $result );
694
- $result = str_replace( "; ", ";", $result );
695
- $result = str_replace( "/*", "\r\n/*", $result );
696
 
697
- return $result;
698
  }
699
 
700
  // Decide if we do defer js
701
  function wppa_is_defer() {
702
 
703
- if ( ! wppa_switch( 'defer_javascript' ) ) return false;
704
- if ( wppa( 'ajax' ) ) return false;
705
- if ( wppa( 'cron' ) ) return false;
706
- if ( is_admin() ) return false;
707
- if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
708
- return true;
 
 
709
  }
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.1.00.005
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
14
  global $wppa_session;
15
  global $wpdb;
16
 
17
+ /* wppa-utils.js */
18
+ $result = '
19
+ wppaDebugCounter = 0,';
20
+
21
+ /* wppa.js */
22
+ $result .= '
23
+ wppaIsChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime),
24
+ wppaOvlActivePanorama = 0,';
25
+
26
+ /* Global and slideshow vars */
27
+ $result .= '
28
+ wppaFullValign = [],
29
+ wppaFullHalign = [],
30
+ wppaFullFrameDelta = [],
31
+ wppaAutoColumnWidth = [],
32
+ wppaAutoColumnFrac = [],
33
+ wppaFadeInAfterFadeOut = false,
34
+ wppaPreambule = [],
35
+ wppaThumbnailPitch = [],
36
+ wppaFilmStripLength = [],
37
+ wppaFilmStripMargin = [],
38
+ wppaFilmStripAreaDelta = [],
39
+ wppaIsMini = [],
40
+ wppaPortraitOnly = [],
41
+ wppaLightBox = [],
42
+ wppaSlideInitRunning = [],
43
+ wppaSlidePause = [],
44
+ wppaSlideBlank = [],
45
+ wppaFilmPageSize = [],
46
+ wppaAspectRatio = [],
47
+ wppaFullSize = [],
48
+ wppaLightboxSingle = [],
49
+ wppaSiteUrl = "' . site_url() . '",
50
+ wppaMasonryCols = [],
51
+ wppaVideoPlaying = [],
52
+ wppaAudioPlaying = [],
53
+ wppaHis = 0,
54
+ wppaStartHtml = [],
55
+ wppaCanAjaxRender = false,
56
+ wppaCanPushState = false,
57
+ wppaMaxOccur = 0,
58
+ wppaFirstOccur = 0,
59
+ wppaUsePhotoNamesInUrls = false,
60
+ wppaShareHideWhenRunning = false,
61
+ wppaCommentRequiredAfterVote = true,
62
+ wppaTopMoc = 0,
63
+ wppaColWidth = [],
64
+ wppaMCRWidth = [],
65
+ wppaFotomotoHideWhenRunning = false,
66
+ wppaFotomotoMinWidth = 400,
67
+ wppaPhotoView = [],
68
+ wppaBackgroundColorImage = "",
69
+ wppaPopupLinkType = "",
70
+ wppaPopupOnclick = [],
71
+ wppaThumbTargetBlank = false,
72
+ wppaRel = "rel",
73
+ wppaEditPhotoWidth = "960",
74
+ wppaThemeStyles = "",
75
+ wppaStickyHeaderHeight = 0,
76
+ wppaModalBgColor = "#ffffff",
77
+ wppaBoxRadius = 0,
78
+ wppaUploadEdit = "none",
79
+ wppaPageArg = "",
80
+ wppaCoverImageResponsive = [],
81
+ wppaSearchBoxSelItems = [],
82
+ wppaSlideWrap = [],
83
+ wppaHideRightClick = false,
84
+ wppaGeoZoom = 10,
85
+ wppaAreaMaxFrac = 1.0,
86
+ wppaNiceScroll = false,
87
+ wppaIconSizeNormal = "default",
88
+ wppaIconSizeStars = 24,
89
+ wppaFilmInit = [],
90
+ wppaResizeEndDelay = 200,
91
+ wppaScrollEndDelay = 200,
92
+ wppaArtmonkeyFileNotSource = false,
93
+ wppaRequestInfoDialogText = "Please specify your question",
94
+ wppaGlobalFsIconSize = 32,
95
+ wppaFsFillcolor = "#999999",
96
+ wppaFsBgcolor = "transparent",
97
+ wppaSlideLinkEqual = ' . ( wppa_opt( 'slideshow_linktype' ) == 'same' ? 'true' : 'false' ) . ',
98
+ _wppaId = [],
99
+ _wppaRealId = [],
100
+ _wppaAvg = [],
101
+ _wppaDisc = [],
102
+ _wppaMyr = [],
103
+ _wppaVRU = [],
104
+ _wppaLinkUrl = [],
105
+ _wppaLinkTitle = [],
106
+ _wppaLinkTarget = [],
107
+ _wppaCommentHtml = [],
108
+ _wppaIptcHtml = [],
109
+ _wppaExifHtml = [],
110
+ _wppaToTheSame = false,
111
+ _wppaSlides = [],
112
+ _wppaNames = [],
113
+ _wppaFilmThumbTitles = [],
114
+ _wppaFullNames = [],
115
+ _wppaDsc = [],
116
+ _wppaOgDsc = [],
117
+ _wppaCurIdx = [],
118
+ _wppaNxtIdx = [],
119
+ _wppaTimeOut = [],
120
+ _wppaSSRuns = [],
121
+ _wppaFg = [],
122
+ _wppaTP = [],
123
+ _wppaIsBusy = [],
124
+ _wppaFirst = [],
125
+ _wppaVoteInProgress = false,
126
+ _wppaTextDelay = ' . wppa_opt( 'animation_speed' ) . ',
127
+ _wppaUrl = [],
128
+ _wppaSkipRated = [],
129
+ _wppaLbTitle = [],
130
+ _wppaStateCount = 0,
131
+ _wppaDidGoto = [],
132
+ _wppaShareUrl = [],
133
+ _wppaShareHtml = [],
134
+ _wppaFilmNoMove = [],
135
+ _wppaHiresUrl = [],
136
+ _wppaIsVideo = [],
137
+ _wppaVideoHtml = [],
138
+ _wppaAudioHtml = [],
139
+ _wppaVideoNatWidth = [],
140
+ _wppaVideoNatHeight = [],
141
+ _wppaWaitTexts = [],
142
+ _wppaImageAlt = [],
143
+ _wppaLastIdx = [],
144
+ _wppaStopping = [],
145
+ _wppaFilename = [],
146
+ _wppaLat = [],
147
+ _wppaLon = [],
148
+ __wppaOverruleRun = false,
149
+ wppaOvlIdx = 0,
150
+ wppaOvlFirst = true,
151
+ wppaOvlKbHandler = "",
152
+ wppaOvlSizeHandler = "",
153
+ wppaOvlPadTop = 5,
154
+ wppaOvlRunning = false,
155
+ wppaOvlVideoPlaying = false,
156
+ wppaOvlAudioPlaying = false,
157
+ wppaOvlShowLegenda = true,
158
+ wppaOvlShowStartStop = true,
159
+ wppaOvlRadius = 0,
160
+ wppaOvlBorderWidth = 16,
161
+ wppaOvlOpen = false,
162
+ wppaOvlClosing = false,
163
+ wppaThumbSize = 100,
164
+ wppaTfMargin = 4,
165
+ wppaZoomData = [],
166
+ wppaSphericData = [],
167
+ wppaOvlTxtHeight = 36,
168
+ wppaOvlOpacity = 0.8,
169
+ wppaOvlOnclickType = "none",
170
+ wppaOvlTheme = "black",
171
+ wppaOvlAnimSpeed = 300,
172
+ wppaOvlSlideSpeed = 3000,
173
+ wppaOvlFontFamily = "Helvetica",
174
+ wppaOvlFontSize = "10",
175
+ wppaOvlFontColor = "",
176
+ wppaOvlFontWeight = "bold",
177
+ wppaOvlLineHeight = "12",
178
+ wppaOvlShowCounter = true,
179
+ wppaOvlIsVideo = false,
180
+ wppaShowLegenda = "",
181
+ wppaOvlFsPhotoId = 0,
182
+ wppaPhotoId = 0,
183
+ wppaOvlVideoStart = false,
184
+ wppaOvlAudioStart = false,
185
+ wppaLastIptc = "",
186
+ wppaLastExif = "",
187
+ wppaIsIpad = false,
188
+ wppaSvgFillcolor = "gray",
189
+ wppaSvgBgcolor = "transparent",
190
+ wppaSvgCornerStyle = "light",
191
+ wppaCoverSpacing = 8,
192
+ wppaEasingSlide = "' . wppa_opt( 'easing_slide' ) . '",
193
+ wppaEasingLightbox = "' . wppa_opt( 'easing_lightbox' ) . '",
194
+ wppaEasingPopup = "' . wppa_opt( 'easing_popup' ) . '",
195
+ wppaEasingDefault = "swing",';
196
+
197
+ /* wppa-ajax-front.js */
198
+ $result .= '
199
+ wppaRenderAdd = false,
200
+ wppaWaitForCounter = 0,';
201
+
202
+ /* wppa-lightbox.js */
203
+ $result .= '
204
+ wppaIsVideo = false,
205
+ wppaHasAudio = false,
206
+ wppaOvlIsPdf = false,
207
+ wppaOvlImgs = [],
208
+ wppaKbHandlerInstalled = false,
209
+ wppaOvlCurIdx = 0,
210
+ wppaOvlSvgInverse = false,
211
+ wppaOvlHasPanoramas = false,
212
+ wppaGlobalOvlPanoramaId = 0,
213
+ wppaOvlBrowseOnClick = false,
214
+ wppaOvlGlobal = false,
215
+ wppaWppaOverlayActivated = false,
216
+ wppaOvlTimer = 0,
217
+ wppaSavedContainerWidth = 0,
218
+ wppaSavedContainerHeight = 0,';
219
+
220
+ /* wppa-touch.js */
221
+ $result .= '
222
+ wppaTriggerElementID = null,
223
+ wppaFingerCount = 0,
224
+ wppaStartX = 0,
225
+ wppaStartY = 0,
226
+ wppaCurX = 0,
227
+ wppaCurY = 0,
228
+ wppaDeltaX = 0,
229
+ wppaDeltaY = 0,
230
+ wppaHorzDiff = 0,
231
+ wppaVertDiff = 0,
232
+ wppaMinLength = 72,
233
+ wppaSwipeLength = 0,
234
+ wppaSwipeAngle = null,
235
+ wppaSwipeDirection = null,
236
+ wppaSwipeOnLightbox = false,
237
+ wppaSwipeMocc = 0,
238
+ wppaMobileTimeStart = 0,';
239
+
240
+ /* admin-scripts.js */
241
+ $result .= '
242
+ wppa_moveup_url = "#",
243
+ wppa_import = "' . esc_js( __( 'Import', 'wp-photo-album-plus' ) ) . '",
244
+ wppa_update = "' . esc_js( __( 'Update', 'wp-photo-album-plus' ) ) . '",
245
+ wppaUploadToThisAlbum = "' . esc_js( __( 'Upload to this album', 'wp-photo-album-plus' ) ) . '",
246
+ wppaCloseText = "' . esc_js( __( 'Close!', 'wp-photo-album-plus' ) ) . '",
247
+ wppaCropper = [],';
248
+
249
+ // Find ajax url
250
+ $can_ajax = 'true';
251
+ switch ( wppa_opt( 'ajax_method' ) ) {
252
+ case 'normal':
253
+ if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
254
+ else $ajax_url = site_url() . '/wppaajax';
255
+ break;
256
+ case 'wppaajax':
257
+ $ajax_url = site_url() . '/wppaajax';
258
+ break;
259
+ case 'admin':
260
+ $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
261
+ break;
262
+ case 'extern':
263
+ if ( is_admin() ) $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
264
+ else $ajax_url = WPPA_URL . '/wppa-ajax-front.php';
265
+ break;
266
+ case 'none':
267
+ $ajax_url = site_url() . '/wp-admin/admin-ajax.php';
268
+ $can_ajax = 'false'; // works on frontend only
269
+ break;
270
+ }
271
+
272
+ /* Language and config specific inits */
273
+ $result .= '
274
+ wppaImageDirectory = "' . wppa_get_imgdir() . '",
275
+ wppaWppaUrl = "' . wppa_get_wppa_url() . '",
276
+ wppaIncludeUrl = "' . trim( includes_url(), '/' ) . '",
277
+ wppaAjaxUrl = "' . $ajax_url . '",
278
+ wppaUploadUrl = "' . WPPA_UPLOAD_URL . '",
279
+ wppaIsIe = ' . ( wppa_is_ie() ? 'true' : 'false' ) . ',
280
+ wppaIsSafari = ' . ( wppa_is_safari() ? 'true' : 'false' ) . ',
281
+ wppaSlideshowNavigationType = "' . wppa_get_navigation_type() . '",
282
+ wppaAudioHeight = ' . wppa_get_audio_control_height() . ',
283
+ wppaFilmThumbTitle = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Double click to start/stop slideshow running', 'wp-photo-album-plus' ) ) . '",
284
+ wppaClickToView = "' . ( wppa_opt( 'film_linktype' ) == 'lightbox' ? wppa_zoom_in( false ) : __( 'Click to view', 'wp-photo-album-plus' ) ) . '",
285
+ wppaLang = "' . $wppa_lang . '",
286
+ wppaVoteForMe = "' . __( wppa_opt( 'vote_button_text' ), 'wp-photo-album-plus' ) . '",
287
+ wppaVotedForMe = "' . __( wppa_opt( 'voted_button_text' ), 'wp-photo-album-plus' ) . '",
288
+ wppaDownLoad = "' . __( 'Download', 'wp-photo-album-plus' ) . '",
289
+ wppaSlideShow = "' . __( 'Slideshow', 'wp-photo-album-plus' ) . '",
290
+ wppaPhoto = "' . __( 'Photo', 'wp-photo-album-plus' ) . '",
291
+ wppaOf = "' . __( 'of', 'wp-photo-album-plus' ) . '",
292
+ wppaNextPhoto = "' . __( 'Next photo', 'wp-photo-album-plus' ) . '",
293
+ wppaPreviousPhoto = "' . __( 'Previous photo', 'wp-photo-album-plus' ) . '",
294
+ wppaNextP = "' . __( 'Next', 'wp-photo-album-plus' ) . '",
295
+ wppaPrevP = "' . __( 'Prev.', 'wp-photo-album-plus' ) . '",
296
+ wppaAvgRating = "' . __( 'Average&nbsp;rating', 'wp-photo-album-plus' ) . '",
297
+ wppaMyRating = "' . __( 'My&nbsp;rating', 'wp-photo-album-plus' ) . '",
298
+ wppaAvgRat = "' . __( 'Avg.', 'wp-photo-album-plus' ) . '",
299
+ wppaMyRat = "' . __( 'Mine', 'wp-photo-album-plus' ) . '",
300
+ wppaDislikeMsg = "' . __( 'You marked this image as inappropriate.', 'wp-photo-album-plus' ) . '",
301
+ wppaStart = "' . __( 'Start', 'wp-photo-album-plus' ) . '",
302
+ wppaStop = "' . __( 'Stop', 'wp-photo-album-plus' ) . '",
303
+ wppaPleaseName = "' . __( 'Please enter your name', 'wp-photo-album-plus' ) . '",
304
+ wppaPleaseEmail = "' . __( 'Please enter a valid email address', 'wp-photo-album-plus' ) . '",
305
+ wppaPleaseComment = "' . __( 'Please enter a comment', 'wp-photo-album-plus' ) . '",
306
+ wppaProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '",
307
+ wppaDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '",
308
+ wppaUploadFailed = "' . __( 'Upload failed', 'wp-photo-album-plus' ) . '",
309
+ wppaServerError = "' . __( 'Server error.', 'wp-photo-album-plus' ) . '",
310
+ wppaGlobalFsIconSize = "'.wppa_opt( 'nav_icon_size_global_fs' ) . '",
311
+ wppaFsFillcolor = "'.wppa_opt( 'fs_svg_color' ) . '",
312
+ wppaFsBgcolor = "'.wppa_opt( 'fs_svg_bg_color' ) . '",
313
+ wppaFsPolicy = "' . ( is_admin() ? 'none' : wppa_opt( 'fs_policy' ) ) . '",
314
+ wppaNiceScroll = ' . ( wppa_switch( 'nicescroll' ) && ! wppa_is_mobile() ? 'true' : 'false' ) . ',
315
+ wppaNieScrollOpts = {' . wppa_opt( 'nicescroll_opts' ) . '},
316
+ wppaVersion = "'.$wppa_api_version.'",
317
+ wppaDebug = '.( wppa_switch( 'allow_debug' ) ? 'true' : 'false' ) . ',
318
+ wppaBackgroundColorImage = "'.wppa_opt( 'bgcolor_img' ) . '",
319
+ wppaPopupLinkType = "'.wppa_opt( 'thumb_linktype' ) . '",
320
+ wppaAnimationType = "'.wppa_opt( 'animation_type' ) . '",
321
+ wppaAnimationSpeed = '.wppa_opt( 'animation_speed' ) . ',
322
+ wppaThumbnailAreaDelta = '.wppa_get_thumbnail_area_delta() . ',
323
+ wppaTextFrameDelta = '.wppa_get_textframe_delta() . ',
324
+ wppaBoxDelta = '.wppa_get_box_delta() . ',
325
+ wppaSlideShowTimeOut = '.wppa_opt( 'slideshow_timeout' ) . ',
326
+ wppaFilmShowGlue = '.( wppa_switch( 'film_show_glue' ) ? 'true' : 'false' ) . ',
327
+ wppaMiniTreshold = '.( wppa_opt( 'mini_treshold' ) ? wppa_opt( 'mini_treshold' ) : '0' ) . ',
328
+ wppaRatingOnce = '.( wppa_switch( 'rating_change' ) || wppa_switch( 'rating_multi' ) ? 'false' : 'true' ) . ',
329
+ wppaHideWhenEmpty = '.( wppa_switch( 'hide_when_empty' ) ? 'true' : 'false' ) . ',
330
+ wppaBGcolorNumbar = "'.wppa_opt( 'bgcolor_numbar' ) . '",
331
+ wppaBcolorNumbar = "'.wppa_opt( 'bcolor_numbar' ) . '",
332
+ wppaBGcolorNumbarActive = "'.wppa_opt( 'bgcolor_numbar_active' ) . '",
333
+ wppaBcolorNumbarActive = "'.wppa_opt( 'bcolor_numbar_active' ) . '",
334
+ wppaFontFamilyNumbar = "'.wppa_opt( 'fontfamily_numbar' ) . '",
335
+ wppaFontSizeNumbar = "'.wppa_opt( 'fontsize_numbar' ) . 'px",
336
+ wppaFontColorNumbar = "'.wppa_opt( 'fontcolor_numbar' ) . '",
337
+ wppaFontWeightNumbar = "'.wppa_opt( 'fontweight_numbar' ) . '",
338
+ wppaFontFamilyNumbarActive = "'.wppa_opt( 'fontfamily_numbar_active' ) . '",
339
+ wppaFontSizeNumbarActive = "'.wppa_opt( 'fontsize_numbar_active' ) . 'px",
340
+ wppaFontColorNumbarActive = "'.wppa_opt( 'fontcolor_numbar_active' ) . '",
341
+ wppaFontWeightNumbarActive = "'.wppa_opt( 'fontweight_numbar_active' ) . '",
342
+ wppaNumbarMax = "'.wppa_opt( 'numbar_max' ) . '",
343
+ wppaNextOnCallback = '.( wppa_switch( 'next_on_callback' ) ? 'true' : 'false' ) . ',
344
+ wppaStarOpacity = '.str_replace(',', '.',( wppa_opt( 'star_opacity' )/'100' )) . ',
345
+ wppaEmailRequired = "'.wppa_opt( 'comment_email_required' ) . '",
346
+ wppaSlideBorderWidth = '.wppa_fbw().',
347
+ wppaAllowAjax = '.$can_ajax.',
348
+ wppaUsePhotoNamesInUrls = '.( wppa_switch( 'use_photo_names_in_urls' ) ? 'true' : 'false' ) . ',
349
+ wppaThumbTargetBlank = '.( wppa_switch( 'thumb_blank' ) ? 'true' : 'false' ) . ',
350
+ wppaRatingMax = '.wppa_opt( 'rating_max' ) . ',
351
+ wppaRatingDisplayType = "'.wppa_opt( 'rating_display_type' ) . '",
352
+ wppaRatingPrec = '.wppa_opt( 'rating_prec' ) . ',
353
+ wppaStretch = '.( wppa_switch( 'enlarge' ) ? 'true' : 'false' ) . ',
354
+ wppaMinThumbSpace = '.wppa_opt( 'tn_margin' ) . ',
355
+ wppaThumbSpaceAuto = '.( wppa_switch( 'thumb_auto' ) ? 'true' : 'false' ) . ',
356
+ wppaMagnifierCursor = "'.wppa_opt( 'magnifier' ) . '",
357
+ wppaArtMonkyLink = "'.wppa_opt( 'art_monkey_link' ) . '",
358
+ wppaAutoOpenComments = '.( wppa_switch( 'auto_open_comments' ) ? 'true' : 'false' ) . ',
359
+ wppaUpdateAddressLine = '.( wppa_switch( 'update_addressline' ) ? 'true' : 'false' ) . ',
360
+ wppaSlideSwipe = '.( wppa_switch( 'slide_swipe' ) ? 'true' : 'false' ) . ',
361
+ wppaMaxCoverWidth = '.wppa_opt( 'max_cover_width' ) . ',
362
+ wppaSlideToFullpopup = '.( wppa_opt( 'slideshow_linktype' ) == 'fullpopup' ? 'true' : 'false' ) . ',
363
+ wppaComAltSize = '.wppa_opt( 'comten_alt_thumbsize' ) . ',
364
+ wppaBumpViewCount = '.( wppa_switch( 'track_viewcounts' ) ? 'true' : 'false' ) . ',
365
+ wppaBumpClickCount = '.( wppa_switch( 'track_clickcounts' ) ? 'true' : 'false' ) . ',
366
+ wppaShareHideWhenRunning = '.( wppa_switch( 'share_hide_when_running' ) ? 'true' : 'false' ) . ',
367
+ wppaFotomoto = '.( wppa_switch( 'fotomoto_on' ) ? 'true' : 'false' ) . ',
368
+ wppaArtMonkeyButton = '.( wppa_opt( 'art_monkey_display' ) == 'button' ? 'true' : 'false' ) . ',
369
+ wppaFotomotoHideWhenRunning = '.( wppa_switch( 'fotomoto_hide_when_running' ) ? 'true' : 'false' ) . ',
370
+ wppaCommentRequiredAfterVote = '.( wppa_switch( 'vote_needs_comment' ) ? 'true' : 'false' ) . ',
371
+ wppaFotomotoMinWidth = '.wppa_opt( 'fotomoto_min_width' ) . ',
372
+ wppaShortQargs = '.( wppa_switch( 'use_short_qargs' ) ? 'true' : 'false' ) . ',
373
+ wppaOvlHires = '.( wppa_switch( 'lb_hres' ) ? 'true' : 'false' ) . ',
374
+ wppaSlideVideoStart = '.( wppa_switch( 'start_slide_video' ) ? 'true' : 'false' ) . ',
375
+ wppaSlideAudioStart = '.( wppa_switch( 'start_slide_audio' ) ? 'true' : 'false' ) . ',
376
+ wppaRel = "data-rel",
377
+ wppaOvlRadius = '.wppa_opt( 'ovl_border_radius' ) . ',
378
+ wppaOvlBorderWidth = '.wppa_opt( 'ovl_border_width' ) . ',
379
+ wppaEditPhotoWidth = "'.(wppa_opt( 'upload_edit' ) == 'new' ? 500 : 960) . '",
380
+ wppaThemeStyles = "'.(wppa_switch( 'upload_edit_theme_css' ) ? get_stylesheet_uri() : '' ) . '",
381
+ wppaStickyHeaderHeight = '.wppa_opt( 'sticky_header_size' ) . ',
382
+ wppaRenderModal = ' . ( wppa_switch( 'ajax_render_modal' ) ? 'true' : 'false' ) . ',
383
+ wppaModalQuitImg = "url(' . wppa_get_imgdir( 'smallcross-' . wppa_opt( 'ovl_theme' ) . '.gif' ) . ' )",
384
+ wppaBoxRadius = "' . wppa_opt( 'bradius' ) . '",
385
+ wppaModalBgColor = "' . wppa_opt( 'bgcolor_modal' ) . '",
386
+ wppaUploadEdit = "' . wppa_opt( 'upload_edit' ) . '",
387
+ wppaSvgFillcolor = "' . wppa_opt( 'svg_color' ) . '",
388
+ wppaSvgBgcolor = "' . wppa_opt( 'svg_bg_color' ) . '",
389
+ wppaOvlSvgFillcolor = "' . wppa_opt( 'ovl_svg_color' ) . '",
390
+ wppaOvlSvgBgcolor = "' . wppa_opt( 'ovl_svg_bg_color' ) . '",
391
+ wppaSvgCornerStyle = "' . wppa_opt( 'icon_corner_style' ) . '",
392
+ wppaHideRightClick = ' . ( wppa_switch( 'no_rightclick' ) ? 'true' : 'false' ) . ',
393
+ wppaGeoZoom = ' . wppa_opt( 'geo_zoom' ) . ',
394
+ wppaLazyLoad = ' . ( wppa_lazy() ? 'true' : 'false' ) . ',
395
+ wppaAreaMaxFrac = ' . ( wppa_opt( 'area_size' ) < 1 ? wppa_opt( 'area_size' ) : 1.0 ) . ',
396
+ wppaIconSizeNormal = "' . wppa_opt( 'nav_icon_size' ) . '",
397
+ wppaIconSizeSlide = "' . wppa_opt( 'nav_icon_size_slide' ) . '",
398
+ wppaResponseSpeed = ' . wppa_opt( 'response_speed' ) . ',
399
+ wppaExtendedResizeCount = ' . wppa_opt( 'extended_resize_count' ) . ',
400
+ wppaExtendedResizeDelay = ' . wppa_opt( 'extended_resize_delay' ) . ',
401
+ wppaCoverSpacing = ' . wppa_opt( 'cover_spacing' ) . ',
402
+ wppaFilmonlyContinuous = ' . ( wppa_switch( 'filmonly_continuous' ) ? 'true' : 'false' ) . ',
403
+ wppaNoAnimateOnMobile = ' . ( wppa_switch( 'no_animate_on_mobile' ) ? 'true' : 'false' ) . ',
404
+ wppaAjaxScroll = ' . ( wppa_switch( 'ajax_scroll' ) && ! is_admin() ? 'true' : 'false' ) . ',
405
+ wppaThumbSize = ' . wppa_opt( 'thumbsize' ) . ',
406
+ wppaTfMargin = ' . wppa_opt( 'tn_margin' ) . ',
407
+ wppaArtmonkeyFileNotSource = ' . ( wppa_opt( 'art_monkey_link' ) == 'file' &&
408
+ wppa_opt( 'art_monkey_display' ) == 'text' &&
409
+ ! wppa_switch( 'artmonkey_use_source' ) ? 'true' : 'false' ) . ',
410
+ wppaRequestInfoDialogText = "' . wppa_opt( 'request_info_text' ) . '",
411
+ wppaThumbAspect = ' . wppa_thumb_asp() . ',';
412
+
413
+ /* Lightbox vars */
414
+ $fontsize_lightbox = wppa_opt( 'fontsize_lightbox' ) ? wppa_opt( 'fontsize_lightbox' ) : '10';
415
+ $d = wppa_switch( 'ovl_show_counter') ? 1 : 0;
416
+ $ovlh = wppa_opt( 'ovl_txt_lines' ) == 'auto' ? 'auto' : ((wppa_opt( 'ovl_txt_lines' ) + $d) * ($fontsize_lightbox + 2));
417
+ $lb_global = '';
418
+ if ( wppa_switch( 'lightbox_global' ) && ! is_admin() ) {
419
+ if ( wppa_switch( 'lightbox_global_set' ) ) {
420
+ $lb_global = 'wppa[single]';
421
+ }
422
+ else {
423
+ $lb_global = 'wppa';
424
+ }
425
+ }
426
+
427
+ $result .= '
428
+ wppaOvlTxtHeight = "'.$ovlh.'",
429
+ wppaOvlOpacity = '.(wppa_opt( 'ovl_opacity' )/100).',
430
+ wppaOvlOnclickType = "'.wppa_opt( 'ovl_onclick' ).'",
431
+ wppaOvlTheme = "'.wppa_opt( 'ovl_theme' ).'",
432
+ wppaOvlAnimSpeed = '.wppa_opt( 'ovl_anim' ).',
433
+ wppaOvlSlideSpeed = '.wppa_opt( 'ovl_slide' ).',
434
+ wppaVer4WindowWidth = 800,
435
+ wppaVer4WindowHeight = 600,
436
+ wppaOvlShowCounter = '.( wppa_switch( 'ovl_show_counter') ? 'true' : 'false' ).',
437
+ '.( wppa_opt( 'fontfamily_lightbox' ) ? 'wppaOvlFontFamily = "'.wppa_opt( 'fontfamily_lightbox' ).'",' : '').'
438
+ wppaOvlFontSize = "'.$fontsize_lightbox.'",
439
+ '.( wppa_opt( 'fontcolor_lightbox' ) ? 'wppaOvlFontColor = "'.wppa_opt( 'fontcolor_lightbox' ).'",' : '').'
440
+ '.( wppa_opt( 'fontweight_lightbox' ) ? 'wppaOvlFontWeight = "'.wppa_opt( 'fontweight_lightbox' ).'",' : '').'
441
+ '.( wppa_opt( 'fontsize_lightbox' ) ? 'wppaOvlLineHeight = "'.(wppa_opt( 'fontsize_lightbox' ) + '2').'",' : '').'
442
+ wppaOvlVideoStart = '.( wppa_switch( 'ovl_video_start' ) ? 'true' : 'false' ).',
443
+ wppaOvlAudioStart = '.( wppa_switch( 'ovl_audio_start' ) ? 'true' : 'false' ).',
444
+ wppaOvlShowStartStop = '.( wppa_switch( 'ovl_show_startstop' ) ? 'true' : 'false' ).',
445
+ wppaIsMobile = '.( wppa_is_mobile() ? 'true' : 'false' ).',
446
+ wppaIsIpad = '.( wppa_is_ipad() ? 'true' : 'false' ).',
447
+ wppaOvlIconSize = "'.wppa_opt( 'nav_icon_size_lightbox' ).'px",
448
+ wppaOvlBrowseOnClick = '.( wppa_switch( 'ovl_browse_on_click' ) ? 'true' : 'false' ).',
449
+ wppaOvlGlobal = ' . ( $lb_global ? '"' . $lb_global . '"' : 'false' ) . ',
450
+ wppaPhotoDirectory = "'.WPPA_UPLOAD_URL.'/",
451
+ wppaThumbDirectory = "'.WPPA_UPLOAD_URL.'/thumbs/",
452
+ wppaTempDirectory = "'.WPPA_UPLOAD_URL.'/temp/",
453
+ wppaFontDirectory = "'.WPPA_UPLOAD_URL.'/fonts/",
454
+ wppaNoPreview = "'.__('No Preview available', 'wp-photo-album-plus').'",
455
+ wppaUIERR = "'.__('Unimplemented virtual album', 'wp-photo-album-plus').'",
456
+ wppaTxtProcessing = "'.__('Processing...', 'wp-photo-album-plus').'",
457
+ wppaTxtDone = "'.__('Done!', 'wp-photo-album-plus').'",
458
+ wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'",
459
+ wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";';
460
+
461
+ // Tinymce photo
462
+ if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
463
+ $id = $wpdb->get_var( "SELECT id FROM $wpdb->wppa_photos
464
+ WHERE ext <> 'xxx'
465
+ AND panorama = 0
466
+ ORDER BY timestamp DESC
467
+ LIMIT 1" );
468
+
469
+ // Fake we are in a widget, to prevent wppa_get_picture_html() from bumping viewcount
470
+ wppa( 'in_widget', true );
471
+
472
+ $result .= '
473
+ wppaShortcodeTemplate = "' . esc_js( wppa_get_picture_html( array( 'id' => $id, 'type' => 'sphoto' ) ) ) . '";
474
+ wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";';
475
+
476
+ // Reset faked widget
477
+ wppa( 'in_widget', false );
478
+ }
479
+
480
+ // The photo views cache
481
+ if ( isset( $wppa_session['photo'] ) ) {
482
+ foreach ( array_keys( $wppa_session['photo'] ) as $p ) {
483
+ $result .= '
484
+ wppaPhotoView[' . $p . '] = true;';
485
+ }
486
+ }
487
+
488
+ // Format
489
+ $result = wppa_compress_js( $result );
490
+ $result = '
491
  <!-- wppa js inits -->
492
  <script>
493
  ' . $result . '
494
  </script>
495
  <!-- End wppa js inits -->
496
  ';
497
+ echo $result;
498
  }
499
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
500
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
501
 
502
  function wppa_thumb_asp() {
503
 
504
+ $aspect = 1;
505
+ if ( wppa_opt( 'thumb_aspect' ) != '0:0:none' ) {
506
+ $t = explode( ':', wppa_opt( 'thumb_aspect' ) );
507
+ $aspect = $t[0] / $t[1];
508
+ }
509
+ elseif ( wppa_opt( 'resize_to' ) != '-1' && wppa_opt( 'resize_to' ) != '0' ) {
510
+ $t = explode( 'x', wppa_opt( 'resize_to' ) );
511
+ $aspect = $t[1] / $t[0];
512
+ }
513
+ else {
514
+ $aspect = wppa_opt( 'maxheight' ) / wppa_opt( 'fullsize' );
515
+ }
516
+ return $aspect;
517
  }
518
 
519
  function wppa_fbw() {
520
 
521
+ if ( is_numeric( wppa_opt( 'fullimage_border_width' ) ) ) {
522
+ $fbw = wppa_opt( 'fullimage_border_width' ) + '1';
523
+ }
524
+ else {
525
+ $fbw = '0';
526
+ }
527
+ return $fbw;
528
  }
529
 
530
  /* LOAD JAVASCRIPT */
536
  global $wppa_lang;
537
  global $wppa_opt;
538
 
539
+ $footer = wppa_is_defer();
540
+
541
+ // WPPA+ Javascript files.
542
+ // All wppa+ js files come in 2 flavours: the normal version and a minified version.
543
+ // If the minified version is available, it will be loaded, else the normal version.
544
+ // If you want to debug js, just delete the minified version; this will cause the normal
545
+ // - readable - version to be loaded.
546
+
547
+ // The js dependancies
548
+ $js_depts = array( 'jquery',
549
+ 'jquery-form',
550
+ 'jquery-masonry',
551
+ 'jquery-ui-dialog',
552
+ );
553
+
554
+ // First see if an 'all' file is present. This is to save http requests
555
+ $all_file = dirname( __FILE__ ) . '/js/wppa-all.js';
556
+ if ( wppa_is_file( $all_file ) ) {
557
+ $js_ver = date( "ymd-Gis", filemtime( $all_file ) );
558
+ wp_enqueue_script( 'wppa', WPPA_URL . '/js/wppa-all.js', $js_depts, $js_ver, $footer );
559
+ }
560
+
561
+ // No all file, do them one by one
562
+ else {
563
+ $js_files = array(
564
+ 'wppa-utils',
565
+ 'wppa',
566
+ 'wppa-slideshow',
567
+ 'wppa-ajax-front',
568
+ 'wppa-lightbox',
569
+ 'wppa-popup',
570
+ 'wppa-touch',
571
+ 'wppa-zoom',
572
+ 'wppa-spheric',
573
+ );
574
+
575
+ foreach ( array_keys( $js_files ) as $idx ) {
576
+ if ( is_file( dirname( __FILE__ ) . '/js/' . $js_files[$idx] . '.min.js' ) ) {
577
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.min.js' ) );
578
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.min.js', $js_depts, $js_ver, $footer );
579
+ }
580
+ else {
581
+ $js_ver = date( "ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'js/' . $js_files[$idx] . '.js' ) );
582
+ wp_enqueue_script( $js_files[$idx], WPPA_URL . '/js/' . $js_files[$idx] . '.js', $js_depts, $js_ver, $footer );
583
+ }
584
+ }
585
+ }
586
+
587
+ // google maps
588
+ if ( wppa_switch( 'save_gpx' ) && strpos( wppa_opt( 'custom_content' ), 'w#location' ) !== false ) {
589
+ $key = wppa_opt( 'map_apikey' );
590
+ wp_enqueue_script( 'wppa-geo',
591
+ 'https://maps.googleapis.com/maps/api/js?' . ( $key ? 'key=' . $key : 'v=3.exp' ),
592
+ '',
593
+ $wppa_api_version,
594
+ $footer );
595
+ }
596
+
597
+ // Nicescroller
598
+ if ( ! wppa_is_mobile() && ( wppa_switch( 'nicescroll' ) || wppa_switch( 'nicescroll_window' ) || wppa_switch( 'load_nicescroller' ) ) ) {
599
+ $nice_url = WPPA_URL . '/vendor/nicescroll/jquery.nicescroll.min.js';
600
+ wp_enqueue_script( 'nicescrollr-inc-nicescroll-min-js', $nice_url, $js_depts, $wppa_api_version, $footer );
601
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
602
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
603
+ }
604
+
605
+ // Easing we need, borrow it from nicescroller if not already loaded
606
+ else {
607
+ $easing_url = WPPA_URL . '/vendor/jquery-easing/jquery.easing.min.js';
608
+ wp_enqueue_script( 'nicescrollr-easing-min-js', $easing_url, $js_depts, $wppa_api_version, $footer );
609
+ }
610
+
611
+ // Panorama
612
+ if ( wppa_switch( 'enable_panorama' ) ) {
613
+ $three_url = WPPA_URL . '/vendor/three/three.min.js';
614
+ $ver = '122';
615
+ wp_enqueue_script( 'wppa-three-min-js', $three_url, $js_depts, $wppa_api_version, $footer );
616
+ }
 
 
 
 
 
617
 
618
  }
619
 
623
  global $wppa_js_page_data;
624
  global $wppa_script_open;
625
 
626
+ // Validate input
627
+ if ( wppa_switch( 'allow_debug' ) ) {
628
+ $i = 0;
629
+ $arr = array( '[' => 0, ']' => 0, '(' => 0, ')' => 0, '{' => 0, '}' => 0 );
630
+ $t = array_keys( $arr );
631
+ while ( $i < strlen( $txt ) ) {
632
+ $c = substr( $txt, $i, 1 );
633
+ if ( in_array( $c, $t ) ) $arr[$c]++;
634
+ $i++;
635
+ }
636
+ for ( $i = 0; $i < 6; $i += 2 ) {
637
+ if ( $arr[$t[$i]] != $arr[$t[$i + 1]] ) {
638
+ wppa_log( 'err', 'Unmatched ' . $t[$i] . ' - ' . $t[$i + 1] . ' in ' . $txt . ' (wppa_js)', true );
639
+ }
640
+ }
641
+ if ( substr( $txt, -1 ) != ';' ) {
642
+ wppa_log( 'err', 'Missing ; in ' . $txt . ' (wppa_js)', true );
643
+ $txt .= ';';
644
+ }
645
+ }
646
+
647
+ // Do it
648
+ if ( ! wppa_is_defer() || wppa_is_caching() ) {
649
+ wppa_out( '
650
  <script>' . $txt . '</script>' );
651
+ return;
652
+ }
653
+
654
+ if ( ! $wppa_script_open ) {
655
+ $wppa_js_page_data = $txt;
656
+ $wppa_script_open = true;
657
+ }
658
+ else {
659
+ $wppa_js_page_data .= '
660
  ' . $txt;
661
+ }
662
  }
663
 
664
  // Output page specific script in the footer.
669
  global $wppa_js_page_data;
670
  global $wppa_script_open;
671
 
672
+ if ( $wppa_js_page_data ) {
673
+ echo '
674
  <!-- WPPA Page specific js -->
675
  <script>' . wppa_compress_js( $wppa_js_page_data ) . '
676
  </script>
677
  <!-- End WPPA Page specific js -->
678
  ';
679
 
680
+ $wppa_js_page_data = '';
681
+ $wppa_script_open = false;
682
+ }
683
  }
684
 
685
  // Compress javascript
686
  function wppa_compress_js( $txt ) {
687
 
688
+ $result = $txt;
689
+ $result = str_replace( "\t", "", $result );
690
+ $result = str_replace( "\r\n", "", $result );
691
+ $result = str_replace( " = ", "=", $result );
692
+ $result = str_replace( "; ", ";", $result );
693
+ $result = str_replace( "/*", "\r\n/*", $result );
694
 
695
+ return $result;
696
  }
697
 
698
  // Decide if we do defer js
699
  function wppa_is_defer() {
700
 
701
+ return true;
702
+
703
+ if ( is_admin() ) return true;
704
+ if ( ! wppa_switch( 'defer_javascript' ) ) return false;
705
+ if ( wppa( 'ajax' ) ) return false;
706
+ if ( wppa( 'cron' ) ) return false;
707
+ if ( wppa( 'is_slide' ) || wppa( 'is_slideonly' ) || wppa( 'is_filmonly' ) ) return false;
708
+ return true;
709
  }
wppa-session.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
- * Version 8.0.07.005
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
@@ -24,7 +24,7 @@ global $wppa_api_version;
24
  }
25
 
26
  // Start a session or retrieve the sessions data. To be called at init.
27
- function wppa_session_start() {
28
  global $wpdb;
29
  global $wppa_session;
30
 
@@ -120,7 +120,7 @@ global $wppa_session;
120
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
121
  $t = explode( ',', $wppa_session['use_searchstring'] );
122
  foreach( array_keys( $t ) as $idx ) {
123
- $t[$idx] .= ' '.wppa_test_for_search( 'at_session_start' );
124
  $t[$idx] = trim( $t[$idx] );
125
  $v = explode( ' ', $t[$idx] );
126
  $t[$idx] = implode( ' ', array_unique( $v ) );
@@ -128,11 +128,11 @@ global $wppa_session;
128
  $wppa_session['use_searchstring'] = ' '.implode( ',', array_unique( $t ) );
129
  }
130
  else {
131
- $wppa_session['use_searchstring'] = wppa_test_for_search( 'at_session_start' );
132
  }
133
  }
134
  else {
135
- $wppa_session['use_searchstring'] = wppa_test_for_search( 'at_session_start' );
136
  }
137
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
138
  $wppa_session['use_searchstring'] = trim( $wppa_session['use_searchstring'], ' ,' );
@@ -233,7 +233,7 @@ static $last_query;
233
  wppa_log('Dbg', 'Could not save session '.$wppa_session['id']);
234
  // $wppa_session = false;
235
  // $last_query = false;
236
- // wppa_session_start();
237
 
238
  return false;
239
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all session routines
6
+ * Version 8.1.00.008
7
  *
8
  * Firefox modifies data in the superglobal $_SESSION.
9
  * See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
24
  }
25
 
26
  // Start a session or retrieve the sessions data. To be called at init.
27
+ function wppa_begin_session() {
28
  global $wpdb;
29
  global $wppa_session;
30
 
120
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
121
  $t = explode( ',', $wppa_session['use_searchstring'] );
122
  foreach( array_keys( $t ) as $idx ) {
123
+ $t[$idx] .= ' '.wppa_test_for_search( 'at_begin_session' );
124
  $t[$idx] = trim( $t[$idx] );
125
  $v = explode( ' ', $t[$idx] );
126
  $t[$idx] = implode( ' ', array_unique( $v ) );
128
  $wppa_session['use_searchstring'] = ' '.implode( ',', array_unique( $t ) );
129
  }
130
  else {
131
+ $wppa_session['use_searchstring'] = wppa_test_for_search( 'at_begin_session' );
132
  }
133
  }
134
  else {
135
+ $wppa_session['use_searchstring'] = wppa_test_for_search( 'at_begin_session' );
136
  }
137
  if ( isset ( $wppa_session['use_searchstring'] ) ) {
138
  $wppa_session['use_searchstring'] = trim( $wppa_session['use_searchstring'], ' ,' );
233
  wppa_log('Dbg', 'Could not save session '.$wppa_session['id']);
234
  // $wppa_session = false;
235
  // $last_query = false;
236
+ // wppa_begin_session();
237
 
238
  return false;
239
  }
wppa-setting-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.0.08.008
7
  *
8
  */
9
 
@@ -143,27 +143,15 @@ function wppa_edit( $xslug, $value, $width = '90%', $minwidth = '', $text = '',
143
  function wppa_textarea($xslug, $buttonlabel = '' ) {
144
 
145
  $slug = substr( $xslug, 5 );
146
- if ( wppa_switch( 'use_wp_editor') ) { // New style textarea, use wp_editor
147
- $editor_id = str_replace( '_', '', $slug);
148
- ob_start();
149
- $quicktags_settings = array( 'buttons' => 'strong,em,link,block,ins,ul,ol,li,code,close' );
150
- wp_editor( wppa_opt( $slug ), $editor_id, $settings = array('wpautop' => false, 'media_buttons' => false, 'textarea_rows' => '6', 'textarea_name' => $slug, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
151
- $html = ob_get_clean();
152
- $blbl = __('Update', 'wp-photo-album-plus');
153
- if ( $buttonlabel ) $blbl .= ' '.$buttonlabel;
154
-
155
- $html .= wppa_ajax_button($blbl, $slug, $editor_id, 'no_confirm');
156
- }
157
- else {
158
- $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug;
159
- $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
160
 
161
- $html = '<textarea id="'.esc_attr($slug).'"'.$title.' style="float:left; width:300px;" onchange="wppaAjaxUpdateOptionValue(\''.$slug.'\', this)" >';
162
- $html .= esc_textarea( stripslashes( wppa_opt( $slug )));
163
- $html .= '</textarea>';
164
 
165
- $html .= '<img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
166
- }
 
 
 
167
 
168
  return $html;
169
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
143
  function wppa_textarea($xslug, $buttonlabel = '' ) {
144
 
145
  $slug = substr( $xslug, 5 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
+ $tit = __('Slug =', 'wp-photo-album-plus').' '.$xslug;
148
+ $title = wppa_switch( 'enable_shortcode_wppa_set' ) ? ' title="'.esc_attr( $tit ).'"' : '';
 
149
 
150
+ $html = '<textarea id="'.esc_attr($slug).'"'.$title.' style="float:left; width:300px;" onchange="wppaAjaxUpdateOptionValue(\''.$slug.'\', this)" >';
151
+ $html .= esc_textarea( stripslashes( wppa_opt( $slug )));
152
+ $html .= '</textarea>';
153
+
154
+ $html .= '<img id="img_'.$slug.'" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
155
 
156
  return $html;
157
  }
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 8.0.10.004
7
  *
8
  */
9
 
@@ -268,16 +268,8 @@ global $wppa_subtab_names;
268
  wppa_ok_message('Done! wppa_delete_all_from_cloudinary');
269
  }
270
  else {
271
- wppa_ok_message('Not yet Done! wppa_delete_all_from_cloudinary' .
272
- '<br />Trying to continue...');
273
- echo
274
- '<script type="text/javascript" >' .
275
- 'document.location=' .
276
- 'document.location+"&' .
277
- 'wppa-settings-submit=Doit&' .
278
- 'wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&' .
279
- 'wppa-key=' . $key . '"' .
280
- '</script>';
281
  }
282
  break;
283
 
@@ -287,16 +279,8 @@ global $wppa_subtab_names;
287
  wppa_ok_message('Done! wppa_delete_derived_from_cloudinary');
288
  }
289
  else {
290
- wppa_ok_message('Not yet Done! wppa_delete_derived_from_cloudinary' .
291
- '<br />Trying to continue...');
292
- echo
293
- '<script type="text/javascript" >' .
294
- 'document.location=' .
295
- 'document.location+"&' .
296
- 'wppa-settings-submit=Doit&' .
297
- 'wppa-nonce=' . wp_create_nonce( 'wppa-nonce' ) . '&' .
298
- 'wppa-key=' . $key . '"' .
299
- '</script>';
300
  }
301
  break;
302
 
@@ -475,88 +459,6 @@ global $wppa_subtab_names;
475
  // The nonce field
476
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' );
477
 
478
- // The css
479
- {
480
- echo '
481
- <style>
482
- .wppa-master-tabs {
483
- position:relative;
484
- top:24px;
485
- }
486
- .wppa-setting-tabs {
487
- position:relative;
488
- top:24px;
489
- }
490
- .wppa-setting-tabs li {
491
- border-color: darkgrey;
492
- border-width: 1px;
493
- float: left;
494
- background-color: white;
495
- padding: 8px 10px;
496
- font-size: 22px;
497
- color: darkgrey;
498
- border-style: solid;
499
- text-align: center;
500
- margin: 0 4px 0 0;
501
- border-top-left-radius: 8px;
502
- border-top-right-radius: 8px;
503
- cursor: pointer;
504
- }
505
- .wppa-master-tabs li {
506
- border-color: darkgrey;
507
- border-width: 1px;
508
- float: left;
509
- background-color: white;
510
- padding: 8px 10px;
511
- font-size: 22px;
512
- color: darkgrey;
513
- border-style: solid;
514
- text-align: center;
515
- margin: 0 4px 6px 0;
516
- border-radius: 8px;
517
- cursor: pointer;
518
- }
519
- #wppa-setting-tab-99 {
520
- float: right;
521
- }
522
- .wppa-tabdesc h3 {
523
- margin: 0 0 9px 0;
524
- padding: 6px 0 0 0;
525
- }
526
- .wppa-master-tabs .active {
527
- color: black;
528
- background-color:#dddddd;
529
- }
530
- .wppa-setting-tabs .active {
531
- color: black;
532
- border-bottom-color: white;
533
- background-color:#dddddd;
534
- }
535
- #wppa-setting-content {
536
- clear:both;
537
- background-color: white;
538
- border-left:1px solid black;
539
- border-right:1px solid black;
540
- border-bottom:1px solid black;
541
- position:relative;
542
- top:24px;
543
- border-color:darkgrey;
544
- margin-bottom:12px;
545
- }
546
- .wppa-colorbox {
547
- height: 28px !important;
548
- }
549
- .wppa-doit-button {
550
- float:left;
551
- border-radius:3px;
552
- font-size: 11px !important;
553
- margin: 0 4px;
554
- padding: 0 6px;
555
- border: 1px solid darkgrey !important;
556
- }
557
- </style>';
558
- }
559
-
560
  // Any tab set? else default general
561
  $tab = wppa_get( 'tab', 'general' );
562
  $subtab = wppa_get( 'subtab', '0' );
@@ -692,9 +594,9 @@ global $wppa_subtab_names;
692
 
693
  // The js
694
  {
695
- echo '
696
- <script>
697
- function wppaSettingTab(tab) {
698
  jQuery(".wppa-setting-tabs li").removeClass("active");
699
  jQuery("#wppa-setting-tab-"+tab).addClass("active");
700
  if ( tab == 99 ) {
@@ -786,8 +688,9 @@ global $wppa_subtab_names;
786
  if (jQuery(".' . $subtab . '").attr("data-inactive") == "1") jQuery(".' . $subtab . '").trigger("click");
787
  },100)});' : ''
788
  ) .
789
- ( $tab == 'watermark' ? 'jQuery(document).ready(function(){wppaCheckFontPreview();});' : '' ) . '
790
- </script>';
 
791
  }
792
 
793
  // Open the content area
@@ -1347,11 +1250,7 @@ global $wppa_subtab_names;
1347
  wppa_setting_new($slug, '9', $name, $desc, $html, $help);
1348
 
1349
  wppa_setting_box_footer_new();
1350
- echo '
1351
- <script type="text/javascript" >
1352
- wppaAjaxGetSpinnerHtml( "normal", "wppa-spin-pre-1" );
1353
- wppaAjaxGetSpinnerHtml( "lightbox", "wppa-spin-pre-2" );
1354
- </script>';
1355
  }
1356
  // Multimedia icon and stubfile specifications
1357
  if ( wppa_switch( 'enable_audio' ) || wppa_switch( 'enable_video' ) || wppa_switch( 'enable_pdf' ) )
@@ -3748,7 +3647,7 @@ global $wppa_subtab_names;
3748
  $html = wppa_select( $slug, $opts, $vals, $onchange ) .
3749
  '&nbsp;&nbsp;<img id="wppa-cursor" src="'.wppa_get_imgdir().wppa_opt( substr( $slug, 5 ) ).'" />';
3750
  wppa_setting_new($slug, '14', $name, $desc, $html, $help);
3751
- echo '<script>'.$onchange.'</script>';
3752
 
3753
  $name = __('Border width', 'wp-photo-album-plus');
3754
  $desc = __('Border width for lightbox display.', 'wp-photo-album-plus');
@@ -3975,13 +3874,6 @@ global $wppa_subtab_names;
3975
  $html = wppa_checkbox($slug);
3976
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
3977
 
3978
- $name = __('Comment db agreement', 'wp-photo-album-plus');
3979
- $desc = __('User needs to tick a checkbox to agree db storage', 'wp-photo-album-plus');
3980
- $help = '';
3981
- $slug = 'wppa_comment_need_db_agree';
3982
- $html = wppa_checkbox($slug);
3983
- wppa_setting_new($slug, '11', $name, $desc, $html, $help);
3984
-
3985
  $name = __('Comment needs vote', 'wp-photo-album-plus');
3986
  $desc = __('User needs to give a rating to get his comment published', 'wp-photo-album-plus');
3987
  $help = '';
@@ -5893,9 +5785,8 @@ global $wppa_subtab_names;
5893
  $slug = 'wppa_ajax_upload_method';
5894
  $opts = array( __('normal', 'wp-photo-album-plus'),
5895
  __('backend', 'wp-photo-album-plus'),
5896
- __('extern', 'wp-photo-album-plus'),
5897
  );
5898
- $vals = array( 'normal', 'backend', 'extern' );
5899
  $html = wppa_select($slug, $opts, $vals);
5900
  wppa_setting_new($slug, '5.1', $name, $desc, $html, $help, wppa_switch( 'ajax_upload' ));
5901
 
@@ -6356,9 +6247,10 @@ global $wppa_subtab_names;
6356
  $name = __('Show Twitter button', 'wp-photo-album-plus');
6357
  $desc = __('Display the Twitter button in the share box.', 'wp-photo-album-plus');
6358
  $help = '';
6359
- $slug = 'wppa_share_twitter';
6360
- $html = wppa_checkbox($slug);
6361
- wppa_setting_new($slug, '7', $name, $desc, $html, $help);
 
6362
 
6363
  $name = __('The creator\'s Twitter account', 'wp-photo-album-plus');
6364
  $desc = __('The Twitter @username a twitter card should be attributed to.', 'wp-photo-album-plus');
@@ -6367,26 +6259,21 @@ global $wppa_subtab_names;
6367
  $html = wppa_input($slug, '150px' );
6368
  wppa_setting_new($slug, '8', $name, $desc, $html, $help);
6369
 
6370
- $name = __('Show Google+ button', 'wp-photo-album-plus');
6371
- $desc = __('Display the Google+ button in the share box.', 'wp-photo-album-plus');
6372
- $help = '';
6373
- $slug = 'wppa_share_google';
6374
- $html = wppa_checkbox($slug);
6375
- wppa_setting_new($slug, '9', $name, $desc, $html, $help);
6376
-
6377
  $name = __('Show Pinterest button', 'wp-photo-album-plus');
6378
  $desc = __('Display the Pintrest button in the share box.', 'wp-photo-album-plus');
6379
  $help = '';
6380
- $slug = 'wppa_share_pinterest';
6381
- $html = wppa_checkbox($slug);
6382
- wppa_setting_new($slug, '10', $name, $desc, $html, $help);
 
6383
 
6384
  $name = __('Show LinkedIn button', 'wp-photo-album-plus');
6385
  $desc = __('Display the LinkedIn button in the share box.', 'wp-photo-album-plus');
6386
  $help = '';
6387
- $slug = 'wppa_share_linkedin';
6388
- $html = wppa_checkbox($slug);
6389
- wppa_setting_new($slug, '11', $name, $desc, $html, $help);
 
6390
 
6391
  $name = __('Show Facebook share button', 'wp-photo-album-plus');
6392
  $desc = __('Display the Facebook button in the share box.', 'wp-photo-album-plus');
@@ -6532,17 +6419,17 @@ global $wppa_subtab_names;
6532
  $help = __('Only change this setting when there are links that do not work', 'wp-photo-album-plus');
6533
  $slug = 'wppa_ajax_method';
6534
  $opts = array( __('Normal', 'wp-photo-album-plus'),
6535
- __('Classic', 'wp-photo-album-plus'),
6536
- // __('Frontend and Backend: Frontend method', 'wp-photo-album-plus'),
6537
  __('Frontend and Backend: Backend method', 'wp-photo-album-plus'),
6538
  __('Frontend: none, Backend: Backend method', 'wp-photo-album-plus'),
6539
  );
 
 
6540
  $vals = array( 'normal',
6541
- 'extern',
6542
- // 'wppaajax',
6543
  'admin',
6544
  'none',
6545
  );
 
 
6546
  $html = wppa_select($slug, $opts, $vals);
6547
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
6548
 
@@ -6584,17 +6471,18 @@ global $wppa_subtab_names;
6584
  $vals = array('none', 'top', 'bottom', 'both');
6585
  $html = wppa_select($slug, $opts, $vals);
6586
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
6587
-
6588
  $name = __('Defer javascript', 'wp-photo-album-plus');
6589
  $desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
6590
  $help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
6591
  $slug = 'wppa_defer_javascript';
6592
  $html = wppa_checkbox($slug);
6593
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
6594
-
6595
  global $wppa_setting_error;
6596
  $wppa_setting_error = true;
6597
 
 
6598
  $name = __('Custom style', 'wp-photo-album-plus');
6599
  $desc = __('Enter custom style specs here.', 'wp-photo-album-plus');
6600
  $help = __('Please move custom css to the wp customizer. WPPA Custom css will be discontinued in a near future revision.', 'wp-photo-album-plus');
@@ -6643,7 +6531,7 @@ global $wppa_subtab_names;
6643
  $slug = 'wppa_custom_style_opera';
6644
  $html = wppa_textarea($slug, $name);
6645
  wppa_setting_new($slug, '19', $name, $desc, $html, $help, wppa_opt( 'custom_style_opera' ) != '' );
6646
-
6647
  $wppa_setting_error = false;
6648
 
6649
  $name = __('Use customized style file', 'wp-photo-album-plus');
@@ -6853,6 +6741,13 @@ global $wppa_subtab_names;
6853
  $html = wppa_select($slug, $opts, $vals, '');
6854
  wppa_setting_new($slug, '42', $name, $desc, $html, $help);
6855
 
 
 
 
 
 
 
 
6856
  wppa_setting_box_footer_new();
6857
  }
6858
  }
@@ -7802,8 +7697,8 @@ global $wppa_subtab_names;
7802
  $help = __('If selected, any logged in user who meets the criteria has the capability to edit the photo information.', 'wp-photo-album-plus');
7803
  $help .= '<br />'.__('Note: This may be AFTER moderation!!', 'wp-photo-album-plus');
7804
  $slug = 'wppa_upload_edit';
7805
- $opts = array( __('--- none ---', 'wp-photo-album-plus'), __('Classic', 'wp-photo-album-plus'), __('New style', 'wp-photo-album-plus') );
7806
- $vals = array( '-none-', 'classic', 'new' );
7807
  $html = wppa_select($slug, $opts, $vals, 'wppaRefreshAfter();' );
7808
  wppa_setting_new($slug, '1', $name, $desc, $html, $help);
7809
 
@@ -8081,13 +7976,6 @@ global $wppa_subtab_names;
8081
  $html = wppa_checkbox($slug);
8082
  wppa_setting_new($slug, '3', $name, $desc, $html, $help);
8083
 
8084
- $name = __('Use WP editor', 'wp-photo-album-plus');
8085
- $desc = __('Use the wp editor for multiline text fields.', 'wp-photo-album-plus');
8086
- $help = '';
8087
- $slug = 'wppa_use_wp_editor';
8088
- $html = wppa_checkbox($slug);
8089
- wppa_setting_new($slug, '3', $name, $desc, $html, $help);
8090
-
8091
  $name = __('Album admin page size', 'wp-photo-album-plus');
8092
  $desc = __('The number of albums per page on the Edit Album admin page.', 'wp-photo-album-plus');
8093
  $help = '';
@@ -8976,7 +8864,7 @@ global $wppa_subtab_names;
8976
 
8977
  $name = htmlspecialchars(__('Convert user-<id> tags', 'wp-photo-album-plus'));
8978
  $desc = __('Convert old style usertags to new style.', 'wp-photo-album-plus');
8979
- $help = htmlspecialchars(__('Coverts user-<id> tags - created by the Choice feature - to user displaynames.', 'wp-photo-album-plus'));
8980
  $slug2 = 'wppa_covert_usertags';
8981
  $html1 = wppa_cronjob_button( $slug2 );
8982
  $html2 = wppa_maintenance_button( $slug2 );
@@ -10249,8 +10137,7 @@ global $wppa_subtab_names;
10249
  if ( function_exists( 'wppa_get_cloudinary_usage' ) && wppa_opt( 'cdn_cloud_name' ) ) {
10250
  $data = wppa_get_cloudinary_usage();
10251
  if ( is_array( $data ) ) {
10252
- $desc = '<style type="text/css" scoped>table, tbody, tr, td { margin:0; padding:0; border:none; font-size: 9px; line-height: 11px; } td { height:11px; }</style>';
10253
- $desc .= '<table style="margin:0;padding:0;border:none:" ><tbody>';
10254
  foreach ( array_keys( $data ) as $i ) {
10255
  $item = $data[$i];
10256
  if ( is_array( $item ) ) {
@@ -10306,13 +10193,6 @@ global $wppa_subtab_names;
10306
 
10307
  if ( wppa_switch( 'fotomoto_on' ) ) {
10308
 
10309
- $name = __('Fotomoto fontsize', 'wp-photo-album-plus');
10310
- $desc = __('Fontsize for the Fotomoto toolbar.', 'wp-photo-album-plus');
10311
- $help = __('If you set it here, it overrules a possible setting for font-size in .FotomotoToolbarClass on the Fotomoto dashboard.', 'wp-photo-album-plus');
10312
- $slug = 'wppa_fotomoto_fontsize';
10313
- $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus'));
10314
- wppa_setting_new($slug, '10', $name, $desc, $html, $help);
10315
-
10316
  $name = __('Hide when running', 'wp-photo-album-plus');
10317
  $desc = __('Hide toolbar on running slideshows', 'wp-photo-album-plus');
10318
  $help = __('The Fotomoto toolbar will re-appear when the slideshow stops.', 'wp-photo-album-plus');
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
268
  wppa_ok_message('Done! wppa_delete_all_from_cloudinary');
269
  }
270
  else {
271
+ wppa_ok_message( 'Not yet Done! wppa_delete_all_from_cloudinary' .
272
+ '<br />Please restart' );
 
 
 
 
 
 
 
 
273
  }
274
  break;
275
 
279
  wppa_ok_message('Done! wppa_delete_derived_from_cloudinary');
280
  }
281
  else {
282
+ wppa_ok_message( 'Not yet Done! wppa_delete_derived_from_cloudinary' .
283
+ '<br />Please restart' );
 
 
 
 
 
 
 
 
284
  }
285
  break;
286
 
459
  // The nonce field
460
  wp_nonce_field( 'wppa-nonce', 'wppa-nonce' );
461
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  // Any tab set? else default general
463
  $tab = wppa_get( 'tab', 'general' );
464
  $subtab = wppa_get( 'subtab', '0' );
594
 
595
  // The js
596
  {
597
+ $the_js =
598
+
599
+ 'function wppaSettingTab(tab) {
600
  jQuery(".wppa-setting-tabs li").removeClass("active");
601
  jQuery("#wppa-setting-tab-"+tab).addClass("active");
602
  if ( tab == 99 ) {
688
  if (jQuery(".' . $subtab . '").attr("data-inactive") == "1") jQuery(".' . $subtab . '").trigger("click");
689
  },100)});' : ''
690
  ) .
691
+ ( $tab == 'watermark' ? 'jQuery(document).ready(function(){wppaCheckFontPreview();});' : '' );
692
+
693
+ wp_add_inline_script( 'wppa-admin', $the_js );
694
  }
695
 
696
  // Open the content area
1250
  wppa_setting_new($slug, '9', $name, $desc, $html, $help);
1251
 
1252
  wppa_setting_box_footer_new();
1253
+ wp_add_inline_script( 'wppa-admin', 'wppaAjaxGetSpinnerHtml( "normal", "wppa-spin-pre-1" );wppaAjaxGetSpinnerHtml( "lightbox", "wppa-spin-pre-2" )' );
 
 
 
 
1254
  }
1255
  // Multimedia icon and stubfile specifications
1256
  if ( wppa_switch( 'enable_audio' ) || wppa_switch( 'enable_video' ) || wppa_switch( 'enable_pdf' ) )
3647
  $html = wppa_select( $slug, $opts, $vals, $onchange ) .
3648
  '&nbsp;&nbsp;<img id="wppa-cursor" src="'.wppa_get_imgdir().wppa_opt( substr( $slug, 5 ) ).'" />';
3649
  wppa_setting_new($slug, '14', $name, $desc, $html, $help);
3650
+ wp_add_inline_script( 'wppa-admin', $onchange );
3651
 
3652
  $name = __('Border width', 'wp-photo-album-plus');
3653
  $desc = __('Border width for lightbox display.', 'wp-photo-album-plus');
3874
  $html = wppa_checkbox($slug);
3875
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
3876
 
 
 
 
 
 
 
 
3877
  $name = __('Comment needs vote', 'wp-photo-album-plus');
3878
  $desc = __('User needs to give a rating to get his comment published', 'wp-photo-album-plus');
3879
  $help = '';
5785
  $slug = 'wppa_ajax_upload_method';
5786
  $opts = array( __('normal', 'wp-photo-album-plus'),
5787
  __('backend', 'wp-photo-album-plus'),
 
5788
  );
5789
+ $vals = array( 'normal', 'backend' );
5790
  $html = wppa_select($slug, $opts, $vals);
5791
  wppa_setting_new($slug, '5.1', $name, $desc, $html, $help, wppa_switch( 'ajax_upload' ));
5792
 
6247
  $name = __('Show Twitter button', 'wp-photo-album-plus');
6248
  $desc = __('Display the Twitter button in the share box.', 'wp-photo-album-plus');
6249
  $help = '';
6250
+ $slug1 = 'wppa_share_twitter';
6251
+ $slug2 = 'wppa_twitter_black';
6252
+ $html = wppa_checkbox($slug1) . '<span style="float-left">' . __('Black circle icon', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2);
6253
+ wppa_setting_new($slug1, '7', $name, $desc, $html, $help);
6254
 
6255
  $name = __('The creator\'s Twitter account', 'wp-photo-album-plus');
6256
  $desc = __('The Twitter @username a twitter card should be attributed to.', 'wp-photo-album-plus');
6259
  $html = wppa_input($slug, '150px' );
6260
  wppa_setting_new($slug, '8', $name, $desc, $html, $help);
6261
 
 
 
 
 
 
 
 
6262
  $name = __('Show Pinterest button', 'wp-photo-album-plus');
6263
  $desc = __('Display the Pintrest button in the share box.', 'wp-photo-album-plus');
6264
  $help = '';
6265
+ $slug1 = 'wppa_share_pinterest';
6266
+ $slug2 = 'wppa_pinterest_black';
6267
+ $html = wppa_checkbox($slug1) . '<span style="float-left">' . __('Black circle icon', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2);
6268
+ wppa_setting_new($slug1, '10', $name, $desc, $html, $help);
6269
 
6270
  $name = __('Show LinkedIn button', 'wp-photo-album-plus');
6271
  $desc = __('Display the LinkedIn button in the share box.', 'wp-photo-album-plus');
6272
  $help = '';
6273
+ $slug1 = 'wppa_share_linkedin';
6274
+ $slug2 = 'wppa_linkedin_black';
6275
+ $html = wppa_checkbox($slug1) . '<span style="float-left">' . __('Black circle icon', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2);
6276
+ wppa_setting_new($slug1, '11', $name, $desc, $html, $help);
6277
 
6278
  $name = __('Show Facebook share button', 'wp-photo-album-plus');
6279
  $desc = __('Display the Facebook button in the share box.', 'wp-photo-album-plus');
6419
  $help = __('Only change this setting when there are links that do not work', 'wp-photo-album-plus');
6420
  $slug = 'wppa_ajax_method';
6421
  $opts = array( __('Normal', 'wp-photo-album-plus'),
 
 
6422
  __('Frontend and Backend: Backend method', 'wp-photo-album-plus'),
6423
  __('Frontend: none, Backend: Backend method', 'wp-photo-album-plus'),
6424
  );
6425
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) ) $opts[] = __('Classic (deprecated)', 'wp-photo-album-plus');
6426
+
6427
  $vals = array( 'normal',
 
 
6428
  'admin',
6429
  'none',
6430
  );
6431
+ if ( wppa_is_file( dirname( __FILE__ ) . '/wppa-ajax-front.php' ) ) $vals[] = 'extern';
6432
+
6433
  $html = wppa_select($slug, $opts, $vals);
6434
  wppa_setting_new($slug, '5', $name, $desc, $html, $help);
6435
 
6471
  $vals = array('none', 'top', 'bottom', 'both');
6472
  $html = wppa_select($slug, $opts, $vals);
6473
  wppa_setting_new($slug, '10', $name, $desc, $html, $help);
6474
+ /*
6475
  $name = __('Defer javascript', 'wp-photo-album-plus');
6476
  $desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus');
6477
  $help = (__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus'));
6478
  $slug = 'wppa_defer_javascript';
6479
  $html = wppa_checkbox($slug);
6480
  wppa_setting_new($slug, '11', $name, $desc, $html, $help);
6481
+ */
6482
  global $wppa_setting_error;
6483
  $wppa_setting_error = true;
6484
 
6485
+ /*
6486
  $name = __('Custom style', 'wp-photo-album-plus');
6487
  $desc = __('Enter custom style specs here.', 'wp-photo-album-plus');
6488
  $help = __('Please move custom css to the wp customizer. WPPA Custom css will be discontinued in a near future revision.', 'wp-photo-album-plus');
6531
  $slug = 'wppa_custom_style_opera';
6532
  $html = wppa_textarea($slug, $name);
6533
  wppa_setting_new($slug, '19', $name, $desc, $html, $help, wppa_opt( 'custom_style_opera' ) != '' );
6534
+ */
6535
  $wppa_setting_error = false;
6536
 
6537
  $name = __('Use customized style file', 'wp-photo-album-plus');
6741
  $html = wppa_select($slug, $opts, $vals, '');
6742
  wppa_setting_new($slug, '42', $name, $desc, $html, $help);
6743
 
6744
+ $name = __('Use wp_upload_dir()', 'wp-photo-album-plus');
6745
+ $desc = __('Rely upon the information supplied by wp_upload_dir() for wppa file locations', 'wp-photo-album-plus');
6746
+ $help = __('Switch this on only when you are using non-standard locations for uploads etc', 'wp-photo-album-plus');
6747
+ $slug = 'wppa_use_wp_upload_dir_locations';
6748
+ $html = wppa_checkbox($slug);
6749
+ wppa_setting_new($slug, '43', $name, $desc, $html, $help);
6750
+
6751
  wppa_setting_box_footer_new();
6752
  }
6753
  }
7697
  $help = __('If selected, any logged in user who meets the criteria has the capability to edit the photo information.', 'wp-photo-album-plus');
7698
  $help .= '<br />'.__('Note: This may be AFTER moderation!!', 'wp-photo-album-plus');
7699
  $slug = 'wppa_upload_edit';
7700
+ $opts = array( __('--- none ---', 'wp-photo-album-plus'), __('New style', 'wp-photo-album-plus') );
7701
+ $vals = array( '-none-', 'new' );
7702
  $html = wppa_select($slug, $opts, $vals, 'wppaRefreshAfter();' );
7703
  wppa_setting_new($slug, '1', $name, $desc, $html, $help);
7704
 
7976
  $html = wppa_checkbox($slug);
7977
  wppa_setting_new($slug, '3', $name, $desc, $html, $help);
7978
 
 
 
 
 
 
 
 
7979
  $name = __('Album admin page size', 'wp-photo-album-plus');
7980
  $desc = __('The number of albums per page on the Edit Album admin page.', 'wp-photo-album-plus');
7981
  $help = '';
8864
 
8865
  $name = htmlspecialchars(__('Convert user-<id> tags', 'wp-photo-album-plus'));
8866
  $desc = __('Convert old style usertags to new style.', 'wp-photo-album-plus');
8867
+ $help = htmlspecialchars(__('Converts user-<id> tags - created by the Choice feature - to user displaynames.', 'wp-photo-album-plus'));
8868
  $slug2 = 'wppa_covert_usertags';
8869
  $html1 = wppa_cronjob_button( $slug2 );
8870
  $html2 = wppa_maintenance_button( $slug2 );
10137
  if ( function_exists( 'wppa_get_cloudinary_usage' ) && wppa_opt( 'cdn_cloud_name' ) ) {
10138
  $data = wppa_get_cloudinary_usage();
10139
  if ( is_array( $data ) ) {
10140
+ $desc .= '<table id="wppa-cloudinary-table" ><tbody>';
 
10141
  foreach ( array_keys( $data ) as $i ) {
10142
  $item = $data[$i];
10143
  if ( is_array( $item ) ) {
10193
 
10194
  if ( wppa_switch( 'fotomoto_on' ) ) {
10195
 
 
 
 
 
 
 
 
10196
  $name = __('Hide when running', 'wp-photo-album-plus');
10197
  $desc = __('Hide toolbar on running slideshows', 'wp-photo-album-plus');
10198
  $help = __('The Fotomoto toolbar will re-appear when the slideshow stops.', '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 8.0.08.007
7
  *
8
  */
9
 
@@ -296,6 +296,7 @@ global $wppa_error;
296
  if ( $old_rev <= '8004004' ) {
297
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET status = 'publish' WHERE status = ''" );
298
  }
 
299
  }
300
 
301
  // Check required directories
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the setup stuff
6
+ * Version 8.1.00.001
7
  *
8
  */
9
 
296
  if ( $old_rev <= '8004004' ) {
297
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET status = 'publish' WHERE status = ''" );
298
  }
299
+
300
  }
301
 
302
  // Check required directories
wppa-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.0.07.015
8
  *
9
  */
10
 
@@ -171,8 +171,8 @@ global $previous_page_last_id;
171
  wppa( 'curpage', '1' );
172
 
173
  // If a page is requested, find it
174
- $pagreq = wppa_get( 'page' );
175
- if ( is_numeric( $pagreq ) && $pagreq > '0' ) {
176
  wppa( 'curpage', $pagreq );
177
  }
178
 
@@ -487,7 +487,7 @@ function wppa_slide_frame() {
487
  'box-shadow:none;' .
488
  'cursor:default;' .
489
  '"' .
490
- ' onmouseover="wppaBbb('.wppa( 'mocc' ).',\'l\',\'show\')"' .
491
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'l\',\'hide\')"' .
492
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'l\',\'click\')"' .
493
  ' />' .
@@ -508,7 +508,7 @@ function wppa_slide_frame() {
508
  'box-shadow:none;' .
509
  'cursor:default;' .
510
  '"' .
511
- ' onmouseover="wppaBbb('.wppa( 'mocc' ).',\'r\',\'show\')"' .
512
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'r\',\'hide\')"' .
513
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'r\',\'click\')"' .
514
  ' />'
@@ -731,13 +731,7 @@ function wppa_slide_custom( $opt = '' ) {
731
  $f_on_this = ! wppa( 'in_widget' ) && fotomoto_page_enabled( wppa_get_the_ID() );
732
  }
733
  if ( wppa_switch( 'fotomoto_on' ) && $f_on_this ) {
734
- $fontsize = wppa_opt( 'fotomoto_fontsize' );
735
- if ( $fontsize ) {
736
- $s = '<style>.FotomotoToolbarClass{font-size:' . wppa_opt( 'fotomoto_fontsize' ) . 'px !important;}</style>';
737
- }
738
- else $s = '';
739
  $content = str_replace( 'w#fotomoto',
740
- $s .
741
  '<div' .
742
  ' id="wppa-fotomoto-container-'.wppa( 'mocc' ).'"' .
743
  ' class="wppa-fotomoto-container"' .
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.1.00.008
8
  *
9
  */
10
 
171
  wppa( 'curpage', '1' );
172
 
173
  // If a page is requested, find it
174
+ $pagreq = wppa_get( 'wppa-page', '0' );
175
+ if ( $pagreq ) {
176
  wppa( 'curpage', $pagreq );
177
  }
178
 
487
  'box-shadow:none;' .
488
  'cursor:default;' .
489
  '"' .
490
+ ' onmouseover="function x(){if(wppaBbb)wppaBbb('.wppa( 'mocc' ).',\'l\',\'show\')}"' .
491
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'l\',\'hide\')"' .
492
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'l\',\'click\')"' .
493
  ' />' .
508
  'box-shadow:none;' .
509
  'cursor:default;' .
510
  '"' .
511
+ ' onmouseover="function x(){if(wppaBbb)wppaBbb('.wppa( 'mocc' ).',\'r\',\'show\')}"' .
512
  ' onmouseout="wppaBbb('.wppa( 'mocc' ).',\'r\',\'hide\')"' .
513
  ' onclick="wppaBbb('.wppa( 'mocc' ).',\'r\',\'click\')"' .
514
  ' />'
731
  $f_on_this = ! wppa( 'in_widget' ) && fotomoto_page_enabled( wppa_get_the_ID() );
732
  }
733
  if ( wppa_switch( 'fotomoto_on' ) && $f_on_this ) {
 
 
 
 
 
734
  $content = str_replace( 'w#fotomoto',
 
735
  '<div' .
736
  ' id="wppa-fotomoto-container-'.wppa( 'mocc' ).'"' .
737
  ' class="wppa-fotomoto-container"' .
wppa-styles.php CHANGED
@@ -3,7 +3,7 @@
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
- /* Version 8.0.07.007
7
  /*
8
  */
9
 
@@ -12,9 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) die( "Can't load this file directly" );
12
  // Create dynamic css
13
  function wppa_create_wppa_dynamic_css() {
14
 
15
- $result = '
16
- <!-- WPPA+ dynamic css -->
17
- <style type="text/css" >
18
  .wppa-box { ' .
19
  ( wppa_opt( 'bwidth' ) > '0' ? 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; ' : '' ) .
20
  ( wppa_opt( 'bradius' ) > '0' ? 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' . wppa_opt( 'bradius' ) . 'px; ' : '' ) .
@@ -77,19 +75,11 @@ function wppa_create_wppa_dynamic_css() {
77
 
78
  // Add miscellaneous styles
79
  if ( ! wppa_switch( 'show_pname' ) ) {
80
- $result .= '
81
  .bc-pname { display:none; }';
82
  }
83
 
84
- // Add custom style
85
- $result .= wppa_opt( 'custom_style' );
86
-
87
- $result .= '
88
- </style>
89
- <!-- END WPPA+ dynamic css -->
90
- ';
91
-
92
- return $result;
93
 
94
  }
95
 
3
  /* Package: wp-photo-album-plus
4
  /*
5
  /* Various style computation routines
6
+ /* Version 8.1.00.006
7
  /*
8
  */
9
 
12
  // Create dynamic css
13
  function wppa_create_wppa_dynamic_css() {
14
 
15
+ $the_css = '
 
 
16
  .wppa-box { ' .
17
  ( wppa_opt( 'bwidth' ) > '0' ? 'border-style: solid; border-width:' . wppa_opt( 'bwidth' ) . 'px; ' : '' ) .
18
  ( wppa_opt( 'bradius' ) > '0' ? 'border-radius:' . wppa_opt( 'bradius' ) . 'px; -moz-border-radius:' . wppa_opt( 'bradius' ) . 'px; ' : '' ) .
75
 
76
  // Add miscellaneous styles
77
  if ( ! wppa_switch( 'show_pname' ) ) {
78
+ $the_css .= '
79
  .bc-pname { display:none; }';
80
  }
81
 
82
+ return $the_css;
 
 
 
 
 
 
 
 
83
 
84
  }
85
 
wppa-tinymce-common.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 7.4.02
6
  *
7
  */
8
 
@@ -21,80 +21,6 @@ global $wpdb;
21
  $result =
22
  '<div id="wppaphoto-form" title="' . esc_attr( __( 'Insert photo', 'wp-photo-album-plus' ) ) . '" >';
23
 
24
- // Front/back end dependant css
25
- if ( $front ) {
26
- $result .= '
27
- <style>
28
- #wppaphoto-table {
29
- box-sizing:border-box; width:100% !important;
30
- }
31
- .wppa-bar {
32
- background-color: #7f7;
33
- width:0%;
34
- height:18px;
35
- border-radius: 3px;
36
- line-height: 18px;
37
- margin: 0;
38
- }
39
- .wppa-percent {
40
- position:relative;
41
- display:inline-block;
42
- top:-19px;
43
- font-size: 12px;
44
- line-height: 18px;
45
- margin: 0;
46
- }
47
- .wppa-message {
48
- clear: both;
49
- }
50
- #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
51
- padding: 2px; 0;
52
- }
53
- #wppaphoto-table th {
54
- width:200px;
55
- }
56
- #wppaphoto-table input {
57
- padding:4px;
58
- }
59
- #wppaphoto-table th, #wppaphoto-table td {
60
- border:none;
61
- }
62
- #wppaphoto-shortcode-preview-container {
63
- width:500px !important;
64
- }
65
- </style>';
66
- }
67
- else {
68
- $result .= '
69
- <style>
70
- #TB_ajaxContent {
71
- box-sizing:border-box; width:100% !important;
72
- }
73
- .wppa-bar {
74
- background-color: #7f7;
75
- width:0%;
76
- height:18px;
77
- border-radius: 3px;
78
- line-height: 18px;
79
- margin: 0;
80
- }
81
- .wppa-percent {
82
- position:relative;
83
- display:inline-block;
84
- top:-19px;
85
- font-size: 12px;
86
- line-height: 18px;
87
- margin: 0;
88
- }
89
- .wppa-message {
90
- clear: both;
91
- }
92
- #wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
93
- padding: 2px; 0;
94
- }
95
- </style>';
96
- }
97
-
98
  // Open table
99
  $result .=
100
  '
@@ -118,8 +44,8 @@ global $wpdb;
118
  '<small class="wppamyphoto-photo" >'.
119
  __('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
120
  sprintf( __('You can select one of your photos from a maximum of %d most recently added', 'wp-photo-album-plus'), wppa_opt( 'generator_max' ) ).'<br />'.
121
- '</small>'.
122
- '</td>'.
123
  '</tr>' .
124
 
125
  // Photo selection max 100 of all photos
@@ -170,7 +96,7 @@ global $wpdb;
170
  ' method="post"' .
171
  ' enctype="multipart/form-data"' .
172
  ' >' .
173
- wppa_nonce_field( 'wppa-check' , 'wppa-nonce', false, false ) .
174
 
175
  // Single album
176
  ( ( count( $albums ) == 1 ) ?
2
  /* wppa-tinymce-common.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.008
6
  *
7
  */
8
 
21
  $result =
22
  '<div id="wppaphoto-form" title="' . esc_attr( __( 'Insert photo', 'wp-photo-album-plus' ) ) . '" >';
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  // Open table
25
  $result .=
26
  '
44
  '<small class="wppamyphoto-photo" >'.
45
  __('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
46
  sprintf( __('You can select one of your photos from a maximum of %d most recently added', 'wp-photo-album-plus'), wppa_opt( 'generator_max' ) ).'<br />'.
47
+ '</small>' .
48
+ '</td>' .
49
  '</tr>' .
50
 
51
  // Photo selection max 100 of all photos
96
  ' method="post"' .
97
  ' enctype="multipart/form-data"' .
98
  ' >' .
99
+ wppa_nonce_field( 'wppa-check' , 'wppa-nonce', false ) .
100
 
101
  // Single album
102
  ( ( count( $albums ) == 1 ) ?
wppa-tinymce-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
- * Version 8.0.00.011
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
@@ -89,23 +89,7 @@ global $wpdb;
89
 
90
  // Make the html
91
  $result =
92
- '<style>
93
- #TB_ajaxContent {
94
- box-sizing:border-box; width:100% !important;
95
- }
96
- #wppagallery-table select {
97
- max-width:540px;
98
- }
99
- #wppagallery-table option {
100
- color: #070;
101
- }
102
- </style>'.
103
  '<div id="wppagallery-form" title="' . esc_attr( __( 'Insert gallery', 'wp-photo-album-plus' ) ) . '" >'.
104
- '<style type="text/css">'.
105
- '#wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {'.
106
- 'padding: 2px; 0;'.
107
- '}'.
108
- '</style>'.
109
  '<table id="wppagallery-table" class="form-table">'.
110
 
111
  // Top type selection
2
  /* wppa-tinymce-shortcodes.php
3
  * Pachkage: wp-photo-album-plus
4
  *
5
+ * Version 8.1.00.004
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) )
89
 
90
  // Make the html
91
  $result =
 
 
 
 
 
 
 
 
 
 
 
92
  '<div id="wppagallery-form" title="' . esc_attr( __( 'Insert gallery', 'wp-photo-album-plus' ) ) . '" >'.
 
 
 
 
 
93
  '<table id="wppagallery-table" class="form-table">'.
94
 
95
  // Top type selection
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 8.0.09.001
7
  *
8
  */
9
 
@@ -22,25 +22,18 @@ global $upload_album;
22
  $user = wppa_get_user();
23
 
24
  // Sanitize album input
25
- if ( isset( $_POST['wppa-album'] ) ) {
26
- $upload_album = strval( intval( $_POST['wppa-album'] ) );
27
- }
28
- else {
29
- $upload_album = null;
30
- }
31
 
32
  // Update watermark settings for the user if new values supplied
33
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
34
 
35
  // File
36
- if ( isset( $_POST['wppa-watermark-file'] ) ) {
37
 
38
  // Sanitize input
39
- $watermark_file = $_POST['wppa-watermark-file'];
40
- if ( stripos( $watermark_file, '.png' ) !== false ) {
41
- $watermark_file = sanitize_file_name( $watermark_file );
42
- }
43
- else {
44
  if ( ! in_array( $watermark_file, array( '--- none ---', '---name---', '---filename---', '---description---', '---predef---' ) ) ) {
45
  $watermark_file = 'nil';
46
  }
@@ -51,10 +44,11 @@ global $upload_album;
51
  }
52
 
53
  // Position
54
- if ( isset( $_POST['wppa-watermark-pos'] ) ) {
55
 
56
  // Sanitize input
57
- $watermark_pos = $_POST['wppa-watermark-pos'];
 
58
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
59
  $watermark_pos = 'nil';
60
  }
@@ -73,11 +67,10 @@ global $upload_album;
73
  }
74
 
75
  // Do the upload if requested
76
- // From BOX A
77
- if ( isset( $_POST['wppa-upload-multiple'] ) ) {
78
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
79
  wppa_upload_multiple();
80
- if ( isset( $_POST['wppa-go-edit-multiple'] ) ) {
81
  if ( current_user_can( 'wppa_admin' ) ) {
82
  wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
83
  <script type="text/javascript" >
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 8.1.00.001
7
  *
8
  */
9
 
22
  $user = wppa_get_user();
23
 
24
  // Sanitize album input
25
+ $upload_album = wppa_get( 'album', '0', 'int' );
 
 
 
 
 
26
 
27
  // Update watermark settings for the user if new values supplied
28
  if ( wppa_switch( 'watermark_on' ) && ( wppa_switch( 'watermark_user' ) || current_user_can( 'wppa_settings' ) ) ) {
29
 
30
  // File
31
+ if ( wppa_get( 'watermark-file' ) ) {
32
 
33
  // Sanitize input
34
+ $watermark_file = sanitize_file_name( wppa_get( 'watermark-file' ), 'nil' );
35
+ if ( stripos( $watermark_file, '.png' ) === false ) {
36
+
 
 
37
  if ( ! in_array( $watermark_file, array( '--- none ---', '---name---', '---filename---', '---description---', '---predef---' ) ) ) {
38
  $watermark_file = 'nil';
39
  }
44
  }
45
 
46
  // Position
47
+ if ( wppa_get( 'watermark-pos' ) ) {
48
 
49
  // Sanitize input
50
+ $watermark_pos = wppa_get( 'watermark-pos', 'nil' );
51
+
52
  if ( ! in_array( $watermark_pos, array( 'toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht' ) ) ) {
53
  $watermark_pos = 'nil';
54
  }
67
  }
68
 
69
  // Do the upload if requested
70
+ if ( wppa_get( 'upload-multiple', false, 'bool' ) ) {
 
71
  check_admin_referer( '$wppa_nonce', WPPA_NONCE );
72
  wppa_upload_multiple();
73
+ if ( wppa_get( 'go-edit-multiple', false, 'bool' ) ) {
74
  if ( current_user_can( 'wppa_admin' ) ) {
75
  wppa_ok_message( __( 'Connecting to edit album...' , 'wp-photo-album-plus' ) ); ?>
76
  <script type="text/javascript" >
wppa-users.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
- * Version 8.0.00.014
7
  *
8
  */
9
 
@@ -38,6 +38,21 @@ static $users;
38
  return $users;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  // Wrapper for get_user_by()
42
  function wppa_get_user_by( $key, $user ) {
43
  static $usercache;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains user and capabilities related routines
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
38
  return $users;
39
  }
40
 
41
+ // Get the options html for a selectionbox with users
42
+ function wppa_get_user_select( $select = '' ) {
43
+ $result = '';
44
+ $iam = $select == '' ? wppa_get_user() : $select;
45
+ $users = wppa_get_users();
46
+ $sel = $select == '--- public ---' ? 'selected="selected"' : '';
47
+ $result .= '<option value="--- public ---" '.$sel.'>'.__( '--- public ---' , 'wp-photo-album-plus').'</option>';
48
+ foreach ( $users as $usr ) {
49
+ if ( $usr['user_login'] == $iam ) $sel = 'selected="selected"';
50
+ else $sel = '';
51
+ $result .= '<option value="' . esc_attr( $usr['user_login'] ) . '" ' . $sel . '>' . sanitize_text_field( $usr['display_name'] ) . '</option>';
52
+ }
53
+ return $result;
54
+ }
55
+
56
  // Wrapper for get_user_by()
57
  function wppa_get_user_by( $key, $user ) {
58
  static $usercache;
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 8.0.10.005
7
  *
8
  */
9
 
@@ -191,16 +191,10 @@ global $wppa_supported_stereo_types;
191
  if ( wppa_is_stereo( $id ) ) {
192
 
193
  // Get type from cookie
194
- $st = isset( $_COOKIE["stereotype"] ) ? $_COOKIE["stereotype"] : 'color';
195
- if ( ! in_array( $st, $wppa_supported_stereo_types ) ) {
196
- $st = '_flat';
197
- }
198
 
199
  // Get glass from cookie
200
- $sg = 'rc';
201
- if ( isset( $_COOKIE["stereoglass"] ) && $_COOKIE["stereoglass"] == 'greenmagenta' ) {
202
- $sg = 'gm';
203
- }
204
 
205
  // Create the file if not present
206
  if ( ! is_file( wppa_get_stereo_path( $id, $st, $sg ) ) ) {
@@ -321,20 +315,22 @@ global $wppa;
321
  $wppa['geo'] .= '<div id="geodiv-' . wppa( 'mocc' ) . '-' . $id . '" style="display:none;">' . $geo . '</div>';
322
  break;
323
  case 'wppa-plus-embedded':
 
324
  if ( $wppa['geo'] == '' ) { // First
325
  $wppa['geo'] = '
326
- <div id="map-canvas-' . wppa( 'mocc' ).'" style="height:' . wppa_opt( 'map_height' ) . 'px; width:100%; padding:0; margin:0; font-size: 10px;" ></div>
327
- <script>
328
- if ( typeof ( _wppaLat ) == "undefined" ) { var _wppaLat = new Array(); var _wppaLon = new Array(); }
329
- if ( typeof ( _wppaRealId ) == "undefined" ) { var _wppaRealId = new Array(); }
330
- _wppaLat[' . wppa( 'mocc' ) . '] = new Array(); _wppaLon[' . wppa( 'mocc' ) . '] = new Array();
331
- </script>';
332
  } // End first
333
- $wppa['geo'] .= '
334
- <script>
335
- _wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat . ';
336
- _wppaLon[' . wppa( 'mocc' ) . '][' . $id.'] = ' . $lon . ';
337
- </script>';
 
338
  break; // End native
339
  case 'none':
340
  break;
@@ -1135,7 +1131,7 @@ function wppa_get_last_album() {
1135
 
1136
  // Combine margin or padding style
1137
  function wppa_combine_style($type, $top = '0', $left = '0', $right = '0', $bottom = '0') {
1138
- // echo $top.' '.$left.' '.$right.' '.$bottom.'<br />';
1139
  $result = $type.':'; // Either 'margin:' or 'padding:'
1140
  if ( $left == $right ) {
1141
  if ( $top == $bottom ) {
@@ -1207,7 +1203,7 @@ global $wpdb;
1207
  }
1208
  }
1209
  }
1210
- echo $count.' source file extensions repaired';
1211
  update_option('wppa_sourcefile_fix_start', '-1');
1212
  }
1213
 
@@ -1217,6 +1213,7 @@ global $wppa_supported_audio_extensions;
1217
  global $wppa_supported_video_extensions;
1218
  global $wpdb;
1219
 
 
1220
  // Sanitize arg
1221
  $photo = strval( intval( $photo ) );
1222
  $photoinfo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
@@ -1230,15 +1227,8 @@ global $wpdb;
1230
  if ( is_array( $in_use ) ) {
1231
 
1232
  if ( defined( 'DOING_AJAX' ) ) {
1233
- echo
1234
- 'ER||0||' .
1235
- '<span style="color:#ff0000;" >' .
1236
- __( 'Could not delete photo', 'wp-photo-album-plus' ) .
1237
- '</span>||' .
1238
- __( 'Photo is still in use in post/page', 'wp-photo-album-plus' ) .
1239
- ' ' .
1240
- $in_use['post_title'] .
1241
- ' (' . $in_use['ID'] . ')';
1242
  wppa_exit();
1243
  }
1244
  else {
@@ -1499,7 +1489,7 @@ function wppa_series_to_array($xtxt) {
1499
  return $result;
1500
  }
1501
  function wppa_stx_err($msg) {
1502
- echo 'Syntax error in album specification. '.$msg;
1503
  wppa_log( 'err', $msg, true );
1504
  }
1505
 
@@ -3216,7 +3206,7 @@ function get_browser_name() {
3216
 
3217
  // Like wp_nonce_field
3218
  // To prevent duplicate id's, we externally add an id number ( e.g. album ) and internally the mocc number.
3219
- function wppa_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $echo = true, $wppa_id = '0' ) {
3220
 
3221
  $name = esc_attr( $name );
3222
  $nonce_field = '<input' .
@@ -3230,10 +3220,6 @@ function wppa_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $
3230
  $nonce_field .= wp_referer_field( false );
3231
  }
3232
 
3233
- if ( $echo ) {
3234
- echo $nonce_field;
3235
- }
3236
-
3237
  return $nonce_field;
3238
  }
3239
 
@@ -3814,68 +3800,40 @@ function wppa_get_mime_type( $id ) {
3814
  return $result;
3815
  }
3816
 
3817
- // Test if a given url is to a photo file
3818
  function wppa_is_url_a_photo( &$url, $save = true ) {
3819
  global $wppa_supported_photo_extensions;
3820
  global $wppa_session;
3821
 
3822
- // Been here before?
3823
- if ( isset( $wppa_session['rem_url'][$url] ) ) {
3824
- return $wppa_session['rem_url'][$url];
3825
- }
3826
-
3827
- // Check existence
3828
- if ( ! wppa_remote_file_exists( $url, $save ) ) {
3829
- $wppa_session['rem_url'][$url] = false;
3830
- if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3831
- return false;
3832
- }
3833
-
3834
  // Init
3835
- $result = true;
3836
- $ext = wppa_get_ext( $url );
3837
-
3838
- // If the url does not have a valid photo extension, its not a photo file
3839
- if ( ! in_array( $ext, $wppa_supported_photo_extensions ) ) {
3840
- $wppa_session['rem_url'][$url] = false;
3841
- if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3842
- return false;
3843
- }
3844
-
3845
- // Using curl may be protected/limited
3846
- // Use curl to see if the url is found to prevent a php warning
3847
- /* experimental */
3848
- if ( function_exists( 'curl_init' ) && false ) {
3849
 
3850
- // Create a curl handle to the expected photofile
3851
- $ch = curl_init( $url );
3852
 
3853
- // Execute
3854
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
3855
- curl_setopt( $ch, CURLOPT_FAILONERROR, true );
3856
- curl_exec( $ch );
3857
 
3858
- // Check if HTTP code > 400 i.e. error 22 occurred
3859
- if( curl_errno( $ch ) == 22 ) {
3860
- $result = false;
3861
- }
3862
 
3863
- // Close handle
3864
- curl_close($ch);
3865
 
3866
- }
3867
 
3868
- // No curl on system, or do not use curl
3869
- else {
3870
-
3871
- // getimagesize on a non imagefile produces a php warning
3872
- $result = is_array( @ getimagesize( $url ) );
3873
  }
3874
 
3875
- // Done
3876
- $wppa_session['rem_url'][$url] = $result;
3877
- if ( count( $wppa_session['rem_url'] ) > 100 ) array_shift( $wppa_session['rem_url'] );
3878
- return $result;
3879
  }
3880
 
3881
  function wppa_get_like_title_a( $id ) {
@@ -3911,18 +3869,6 @@ global $wpdb;
3911
  return $result;
3912
  }
3913
 
3914
- function wppa_print_tree( $path ) {
3915
- $path = rtrim( $path, '/' );
3916
- echo $path . '<br />';
3917
- $files = wppa_glob( $path . '/*' );
3918
- foreach( $files as $file ) {
3919
- echo $file . '<br />';
3920
- if ( wppa_is_dir( $file ) ) {
3921
- wppa_print_tree( $file );
3922
- }
3923
- }
3924
- }
3925
-
3926
  // Returns available memory in bytes
3927
  function wppa_memry_limit() {
3928
 
@@ -3966,43 +3912,33 @@ function wppa_create_qrcode_cache( $url, $size = '80' ) {
3966
 
3967
  // In cache already?
3968
  $key = md5( $qrsrc );
3969
- if ( is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
 
 
 
3970
 
3971
  // Bump cache found counter
3972
  update_option( 'wppa_qr_cache_hits', wppa_get_option( 'wppa_qr_cache_hits', 0 ) + 1 );
3973
- return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3974
  }
3975
 
3976
  // Bump cache miss counter
3977
  update_option( 'wppa_qr_cache_miss', wppa_get_option( 'wppa_qr_cache_miss', 0 ) + 1 );
3978
 
3979
  // Catch the qr image
3980
- $curl = curl_init();
3981
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
3982
- curl_setopt( $curl, CURLOPT_URL, $qrsrc );
3983
- $contents = curl_exec( $curl );
3984
- curl_close( $curl );
3985
-
3986
- // Save the image
3987
- if ( strlen( $contents ) > 1000 ) {
3988
-
3989
- wppa_put_contents( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', $contents );
3990
-
3991
- /*
3992
- $file = wppa _fopen( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg', 'w' );
3993
- if ( $file ) {
3994
- fwrite( $file, $contents, strlen( $contents ) );
3995
- fclose( $file );
3996
- }
3997
- */
3998
- }
3999
 
4000
- if ( wppa_is_file( WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg' ) ) {
4001
- return WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
4002
- }
4003
- else {
4004
- return $qrsrc;
4005
  }
 
 
 
4006
  }
4007
 
4008
 
@@ -4804,7 +4740,7 @@ function wppa_dump( $txt = '' ) {
4804
 
4805
  if ( $txt ) {
4806
  if ( wppa_is_file( $file ) ) {
4807
- $txt = wppa_get_contents( $file ) . "\n" . $who . ' ' . $when . ' ' . $txt;
4808
  }
4809
  wppa_put_contents( $file, $txt );
4810
  }
@@ -4873,46 +4809,6 @@ function wppa_is_panorama( $id ) {
4873
  return $result;
4874
  }
4875
 
4876
- // See if a remote file exists
4877
- function wppa_remote_file_exists( &$url, $save = true ) {
4878
-
4879
- $orig_url = $url;
4880
- $ext = wppa_get_ext( $url );
4881
- $url_1 = wppa_strip_ext( $url );
4882
- $exts = array( 'jpg', 'png', 'jpeg' );
4883
-
4884
- for ( $i=1; $i<4; $i++ ) { // Give it four tries
4885
- foreach( $exts as $ext ) { // Try all possible extensions
4886
-
4887
- $url = $url_1 . '.' . $ext;
4888
- $ch = curl_init( $url );
4889
- $options = array(
4890
- CURLOPT_NOBODY => true,
4891
- CURLOPT_SSL_VERIFYPEER => true,
4892
- );
4893
- curl_setopt_array( $ch, $options );
4894
- curl_exec( $ch );
4895
- $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
4896
- curl_close( $ch );
4897
- wppa_log( 'dbg', 'curl_exec() returned {b}' . $httpCode . '{/b} for ' . $url );
4898
- if ( $httpCode == 200 ) {
4899
- $path = WPPA_DEPOT_PATH . '/' . basename( wppa_compress_tree_path( $url ) );
4900
- if ( ! wppa_is_file( $path ) || ! wppa_filesize( $path ) ) {
4901
- $data = file_get_contents( $url );
4902
- if ( $save ) {
4903
- file_put_contents( $path, $data );
4904
- wppa_log( 'dbg', basename( $path ) . ' saved by wppa_remote_file_exists()' );
4905
- }
4906
- }
4907
- return true;
4908
- }
4909
- }
4910
- sleep( 1 ); // Wait a second, may help sometimes
4911
- }
4912
- $url = $orig_url;
4913
- return false;
4914
- }
4915
-
4916
  // Rename all files inside a tree to their sanitized name (recursive)
4917
  function wppa_rename_files_sanitized( $root ) {
4918
 
@@ -5030,7 +4926,6 @@ function wppa_compress_html( $txt ) {
5030
  $result = str_replace( " ", " ", $result );
5031
  $result = str_replace( '> <', '><', $result );
5032
  $result = str_replace( '<ul></ul>', '', $result );
5033
- $result = str_replace( '</script><script>', '', $result );
5034
  $result = str_replace( '<!--', "\n<!--", $result );
5035
 
5036
  return $result;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
191
  if ( wppa_is_stereo( $id ) ) {
192
 
193
  // Get type from cookie
194
+ $st = wppa_get_cookie( 'stereotype', '_flat' );
 
 
 
195
 
196
  // Get glass from cookie
197
+ $sg = ( wppa_get( 'stereoglass' ) == 'greenmagenta' ? 'gm' : 'rc' );
 
 
 
198
 
199
  // Create the file if not present
200
  if ( ! is_file( wppa_get_stereo_path( $id, $st, $sg ) ) ) {
315
  $wppa['geo'] .= '<div id="geodiv-' . wppa( 'mocc' ) . '-' . $id . '" style="display:none;">' . $geo . '</div>';
316
  break;
317
  case 'wppa-plus-embedded':
318
+ $the_js = '';
319
  if ( $wppa['geo'] == '' ) { // First
320
  $wppa['geo'] = '
321
+ <div id="map-canvas-' . wppa( 'mocc' ).'"
322
+ style="height:' . wppa_opt( 'map_height' ) . 'px; width:100%; padding:0; margin:0; font-size: 10px;" >
323
+ </div>';
324
+ $the_js .= '
325
+ _wppaLat[' . wppa( 'mocc' ) . '] = [];
326
+ _wppaLon[' . wppa( 'mocc' ) . '] = [];';
327
  } // End first
328
+
329
+ $the_js .= '
330
+ _wppaLat[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lat . ';
331
+ _wppaLon[' . wppa( 'mocc' ) . '][' . $id . '] = ' . $lon . ';';
332
+
333
+ wppa_js( $the_js );
334
  break; // End native
335
  case 'none':
336
  break;
1131
 
1132
  // Combine margin or padding style
1133
  function wppa_combine_style($type, $top = '0', $left = '0', $right = '0', $bottom = '0') {
1134
+
1135
  $result = $type.':'; // Either 'margin:' or 'padding:'
1136
  if ( $left == $right ) {
1137
  if ( $top == $bottom ) {
1203
  }
1204
  }
1205
  }
1206
+ echo esc_html__( sprintf( '%d source file extensions repaired', 'wp-photo-album-plus' ), $count );
1207
  update_option('wppa_sourcefile_fix_start', '-1');
1208
  }
1209
 
1213
  global $wppa_supported_video_extensions;
1214
  global $wpdb;
1215
 
1216
+
1217
  // Sanitize arg
1218
  $photo = strval( intval( $photo ) );
1219
  $photoinfo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->wppa_photos
1227
  if ( is_array( $in_use ) ) {
1228
 
1229
  if ( defined( 'DOING_AJAX' ) ) {
1230
+ wppa_echo( 'ER||0||' . '<span style="color:#ff0000;" >' . esc_html__( 'Could not delete photo', 'wp-photo-album-plus' ) . '</span>||' .
1231
+ __( 'Photo is still in use in post/page', 'wp-photo-album-plus' ) . ' ' . $in_use['post_title'] . ' (' . $in_use['ID'] . ')', 'post' );
 
 
 
 
 
 
 
1232
  wppa_exit();
1233
  }
1234
  else {
1489
  return $result;
1490
  }
1491
  function wppa_stx_err($msg) {
1492
+ echo esc_html( 'Syntax error in album specification. ' . $msg );
1493
  wppa_log( 'err', $msg, true );
1494
  }
1495
 
3206
 
3207
  // Like wp_nonce_field
3208
  // To prevent duplicate id's, we externally add an id number ( e.g. album ) and internally the mocc number.
3209
+ function wppa_nonce_field( $action = -1, $name = "_wpnonce", $referer = true, $wppa_id = '0' ) {
3210
 
3211
  $name = esc_attr( $name );
3212
  $nonce_field = '<input' .
3220
  $nonce_field .= wp_referer_field( false );
3221
  }
3222
 
 
 
 
 
3223
  return $nonce_field;
3224
  }
3225
 
3800
  return $result;
3801
  }
3802
 
3803
+ // Test if a given url is to a photo file, possibly adjust url extension
3804
  function wppa_is_url_a_photo( &$url, $save = true ) {
3805
  global $wppa_supported_photo_extensions;
3806
  global $wppa_session;
3807
 
 
 
 
 
 
 
 
 
 
 
 
 
3808
  // Init
3809
+ $result = true;
3810
+ $ext = wppa_get_ext( $url );
3811
+ $urlnoext = wppa_strip_ext( $url );
 
 
 
 
 
 
 
 
 
 
 
3812
 
3813
+ // Try all supported extensions
3814
+ foreach( $wppa_supported_photo_extensions as $ext ) {
3815
 
3816
+ $url = $urlnoext . '.' . $ext;
 
 
 
3817
 
3818
+ // Use wp HTTP API to retrieve the photo
3819
+ $response = wp_remote_get( $url );
3820
+ $result = wp_remote_retrieve_body( $response );
3821
+ $httpcode = wp_remote_retrieve_response_code( $response );
3822
 
3823
+ // Done, save image optionally
3824
+ if ( $httpcode == 200 ) {
3825
 
3826
+ if ( $save ) {
3827
 
3828
+ $path = WPPA_DEPOT_PATH . '/' . basename( wppa_compress_tree_path( $url ) );
3829
+ wppa_put_contents( $path, $result );
3830
+ }
3831
+ return true;
3832
+ }
3833
  }
3834
 
3835
+ // No
3836
+ return false;
 
 
3837
  }
3838
 
3839
  function wppa_get_like_title_a( $id ) {
3869
  return $result;
3870
  }
3871
 
 
 
 
 
 
 
 
 
 
 
 
 
3872
  // Returns available memory in bytes
3873
  function wppa_memry_limit() {
3874
 
3912
 
3913
  // In cache already?
3914
  $key = md5( $qrsrc );
3915
+ $qr_image_path = WPPA_UPLOAD_PATH . '/qr/' . $key . '.svg';
3916
+ $qr_image_url = WPPA_UPLOAD_URL . '/qr/' . $key . '.svg';
3917
+
3918
+ if ( is_file( $qr_image_path ) ) {
3919
 
3920
  // Bump cache found counter
3921
  update_option( 'wppa_qr_cache_hits', wppa_get_option( 'wppa_qr_cache_hits', 0 ) + 1 );
3922
+ return $qr_image_url;
3923
  }
3924
 
3925
  // Bump cache miss counter
3926
  update_option( 'wppa_qr_cache_miss', wppa_get_option( 'wppa_qr_cache_miss', 0 ) + 1 );
3927
 
3928
  // Catch the qr image
3929
+ $response = wp_remote_get( $qrsrc );
3930
+ $contents = wp_remote_retrieve_body( $response );
3931
+ $httpcode = wp_remote_retrieve_response_code( $response );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3932
 
3933
+ // On success, save the image and return the url to the image
3934
+ if ( $httpcode == 200 ) {
3935
+
3936
+ wppa_put_contents( $qr_image_path, $contents );
3937
+ return $qr_image_url;
3938
  }
3939
+
3940
+ // Failed, return qr source url
3941
+ return $qrsrc;
3942
  }
3943
 
3944
 
4740
 
4741
  if ( $txt ) {
4742
  if ( wppa_is_file( $file ) ) {
4743
+ $txt = wppa_get_contents( $file ) . "\n" . /* $who . ' ' . $when . ' ' . */ $txt;
4744
  }
4745
  wppa_put_contents( $file, $txt );
4746
  }
4809
  return $result;
4810
  }
4811
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4812
  // Rename all files inside a tree to their sanitized name (recursive)
4813
  function wppa_rename_files_sanitized( $root ) {
4814
 
4926
  $result = str_replace( " ", " ", $result );
4927
  $result = str_replace( '> <', '><', $result );
4928
  $result = str_replace( '<ul></ul>', '', $result );
 
4929
  $result = str_replace( '<!--', "\n<!--", $result );
4930
 
4931
  return $result;
wppa-video.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all video routines
6
- * Version 8.0.00.019
7
  *
8
  */
9
 
@@ -75,16 +75,16 @@ function wppa_get_video_html( $args ) {
75
  ) ) );
76
 
77
  // Prepare attributes
78
- $w = $width ? ' width:'.$width.'px;' : '';
79
- $w = $widthp ? ' width:'.$widthp.'%;' : $w;
80
- $h = $height ? ' height:'.$height.'px;' : '';
81
- $t = $margin_top ? ' margin-top:'.$margin_top.'px;' : '';
82
- $b = $margin_bottom ? ' margin-bottom:'.$margin_bottom.'px;' : '';
83
  $ctrl = $controls ? ' controls' : '';
84
  $tit = $title ? ' title="'.$title.'"' : '';
85
  $onc = $onclick ? ' onclick="'.$onclick.'"' : '';
86
  $cls = $class ? ' class="'.$class.'"' : '';
87
- $style = $style ? rtrim( trim( $style ), ';' ) . ';' : '';
88
  $play = $autoplay ? ' autoplay' : '';
89
 
90
  // See if there is a poster image
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all video routines
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
75
  ) ) );
76
 
77
  // Prepare attributes
78
+ $w = $width ? 'width:'.$width.'px;' : '';
79
+ $w = $widthp ? 'width:'.$widthp.'%;' : $w;
80
+ $h = $height ? 'height:'.$height.'px;' : '';
81
+ $t = $margin_top ? 'margin-top:'.$margin_top.'px;' : '';
82
+ $b = $margin_bottom ? 'margin-bottom:'.$margin_bottom.'px;' : '';
83
  $ctrl = $controls ? ' controls' : '';
84
  $tit = $title ? ' title="'.$title.'"' : '';
85
  $onc = $onclick ? ' onclick="'.$onclick.'"' : '';
86
  $cls = $class ? ' class="'.$class.'"' : '';
87
+ $style = $style ? trim( $style, '; ' ) : '';
88
  $play = $autoplay ? ' autoplay' : '';
89
 
90
  // See if there is a poster image
wppa-widget-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
- /* Version 8.0.08.006
6
  /*
7
  */
8
 
@@ -384,7 +384,7 @@ function wppa_widget_checkbox( $class, $item, $value, $label, $subtext = '', $di
384
  //
385
  // Typical usage:
386
  //
387
- // echo wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
388
  //
389
  function wppa_widget_input( $class, $item, $value, $label, $subtext = '' ) {
390
 
2
  /* wppa-widget-functions.php
3
  /* Package: wp-photo-album-plus
4
  /*
5
+ /* Version 8.1.00.008
6
  /*
7
  */
8
 
384
  //
385
  // Typical usage:
386
  //
387
+ // wppa_widget_input( $this, 'title', $instance['title'], __( 'Title', 'wp-photo-album-plus' ) );
388
  //
389
  function wppa_widget_input( $class, $item, $value, $label, $subtext = '' ) {
390
 
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 8.0.08.007
7
  *
8
  */
9
 
@@ -630,11 +630,6 @@ global $wpdb;
630
  if ( ! wppa_is_int( $id ) ) return false;
631
  if ( $id <= '0' ) return false;
632
 
633
- if ( ! in_array( $table, array( WPPA_ALBUMS, WPPA_PHOTOS, WPPA_COMMENTS, WPPA_RATING, WPPA_EXIF, WPPA_IPTC, WPPA_INDEX, WPPA_SESSION ) ) ) {
634
- echo 'Unexpected error in wppa_is_id_free()';
635
- exit();
636
- }
637
-
638
  $exists = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE id = %s", $id ), ARRAY_A );
639
  if ( $exists ) return false;
640
  return true;
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level wpdb routines that add new records
6
+ * Version 8.1.00.008
7
  *
8
  */
9
 
630
  if ( ! wppa_is_int( $id ) ) return false;
631
  if ( $id <= '0' ) return false;
632
 
 
 
 
 
 
633
  $exists = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE id = %s", $id ), ARRAY_A );
634
  if ( $exists ) return false;
635
  return true;
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 8.0.08.001
9
  *
10
  */
11
 
@@ -466,7 +466,8 @@ function wppa_put_contents( $path, $contents, $log = true ) {
466
  // Read an entire file
467
  function wppa_get_contents( $file ) {
468
 
469
- if ( ! wppa_is_path_safe( $file ) ) {
 
470
  wppa_log( 'Err', 'Unsafe path detected in wppa_get_contents(): ' . wppa_shortpath( $path ), true );
471
  return false;
472
  }
@@ -497,7 +498,7 @@ function wppa_get_contents_array( $path, $log = true ) {
497
  }
498
 
499
  // Utility to check if a given full filepath is safe to manipulate upon
500
- function wppa_is_path_safe( $path, $wp_content = false ) {
501
  global $wppa_lang;
502
  global $wppa_log_file;
503
 
@@ -508,10 +509,10 @@ global $wppa_log_file;
508
 
509
  // Safe protocols
510
  if ( strpos( strtolower( $path ), 'http://' ) === 0 ) {
511
- return true;
512
  }
513
  if ( strpos( strtolower( $path ), 'https://' ) === 0 ) {
514
- return true;
515
  }
516
 
517
  // During activation/setup
@@ -717,4 +718,158 @@ function wppa_filetime( $path, $log = true ) {
717
  }
718
 
719
  return filemtime( $path );
720
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 8.1.00.008
9
  *
10
  */
11
 
466
  // Read an entire file
467
  function wppa_get_contents( $file ) {
468
 
469
+ // May be inside wp-content, may not be remote
470
+ if ( ! wppa_is_path_safe( $file, true, false ) ) {
471
  wppa_log( 'Err', 'Unsafe path detected in wppa_get_contents(): ' . wppa_shortpath( $path ), true );
472
  return false;
473
  }
498
  }
499
 
500
  // Utility to check if a given full filepath is safe to manipulate upon
501
+ function wppa_is_path_safe( $path, $wp_content = false, $may_remote = true ) {
502
  global $wppa_lang;
503
  global $wppa_log_file;
504
 
509
 
510
  // Safe protocols
511
  if ( strpos( strtolower( $path ), 'http://' ) === 0 ) {
512
+ return $may_remote;
513
  }
514
  if ( strpos( strtolower( $path ), 'https://' ) === 0 ) {
515
+ return $may_remote;
516
  }
517
 
518
  // During activation/setup
718
  }
719
 
720
  return filemtime( $path );
721
+ }
722
+
723
+ function wppa_echo( $html, $a_tags = false, $a_prot = false ) {
724
+ static $allowed_tags;
725
+
726
+ if ( ! is_array( $allowed_tags ) ) {
727
+ $allowed_tags =
728
+ array(
729
+ 'a' => array(
730
+ 'href' => true,
731
+ 'target' => true,
732
+ 'title' => true,
733
+ 'id' => true,
734
+ 'onclick' => true,
735
+ 'style' => true,
736
+ ),
737
+ 'audio' => array(
738
+ 'id' => true,
739
+ 'data-from' => true,
740
+ 'controls' => true,
741
+ 'style' => true,
742
+ 'preload' => true,
743
+ 'type' => true,
744
+ ),
745
+ 'b' => array(),
746
+ 'br' => array(),
747
+ 'div' => array(
748
+ 'id' => true,
749
+ 'class' => true,
750
+ 'style' => true,
751
+ 'touch-action' => true,
752
+ ),
753
+ 'em' => array(),
754
+ 'form' => array(
755
+ 'id' => true,
756
+ 'class' => true,
757
+ 'onsubmit' => true,
758
+ ),
759
+ 'h1' => array(),
760
+ 'h2' => array(),
761
+ 'h3' => array(),
762
+ 'h4' => array(),
763
+ 'h5' => array(),
764
+ 'h6' => array(),
765
+ 'i' => array(),
766
+ 'img' => array(
767
+ 'id' => true,
768
+ 'alt' => true,
769
+ 'src' => true,
770
+ 'data-src' => true,
771
+ 'style' => true,
772
+ 'placeholder' => true,
773
+ 'srcset' => true,
774
+ ),
775
+ 'input' => array(
776
+ 'id' => true,
777
+ 'type' => true,
778
+ 'value' => true,
779
+ 'onclick' => true,
780
+ 'id' => true,
781
+ 'style' => true,
782
+ 'class' => true,
783
+ 'title' => true,
784
+ 'onchange' => true,
785
+ 'name' => true,
786
+ 'checked' => true,
787
+ ),
788
+ 'option' => array(
789
+ 'class' => true,
790
+ 'selected' =>true,
791
+ 'value' => true,
792
+ 'title' => true,
793
+ 'disabled' => true,
794
+ ),
795
+ 'p' => array(),
796
+ 'select' => array(
797
+ 'id' => true,
798
+ 'onchange' => true,
799
+ 'title' => true,
800
+ 'style' => true,
801
+ 'name' => true,
802
+ 'class' => true,
803
+ ),
804
+ 'small' => array(
805
+ 'style' => true,
806
+ ),
807
+ 'span' => array(
808
+ 'style' => true,
809
+ 'id' => true,
810
+ 'class' => true,
811
+ ),
812
+ 'strong' => array(),
813
+ 'table' => array(
814
+ 'id' => true,
815
+ 'class' => true,
816
+ 'style' => true,
817
+ ),
818
+ 'tbody' => array(),
819
+ 'textarea' => array(
820
+ 'id' => true,
821
+ 'style' => true,
822
+ 'onchange' => true,
823
+ 'name' => true,
824
+ ),
825
+ 'thead' => array(),
826
+ 'tr' => array(
827
+ 'id' => true,
828
+ 'style' => true,
829
+ 'class' => true,
830
+ ),
831
+ 'td' => array(
832
+ 'id' => true,
833
+ 'style' => true,
834
+ 'class' => true,
835
+ 'colspan' => true,
836
+ ),
837
+ 'title' => array(),
838
+ 'video' => array(
839
+ 'id' => true,
840
+ 'preload' => true,
841
+ 'style' => true,
842
+ 'type' => true,
843
+ 'controls' => true,
844
+ 'onmouseover' => true,
845
+ 'onmouseout' => true,
846
+ ),
847
+ 'source' => array(
848
+ 'src' => true,
849
+ 'type' => true,
850
+ ),
851
+ );
852
+ }
853
+
854
+ $t = $a_tags ? $a_tags : $allowed_tags;
855
+ $p = $a_prot ? $a_prot : wp_allowed_protocols();
856
+
857
+ /* Start debugging */
858
+ $before = str_replace( ['" >','"/>',' >',';"','&amp;'], ['">','" />','>','"','&'], wppa_compress_html( $html ) );
859
+ $after = wppa_compress_html( wp_kses( $html, $t, $p ) );
860
+ $after = str_replace( ['&amp;', ';"', ' &gt;'], ['&', '"', '>'], $after );
861
+ if ( $before != $after ) {
862
+ // wppa_dump( 'Before: ' . $before );
863
+ // wppa_dump( 'After: ' . $after );
864
+ }
865
+ /* End debugging */
866
+
867
+ echo wp_kses( $html, $t, $p );
868
+
869
+ }
870
+ add_filter( 'safe_style_css', function( $styles ) {
871
+ $styles[] = 'display';
872
+ $styles[] = 'float';
873
+ $styles[] = 'visibility';
874
+ return $styles;
875
+ } );
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: 8.0.10.006
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/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.0.10.006'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
@@ -150,8 +150,8 @@ define( 'WPPA_DEBUG', false );
150
  /* Declare init actions */
151
 
152
  /* START SESSION */
153
- add_action( 'init', 'wppa_session_start', 1 );
154
- add_action( 'admin_init', 'wppa_session_start', 1 );
155
 
156
  /* Init path and url constants */
157
  add_action( 'init', 'wppa_init_path_and_url_constants', 1 );
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: 8.1.00.008
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/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.1.00.008'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
150
  /* Declare init actions */
151
 
152
  /* START SESSION */
153
+ add_action( 'init', 'wppa_begin_session', 1 );
154
+ add_action( 'admin_init', 'wppa_begin_session', 1 );
155
 
156
  /* Init path and url constants */
157
  add_action( 'init', 'wppa_init_path_and_url_constants', 1 );