Version Description
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.7.10 |
Comparing to | |
See all releases |
Code changes from version 6.7.09 to 6.7.10
- js/wppa-tinymce-photo-front.js +331 -0
- js/wppa-tinymce-photo-front.min.js +1 -0
- js/wppa-tinymce-photo.js +5 -6
- js/wppa-tinymce-photo.min.js +1 -1
- readme.txt +13 -2
- wppa-ajax.php +6 -0
- wppa-functions.php +5 -5
- wppa-init.php +1 -0
- wppa-non-admin.php +40 -2
- wppa-settings-autosave.php +29 -1
- wppa-setup.php +2 -0
- wppa-slideshow.php +2 -2
- wppa-tinymce-common.php +406 -0
- wppa-tinymce-photo-front.php +75 -0
- wppa-tinymce-photo.php +7 -347
- wppa-tinymce-shortcodes.php +8 -8
- wppa.php +3 -3
js/wppa-tinymce-photo-front.js
ADDED
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* wppa-tinymce-photo.js
|
2 |
+
* Pachkage: wp-photo-album-plus
|
3 |
+
*
|
4 |
+
*
|
5 |
+
* Version 6.7.10
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
// Add the wppa button to the mce editor
|
10 |
+
tinymce.PluginManager.add('wppaphoto', function(editor, url) {
|
11 |
+
|
12 |
+
function openWppaPhotoShortcodeGenerator() {
|
13 |
+
|
14 |
+
|
15 |
+
var opt = {
|
16 |
+
modal: true,
|
17 |
+
resizable: true,
|
18 |
+
width: 720,
|
19 |
+
show: {
|
20 |
+
effect: "fadeIn",
|
21 |
+
duration: 400
|
22 |
+
},
|
23 |
+
closeText: "",
|
24 |
+
close: function(event,ui) {
|
25 |
+
|
26 |
+
if ( ! wppaMyPhotoSelection ) {
|
27 |
+
wppaMyPhotoSelection=true;
|
28 |
+
jQuery('#wppaphoto-allphoto-tr').hide();
|
29 |
+
jQuery('#wppaphoto-myphoto-tr').show();
|
30 |
+
jQuery('#wppaphoto-photo-preview').html('');
|
31 |
+
jQuery('.wppa-photo-select-item').prop('selected',false);
|
32 |
+
jQuery('.wppa-photo-select-item-first').prop('selected',true);
|
33 |
+
}
|
34 |
+
},
|
35 |
+
open: function(event,ui) {
|
36 |
+
wppaPhotoEvaluate();
|
37 |
+
}
|
38 |
+
};
|
39 |
+
|
40 |
+
jQuery( "#wppaphoto-form" ).dialog(opt).dialog( "open" );
|
41 |
+
|
42 |
+
jQuery( '.ui-widget-header' ).css( {
|
43 |
+
background: 'none',
|
44 |
+
});
|
45 |
+
|
46 |
+
jQuery( '.ui-dialog' ).css( {
|
47 |
+
boxShadow: '0px 0px 5px 5px #aaaaaa',
|
48 |
+
borderRadius: wppaBoxRadius+'px',
|
49 |
+
padding: '8px',
|
50 |
+
backgroundColor: wppaModalBgColor,
|
51 |
+
boxSizing: 'content-box',
|
52 |
+
zIndex: 100000,
|
53 |
+
});
|
54 |
+
|
55 |
+
jQuery( '.ui-dialog-titlebar' ).css( {
|
56 |
+
lineHeight: '0px',
|
57 |
+
height: '24px',
|
58 |
+
});
|
59 |
+
|
60 |
+
jQuery( '.ui-dialog-title' ).css( {
|
61 |
+
position: 'absolute',
|
62 |
+
top: '15px',
|
63 |
+
});
|
64 |
+
|
65 |
+
jQuery( '.ui-button' ).css( {
|
66 |
+
backgroundImage: wppaModalQuitImg,
|
67 |
+
padding: 0,
|
68 |
+
position: 'absolute',
|
69 |
+
right: '8px',
|
70 |
+
top: '8px',
|
71 |
+
width: '16px',
|
72 |
+
height: '16px',
|
73 |
+
});
|
74 |
+
|
75 |
+
jQuery( '.ui-button' ).attr( 'title', 'Close' );
|
76 |
+
|
77 |
+
jQuery( '.ui-icon-closethick' ).css( {
|
78 |
+
display: 'none',
|
79 |
+
});
|
80 |
+
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
editor.addButton('wppa_photo_button', {
|
85 |
+
image: wppaImageDirectory+'camera32.png',
|
86 |
+
tooltip: 'WPPA+ Insert photo',
|
87 |
+
onclick: openWppaPhotoShortcodeGenerator
|
88 |
+
});
|
89 |
+
|
90 |
+
});
|
91 |
+
|
92 |
+
// executes this when the DOM is ready
|
93 |
+
jQuery(function(){
|
94 |
+
|
95 |
+
// creates a form to be displayed everytime the button is clicked
|
96 |
+
var xmlhttp;
|
97 |
+
if ( window.XMLHttpRequest ) { // code for IE7+, Firefox, Chrome, Opera, Safari
|
98 |
+
xmlhttp = new XMLHttpRequest();
|
99 |
+
}
|
100 |
+
else { // code for IE6, IE5
|
101 |
+
xmlhttp=new ActiveXObject( "Microsoft.XMLHTTP" );
|
102 |
+
}
|
103 |
+
|
104 |
+
// wppa-ajax.php calls wppa_make_tinymce_dialog(); which is located in wppa-tinymce.php
|
105 |
+
var url = wppaAjaxUrl+'?action=wppa&wppa-action=tinymcephotodialogfront';
|
106 |
+
|
107 |
+
xmlhttp.onreadystatechange=function() {
|
108 |
+
if (xmlhttp.readyState == 4 && xmlhttp.status!=404 ) {
|
109 |
+
var formtext = xmlhttp.responseText;
|
110 |
+
|
111 |
+
var form = jQuery(formtext);
|
112 |
+
|
113 |
+
var table = form.find('table');
|
114 |
+
form.appendTo('body').hide();
|
115 |
+
|
116 |
+
// handles the click event of the submit button
|
117 |
+
form.find('#wppaphoto-submit').click(function(){
|
118 |
+
|
119 |
+
// Get the shortcode from the preview/edit box
|
120 |
+
newShortcode = jQuery( '#wppaphoto-shortcode-preview' ).val();
|
121 |
+
|
122 |
+
// Filter
|
123 |
+
newShortcode = newShortcode.replace(/"/g, '"');
|
124 |
+
|
125 |
+
// inserts the shortcode into the active editor
|
126 |
+
tinyMCE.activeEditor.execCommand('mceInsertContent', 0, newShortcode);
|
127 |
+
|
128 |
+
// Switch back to own photos only
|
129 |
+
if ( ! wppaMyPhotoSelection ) {
|
130 |
+
|
131 |
+
wppaMyPhotoSelection=true;
|
132 |
+
|
133 |
+
jQuery('#wppaphoto-allphoto-tr').hide();
|
134 |
+
jQuery('#wppaphoto-myphoto-tr').show();
|
135 |
+
jQuery('#wppaphoto-photo-preview').html('');
|
136 |
+
|
137 |
+
jQuery('.wppa-photo-select-item').prop('selected',false);
|
138 |
+
jQuery('.wppa-photo-select-item-first').prop('selected',true);
|
139 |
+
jQuery('#wppaphoto-myphoto').val('');
|
140 |
+
|
141 |
+
}
|
142 |
+
|
143 |
+
// closes Dialog box
|
144 |
+
jQuery( "#wppaphoto-form" ).dialog( "close" );
|
145 |
+
//tb_remove();
|
146 |
+
});
|
147 |
+
}
|
148 |
+
}
|
149 |
+
xmlhttp.open("GET",url,true);
|
150 |
+
xmlhttp.send();
|
151 |
+
|
152 |
+
});
|
153 |
+
|
154 |
+
var wppaMyPhotoSelection = true;
|
155 |
+
function wppaPhotoEvaluate() {
|
156 |
+
|
157 |
+
// Assume shortcode complete
|
158 |
+
var shortcodeOk = true;
|
159 |
+
var shortcode;
|
160 |
+
var myAll;
|
161 |
+
|
162 |
+
// Photo
|
163 |
+
if ( wppaMyPhotoSelection ) {
|
164 |
+
myAll = 'my';
|
165 |
+
}
|
166 |
+
else {
|
167 |
+
myAll = 'all';
|
168 |
+
}
|
169 |
+
photo = jQuery('#wppaphoto-'+myAll+'photo').val();
|
170 |
+
|
171 |
+
// Make shortcode
|
172 |
+
if ( ! wppaIsEmpty( photo ) ) {
|
173 |
+
|
174 |
+
// Output type
|
175 |
+
switch ( wppaOutputType ) {
|
176 |
+
|
177 |
+
// Shortcode
|
178 |
+
case 'shortcode':
|
179 |
+
id = photo.replace(/\//g,'');
|
180 |
+
id = id.split('.');
|
181 |
+
id = id[0];
|
182 |
+
shortcode = '[photo' + ' ' + id + ']';
|
183 |
+
break;
|
184 |
+
|
185 |
+
// HTML for a single image
|
186 |
+
case 'html':
|
187 |
+
if ( photo.indexOf('xxx') != -1 ) {
|
188 |
+
shortcode = 'Videos are not supported here';
|
189 |
+
}
|
190 |
+
else {
|
191 |
+
var temp = wppaShortcodeTemplateId;
|
192 |
+
var template = wppaShortcodeTemplate;
|
193 |
+
|
194 |
+
// Global replace template photo id by our photo id
|
195 |
+
shortcode = template.split(temp).join(photo);
|
196 |
+
}
|
197 |
+
break;
|
198 |
+
|
199 |
+
// IMG tag only
|
200 |
+
case 'img':
|
201 |
+
|
202 |
+
if ( photo.indexOf('xxx') != -1 ) {
|
203 |
+
var idv = photo.replace('xxx', '');
|
204 |
+
shortcode = '<video preload="metadata" style="width:100%;height:auto;" controls >'+
|
205 |
+
'<source src="'+wppaPhotoDirectory+idv+'mp4" type="video/mp4">'+
|
206 |
+
'<source src="'+wppaPhotoDirectory+idv+'ogg" type="video/ogg">'+
|
207 |
+
'<source src="'+wppaPhotoDirectory+idv+'ogv" type="video/ogg">'+
|
208 |
+
'<source src="'+wppaPhotoDirectory+idv+'webm" type="video/webm">'+
|
209 |
+
'</video>';
|
210 |
+
}
|
211 |
+
else {
|
212 |
+
shortcode = '<img src="' + wppaPhotoDirectory + photo + '" />';
|
213 |
+
}
|
214 |
+
break;
|
215 |
+
|
216 |
+
default:
|
217 |
+
|
218 |
+
shortcode = 'Unimplemented output type';
|
219 |
+
break;
|
220 |
+
}
|
221 |
+
|
222 |
+
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#070');
|
223 |
+
shortcode = shortcode.replace(/"/g, '"');
|
224 |
+
|
225 |
+
jQuery('#wppaphoto-photo-preview-tr').show();
|
226 |
+
wppaTinyMceBasicPhotoPreview( photo );
|
227 |
+
|
228 |
+
}
|
229 |
+
else {
|
230 |
+
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#700');
|
231 |
+
shortcode = '';
|
232 |
+
}
|
233 |
+
|
234 |
+
// Display shortcode
|
235 |
+
var html = '<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+shortcode+'" />';
|
236 |
+
jQuery( '#wppaphoto-shortcode-preview-container' ).html( html );
|
237 |
+
|
238 |
+
// Is shortcode complete?
|
239 |
+
shortcodeOk = ! wppaIsEmpty( photo );
|
240 |
+
|
241 |
+
// Display the right button
|
242 |
+
if ( shortcodeOk ) {
|
243 |
+
jQuery('#wppaphoto-submit').show();
|
244 |
+
jQuery('#wppaphoto-submit-notok').hide();
|
245 |
+
}
|
246 |
+
else {
|
247 |
+
jQuery('#wppaphoto-submit').hide();
|
248 |
+
jQuery('#wppaphoto-submit-notok').show();
|
249 |
+
}
|
250 |
+
}
|
251 |
+
|
252 |
+
function wppaTinyMceBasicPhotoPreview( id ) {
|
253 |
+
|
254 |
+
// Pre-clear
|
255 |
+
jQuery('#wppaphoto-photo-preview').html('');
|
256 |
+
|
257 |
+
// No preview for photo of the day
|
258 |
+
if ( id == '#potd' ) {
|
259 |
+
jQuery('#wppaphoto-photo-preview').html(wppaNoPreview); // No preview
|
260 |
+
}
|
261 |
+
|
262 |
+
// Video?
|
263 |
+
else if ( id.indexOf('xxx') != -1 ) {
|
264 |
+
var idv = id.replace('xxx', '');
|
265 |
+
jQuery('#wppaphoto-photo-preview').html('<video preload="metadata" style="max-width:400px; max-height:300px; margin-top:3px;" controls>'+
|
266 |
+
'<source src="'+wppaPhotoDirectory+idv+'mp4" type="video/mp4">'+
|
267 |
+
'<source src="'+wppaPhotoDirectory+idv+'ogg" type="video/ogg">'+
|
268 |
+
'<source src="'+wppaPhotoDirectory+idv+'ogv" type="video/ogg">'+
|
269 |
+
'<source src="'+wppaPhotoDirectory+idv+'webm" type="video/webm">'+
|
270 |
+
'</video>');
|
271 |
+
}
|
272 |
+
|
273 |
+
// Photo
|
274 |
+
else {
|
275 |
+
jQuery('#wppaphoto-photo-preview').html('<img src="'+wppaPhotoDirectory+id+'" style="max-width:400px; max-height:300px;" />');
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
function wppaDisplaySelectedFile(filetagid, displaytagid) {
|
280 |
+
|
281 |
+
var theFile = jQuery('#'+filetagid);
|
282 |
+
var result = theFile[0].files[0].name;
|
283 |
+
|
284 |
+
jQuery('#'+displaytagid).val('Upload '+result);
|
285 |
+
}
|
286 |
+
|
287 |
+
// Ajax upload script
|
288 |
+
jQuery(function() {
|
289 |
+
|
290 |
+
var options = {
|
291 |
+
beforeSend: function() {
|
292 |
+
jQuery("#progress").show();
|
293 |
+
jQuery("#bar").width('0%');
|
294 |
+
jQuery("#message").html("");
|
295 |
+
jQuery("#percent").html("");
|
296 |
+
},
|
297 |
+
uploadProgress: function(event, position, total, percentComplete) {
|
298 |
+
jQuery("#bar").width(percentComplete+'%');
|
299 |
+
if ( percentComplete < 95 ) {
|
300 |
+
jQuery("#percent").html(percentComplete+'%');
|
301 |
+
}
|
302 |
+
else {
|
303 |
+
jQuery("#percent").html(wppaTxtProcessing);
|
304 |
+
}
|
305 |
+
},
|
306 |
+
success: function() {
|
307 |
+
jQuery("#bar").width('100%');
|
308 |
+
jQuery("#percent").html(wppaTxtDone);
|
309 |
+
},
|
310 |
+
complete: function(response) {
|
311 |
+
|
312 |
+
var resparr = response.responseText.split( '||' );
|
313 |
+
|
314 |
+
// Non fatal error uploading?
|
315 |
+
if ( resparr.length == 1 ) {
|
316 |
+
jQuery("#message").html( '<span style="font-size: 10px;" >'+resparr[0]+'</span>' );
|
317 |
+
}
|
318 |
+
else {
|
319 |
+
jQuery( '#wppaphoto-myphoto' ).html( resparr[2] );
|
320 |
+
}
|
321 |
+
wppaPhotoEvaluate();
|
322 |
+
|
323 |
+
},
|
324 |
+
error: function() {
|
325 |
+
jQuery("#message").html( '<span style="color: red;" >'+wppaTxtErrUnable+'</span>' );
|
326 |
+
}
|
327 |
+
};
|
328 |
+
|
329 |
+
setTimeout(function(){jQuery("#wppa-uplform").ajaxForm(options);}, 1000);
|
330 |
+
|
331 |
+
});
|
js/wppa-tinymce-photo-front.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
function wppaPhotoEvaluate(){var o,e;if(e=wppaMyPhotoSelection?"my":"all",photo=jQuery("#wppaphoto-"+e+"photo").val(),wppaIsEmpty(photo))jQuery("#wppaphoto-"+e+"photo").css("color","#700"),o="";else{switch(wppaOutputType){case"shortcode":id=photo.replace(/\//g,""),id=id.split("."),id=id[0],o="[photo "+id+"]";break;case"html":if(-1!=photo.indexOf("xxx"))o="Videos are not supported here";else{var p=wppaShortcodeTemplateId;o=wppaShortcodeTemplate.split(p).join(photo)}break;case"img":if(-1!=photo.indexOf("xxx")){var t=photo.replace("xxx","");o='<video preload="metadata" style="width:100%;height:auto;" controls ><source src="'+wppaPhotoDirectory+t+'mp4" type="video/mp4"><source src="'+wppaPhotoDirectory+t+'ogg" type="video/ogg"><source src="'+wppaPhotoDirectory+t+'ogv" type="video/ogg"><source src="'+wppaPhotoDirectory+t+'webm" type="video/webm"></video>'}else o='<img src="'+wppaPhotoDirectory+photo+'" />';break;default:o="Unimplemented output type"}jQuery("#wppaphoto-"+e+"photo").css("color","#070"),o=o.replace(/"/g,"""),jQuery("#wppaphoto-photo-preview-tr").show(),wppaTinyMceBasicPhotoPreview(photo)}var r='<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+o+'" />';jQuery("#wppaphoto-shortcode-preview-container").html(r),!wppaIsEmpty(photo)?(jQuery("#wppaphoto-submit").show(),jQuery("#wppaphoto-submit-notok").hide()):(jQuery("#wppaphoto-submit").hide(),jQuery("#wppaphoto-submit-notok").show())}function wppaTinyMceBasicPhotoPreview(o){if(jQuery("#wppaphoto-photo-preview").html(""),"#potd"==o)jQuery("#wppaphoto-photo-preview").html(wppaNoPreview);else if(-1!=o.indexOf("xxx")){var e=o.replace("xxx","");jQuery("#wppaphoto-photo-preview").html('<video preload="metadata" style="max-width:400px; max-height:300px; margin-top:3px;" controls><source src="'+wppaPhotoDirectory+e+'mp4" type="video/mp4"><source src="'+wppaPhotoDirectory+e+'ogg" type="video/ogg"><source src="'+wppaPhotoDirectory+e+'ogv" type="video/ogg"><source src="'+wppaPhotoDirectory+e+'webm" type="video/webm"></video>')}else jQuery("#wppaphoto-photo-preview").html('<img src="'+wppaPhotoDirectory+o+'" style="max-width:400px; max-height:300px;" />')}function wppaDisplaySelectedFile(o,e){var p=jQuery("#"+o)[0].files[0].name;jQuery("#"+e).val("Upload "+p)}tinymce.PluginManager.add("wppaphoto",function(o,e){o.addButton("wppa_photo_button",{image:wppaImageDirectory+"camera32.png",tooltip:"WPPA+ Insert photo",onclick:function(){var o={modal:!0,resizable:!0,width:720,show:{effect:"fadeIn",duration:400},closeText:"",close:function(o,e){wppaMyPhotoSelection||(wppaMyPhotoSelection=!0,jQuery("#wppaphoto-allphoto-tr").hide(),jQuery("#wppaphoto-myphoto-tr").show(),jQuery("#wppaphoto-photo-preview").html(""),jQuery(".wppa-photo-select-item").prop("selected",!1),jQuery(".wppa-photo-select-item-first").prop("selected",!0))},open:function(o,e){wppaPhotoEvaluate()}};jQuery("#wppaphoto-form").dialog(o).dialog("open"),jQuery(".ui-widget-header").css({background:"none"}),jQuery(".ui-dialog").css({boxShadow:"0px 0px 5px 5px #aaaaaa",borderRadius:wppaBoxRadius+"px",padding:"8px",backgroundColor:wppaModalBgColor,boxSizing:"content-box",zIndex:1e5}),jQuery(".ui-dialog-titlebar").css({lineHeight:"0px",height:"24px"}),jQuery(".ui-dialog-title").css({position:"absolute",top:"15px"}),jQuery(".ui-button").css({backgroundImage:wppaModalQuitImg,padding:0,position:"absolute",right:"8px",top:"8px",width:"16px",height:"16px"}),jQuery(".ui-button").attr("title","Close"),jQuery(".ui-icon-closethick").css({display:"none"})}})}),jQuery(function(){var o;o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");var e=wppaAjaxUrl+"?action=wppa&wppa-action=tinymcephotodialogfront";o.onreadystatechange=function(){if(4==o.readyState&&404!=o.status){var e=o.responseText,p=jQuery(e);p.find("table");p.appendTo("body").hide(),p.find("#wppaphoto-submit").click(function(){newShortcode=jQuery("#wppaphoto-shortcode-preview").val(),newShortcode=newShortcode.replace(/"/g,'"'),tinyMCE.activeEditor.execCommand("mceInsertContent",0,newShortcode),wppaMyPhotoSelection||(wppaMyPhotoSelection=!0,jQuery("#wppaphoto-allphoto-tr").hide(),jQuery("#wppaphoto-myphoto-tr").show(),jQuery("#wppaphoto-photo-preview").html(""),jQuery(".wppa-photo-select-item").prop("selected",!1),jQuery(".wppa-photo-select-item-first").prop("selected",!0),jQuery("#wppaphoto-myphoto").val("")),jQuery("#wppaphoto-form").dialog("close")})}},o.open("GET",e,!0),o.send()});var wppaMyPhotoSelection=!0;jQuery(function(){var o={beforeSend:function(){jQuery("#progress").show(),jQuery("#bar").width("0%"),jQuery("#message").html(""),jQuery("#percent").html("")},uploadProgress:function(o,e,p,t){jQuery("#bar").width(t+"%"),t<95?jQuery("#percent").html(t+"%"):jQuery("#percent").html(wppaTxtProcessing)},success:function(){jQuery("#bar").width("100%"),jQuery("#percent").html(wppaTxtDone)},complete:function(o){var e=o.responseText.split("||");1==e.length?jQuery("#message").html('<span style="font-size: 10px;" >'+e[0]+"</span>"):jQuery("#wppaphoto-myphoto").html(e[2]),wppaPhotoEvaluate()},error:function(){jQuery("#message").html('<span style="color: red;" >'+wppaTxtErrUnable+"</span>")}};setTimeout(function(){jQuery("#wppa-uplform").ajaxForm(o)},1e3)});
|
js/wppa-tinymce-photo.js
CHANGED
@@ -16,6 +16,7 @@ tinymce.PluginManager.add('wppaphoto', function(editor, url) {
|
|
16 |
H = jQuery(window).height();
|
17 |
H = H - 120;
|
18 |
tb_show( 'WPPA+ Insert photo', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=wppaphoto-form' );
|
|
|
19 |
}
|
20 |
|
21 |
editor.addButton('wppa_photo_button', {
|
@@ -82,7 +83,7 @@ function wppaPhotoEvaluate() {
|
|
82 |
|
83 |
// Assume shortcode complete
|
84 |
var shortcodeOk = true;
|
85 |
-
var shortcode
|
86 |
var myAll;
|
87 |
|
88 |
// Photo
|
@@ -100,16 +101,14 @@ function wppaPhotoEvaluate() {
|
|
100 |
id = id[0];
|
101 |
jQuery('#wppaphoto-photo-preview-tr').show();
|
102 |
wppaTinyMceBasicPhotoPreview( photo );
|
103 |
-
shortcode += ' '+id;
|
104 |
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#070');
|
|
|
105 |
}
|
106 |
else {
|
107 |
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#700');
|
|
|
108 |
}
|
109 |
|
110 |
-
// Close
|
111 |
-
shortcode += ']';
|
112 |
-
|
113 |
// Display shortcode
|
114 |
shortcode = shortcode.replace(/"/g, '"');
|
115 |
var html = '<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+shortcode+'" />';
|
@@ -198,6 +197,6 @@ jQuery(function() {
|
|
198 |
}
|
199 |
};
|
200 |
|
201 |
-
setTimeout(function(){jQuery("#wppa-uplform").ajaxForm(options)}, 1000);
|
202 |
|
203 |
});
|
16 |
H = jQuery(window).height();
|
17 |
H = H - 120;
|
18 |
tb_show( 'WPPA+ Insert photo', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=wppaphoto-form' );
|
19 |
+
wppaPhotoEvaluate();
|
20 |
}
|
21 |
|
22 |
editor.addButton('wppa_photo_button', {
|
83 |
|
84 |
// Assume shortcode complete
|
85 |
var shortcodeOk = true;
|
86 |
+
var shortcode;
|
87 |
var myAll;
|
88 |
|
89 |
// Photo
|
101 |
id = id[0];
|
102 |
jQuery('#wppaphoto-photo-preview-tr').show();
|
103 |
wppaTinyMceBasicPhotoPreview( photo );
|
|
|
104 |
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#070');
|
105 |
+
shortcode = '[photo ' + id + ']';
|
106 |
}
|
107 |
else {
|
108 |
jQuery('#wppaphoto-'+myAll+'photo').css('color', '#700');
|
109 |
+
shortcode = '';
|
110 |
}
|
111 |
|
|
|
|
|
|
|
112 |
// Display shortcode
|
113 |
shortcode = shortcode.replace(/"/g, '"');
|
114 |
var html = '<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+shortcode+'" />';
|
197 |
}
|
198 |
};
|
199 |
|
200 |
+
setTimeout(function(){jQuery("#wppa-uplform").ajaxForm(options);}, 1000);
|
201 |
|
202 |
});
|
js/wppa-tinymce-photo.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function wppaPhotoEvaluate(){var o,e
|
1 |
+
function wppaPhotoEvaluate(){var o,e;e=wppaMyPhotoSelection?"my":"all",photo=jQuery("#wppaphoto-"+e+"photo").val(),wppaIsEmpty(photo)?(jQuery("#wppaphoto-"+e+"photo").css("color","#700"),o=""):(id=photo.replace(/\//g,""),id=id.split("."),id=id[0],jQuery("#wppaphoto-photo-preview-tr").show(),wppaTinyMceBasicPhotoPreview(photo),jQuery("#wppaphoto-"+e+"photo").css("color","#070"),o="[photo "+id+"]");var t='<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="'+(o=o.replace(/"/g,"""))+'" />';jQuery("#wppaphoto-shortcode-preview-container").html(t),!wppaIsEmpty(photo)?(jQuery("#wppaphoto-submit").show(),jQuery("#wppaphoto-submit-notok").hide()):(jQuery("#wppaphoto-submit").hide(),jQuery("#wppaphoto-submit-notok").show())}function wppaTinyMceBasicPhotoPreview(o){if("#potd"==o)jQuery("#wppaphoto-photo-preview").html(wppaNoPreview);else if(-1!=o.indexOf("xxx")){var e=o.replace("xxx","");jQuery("#wppaphoto-photo-preview").html('<video preload="metadata" style="max-width:400px; max-height:300px; margin-top:3px;" controls><source src="'+wppaPhotoDirectory+e+'mp4" type="video/mp4"><source src="'+wppaPhotoDirectory+e+'ogg" type="video/ogg"><source src="'+wppaPhotoDirectory+e+'ogv" type="video/ogg"><source src="'+wppaPhotoDirectory+e+'webm" type="video/webm"></video>')}else jQuery("#wppaphoto-photo-preview").html('<img src="'+wppaPhotoDirectory+o+'" style="max-width:400px; max-height:300px;" />')}function wppaDisplaySelectedFile(o,e){var t=jQuery("#"+o)[0].files[0].name;jQuery("#"+e).val("Upload "+t)}tinymce.PluginManager.add("wppaphoto",function(o,e){o.addButton("wppa_photo_button",{image:wppaImageDirectory+"camera32.png",tooltip:"WPPA+ Insert photo",onclick:function(){var o=jQuery(window).width(),e=jQuery(window).height(),t=720<o?720:o;t-=80,e=jQuery(window).height(),e-=120,tb_show("WPPA+ Insert photo","#TB_inline?width="+t+"&height="+e+"&inlineId=wppaphoto-form"),wppaPhotoEvaluate()}})}),jQuery(function(){var o;o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");var e=wppaAjaxUrl+"?action=wppa&wppa-action=tinymcephotodialog";o.open("GET",e,!0),o.send(),o.onreadystatechange=function(){if(4==o.readyState&&404!=o.status){var e=o.responseText,t=jQuery(e);t.find("table");t.appendTo("body").hide(),t.find("#wppaphoto-submit").click(function(){newShortcode=jQuery("#wppaphoto-shortcode-preview").val(),newShortcode=newShortcode.replace(/"/g,'"'),tinyMCE.activeEditor.execCommand("mceInsertContent",0,newShortcode),wppaMyPhotoSelection=!0,jQuery("#wppaphoto-allphoto-tr").hide(),jQuery("#wppaphoto-myphoto-tr").show(),jQuery("#wppaphoto-photo-preview").html(""),tb_remove()})}}});var wppaMyPhotoSelection=!0;jQuery(function(){var o={beforeSend:function(){jQuery("#progress").show(),jQuery("#bar").width("0%"),jQuery("#message").html(""),jQuery("#percent").html("")},uploadProgress:function(o,e,t,p){jQuery("#bar").width(p+"%"),p<95?jQuery("#percent").html(p+"%"):jQuery("#percent").html(wppaTxtProcessing)},success:function(){jQuery("#bar").width("100%"),jQuery("#percent").html(wppaTxtDone)},complete:function(o){var e=o.responseText.split("||");1==e.length?jQuery("#message").html('<span style="font-size: 10px;" >'+e[0]+"</span>"):jQuery("#wppaphoto-myphoto").html(e[2]),wppaPhotoEvaluate()},error:function(){jQuery("#message").html('<span style="color: red;" >'+wppaTxtErrUnable+"</span>")}};setTimeout(function(){jQuery("#wppa-uplform").ajaxForm(o)},1e3)});
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.7.
|
6 |
-
Stable tag: 6.7.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -127,6 +127,17 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
= 6.7.09 =
|
131 |
|
132 |
= Bug Fixes =
|
2 |
Contributors: opajaap
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.7.10
|
6 |
+
Stable tag: 6.7.09
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
127 |
|
128 |
See for additional information: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
129 |
|
130 |
+
= 6.7.10 =
|
131 |
+
|
132 |
+
= Bug Fixes =
|
133 |
+
|
134 |
+
* Various minor fixes for PHP 7.1 compatibility.
|
135 |
+
|
136 |
+
= New Features =
|
137 |
+
|
138 |
+
* The shortcodeenerator for shortcode [photo xxx] is now also available for front-end tinymce editors.
|
139 |
+
See https://wppa.nl/docs-by-subject/advanced-topics/shortcode-photo/ for an explanation.
|
140 |
+
|
141 |
= 6.7.09 =
|
142 |
|
143 |
= Bug Fixes =
|
wppa-ajax.php
CHANGED
@@ -667,6 +667,12 @@ global $wppa_log_file;
|
|
667 |
wppa_exit();
|
668 |
break;
|
669 |
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
case 'bumpviewcount':
|
671 |
$nonce = $_REQUEST['wppa-nonce'];
|
672 |
if ( wp_verify_nonce( $nonce, 'wppa-check' ) ) {
|
667 |
wppa_exit();
|
668 |
break;
|
669 |
|
670 |
+
case 'tinymcephotodialogfront':
|
671 |
+
$result = wppa_make_tinymce_photo_dialog( 'front' );
|
672 |
+
echo $result;
|
673 |
+
wppa_exit();
|
674 |
+
break;
|
675 |
+
|
676 |
case 'bumpviewcount':
|
677 |
$nonce = $_REQUEST['wppa-nonce'];
|
678 |
if ( wp_verify_nonce( $nonce, 'wppa-check' ) ) {
|
wppa-functions.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -3403,7 +3403,7 @@ global $blog_id;
|
|
3403 |
wppa_add_js_page_data( "\n" . 'wppaFullFrameDelta['.wppa( 'mocc' ).'] = '.$delta.';' );
|
3404 |
|
3405 |
// last minute change: script %%size != default colwidth
|
3406 |
-
$temp = wppa_get_container_width() - ( 2*6 + 2*36 + 2*wppa_opt( 'bwidth' ) );
|
3407 |
if ( wppa_in_widget() ) $temp = wppa_get_container_width() - ( 2*6 + 2*18 + 2*wppa_opt( 'bwidth' ) );
|
3408 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripLength['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3409 |
|
@@ -3414,7 +3414,7 @@ global $blog_id;
|
|
3414 |
$temp = wppa_opt( 'tn_margin' ) / 2;
|
3415 |
if ( wppa_in_widget() ) $temp /= 2;
|
3416 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripMargin['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3417 |
-
$temp = 2*6 + 2*42 + 2*wppa_opt( 'bwidth' );
|
3418 |
if ( wppa_in_widget() ) $temp = 2*6 + 2*21 + 2*wppa_opt( 'bwidth' );
|
3419 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripAreaDelta['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3420 |
$temp = wppa_get_preambule();
|
@@ -3807,7 +3807,7 @@ function wppa_get_cover_width( $type, $numeric = false ) {
|
|
3807 |
if ( $numeric ) {
|
3808 |
$result = str_replace( 'width:', '', $result );
|
3809 |
if ( strpos( $result, '%' ) ) {
|
3810 |
-
$result = str_replace( '%', '', $result );
|
3811 |
$result = $result * wppa_opt( 'initial_colwidth' ) / '100';
|
3812 |
}
|
3813 |
else {
|
@@ -3908,7 +3908,7 @@ function wppa_get_text_frame_style( $photo_left, $type ) {
|
|
3908 |
function wppa_get_textframe_delta() {
|
3909 |
|
3910 |
$delta = wppa_opt( 'smallsize' );
|
3911 |
-
$delta += ( 2 * ( 7 + wppa_opt( 'bwidth' ) + 4 ) + 5 + 2 ); // 2 * ( padding + border + photopadding ) + margin
|
3912 |
return $delta;
|
3913 |
}
|
3914 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Various functions
|
6 |
+
* Version 6.7.10
|
7 |
*
|
8 |
*/
|
9 |
|
3403 |
wppa_add_js_page_data( "\n" . 'wppaFullFrameDelta['.wppa( 'mocc' ).'] = '.$delta.';' );
|
3404 |
|
3405 |
// last minute change: script %%size != default colwidth
|
3406 |
+
$temp = wppa_get_container_width() - ( 2*6 + 2*36 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 ) );
|
3407 |
if ( wppa_in_widget() ) $temp = wppa_get_container_width() - ( 2*6 + 2*18 + 2*wppa_opt( 'bwidth' ) );
|
3408 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripLength['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3409 |
|
3414 |
$temp = wppa_opt( 'tn_margin' ) / 2;
|
3415 |
if ( wppa_in_widget() ) $temp /= 2;
|
3416 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripMargin['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3417 |
+
$temp = 2*6 + 2*42 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 );
|
3418 |
if ( wppa_in_widget() ) $temp = 2*6 + 2*21 + 2*wppa_opt( 'bwidth' );
|
3419 |
wppa_add_js_page_data( "\n" . 'wppaFilmStripAreaDelta['.wppa( 'mocc' ).'] = '.$temp.';' );
|
3420 |
$temp = wppa_get_preambule();
|
3807 |
if ( $numeric ) {
|
3808 |
$result = str_replace( 'width:', '', $result );
|
3809 |
if ( strpos( $result, '%' ) ) {
|
3810 |
+
$result = str_replace( array( '%', ';'), '', $result );
|
3811 |
$result = $result * wppa_opt( 'initial_colwidth' ) / '100';
|
3812 |
}
|
3813 |
else {
|
3908 |
function wppa_get_textframe_delta() {
|
3909 |
|
3910 |
$delta = wppa_opt( 'smallsize' );
|
3911 |
+
$delta += ( 2 * ( 7 + ( wppa_opt( 'bwidth' ) ? wppa_opt( 'bwidth' ) : 0 ) + 4 ) + 5 + 2 ); // 2 * ( padding + border + photopadding ) + margin
|
3912 |
return $delta;
|
3913 |
}
|
3914 |
|
wppa-init.php
CHANGED
@@ -53,6 +53,7 @@ require_once 'wppa-encrypt.php';
|
|
53 |
require_once 'wppa-photo-files.php';
|
54 |
require_once 'wppa-cron.php';
|
55 |
require_once 'wppa-maintenance.php';
|
|
|
56 |
|
57 |
/* Load cloudinary if configured and php version >= 5.3 */
|
58 |
if ( PHP_VERSION_ID >= 50300 ) require_once 'wppa-cloudinary.php';
|
53 |
require_once 'wppa-photo-files.php';
|
54 |
require_once 'wppa-cron.php';
|
55 |
require_once 'wppa-maintenance.php';
|
56 |
+
require_once 'wppa-tinymce-common.php';
|
57 |
|
58 |
/* Load cloudinary if configured and php version >= 5.3 */
|
59 |
if ( PHP_VERSION_ID >= 50300 ) require_once 'wppa-cloudinary.php';
|
wppa-non-admin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -21,6 +21,7 @@ require_once 'wppa-styles.php';
|
|
21 |
require_once 'wppa-cart.php';
|
22 |
require_once 'wppa-thumbnails.php';
|
23 |
require_once 'wppa-picture.php';
|
|
|
24 |
|
25 |
/* LOAD STYLESHEET */
|
26 |
add_action('wp_enqueue_scripts', 'wppa_add_style');
|
@@ -292,7 +293,7 @@ global $wppa_opt;
|
|
292 |
);
|
293 |
|
294 |
$js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
|
295 |
-
if ( wppa_switch( 'ajax_render_modal' ) || wppa_opt( 'upload_edit' ) == 'new' ) {
|
296 |
$js_dept1[] = 'jquery-ui-dialog';
|
297 |
}
|
298 |
|
@@ -973,6 +974,43 @@ function wppa_set_shortcode_priority() {
|
|
973 |
}
|
974 |
}
|
975 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
976 |
// This function contains strings for i18n from files not included
|
977 |
// in the search for frontend required translatable strings
|
978 |
// Mainly from widgets
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the non admin stuff
|
6 |
+
* Version 6.7.10
|
7 |
*
|
8 |
*/
|
9 |
|
21 |
require_once 'wppa-cart.php';
|
22 |
require_once 'wppa-thumbnails.php';
|
23 |
require_once 'wppa-picture.php';
|
24 |
+
require_once 'wppa-tinymce-photo-front.php';
|
25 |
|
26 |
/* LOAD STYLESHEET */
|
27 |
add_action('wp_enqueue_scripts', 'wppa_add_style');
|
293 |
);
|
294 |
|
295 |
$js_dept1 = array( 'jquery', 'jquery-form', 'wppa-utils' );
|
296 |
+
if ( wppa_switch( 'ajax_render_modal' ) || wppa_opt( 'upload_edit' ) == 'new' || wppa_switch( 'photo_shortcode_enabled' ) ) {
|
297 |
$js_dept1[] = 'jquery-ui-dialog';
|
298 |
}
|
299 |
|
974 |
}
|
975 |
}
|
976 |
|
977 |
+
|
978 |
+
/* We use bbPress */
|
979 |
+
// editor bbpress in tinymce mode
|
980 |
+
function wppa_enable_visual_editor_in_bbpress( $args = array() ) {
|
981 |
+
|
982 |
+
if ( wppa_switch( 'photo_on_bbpress' ) ) {
|
983 |
+
$args['tinymce'] = true;
|
984 |
+
$args['teeny'] = false;
|
985 |
+
}
|
986 |
+
return $args;
|
987 |
+
}
|
988 |
+
add_filter( 'bbp_after_get_the_content_parse_args', 'wppa_enable_visual_editor_in_bbpress' );
|
989 |
+
|
990 |
+
// remove insert wp image button
|
991 |
+
function wppa_remove_image_button_in_bbpress( $buttons ) {
|
992 |
+
|
993 |
+
if ( wppa_switch( 'photo_on_bbpress' ) ) {
|
994 |
+
if ( ( $key = array_search( 'image', $buttons ) ) !== false ) {
|
995 |
+
unset( $buttons[$key] );
|
996 |
+
}
|
997 |
+
}
|
998 |
+
return $buttons ;
|
999 |
+
}
|
1000 |
+
add_filter( 'bbp_get_teeny_mce_buttons', 'rew_remove_image_button_in_bbpress' );
|
1001 |
+
|
1002 |
+
// enable processing shortcodes
|
1003 |
+
function wppa_enable_shortcodes_in_bbpress( $content ) {
|
1004 |
+
|
1005 |
+
if ( wppa_switch( 'photo_on_bbpress' ) ) {
|
1006 |
+
$content = do_shortcode( $content );
|
1007 |
+
}
|
1008 |
+
return $content;
|
1009 |
+
}
|
1010 |
+
add_filter( 'bbp_get_topic_content', 'wppa_enable_shortcodes_in_bbpress', 1000 );
|
1011 |
+
add_filter( 'bbp_get_reply_content', 'wppa_enable_shortcodes_in_bbpress', 1000 );
|
1012 |
+
|
1013 |
+
|
1014 |
// This function contains strings for i18n from files not included
|
1015 |
// in the search for frontend required translatable strings
|
1016 |
// Mainly from widgets
|
wppa-settings-autosave.php
CHANGED
@@ -9663,6 +9663,15 @@ global $wp_version;
|
|
9663 |
$clas = '';
|
9664 |
$tags = 'system';
|
9665 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9666 |
|
9667 |
}
|
9668 |
wppa_setting_subheader( 'K', '1', __('External services related settings and actions.', 'wp-photo-album-plus'));
|
@@ -10018,7 +10027,26 @@ global $wp_version;
|
|
10018 |
$tags = 'system';
|
10019 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
10020 |
|
10021 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10022 |
}
|
10023 |
?>
|
10024 |
|
9663 |
$clas = '';
|
9664 |
$tags = 'system';
|
9665 |
wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags);
|
9666 |
+
|
9667 |
+
$name = __('Shortcode [photo nnn] on bbPress', 'wp-photo-album-plus');
|
9668 |
+
$desc = __('Enable the [photo] shortcode generator on bbPress frontend editors', 'wp-photo-album-plus');
|
9669 |
+
$help = '';
|
9670 |
+
$slug = 'wppa_photo_on_bbpress';
|
9671 |
+
$html = wppa_checkbox($slug);
|
9672 |
+
$clas = '';
|
9673 |
+
$tags = 'system';
|
9674 |
+
wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags);
|
9675 |
|
9676 |
}
|
9677 |
wppa_setting_subheader( 'K', '1', __('External services related settings and actions.', 'wp-photo-album-plus'));
|
10027 |
$tags = 'system';
|
10028 |
wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags);
|
10029 |
|
10030 |
+
$name = __('Fe type', 'wp-photo-album-plus');
|
10031 |
+
$desc = __('Frontend editor shortcode generator output type', 'wp-photo-album-plus');
|
10032 |
+
$help = esc_js( __( 'If you want to use the shortcode generator in frontend tinymce editors, select if you want the shortcode or the html to be entered in the post'));
|
10033 |
+
$help .= '\n\n'.esc_js('Select \'html\' if the inserted shortcode not is converted to the photo', 'wp-photo-album-plus');
|
10034 |
+
$slug = 'wppa_photo_shortcode_fe_type';
|
10035 |
+
$opts = array( __('--- none ---', 'wp-photo-album-plus'),
|
10036 |
+
__('shortcode', 'wp-photo-album-plus'),
|
10037 |
+
__('html', 'wp-photo-album-plus'),
|
10038 |
+
__('img tag', 'wp-photo-album-plus'),
|
10039 |
+
);
|
10040 |
+
$vals = array( '-none-',
|
10041 |
+
'shortcode',
|
10042 |
+
'html',
|
10043 |
+
'img',
|
10044 |
+
);
|
10045 |
+
$html = wppa_select($slug, $opts, $vals);
|
10046 |
+
$clas = '';
|
10047 |
+
$tags = 'system';
|
10048 |
+
wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags);
|
10049 |
+
|
10050 |
}
|
10051 |
?>
|
10052 |
|
wppa-setup.php
CHANGED
@@ -1723,6 +1723,7 @@ Hide Camera info
|
|
1723 |
'wppa_cp_points_upload' => '0',
|
1724 |
'wppa_use_scabn' => 'no',
|
1725 |
'wppa_use_CMTooltipGlossary' => 'no',
|
|
|
1726 |
|
1727 |
// K External services
|
1728 |
'wppa_cdn_service' => '',
|
@@ -1749,6 +1750,7 @@ Hide Camera info
|
|
1749 |
'wppa_photo_shortcode_type' => 'mphoto',
|
1750 |
'wppa_photo_shortcode_size' => '350',
|
1751 |
'wppa_photo_shortcode_align' => 'center',
|
|
|
1752 |
|
1753 |
// Photo of the day widget
|
1754 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
1723 |
'wppa_cp_points_upload' => '0',
|
1724 |
'wppa_use_scabn' => 'no',
|
1725 |
'wppa_use_CMTooltipGlossary' => 'no',
|
1726 |
+
'wppa_photo_on_bbpress' => 'no',
|
1727 |
|
1728 |
// K External services
|
1729 |
'wppa_cdn_service' => '',
|
1750 |
'wppa_photo_shortcode_type' => 'mphoto',
|
1751 |
'wppa_photo_shortcode_size' => '350',
|
1752 |
'wppa_photo_shortcode_align' => 'center',
|
1753 |
+
'wppa_photo_shortcode_fe_type' => '-none-',
|
1754 |
|
1755 |
// Photo of the day widget
|
1756 |
'wppa_potd_title' => __('Photo of the day', 'wp-photo-album-plus'),
|
wppa-slideshow.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
-
* Version 6.7.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -1313,7 +1313,7 @@ function wppa_slide_filmstrip( $opt = '' ) {
|
|
1313 |
|
1314 |
$conw = wppa_get_container_width();
|
1315 |
if ( $conw < 1 ) $conw *= 640;
|
1316 |
-
$w = $conw - ( 2*6 + 2*42 + 2*wppa_opt( 'bwidth' ) ); /* 2*padding + 2*arrows + 2*border */
|
1317 |
if ( wppa_in_widget() ) $w = $conw - ( 2*6 + 2*21 + 2*wppa_opt( 'bwidth' ) ); /* 2*padding + 2*arrow + 2*border */
|
1318 |
$IE6 = 'width: '.$w.'px;';
|
1319 |
$pagsiz = round( $w / ( wppa_opt( 'film_thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all the slideshow high level functions
|
6 |
+
* Version 6.7.10
|
7 |
*
|
8 |
*/
|
9 |
|
1313 |
|
1314 |
$conw = wppa_get_container_width();
|
1315 |
if ( $conw < 1 ) $conw *= 640;
|
1316 |
+
$w = $conw - ( 2*6 + 2*42 + ( wppa_opt( 'bwidth' ) ? 2*wppa_opt( 'bwidth' ) : 0 ) ); /* 2*padding + 2*arrows + 2*border */
|
1317 |
if ( wppa_in_widget() ) $w = $conw - ( 2*6 + 2*21 + 2*wppa_opt( 'bwidth' ) ); /* 2*padding + 2*arrow + 2*border */
|
1318 |
$IE6 = 'width: '.$w.'px;';
|
1319 |
$pagsiz = round( $w / ( wppa_opt( 'film_thumbsize' ) + wppa_opt( 'tn_margin' ) ) );
|
wppa-tinymce-common.php
ADDED
@@ -0,0 +1,406 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* wppa-tinymce-common.php
|
3 |
+
* Pachkage: wp-photo-album-plus
|
4 |
+
*
|
5 |
+
* Version 6.7.10
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
function wppa_make_tinymce_photo_dialog( $front = false ) {
|
10 |
+
global $wpdb;
|
11 |
+
|
12 |
+
// Prepare albuminfo
|
13 |
+
$albums = $wpdb->get_results( "SELECT `id`, `name` " .
|
14 |
+
"FROM `" . WPPA_ALBUMS . "` " .
|
15 |
+
"WHERE `owner` = '" . wppa_get_user() . "' " .
|
16 |
+
"OR `owner` = '--- public ---' " .
|
17 |
+
"ORDER BY `name` ",
|
18 |
+
ARRAY_A );
|
19 |
+
|
20 |
+
// Make the html
|
21 |
+
// Open wrapper
|
22 |
+
$result =
|
23 |
+
'<div id="wppaphoto-form" title="' . esc_attr( __( 'Insert photo', 'wp-photo-album-plus' ) ) . '" >';
|
24 |
+
|
25 |
+
// Front/back end dependant css
|
26 |
+
if ( $front ) {
|
27 |
+
$result .= '
|
28 |
+
<style>
|
29 |
+
#wppaphoto-table {
|
30 |
+
box-sizing:border-box; width:100% !important;
|
31 |
+
}
|
32 |
+
.wppa-bar {
|
33 |
+
background-color: #7f7;
|
34 |
+
width:0%;
|
35 |
+
height:18px;
|
36 |
+
border-radius: 3px;
|
37 |
+
line-height: 18px;
|
38 |
+
margin: 0;
|
39 |
+
}
|
40 |
+
.wppa-percent {
|
41 |
+
position:relative;
|
42 |
+
display:inline-block;
|
43 |
+
top:-19px;
|
44 |
+
font-size: 12px;
|
45 |
+
line-height: 18px;
|
46 |
+
margin: 0;
|
47 |
+
}
|
48 |
+
.wppa-message {
|
49 |
+
clear: both;
|
50 |
+
}
|
51 |
+
#wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
|
52 |
+
padding: 2px; 0;
|
53 |
+
}
|
54 |
+
#wppaphoto-table th {
|
55 |
+
width:200px;
|
56 |
+
}
|
57 |
+
#wppaphoto-table input {
|
58 |
+
padding:4px;
|
59 |
+
}
|
60 |
+
#wppaphoto-table th, #wppaphoto-table td {
|
61 |
+
border:none;
|
62 |
+
}
|
63 |
+
#wppaphoto-shortcode-preview-container {
|
64 |
+
width:500px !important;
|
65 |
+
}
|
66 |
+
</style>';
|
67 |
+
}
|
68 |
+
else {
|
69 |
+
$result .= '
|
70 |
+
<style>
|
71 |
+
#TB_ajaxContent {
|
72 |
+
box-sizing:border-box; width:100% !important;
|
73 |
+
}
|
74 |
+
.wppa-bar {
|
75 |
+
background-color: #7f7;
|
76 |
+
width:0%;
|
77 |
+
height:18px;
|
78 |
+
border-radius: 3px;
|
79 |
+
line-height: 18px;
|
80 |
+
margin: 0;
|
81 |
+
}
|
82 |
+
.wppa-percent {
|
83 |
+
position:relative;
|
84 |
+
display:inline-block;
|
85 |
+
top:-19px;
|
86 |
+
font-size: 12px;
|
87 |
+
line-height: 18px;
|
88 |
+
margin: 0;
|
89 |
+
}
|
90 |
+
.wppa-message {
|
91 |
+
clear: both;
|
92 |
+
}
|
93 |
+
#wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
|
94 |
+
padding: 2px; 0;
|
95 |
+
}
|
96 |
+
</style>';
|
97 |
+
}
|
98 |
+
|
99 |
+
// Open table
|
100 |
+
$result .=
|
101 |
+
'
|
102 |
+
<table id="wppaphoto-table" class="form-table" >' .
|
103 |
+
'<tbody>' .
|
104 |
+
|
105 |
+
// My photos selection
|
106 |
+
'
|
107 |
+
<tr id="wppaphoto-myphoto-tr" style="" >' .
|
108 |
+
'<th><label for="wppaphoto-myphoto" class="wppaphoto-myphoto" >'.__('My Photo to be used', 'wp-photo-album-plus').':</label></th>'.
|
109 |
+
'<td>'.
|
110 |
+
'<select id="wppaphoto-myphoto" name="photo" class="wppaphoto-myphoto" onchange="wppaPhotoEvaluate()" >' .
|
111 |
+
wppa_get_myphotos_selection_body_for_tinymce() .
|
112 |
+
'</select>'.
|
113 |
+
'<input' .
|
114 |
+
' type="button"' .
|
115 |
+
' value="' . esc_attr( __( 'All photos', 'wp-photo-album-plus' ) ) . '"' .
|
116 |
+
' onclick="jQuery(\'#wppaphoto-myphoto-tr\').hide();jQuery(\'#wppaphoto-allphoto-tr\').show();wppaMyPhotoSelection=false;jQuery(\'#wppaphoto-photo-preview\').html(\'\');wppaPhotoEvaluate();"' .
|
117 |
+
' />' .
|
118 |
+
'<br />'.
|
119 |
+
'<small style="" class="wppamyphoto-photo" >'.
|
120 |
+
__('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
|
121 |
+
__('You can select one of your photos from a maximum of 100 most recently added', 'wp-photo-album-plus').'<br />'.
|
122 |
+
'</small>'.
|
123 |
+
'</td>'.
|
124 |
+
'</tr>' .
|
125 |
+
|
126 |
+
// Photo selection max 100 of all photos
|
127 |
+
'
|
128 |
+
<tr id="wppaphoto-allphoto-tr" style="display:none;" >'.
|
129 |
+
'<th><label for="wppaphoto-allphoto" class="wppaphoto-allphoto" >'.__('The Photo to be used', 'wp-photo-album-plus').':</label></th>'.
|
130 |
+
'<td>'.
|
131 |
+
'<select id="wppaphoto-allphoto" name="photo" class="wppaphoto-allphoto" onchange="wppaPhotoEvaluate()" >' .
|
132 |
+
wppa_get_allphotos_selection_body_for_tinymce() .
|
133 |
+
'</select>' .
|
134 |
+
'<br />' .
|
135 |
+
'<small style="" class="wppaphoto-allphoto" >'.
|
136 |
+
__('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
|
137 |
+
__('You can select from a maximum of 100 most recently added photos', 'wp-photo-album-plus').'<br />'.
|
138 |
+
'</small>'.
|
139 |
+
'</td>'.
|
140 |
+
'</tr>'.
|
141 |
+
|
142 |
+
// Photo preview
|
143 |
+
'
|
144 |
+
<tr id="wppaphoto-photo-preview-tr" style="" >'.
|
145 |
+
'<th>' .
|
146 |
+
__( 'Preview image', 'wp-photo-album-plus').':' .
|
147 |
+
'</th>'.
|
148 |
+
'<td id="wppaphoto-photo-preview" style="text-align:center;" >' .
|
149 |
+
'</td>' .
|
150 |
+
'</tr>' .
|
151 |
+
|
152 |
+
// Upload new photo dialog
|
153 |
+
( count( $albums ) > 0 ?
|
154 |
+
'
|
155 |
+
<tr id="wppa-tinymce-upload-tr" >' .
|
156 |
+
'<th>' .
|
157 |
+
'<a' .
|
158 |
+
' style="cursor:pointer;"' .
|
159 |
+
' onclick="jQuery(\'#upload-td\').show();jQuery( \'#wppa-user-upload\' ).click();"' .
|
160 |
+
' >' .
|
161 |
+
__( 'Upload new photo', 'wp-photo-album-plus' ) . ':' .
|
162 |
+
'</a>' .
|
163 |
+
'</th>'.
|
164 |
+
'<td id="upload-td" style="display:none;" >' .
|
165 |
+
|
166 |
+
// Open form
|
167 |
+
'<form' .
|
168 |
+
' id="wppa-uplform"' .
|
169 |
+
' action="' . WPPA_URL . '/wppa-ajax-front.php?action=wppa&wppa-action=do-fe-upload&fromtinymce=1"' .
|
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 ) ?
|
177 |
+
|
178 |
+
'<input' .
|
179 |
+
' type="hidden"' .
|
180 |
+
' id="wppa-upload-album"' .
|
181 |
+
' name="wppa-upload-album"' .
|
182 |
+
' value="' . $albums[0]['id'] . '"' .
|
183 |
+
' />' .
|
184 |
+
|
185 |
+
__( 'Upload to album', 'wp-photo-album-plus' ) . ': <b>' . wppa_get_album_name( $albums[0]['id'] ) . '</b>' :
|
186 |
+
|
187 |
+
|
188 |
+
// Multiple albums
|
189 |
+
__( 'Upload to album', 'wp-photo-album-plus' ) . ':' .
|
190 |
+
wppa_album_select_a( array( 'tagid' => 'wppa-upload-album',
|
191 |
+
'tagname' => 'wppa-upload-album',
|
192 |
+
'tagopen' => '<select' .
|
193 |
+
' id="wppa-upload-album"' .
|
194 |
+
' name="wppa-upload-album"' .
|
195 |
+
' style="max-width:300px;"' .
|
196 |
+
' >' ,
|
197 |
+
'addpleaseselect' => true,
|
198 |
+
'checkupload' => true,
|
199 |
+
'checkowner' => true,
|
200 |
+
|
201 |
+
) ) ) .
|
202 |
+
|
203 |
+
// The (hidden) functional button
|
204 |
+
'
|
205 |
+
<input' .
|
206 |
+
' type="file"' .
|
207 |
+
' style="' .
|
208 |
+
'display:none;' .
|
209 |
+
'"' .
|
210 |
+
' id="wppa-user-upload"' .
|
211 |
+
' name="wppa-user-upload"' .
|
212 |
+
' onchange="jQuery( \'#wppa-user-upload-submit\' ).css( \'display\', \'block\' );wppaDisplaySelectedFile(\'wppa-user-upload\', \'wppa-user-upload-submit\');"' .
|
213 |
+
' />' .
|
214 |
+
|
215 |
+
// The upload submit button
|
216 |
+
'
|
217 |
+
<input' .
|
218 |
+
' type="submit"' .
|
219 |
+
' id="wppa-user-upload-submit"' .
|
220 |
+
' onclick="if ( document.getElementById( \'wppa-upload-album\' ).value == 0 )' .
|
221 |
+
' {alert( \''.esc_js( __( 'Please select an album and try again', 'wp-photo-album-plus' ) ).'\' );return false;}"' .
|
222 |
+
' style="display:none;margin: 6px 0;"' .
|
223 |
+
' class="wppa-user-upload-submit"' .
|
224 |
+
' name="wppa-user-upload-submit"' .
|
225 |
+
' value=""' .
|
226 |
+
' />' .
|
227 |
+
|
228 |
+
// The progression bar
|
229 |
+
'
|
230 |
+
<div' .
|
231 |
+
' id="progress"' .
|
232 |
+
' class="wppa-progress "' .
|
233 |
+
' style="clear:both;width:70%;border-color:#777;height:18px;border:1px solid;padding:1px;border-radius:3px;line-height: 18px;text-align: center;"' .
|
234 |
+
' >' .
|
235 |
+
'<div id="bar" class="wppa-bar" ></div>' .
|
236 |
+
'<div id="percent" class="wppa-percent" >0%</div >' .
|
237 |
+
'</div>' .
|
238 |
+
'<div id="message" class="wppa-message" ></div>' .
|
239 |
+
|
240 |
+
|
241 |
+
// Form complete
|
242 |
+
'</form>' .
|
243 |
+
'</td>' .
|
244 |
+
'</tr>' : '' ) .
|
245 |
+
|
246 |
+
// Shortcode preview
|
247 |
+
'
|
248 |
+
<tr>' .
|
249 |
+
'<th>' .
|
250 |
+
__( 'Shortcode', 'wp-photo-album-plus' ) . ':' .
|
251 |
+
'</th>' .
|
252 |
+
'<td id="wppaphoto-shortcode-preview-container" >' .
|
253 |
+
'<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:500px; height:26px;" value="[photo]" />' .
|
254 |
+
'</td>' .
|
255 |
+
'</tr>' .
|
256 |
+
|
257 |
+
'</tbody>' .
|
258 |
+
|
259 |
+
'</table>' .
|
260 |
+
|
261 |
+
// Insert shortcode button
|
262 |
+
'
|
263 |
+
<p class="submit" style="padding:4px;margin:0;" >'.
|
264 |
+
'<input type="button" id="wppaphoto-submit" class="button-primary" value="'.__( 'Insert Photo', 'wp-photo-album-plus').'" name="submit" /> '.
|
265 |
+
'<input type="button" id="wppaphoto-submit-notok" class="button-secundary" value="'.__( 'Insert Photo', 'wp-photo-album-plus').'" onclick="alert(\''.esc_js(__('Please select a photo', 'wp-photo-album-plus')).'\')" /> '.
|
266 |
+
'</p>' .
|
267 |
+
|
268 |
+
// Initial evaluate
|
269 |
+
'<script type="text/javascript" >wppaPhotoEvaluate()</script>' .
|
270 |
+
|
271 |
+
// Close main wrapper
|
272 |
+
'
|
273 |
+
</div>';
|
274 |
+
|
275 |
+
return $result;
|
276 |
+
}
|
277 |
+
|
278 |
+
// The my photos selection box body
|
279 |
+
function wppa_get_myphotos_selection_body_for_tinymce( $selected = 0 ) {
|
280 |
+
global $wpdb;
|
281 |
+
|
282 |
+
// Init
|
283 |
+
$result = '';
|
284 |
+
|
285 |
+
// Prepare photoinfo
|
286 |
+
$my_photos = $wpdb->get_results( "SELECT `id`, `name`, `album`, `ext` " .
|
287 |
+
"FROM `" . WPPA_PHOTOS . "` " .
|
288 |
+
"WHERE `owner` = '" . wppa_get_user() . "' " .
|
289 |
+
"ORDER BY `timestamp` DESC LIMIT 100",
|
290 |
+
ARRAY_A );
|
291 |
+
|
292 |
+
if ( $my_photos ) {
|
293 |
+
|
294 |
+
// Please select
|
295 |
+
$result .= '<option' .
|
296 |
+
' class="wppa-photo-select-item-first"' .
|
297 |
+
' value=""' .
|
298 |
+
' disabled="disabled"' .
|
299 |
+
( $selected ? '' : ' selected="selected"' ) .
|
300 |
+
' style="color:#700"' .
|
301 |
+
' >' .
|
302 |
+
'-- ' . __( 'Please select a photo', 'wp-photo-album-plus' ) . ' --' .
|
303 |
+
'</option>';
|
304 |
+
|
305 |
+
// Most recent 100 photos of this owner
|
306 |
+
foreach ( $my_photos as $photo ) {
|
307 |
+
|
308 |
+
$name = stripslashes(__($photo['name']));
|
309 |
+
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
310 |
+
|
311 |
+
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
312 |
+
$val = $photo['id'] . '.' . $photo['ext'];
|
313 |
+
}
|
314 |
+
else {
|
315 |
+
$val = wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'];
|
316 |
+
}
|
317 |
+
|
318 |
+
if ( wppa_has_audio( $photo['id'] ) && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
319 |
+
$value = wppa_fix_poster_ext( $val, $photo['id'] );
|
320 |
+
}
|
321 |
+
else {
|
322 |
+
$value = $val;
|
323 |
+
}
|
324 |
+
|
325 |
+
$result .= '<option' .
|
326 |
+
' class="wppa-photo-select-item"' .
|
327 |
+
' value="' . $value . '"' .
|
328 |
+
' >' .
|
329 |
+
$name .
|
330 |
+
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
331 |
+
'</option>';
|
332 |
+
|
333 |
+
}
|
334 |
+
}
|
335 |
+
else {
|
336 |
+
$result .= '<option value="0" >' .
|
337 |
+
__( 'You have no photos yet', 'wp-photo-album-plus' ) .
|
338 |
+
'</option>';
|
339 |
+
}
|
340 |
+
|
341 |
+
return $result;
|
342 |
+
}
|
343 |
+
|
344 |
+
// The my photos selection box body
|
345 |
+
function wppa_get_allphotos_selection_body_for_tinymce() {
|
346 |
+
global $wpdb;
|
347 |
+
|
348 |
+
// Init
|
349 |
+
$result = '';
|
350 |
+
|
351 |
+
// Prepare photoinfo
|
352 |
+
$all_photos = $wpdb->get_results( "SELECT `id`, `name`, `album`, `ext` " .
|
353 |
+
"FROM `" . WPPA_PHOTOS . "` " .
|
354 |
+
"ORDER BY `timestamp` DESC LIMIT 100",
|
355 |
+
ARRAY_A );
|
356 |
+
|
357 |
+
if ( $all_photos ) {
|
358 |
+
|
359 |
+
// Please select
|
360 |
+
$result .= '<option' .
|
361 |
+
' class="wppa-photo-select-item-first"' .
|
362 |
+
' value=""' .
|
363 |
+
' disabled="disabled"' .
|
364 |
+
' selected="selected"' .
|
365 |
+
' style="color:#700"' .
|
366 |
+
' >' .
|
367 |
+
'-- ' . __( 'Please select a photo', 'wp-photo-album-plus' ) . ' --' .
|
368 |
+
'</option>';
|
369 |
+
|
370 |
+
// Most recent 100 photos of all photos
|
371 |
+
foreach ( $all_photos as $photo ) {
|
372 |
+
|
373 |
+
$name = stripslashes(__($photo['name']));
|
374 |
+
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
375 |
+
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
376 |
+
$val = $photo['id'] . '.' . $photo['ext'];
|
377 |
+
}
|
378 |
+
else {
|
379 |
+
$val = wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'];
|
380 |
+
}
|
381 |
+
|
382 |
+
if ( wppa_has_audio( $photo['id'] ) && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
383 |
+
$value = wppa_fix_poster_ext( $val, $photo['id'] );
|
384 |
+
}
|
385 |
+
else {
|
386 |
+
$value = $val;
|
387 |
+
}
|
388 |
+
|
389 |
+
$result .= '<option' .
|
390 |
+
' class="wppa-photo-select-item"' .
|
391 |
+
' value="' . $value . '"' .
|
392 |
+
' >' .
|
393 |
+
$name .
|
394 |
+
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
395 |
+
'</option>';
|
396 |
+
|
397 |
+
}
|
398 |
+
}
|
399 |
+
else {
|
400 |
+
$result .= '<option value="0" >' .
|
401 |
+
__( 'There are no photos yet', 'wp-photo-album-plus' ) .
|
402 |
+
'</option>';
|
403 |
+
}
|
404 |
+
|
405 |
+
return $result;
|
406 |
+
}
|
wppa-tinymce-photo-front.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* wppa-tinymce-photo-front.php
|
3 |
+
* Pachkage: wp-photo-album-plus
|
4 |
+
*
|
5 |
+
* Version 6.7.10
|
6 |
+
*
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) )
|
10 |
+
die( "Can't load this file directly" );
|
11 |
+
|
12 |
+
add_action( 'init', 'wppa_tinymce_photo_action_init_front' );
|
13 |
+
|
14 |
+
function wppa_tinymce_photo_action_init_front() {
|
15 |
+
|
16 |
+
if ( wppa_switch( 'photo_shortcode_enabled' ) && wppa_opt( 'photo_shortcode_fe_type' ) != '-none-' ) {
|
17 |
+
|
18 |
+
add_filter( 'mce_buttons', 'wppa_filter_mce_photo_button_front', 11 );
|
19 |
+
add_filter( 'mce_external_plugins', 'wppa_filter_mce_photo_plugin_front' );
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
function wppa_filter_mce_photo_button_front( $buttons ) {
|
24 |
+
|
25 |
+
// add a separation before our button.
|
26 |
+
array_push( $buttons, ' ', 'wppa_photo_button' );
|
27 |
+
return $buttons;
|
28 |
+
}
|
29 |
+
|
30 |
+
function wppa_filter_mce_photo_plugin_front( $plugins ) {
|
31 |
+
|
32 |
+
// this plugin file will work the magic of our button
|
33 |
+
if ( is_file( WPPA_PATH . '/js/wppa-tinymce-photo-front.min.js' ) ) {
|
34 |
+
$file = 'js/wppa-tinymce-photo-front.min.js';
|
35 |
+
}
|
36 |
+
else {
|
37 |
+
$file = 'js/wppa-tinymce-photo-front.js';
|
38 |
+
}
|
39 |
+
$plugins['wppaphoto'] = plugin_dir_url( __FILE__ ) . $file;
|
40 |
+
return $plugins;
|
41 |
+
}
|
42 |
+
|
43 |
+
add_action( 'wp_head', 'wppa_inject_3_js' );
|
44 |
+
|
45 |
+
function wppa_inject_3_js() {
|
46 |
+
global $wppa_api_version;
|
47 |
+
static $done;
|
48 |
+
global $wpdb;
|
49 |
+
|
50 |
+
if ( wppa_switch( 'photo_shortcode_enabled' ) && ! $done ) {
|
51 |
+
|
52 |
+
// Find an existing photo
|
53 |
+
$id = $wpdb->get_var( "SELECT `id` FROM " . WPPA_PHOTOS . " WHERE `ext` <> 'xxx' ORDER BY `timestamp` DESC LIMIT 1" );
|
54 |
+
|
55 |
+
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
56 |
+
echo
|
57 |
+
'<script type="text/javascript">
|
58 |
+
/* <![CDATA[ */
|
59 |
+
wppaImageDirectory = "' . wppa_get_imgdir() . '";
|
60 |
+
wppaAjaxUrl = "' . admin_url( 'admin-ajax.php' ) . '";
|
61 |
+
wppaPhotoDirectory = "' . WPPA_UPLOAD_URL . '/";
|
62 |
+
wppaNoPreview = "' . __( 'No Preview available', 'wp-photo-album-plus' ) . '";
|
63 |
+
wppaTxtProcessing = "' . __( 'Processing...', 'wp-photo-album-plus' ) . '";
|
64 |
+
wppaTxtDone = "' . __( 'Done!', 'wp-photo-album-plus' ) . '";
|
65 |
+
wppaTxtErrUnable = "' . __( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ) . '";
|
66 |
+
wppaOutputType = "' . wppa_opt( 'photo_shortcode_fe_type' ) . '";
|
67 |
+
wppaShortcodeTemplate = "' . esc_js( do_shortcode( '[photo ' . $id . ']' ) ) . '";
|
68 |
+
wppaShortcodeTemplateId = "' . $id . '.' . wppa_get_photo_item( $id, 'ext' ) . '";
|
69 |
+
/* ]]> */
|
70 |
+
</script>';
|
71 |
+
|
72 |
+
$done = true;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
wppa-tinymce-photo.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/* wppa-tinymce-photo.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
-
* Version 6.7.
|
6 |
*
|
7 |
*/
|
8 |
|
@@ -14,23 +14,23 @@ add_action( 'init', 'wppa_tinymce_photo_action_init' ); // 'admin_init'
|
|
14 |
function wppa_tinymce_photo_action_init() {
|
15 |
|
16 |
if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
|
17 |
-
|
18 |
add_filter( 'mce_buttons', 'wppa_filter_mce_photo_button', 11 );
|
19 |
add_filter( 'mce_external_plugins', 'wppa_filter_mce_photo_plugin' );
|
20 |
}
|
21 |
}
|
22 |
|
23 |
function wppa_filter_mce_photo_button( $buttons ) {
|
24 |
-
|
25 |
// add a separation before our button.
|
26 |
array_push( $buttons, ' ', 'wppa_photo_button' );
|
27 |
return $buttons;
|
28 |
}
|
29 |
|
30 |
function wppa_filter_mce_photo_plugin( $plugins ) {
|
31 |
-
|
32 |
// this plugin file will work the magic of our button
|
33 |
-
if ( is_file( WPPA_PATH . '/js/wppa-tinymce-
|
34 |
$file = 'js/wppa-tinymce-photo.min.js';
|
35 |
}
|
36 |
else {
|
@@ -47,7 +47,7 @@ global $wppa_api_version;
|
|
47 |
static $done;
|
48 |
|
49 |
if ( wppa_switch( 'photo_shortcode_enabled' ) && ! $done ) {
|
50 |
-
|
51 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
52 |
echo('<script type="text/javascript">'."\n");
|
53 |
echo('/* <![CDATA[ */'."\n");
|
@@ -68,348 +68,8 @@ static $done;
|
|
68 |
echo("\t".'wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'";');
|
69 |
echo("/* ]]> */\n");
|
70 |
echo("</script>\n");
|
71 |
-
|
72 |
-
$done = true;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
function wppa_make_tinymce_photo_dialog() {
|
77 |
-
global $wpdb;
|
78 |
-
|
79 |
-
// Prepare albuminfo
|
80 |
-
$albums = $wpdb->get_results( "SELECT `id`, `name` " .
|
81 |
-
"FROM `" . WPPA_ALBUMS . "` " .
|
82 |
-
"WHERE `owner` = '" . wppa_get_user() . "' " .
|
83 |
-
"OR `owner` = '--- public ---' " .
|
84 |
-
"ORDER BY `name` ",
|
85 |
-
ARRAY_A );
|
86 |
-
|
87 |
-
// Make the html
|
88 |
-
// Open wrapper
|
89 |
-
$result =
|
90 |
-
'<div id="wppaphoto-form">' .
|
91 |
-
'<style>
|
92 |
-
#TB_ajaxContent {
|
93 |
-
box-sizing:border-box; width:100% !important;
|
94 |
-
}
|
95 |
-
.wppa-bar {
|
96 |
-
background-color: #7f7;
|
97 |
-
width:0%;
|
98 |
-
height:18px;
|
99 |
-
border-radius: 3px;
|
100 |
-
line-height: 18px;
|
101 |
-
margin: 0;
|
102 |
-
}
|
103 |
-
.wppa-percent {
|
104 |
-
position:relative;
|
105 |
-
display:inline-block;
|
106 |
-
top:-19px;
|
107 |
-
font-size: 12px;
|
108 |
-
line-height: 18px;
|
109 |
-
margin: 0;
|
110 |
-
}
|
111 |
-
.wppa-message {
|
112 |
-
clear: both;
|
113 |
-
}
|
114 |
-
#wppaphoto-table tr, #wppaphoto-table th, #wppaphoto-table td {
|
115 |
-
padding: 2px; 0;
|
116 |
-
}
|
117 |
-
</style>' .
|
118 |
-
|
119 |
-
// Open table
|
120 |
-
'
|
121 |
-
<table id="wppaphoto-table" class="form-table" >' .
|
122 |
-
'<tbody>' .
|
123 |
-
|
124 |
-
// My photos selection
|
125 |
-
'
|
126 |
-
<tr id="wppaphoto-myphoto-tr" style="" >' .
|
127 |
-
'<th><label for="wppaphoto-myphoto" class="wppaphoto-myphoto" >'.__('My Photo to be used', 'wp-photo-album-plus').':</label></th>'.
|
128 |
-
'<td>'.
|
129 |
-
'<select id="wppaphoto-myphoto" name="photo" class="wppaphoto-myphoto" onchange="wppaPhotoEvaluate()" >' .
|
130 |
-
wppa_get_myphotos_selection_body_for_tinymce() .
|
131 |
-
'</select>'.
|
132 |
-
'<input' .
|
133 |
-
' type="button"' .
|
134 |
-
' value="' . esc_attr( __( 'All photos', 'wp-photo-album-plus' ) ) . '"' .
|
135 |
-
' onclick="jQuery(\'#wppaphoto-myphoto-tr\').hide();jQuery(\'#wppaphoto-allphoto-tr\').show();wppaMyPhotoSelection=false;jQuery(\'#wppaphoto-photo-preview\').html(\'\');wppaPhotoEvaluate();"' .
|
136 |
-
' />' .
|
137 |
-
'<br />'.
|
138 |
-
'<small style="" class="wppamyphoto-photo" >'.
|
139 |
-
__('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
|
140 |
-
__('You can select one of your photos from a maximum of 100 most recently added', 'wp-photo-album-plus').'<br />'.
|
141 |
-
'</small>'.
|
142 |
-
'</td>'.
|
143 |
-
'</tr>' .
|
144 |
-
|
145 |
-
// Photo selection max 100 of all photos
|
146 |
-
'
|
147 |
-
<tr id="wppaphoto-allphoto-tr" style="display:none;" >'.
|
148 |
-
'<th><label for="wppaphoto-allphoto" class="wppaphoto-allphoto" >'.__('The Photo to be used', 'wp-photo-album-plus').':</label></th>'.
|
149 |
-
'<td>'.
|
150 |
-
'<select id="wppaphoto-allphoto" name="photo" class="wppaphoto-allphoto" onchange="wppaPhotoEvaluate()" >' .
|
151 |
-
wppa_get_allphotos_selection_body_for_tinymce() .
|
152 |
-
'</select>' .
|
153 |
-
'<br />' .
|
154 |
-
'<small style="" class="wppaphoto-allphoto" >'.
|
155 |
-
__('Specify the photo to be used', 'wp-photo-album-plus').'<br />'.
|
156 |
-
__('You can select from a maximum of 100 most recently added photos', 'wp-photo-album-plus').'<br />'.
|
157 |
-
'</small>'.
|
158 |
-
'</td>'.
|
159 |
-
'</tr>'.
|
160 |
-
|
161 |
-
// Photo preview
|
162 |
-
'
|
163 |
-
<tr id="wppaphoto-photo-preview-tr" style="" >'.
|
164 |
-
'<th>' .
|
165 |
-
__( 'Preview image', 'wp-photo-album-plus').':' .
|
166 |
-
'</th>'.
|
167 |
-
'<td id="wppaphoto-photo-preview" style="text-align:center;" >' .
|
168 |
-
'</td>' .
|
169 |
-
'</tr>' .
|
170 |
-
|
171 |
-
// Upload new photo dialog
|
172 |
-
( count( $albums ) > 0 ?
|
173 |
-
'
|
174 |
-
<tr>' .
|
175 |
-
'<th>' .
|
176 |
-
'<a' .
|
177 |
-
' style="cursor:pointer;"' .
|
178 |
-
' onclick="jQuery(\'#upload-td\').show();jQuery( \'#wppa-user-upload\' ).click();"' .
|
179 |
-
' >' .
|
180 |
-
__( 'Upload new photo', 'wp-photo-album-plus' ) . ':' .
|
181 |
-
'</a>' .
|
182 |
-
'</th>'.
|
183 |
-
'<td id="upload-td" style="display:none;" >' .
|
184 |
-
|
185 |
-
// Open form
|
186 |
-
'<form' .
|
187 |
-
' id="wppa-uplform"' .
|
188 |
-
' action="' . WPPA_URL . '/wppa-ajax-front.php?action=wppa&wppa-action=do-fe-upload&fromtinymce=1"' .
|
189 |
-
' method="post"' .
|
190 |
-
' enctype="multipart/form-data"' .
|
191 |
-
' >' .
|
192 |
-
wppa_nonce_field( 'wppa-check' , 'wppa-nonce', false, false ) .
|
193 |
-
|
194 |
-
// Single album
|
195 |
-
( ( count( $albums ) == 1 ) ?
|
196 |
-
|
197 |
-
'<input' .
|
198 |
-
' type="hidden"' .
|
199 |
-
' id="wppa-upload-album"' .
|
200 |
-
' name="wppa-upload-album"' .
|
201 |
-
' value="' . $albums[0]['id'] . '"' .
|
202 |
-
' />' .
|
203 |
-
|
204 |
-
__( 'Upload to album', 'wp-photo-album-plus' ) . ': <b>' . wppa_get_album_name( $albums[0]['id'] ) . '</b>' :
|
205 |
-
|
206 |
-
|
207 |
-
// Multiple albums
|
208 |
-
__( 'Upload to album', 'wp-photo-album-plus' ) . ':' .
|
209 |
-
wppa_album_select_a( array( 'tagid' => 'wppa-upload-album',
|
210 |
-
'tagname' => 'wppa-upload-album',
|
211 |
-
'tagopen' => '<select' .
|
212 |
-
' id="wppa-upload-album"' .
|
213 |
-
' name="wppa-upload-album"' .
|
214 |
-
' style="max-width:300px;"' .
|
215 |
-
' >' ,
|
216 |
-
'addpleaseselect' => true,
|
217 |
-
'checkupload' => true,
|
218 |
-
'checkowner' => true,
|
219 |
-
|
220 |
-
) ) ) .
|
221 |
-
|
222 |
-
// The (hidden) functional button
|
223 |
-
'
|
224 |
-
<input' .
|
225 |
-
' type="file"' .
|
226 |
-
' style="' .
|
227 |
-
'display:none;' .
|
228 |
-
'"' .
|
229 |
-
' id="wppa-user-upload"' .
|
230 |
-
' name="wppa-user-upload"' .
|
231 |
-
' onchange="jQuery( \'#wppa-user-upload-submit\' ).css( \'display\', \'block\' );wppaDisplaySelectedFile(\'wppa-user-upload\', \'wppa-user-upload-submit\');"' .
|
232 |
-
' />' .
|
233 |
-
|
234 |
-
// The upload submit button
|
235 |
-
'
|
236 |
-
<input' .
|
237 |
-
' type="submit"' .
|
238 |
-
' id="wppa-user-upload-submit"' .
|
239 |
-
' onclick="if ( document.getElementById( \'wppa-upload-album\' ).value == 0 )' .
|
240 |
-
' {alert( \''.esc_js( __( 'Please select an album and try again', 'wp-photo-album-plus' ) ).'\' );return false;}"' .
|
241 |
-
' style="display:none;margin: 6px 0;"' .
|
242 |
-
' class="wppa-user-upload-submit"' .
|
243 |
-
' name="wppa-user-upload-submit"' .
|
244 |
-
' value=""' .
|
245 |
-
' />' .
|
246 |
-
|
247 |
-
// The progression bar
|
248 |
-
'
|
249 |
-
<div' .
|
250 |
-
' id="progress"' .
|
251 |
-
' class="wppa-progress "' .
|
252 |
-
' style="clear:both;width:70%;border-color:#777;height:18px;border:1px solid;padding:1px;border-radius:3px;line-height: 18px;text-align: center;"' .
|
253 |
-
' >' .
|
254 |
-
'<div id="bar" class="wppa-bar" ></div>' .
|
255 |
-
'<div id="percent" class="wppa-percent" >0%</div >' .
|
256 |
-
'</div>' .
|
257 |
-
'<div id="message" class="wppa-message" ></div>' .
|
258 |
-
|
259 |
-
|
260 |
-
// Form complete
|
261 |
-
'</form>' .
|
262 |
-
'</td>' .
|
263 |
-
'</tr>' : '' ) .
|
264 |
-
|
265 |
-
// Shortcode preview
|
266 |
-
'
|
267 |
-
<tr>' .
|
268 |
-
'<th>' .
|
269 |
-
__( 'Shortcode', 'wp-photo-album-plus' ) . ':' .
|
270 |
-
'</th>' .
|
271 |
-
'<td id="wppaphoto-shortcode-preview-container" >' .
|
272 |
-
'<input type="text" id="wppaphoto-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="[photo]" />' .
|
273 |
-
'</td>' .
|
274 |
-
'</tr>' .
|
275 |
|
276 |
-
|
277 |
-
|
278 |
-
'</table>' .
|
279 |
-
|
280 |
-
// Insert shortcode button
|
281 |
-
'
|
282 |
-
<p class="submit">'.
|
283 |
-
'<input type="button" id="wppaphoto-submit" class="button-primary" value="'.__( 'Insert Photo', 'wp-photo-album-plus').'" name="submit" /> '.
|
284 |
-
'<input type="button" id="wppaphoto-submit-notok" class="button-secundary" value="'.__( 'Insert Photo', 'wp-photo-album-plus').'" onclick="alert(\''.esc_js(__('Please select a photo', 'wp-photo-album-plus')).'\')" /> '.
|
285 |
-
'</p>' .
|
286 |
-
|
287 |
-
// Initial evaluate
|
288 |
-
'<script type="text/javascript" >wppaPhotoEvaluate()</script>' .
|
289 |
-
|
290 |
-
// Close main wrapper
|
291 |
-
'
|
292 |
-
</div>';
|
293 |
-
|
294 |
-
return $result;
|
295 |
-
}
|
296 |
-
|
297 |
-
// The my photos selection box body
|
298 |
-
function wppa_get_myphotos_selection_body_for_tinymce( $selected = 0 ) {
|
299 |
-
global $wpdb;
|
300 |
-
|
301 |
-
// Init
|
302 |
-
$result = '';
|
303 |
-
|
304 |
-
// Prepare photoinfo
|
305 |
-
$my_photos = $wpdb->get_results( "SELECT `id`, `name`, `album`, `ext` " .
|
306 |
-
"FROM `" . WPPA_PHOTOS . "` " .
|
307 |
-
"WHERE `owner` = '" . wppa_get_user() . "' " .
|
308 |
-
"ORDER BY `timestamp` DESC LIMIT 100",
|
309 |
-
ARRAY_A );
|
310 |
-
|
311 |
-
if ( $my_photos ) {
|
312 |
-
|
313 |
-
// Please select
|
314 |
-
$result .= '<option' .
|
315 |
-
' value=""' .
|
316 |
-
' disabled="disabled"' .
|
317 |
-
( $selected ? '' : ' selected="selected"' ) .
|
318 |
-
' style="color:#700"' .
|
319 |
-
' >' .
|
320 |
-
'-- ' . __( 'Please select a photo', 'wp-photo-album-plus' ) . ' --' .
|
321 |
-
'</option>';
|
322 |
-
|
323 |
-
// Most recent 100 photos of this owner
|
324 |
-
foreach ( $my_photos as $photo ) {
|
325 |
-
|
326 |
-
$name = stripslashes(__($photo['name']));
|
327 |
-
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
328 |
-
|
329 |
-
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
330 |
-
$val = $photo['id'] . '.' . $photo['ext'];
|
331 |
-
}
|
332 |
-
else {
|
333 |
-
$val = wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'];
|
334 |
-
}
|
335 |
-
|
336 |
-
if ( wppa_has_audio() && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
337 |
-
$value = wppa_fix_poster_ext( $val );
|
338 |
-
}
|
339 |
-
else {
|
340 |
-
$value = $val;
|
341 |
-
}
|
342 |
-
|
343 |
-
$result .= '<option' .
|
344 |
-
' value="' . $value . '"' .
|
345 |
-
' >' .
|
346 |
-
$name .
|
347 |
-
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
348 |
-
'</option>';
|
349 |
-
|
350 |
-
}
|
351 |
-
}
|
352 |
-
else {
|
353 |
-
$result .= '<option value="0" >' .
|
354 |
-
__( 'You have no photos yet', 'wp-photo-album-plus' ) .
|
355 |
-
'</option>';
|
356 |
}
|
357 |
-
|
358 |
-
return $result;
|
359 |
}
|
360 |
|
361 |
-
// The my photos selection box body
|
362 |
-
function wppa_get_allphotos_selection_body_for_tinymce() {
|
363 |
-
global $wpdb;
|
364 |
-
|
365 |
-
// Init
|
366 |
-
$result = '';
|
367 |
-
|
368 |
-
// Prepare photoinfo
|
369 |
-
$all_photos = $wpdb->get_results( "SELECT `id`, `name`, `album`, `ext` " .
|
370 |
-
"FROM `" . WPPA_PHOTOS . "` " .
|
371 |
-
"ORDER BY `timestamp` DESC LIMIT 100",
|
372 |
-
ARRAY_A );
|
373 |
-
|
374 |
-
if ( $all_photos ) {
|
375 |
-
|
376 |
-
// Please select
|
377 |
-
$result .= '<option' .
|
378 |
-
' value=""' .
|
379 |
-
' disabled="disabled"' .
|
380 |
-
' selected="selected"' .
|
381 |
-
' style="color:#700"' .
|
382 |
-
' >' .
|
383 |
-
'-- ' . __( 'Please select a photo', 'wp-photo-album-plus' ) . ' --' .
|
384 |
-
'</option>';
|
385 |
-
|
386 |
-
// Most recent 100 photos of this owner
|
387 |
-
foreach ( $all_photos as $photo ) {
|
388 |
-
$name = stripslashes(__($photo['name']));
|
389 |
-
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
390 |
-
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
391 |
-
$result .= '<option' .
|
392 |
-
' value="' . wppa_fix_poster_ext( $photo['id'] . '.' . $photo['ext'], $photo['id'] ) . '"' .
|
393 |
-
' >' .
|
394 |
-
$name .
|
395 |
-
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
396 |
-
'</option>';
|
397 |
-
}
|
398 |
-
else {
|
399 |
-
$result .= '<option' .
|
400 |
-
' value="' . wppa_fix_poster_ext( wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'], $photo['id'] ) . '"' .
|
401 |
-
' >' .
|
402 |
-
$name .
|
403 |
-
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
404 |
-
'</option>';
|
405 |
-
}
|
406 |
-
}
|
407 |
-
}
|
408 |
-
else {
|
409 |
-
$result .= '<option value="0" >' .
|
410 |
-
__( 'There are no photos yet', 'wp-photo-album-plus' ) .
|
411 |
-
'</option>';
|
412 |
-
}
|
413 |
-
|
414 |
-
return $result;
|
415 |
-
}
|
2 |
/* wppa-tinymce-photo.php
|
3 |
* Pachkage: wp-photo-album-plus
|
4 |
*
|
5 |
+
* Version 6.7.10
|
6 |
*
|
7 |
*/
|
8 |
|
14 |
function wppa_tinymce_photo_action_init() {
|
15 |
|
16 |
if ( wppa_switch( 'photo_shortcode_enabled' ) ) {
|
17 |
+
|
18 |
add_filter( 'mce_buttons', 'wppa_filter_mce_photo_button', 11 );
|
19 |
add_filter( 'mce_external_plugins', 'wppa_filter_mce_photo_plugin' );
|
20 |
}
|
21 |
}
|
22 |
|
23 |
function wppa_filter_mce_photo_button( $buttons ) {
|
24 |
+
|
25 |
// add a separation before our button.
|
26 |
array_push( $buttons, ' ', 'wppa_photo_button' );
|
27 |
return $buttons;
|
28 |
}
|
29 |
|
30 |
function wppa_filter_mce_photo_plugin( $plugins ) {
|
31 |
+
|
32 |
// this plugin file will work the magic of our button
|
33 |
+
if ( is_file( WPPA_PATH . '/js/wppa-tinymce-photo.min.js' ) ) {
|
34 |
$file = 'js/wppa-tinymce-photo.min.js';
|
35 |
}
|
36 |
else {
|
47 |
static $done;
|
48 |
|
49 |
if ( wppa_switch( 'photo_shortcode_enabled' ) && ! $done ) {
|
50 |
+
|
51 |
// Things that wppa-tinymce.js AND OTHER MODULES!!! need to know
|
52 |
echo('<script type="text/javascript">'."\n");
|
53 |
echo('/* <![CDATA[ */'."\n");
|
68 |
echo("\t".'wppaTxtErrUnable = "'.__( 'ERROR: unable to upload files.', 'wp-photo-album-plus' ).'";');
|
69 |
echo("/* ]]> */\n");
|
70 |
echo("</script>\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
$done = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
|
|
|
|
74 |
}
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wppa-tinymce-shortcodes.php
CHANGED
@@ -483,29 +483,29 @@ global $wpdb;
|
|
483 |
|
484 |
// Most recent 100 photos
|
485 |
foreach ( $photos as $photo ) {
|
486 |
-
|
487 |
$name = stripslashes(__($photo['name']));
|
488 |
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
489 |
-
|
490 |
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
491 |
$val = $photo['id'] . '.' . $photo['ext'];
|
492 |
}
|
493 |
else {
|
494 |
$val = wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'];
|
495 |
}
|
496 |
-
|
497 |
-
if ( wppa_has_audio() && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
498 |
$value = wppa_fix_poster_ext( $val );
|
499 |
}
|
500 |
else {
|
501 |
$value = $val;
|
502 |
}
|
503 |
-
|
504 |
$result .= '<option' .
|
505 |
' value="' . $value . '"' .
|
506 |
-
' >' .
|
507 |
-
$name .
|
508 |
-
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
509 |
'</option>';
|
510 |
}
|
511 |
$result .= '<option value="#last" >-- '.__('The most recently uploaded photo', 'wp-photo-album-plus').' --</option>'.
|
483 |
|
484 |
// Most recent 100 photos
|
485 |
foreach ( $photos as $photo ) {
|
486 |
+
|
487 |
$name = stripslashes(__($photo['name']));
|
488 |
if ( strlen($name) > '50') $name = substr($name, '0', '50').'...';
|
489 |
+
|
490 |
if ( get_option( 'wppa_file_system' ) == 'flat' ) {
|
491 |
$val = $photo['id'] . '.' . $photo['ext'];
|
492 |
}
|
493 |
else {
|
494 |
$val = wppa_expand_id( $photo['id'] ) . '.' . $photo['ext'];
|
495 |
}
|
496 |
+
|
497 |
+
if ( wppa_has_audio( $photo['id'] ) && is_file( WPPA_UPLOAD_PATH . '/' . wppa_fix_poster_ext( $val, $photo['id'] ) ) ) {
|
498 |
$value = wppa_fix_poster_ext( $val );
|
499 |
}
|
500 |
else {
|
501 |
$value = $val;
|
502 |
}
|
503 |
+
|
504 |
$result .= '<option' .
|
505 |
' value="' . $value . '"' .
|
506 |
+
' >' .
|
507 |
+
$name .
|
508 |
+
' (' . wppa_get_album_name( $photo['album'] ) . ')' .
|
509 |
'</option>';
|
510 |
}
|
511 |
$result .= '<option value="#last" >-- '.__('The most recently uploaded photo', 'wp-photo-album-plus').' --</option>'.
|
wppa.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
-
* Version: 6.7.
|
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/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-7-
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|
2 |
/*
|
3 |
* Plugin Name: WP Photo Album Plus
|
4 |
* Description: Easily manage and display your photo albums and slideshows within your WordPress site.
|
5 |
+
* Version: 6.7.10
|
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/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6710'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-7-010-009'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|