PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 2.40
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v2.40
3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 2.44 All 141 releases
photonic / Options / Flickr.php

Flickr.php in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 2.40, at Options/Flickr.php

430 lines 20.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Photonic_Plugin\Options;
3
4 use Photonic_Plugin\Core\Photonic;
5 use Photonic_Plugin\Core\Utilities;
6
7 class Flickr extends Option_Tab {
8 private static $instance;
9
10 private function __construct() {
11 $this->options = [
12 ['name' => "How To",
13 'desc' => "Control generic settings for the plugin",
14 'category' => 'flickr-how-to',
15 'buttons' => 'no-buttons',
16 'type' => 'section',],
17
18 ['name' => "Creating a gallery",
19 'desc' => "<strong>Please complete the setup steps in the \"Flickr Settings\" tab before attempting to create a gallery!</strong> <br/><br/>
20 To create a gallery with Flickr content you can use either a <strong><em>Gutenberg Block</em></strong>
21 or the <em>Add / Edit Photonic Gallery</em> button in the <strong><em>Classic Editor</em></strong>:<br/><br/>
22 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-1.png' style='max-width: 600px;' alt='Wizard' />",
23 'grouping' => 'flickr-how-to',
24 'type' => 'blurb',],
25
26 ['name' => "Flickr settings",
27 'desc' => "Control settings for Flickr",
28 'category' => "flickr-settings",
29 'type' => 'section',],
30
31 ['name' => "Flickr API Key",
32 'desc' => "To make use of the Flickr functionality you have to use your Flickr API Key.
33 You can <a href='http://www.flickr.com/services/api/misc.api_keys.html'>obtain a key online</a> if you don't have one.
34 Note that you are responsible for following all of the Flickr API's <a href='http://www.flickr.com/services/api/tos/'>Terms of Service</a>",
35 'id' => "flickr_api_key",
36 'grouping' => "flickr-settings",
37 'type' => 'text'],
38
39 ['name' => "Flickr API Secret",
40 'desc' => "To make use of authenticated Flickr functionality you have to use your Flickr API secret.
41 You can <a href='http://www.flickr.com/services/api/misc.api_keys.html'>obtain a key online</a> if you don't have one.
42 Note that you are responsible for following all of the Flickr API's <a href='http://www.flickr.com/services/api/tos/'>Terms of Service</a>",
43 'id' => "flickr_api_secret",
44 'grouping' => "flickr-settings",
45 'type' => 'text'],
46
47 ['name' => "Access Token (for Back-end / Server-side Authentication)",
48 'desc' => "To get your token go to <em>Photonic &rarr; Authentication &rarr; Flickr</em>, and authenticate. Save the token you get here. <br/>If you have set
49 up a token, your users can see protected Flickr photos without a Flickr account. See <a href='https://aquoid.com/plugins/photonic/authentication/'>here</a> for more.",
50 'id' => "flickr_access_token",
51 'grouping' => "flickr-settings",
52 'type' => 'text'],
53
54 ['name' => "Access Token Secret (for Back-end / Server-side Authentication)",
55 'desc' => "To get your token secret go to <em>Photonic &rarr; Authentication &rarr; Flickr</em>, and authenticate. Save the token secret you get here. Your token secret works with the token set in the prvious option. See <a href='https://aquoid.com/plugins/photonic/authentication/'>here</a> for more.",
56 'id' => "flickr_token_secret",
57 'grouping' => "flickr-settings",
58 'type' => 'text'],
59
60 ['name' => 'Default user',
61 'desc' => 'If no user is specified in the shortcode this one will be used. <strong>Note that this is not the username from https://www.flickr.com/photos/<span style="text-decoration: underline">username</span>/</strong>, but you can get the user id from <em>Photonic &rarr; Helpers</em>.',
62 'id' => 'flickr_default_user',
63 'grouping' => 'flickr-settings',
64 'type' => 'text'],
65
66 ['name' => 'Media to show',
67 'desc' => 'You can choose to include photos as well as videos in your output. This can be overridden by the <code>media</code> parameter in the shortcode:',
68 'id' => "flickr_media",
69 'grouping' => "flickr-settings",
70 'type' => 'select',
71 'options' => Utilities::media_options()],
72
73 ['name' => "Thumbnail size",
74 'desc' => "Flickr lets you display a thumbnail in the following sizes:",
75 'id' => "flickr_thumb_size",
76 'grouping' => "flickr-settings",
77 'type' => 'select',
78 'options' => [
79 "s" => "Small square, 75x75px",
80 "q" => "Large square, 150x150px",
81 "t" => "Thumbnail, 100px on longest side",
82 "m" => "Small, 240px on longest side",
83 "n" => "Small, 320px on longest side",
84 ]],
85
86 ['name' => "Main image size",
87 'desc' => "When you click on a thumbnail this size will be displayed if you are using a slideshow. If you are not using a slideshow you will be taken to the Flickr page:",
88 'id' => "flickr_main_size",
89 'grouping' => "flickr-settings",
90 'type' => 'select',
91 'options' => [
92 "none" => "Medium, 500px on the longest side",
93 "z" => "Medium, 640px on longest side",
94 "c" => "Medium, 800px on longest side",
95 "b" => "Large, 1024px on longest side",
96 "h" => "Large, 1600px on longest side",
97 "k" => "Large, 2048px on longest side",
98 "o" => "Original",
99 ]],
100
101 ['name' => "Tile image size",
102 'desc' => "<strong>This is applicable only if you are using the random tiled gallery, masonry or mosaic layouts.</strong> This size will be used as the image for the tiles. Picking a size smaller than the Main image size above will save bandwidth if your users <strong>don't click</strong> on individual images. Conversely, leaving this the same as the Main image size will save bandwidth if your users <strong>do click</strong> on individual images:",
103 'id' => "flickr_tile_size",
104 'grouping' => "flickr-settings",
105 'type' => 'select',
106 'options' => [
107 "same" => "Same as Main image size",
108 "n" => "Small, 320px on longest side",
109 "none" => "Medium, 500px on the longest side",
110 "z" => "Medium, 640px on longest side",
111 "c" => "Medium, 800px on longest side",
112 "b" => "Large, 1024px on longest side",
113 "h" => "Large, 1600px on longest side",
114 "k" => "Large, 2048px on longest side",
115 "o" => "Original",
116 ]],
117
118 ['name' => "Video size",
119 'desc' => "This is the video size that will be used for the lightbox:",
120 'id' => "flickr_video_size",
121 'grouping' => "flickr-settings",
122 'type' => 'select',
123 'options' => [
124 'Site MP4' => 'Site MP4',
125 'Mobile MP4' => 'Mobile MP4',
126 'HD MP4' => 'HD MP4',
127 'Video Original' => 'Video Original',
128 ]],
129
130 ['name' => "Disable lightbox linking",
131 'desc' => "Check this to disable linking the photo title in the lightbox to the original photo page.",
132 'id' => "flickr_disable_title_link",
133 'grouping' => "flickr-settings",
134 'type' => 'checkbox'],
135
136 ['name' => "Photo titles and captions",
137 'desc' => "What do you want to show as the photo title in the tooltip and lightbox?",
138 'id' => "flickr_title_caption",
139 'grouping' => "flickr-settings",
140 'type' => 'select',
141 'options' => Utilities::title_caption_options()],
142
143 ['name' => "Collections",
144 'desc' => "Control settings for Flickr collection thumbnails",
145 'category' => "flickr-collections",
146 'type' => 'section',],
147
148 ['name' => "What is this section?",
149 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
150 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-5.png' style='max-width: 600px;' alt='Collections'/><br/><br/>
151 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' view='collections']</code>
152 or <code>[gallery type='flickr' user_id='abc' collection_id='xyz']</code>. They are used to control the collection's thumbnail display.",
153 'grouping' => "flickr-collections",
154 'type' => 'blurb',],
155
156 ['name' => "Hide Empty Collection Details",
157 'desc' => "This will hide the collection header if your collection has no sets. Nested collections will be displayed, however.",
158 'id' => "flickr_hide_empty_collection_details",
159 'grouping' => "flickr-collections",
160 'type' => 'checkbox'],
161
162 ['name' => "Hide Collection Thumbnail",
163 'desc' => "This will hide the thumbnail that is auto-generated by Flickr for your collection.",
164 'id' => "flickr_hide_collection_thumbnail",
165 'grouping' => "flickr-collections",
166 'type' => 'checkbox'],
167
168 ['name' => "Hide Collection Title",
169 'desc' => "This will hide the title for your Flickr collection.",
170 'id' => "flickr_hide_collection_title",
171 'grouping' => "flickr-collections",
172 'type' => 'checkbox'],
173
174 ['name' => "Hide Number of Sets",
175 'desc' => "This will hide the number of Photosets / Albums in your Flickr collection.",
176 'id' => "flickr_hide_collection_set_count",
177 'grouping' => "flickr-collections",
178 'type' => 'checkbox'],
179
180 ['name' => "Photoset / Album Thumbnails (with other Photosets / Albums)",
181 'desc' => "Control settings for Flickr Photoset thumbnails",
182 'category' => "flickr-sets",
183 'type' => 'section',],
184
185 ['name' => "What is this section?",
186 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
187 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-3.png' style='max-width: 600px;' alt='Albums'/><br/><br/>
188 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' view='photosets']</code> or <code>[gallery type='flickr' user_id='abc' collection_id='xyz']</code>
189 or <code>[gallery type='flickr' user_id='abc' view='collections']</code>. They are used to control the Photoset's thumbnail display",
190 'grouping' => "flickr-sets",
191 'type' => 'blurb',],
192
193 ['name' => "Photoset Title Display",
194 'desc' => "How do you want the title of the Photoset?",
195 'id' => "flickr_collection_set_title_display",
196 'grouping' => "flickr-sets",
197 'type' => 'radio',
198 'options' => $this->title_styles()],
199
200 ['name' => "Hide Photo Count in Title Display",
201 'desc' => "This will hide the number of photos in your Photoset's title.",
202 'id' => "flickr_hide_collection_set_photos_count_display",
203 'grouping' => "flickr-sets",
204 'type' => 'checkbox'],
205
206 ['name' => "Constrain Photosets Per Row",
207 'desc' => "How do you want the control the number of photoset thumbnails per row? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
208 'id' => "flickr_collection_set_per_row_constraint",
209 'grouping' => "flickr-sets",
210 'type' => 'select',
211 'options' => ["padding" => "Fix the padding around the thumbnails",
212 "count" => "Fix the number of thumbnails per row",
213 ]],
214
215 ['name' => "Constrain by padding",
216 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
217 'id' => "flickr_collection_set_constrain_by_padding",
218 'grouping' => "flickr-sets",
219 'type' => 'text',
220 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."],
221
222 ['name' => "Constrain by number of thumbnails",
223 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
224 'id' => "flickr_collection_set_constrain_by_count",
225 'grouping' => "flickr-sets",
226 'type' => 'select',
227 'options' => $this->selection_range(1, 25)],
228
229 ['name' => "Photoset / Album Headers (Standalone Photosets / Albums)",
230 'desc' => "Control settings for Flickr Photosets when displayed in your page",
231 'category' => "flickr-set",
232 'type' => 'section',],
233
234 ['name' => "What is this section?",
235 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
236 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-4.png' style='max-width: 600px;' alt='Individual albums'/><br/><br/>
237 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' photoset_id='xyz']</code> to show its contents on the page,
238 or if you use <code>[gallery type='flickr' user_id='abc' view='photosets']</code> and click on a thumbnail to open the included images in a popup.",
239 'grouping' => "flickr-set",
240 'type' => 'blurb',],
241
242 ['name' => "Hide Header Thumbnail",
243 'desc' => "This will hide the thumbnail in the header for your Flickr Photoset.",
244 'id' => "flickr_hide_set_thumbnail",
245 'grouping' => "flickr-set",
246 'type' => 'checkbox'],
247
248 ['name' => "Hide Header Title",
249 'desc' => "This will hide the title in the header for your Flickr Photoset.",
250 'id' => "flickr_hide_set_title",
251 'grouping' => "flickr-set",
252 'type' => 'checkbox'],
253
254 ['name' => "Hide Number of Photos",
255 'desc' => "This will hide the number of photos in the header in your Flickr Photoset.",
256 'id' => "flickr_hide_set_photo_count",
257 'grouping' => "flickr-set",
258 'type' => 'checkbox'],
259
260 ['name' => "Gallery Thumbnails (with other Galleries)",
261 'desc' => "Control settings for Flickr Gallery thumbnails",
262 'category' => "flickr-galleries",
263 'type' => 'section',],
264
265 ['name' => "What is this section?",
266 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
267 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-6.png' style='max-width: 600px;' alt='Galleries'/><br/><br/>
268 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' view='galleries']</code>. They are used to control the Gallery's thumbnail display",
269 'grouping' => "flickr-galleries",
270 'type' => 'blurb',],
271
272 ['name' => "Gallery Title Display",
273 'desc' => "How do you want the title of the Gallery?",
274 'id' => "flickr_gallery_title_display",
275 'grouping' => "flickr-galleries",
276 'type' => 'radio',
277 'options' => $this->title_styles()],
278
279 ['name' => "Hide Photo Count in Title Display",
280 'desc' => "This will hide the number of photos in your Gallery's title.",
281 'id' => "flickr_hide_gallery_photos_count_display",
282 'grouping' => "flickr-galleries",
283 'type' => 'checkbox'],
284
285 ['name' => "Constrain Galleries Per Row",
286 'desc' => "How do you want the control the number of gallery thumbnails per row? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
287 'id' => "flickr_galleries_per_row_constraint",
288 'grouping' => "flickr-galleries",
289 'type' => 'select',
290 'options' => ["padding" => "Fix the padding around the thumbnails",
291 "count" => "Fix the number of thumbnails per row",
292 ]],
293
294 ['name' => "Constrain by padding",
295 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
296 'id' => "flickr_galleries_constrain_by_padding",
297 'grouping' => "flickr-galleries",
298 'type' => 'text',
299 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."],
300
301 ['name' => "Constrain by number of thumbnails",
302 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
303 'id' => "flickr_galleries_constrain_by_count",
304 'grouping' => "flickr-galleries",
305 'type' => 'select',
306 'options' => $this->selection_range(1, 25)],
307
308 ['name' => "Gallery Headers (Standalone Galleries)",
309 'desc' => "Control settings for Flickr Galleries when displayed in your page",
310 'category' => "flickr-gallery",
311 'type' => 'section',],
312
313 ['name' => "What is this section?",
314 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
315 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-7.png' style='max-width: 600px;' alt='Individual galleries'/><br/><br/>
316 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' gallery_id='xyz']</code> to show its contents on the page, or if you use <code>[gallery type='flickr' user_id='abc' view='galleries']</code> and click on a thumbnail to open the included images in a popup.",
317 'grouping' => "flickr-gallery",
318 'type' => 'blurb',],
319
320 ['name' => "Hide Header Thumbnail",
321 'desc' => "This will hide the thumbnail in the header for your Flickr Gallery.",
322 'id' => "flickr_hide_gallery_thumbnail",
323 'grouping' => "flickr-gallery",
324 'type' => 'checkbox'],
325
326 ['name' => "Hide Header Title",
327 'desc' => "This will hide the title in the header for your Flickr Gallery.",
328 'id' => "flickr_hide_gallery_title",
329 'grouping' => "flickr-gallery",
330 'type' => 'checkbox'],
331
332 ['name' => "Hide Number of Photos",
333 'desc' => "This will hide the number of photos in the header in your Flickr Gallery.",
334 'id' => "flickr_hide_gallery_photo_count",
335 'grouping' => "flickr-gallery",
336 'type' => 'checkbox'],
337
338 ['name' => "Photos (Main Page)",
339 'desc' => "Control settings for Flickr Photos when displayed in your page",
340 'category' => "flickr-photos",
341 'type' => 'section',],
342
343 ['name' => "What is this section?",
344 'desc' => "Options in this section are in effect when you pick the following gallery creation options:<br/><br/>
345 <img src='".PHOTONIC_URL."Options/screenshots/Flickr-2.png' style='max-width: 600px;' alt='Photostream'/><br/><br/>
346 If you are using the shortcode, the settings kick in for <code>[gallery type='flickr' user_id='abc' photoset_id='xyz']</code>
347 or <code>[gallery type='flickr' user_id='abc' view='photos']</code>. In other words, the photos are printed directly on the page.",
348 'grouping' => "flickr-photos",
349 'type' => 'blurb',],
350
351 ['name' => "Photo Title Display",
352 'desc' => "How do you want the title of the photos?",
353 'id' => "flickr_photo_title_display",
354 'grouping' => "flickr-photos",
355 'type' => 'radio',
356 'options' => $this->title_styles()],
357
358 ['name' => "Constrain Photos Per Row",
359 'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
360 'id' => "flickr_photos_per_row_constraint",
361 'grouping' => "flickr-photos",
362 'type' => 'select',
363 'options' => ["padding" => "Fix the padding around the thumbnails",
364 "count" => "Fix the number of thumbnails per row",
365 ]],
366
367 ['name' => "Constrain by padding",
368 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
369 'id' => "flickr_photos_constrain_by_padding",
370 'grouping' => "flickr-photos",
371 'type' => 'text',
372 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."],
373
374 ['name' => "Constrain by number of thumbnails",
375 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
376 'id' => "flickr_photos_constrain_by_count",
377 'grouping' => "flickr-photos",
378 'type' => 'select',
379 'options' => $this->selection_range(1, 25)],
380
381 ['name' => "Photos (Overlaid Popup Panel)",
382 'desc' => "Control settings for Flickr Photos when displayed in a popup",
383 'category' => "flickr-photos-pop",
384 'type' => 'section',],
385
386 ['name' => "What is this section?",
387 'desc' => "Options in this section are in effect when you click on a Photoset thumbnail to launch an overlaid gallery. In other words, the photos are printed directly on a popup.",
388 'grouping' => "flickr-photos-pop",
389 'type' => 'blurb',],
390
391 ['name' => "Photo Title Display",
392 'desc' => "How do you want the title of the photos?",
393 'id' => "flickr_photo_pop_title_display",
394 'grouping' => "flickr-photos-pop",
395 'type' => 'radio',
396 'options' => $this->title_styles()],
397
398 ['name' => "Constrain Photos Per Row",
399 'desc' => "How do you want the control the number of photo thumbnails per row by default? This can be overridden by adding the '<code>columns</code>' parameter to the '<code>gallery</code>' shortcode.",
400 'id' => "flickr_photos_pop_per_row_constraint",
401 'grouping' => "flickr-photos-pop",
402 'type' => 'select',
403 'options' => ["padding" => "Fix the padding around the thumbnails",
404 "count" => "Fix the number of thumbnails per row",
405 ]],
406
407 ['name' => "Constrain by padding",
408 'desc' => " If you have constrained by padding above, enter the number of pixels here to pad the thumbs by",
409 'id' => "flickr_photos_pop_constrain_by_padding",
410 'grouping' => "flickr-photos-pop",
411 'type' => 'text',
412 'hint' => "Enter the number of pixels here (don't enter 'px'). Non-integers will be ignored."],
413
414 ['name' => "Constrain by number of thumbnails",
415 'desc' => " If you have constrained by number of thumbnails per row above, enter the number of thumbnails",
416 'id' => "flickr_photos_pop_constrain_by_count",
417 'grouping' => "flickr-photos-pop",
418 'type' => 'select',
419 'options' => $this->selection_range(1, 25)],
420 ];
421 }
422
423 public static function get_instance() {
424 if (self::$instance == null) {
425 self::$instance = new Flickr();
426 }
427 return self::$instance;
428 }
429 }
430