PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.14
Shortcodes and extra features for Phlox theme v2.17.14
2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / flickr.php
auxin-elements / includes / elements Last commit date
about-widget.php 1 year ago accordion-widget.php 1 year ago accordion.php 1 year ago attachment-url.php 1 year ago audio.php 1 year ago before-after.php 1 year ago button.php 1 year ago code.php 1 year ago contact-box.php 1 year ago contact-form.php 1 year ago custom-list.php 6 months ago divider.php 1 year ago dropcap.php 1 year ago facebook.php 1 year ago flickr.php 1 year ago gallery.php 1 year ago gmap.php 1 year ago highlight.php 1 year ago image.php 1 year ago instagram-feed.php 1 year ago latest-posts-slider.php 1 year ago popular-posts-widget.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-posts-widget.php 1 year ago recent-products.php 1 year ago related-posts.php 8 years ago sample-element.php 1 year ago search.php 1 year ago socials-list.php 1 year ago staff.php 1 year ago tab-widget.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 1 year ago
flickr.php
359 lines
1 <?php
2 /**
3 * Divider element
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2025 averta
11 */
12
13 function auxin_get_flickr_master_array( $master_array ) {
14
15 $master_array['aux_flickr'] = array(
16 'name' => __('Flickr Justified Gallery', 'auxin-elements' ),
17 'auxin_output_callback' => 'auxin_widget_flickr_callback',
18 'base' => 'aux_flickr',
19 'description' => __('It uses Flickr Justified Gallery plugin.', 'auxin-elements'),
20 'class' => 'aux-widget-flickr',
21 'show_settings_on_create' => true,
22 'weight' => 1,
23 'is_widget' => true,
24 'is_shortcode' => true,
25 'category' => THEME_NAME,
26 'group' => '',
27 'admin_enqueue_js' => '',
28 'admin_enqueue_css' => '',
29 'front_enqueue_js' => '',
30 'front_enqueue_css' => '',
31 'icon' => 'aux-element aux-pb-icons-flickr',
32 'custom_markup' => '',
33 'js_view' => '',
34 'html_template' => '',
35 'deprecated' => '',
36 'content_element' => '',
37 'as_parent' => '',
38 'as_child' => '',
39 'params' => array(
40 array(
41 'heading' => __('User ID', 'auxin-elements'),
42 'description' => sprintf(__('Displays the photostream of the specified user, no matter what is the default user ID in the settings. Remember that you can use %sidgettr%s to retrieve the user_id.', 'auxin-elements'), '<a target="_blank" href="http://idgettr.com/">','</a>'),
43 'param_name' => 'user_id',
44 'type' => 'textfield',
45 'value' => '',
46 'def_value' => '',
47 'holder' => 'textfield',
48 'class' => 'user_id',
49 'admin_label' => false,
50 'dependency' => '',
51 'weight' => '',
52 'group' => '' ,
53 'edit_field_class' => ''
54 ),
55 array(
56 'heading' => __('Flickr image type', 'auxin-elements'),
57 'description' => '',
58 'param_name' => 'flickr_type',
59 'type' => 'dropdown',
60 'value' => array(
61 'photostream' => __('Photostream' , 'auxin-elements'),
62 'galleries' => __('Galleries', 'auxin-elements'),
63 'album' => __('Album', 'auxin-elements'), // flickr set
64 'group' => __('Group pools', 'auxin-elements'),
65 'tags' => __('Tags', 'auxin-elements'),
66 ),
67 'def_value' => 'none',
68 'holder' => '',
69 'class' => 'flickr_type',
70 'admin_label' => true,
71 'dependency' => '',
72 'weight' => '',
73 'group' => '' ,
74 'edit_field_class' => ''
75 ),
76 array(
77 'heading' => __('Gallery ID', 'auxin-elements'),
78 'description' => __('To show the photos of a particular gallery, you need to know its id. For example, the id of the gallery located in the URL: http://www.flickr.com/photos/miro-mannino/galleries/72157636382842016/ is: 72157636382842016', 'auxin-elements'),
79 'param_name' => 'gallery_id',
80 'type' => 'textfield',
81 'value' => '',
82 'def_value' => '',
83 'holder' => 'textfield',
84 'class' => 'gallery_id',
85 'admin_label' => false,
86 'dependency' => array(
87 'element' => 'flickr_type',
88 'value' => 'galleries'
89 ),
90 'weight' => '',
91 'group' => '' ,
92 'edit_field_class' => ''
93 ),
94 array(
95 'heading' => __('Album ID', 'auxin-elements'),
96 'description' => __('To show the photos of a particular photo set (also called "album"), you need to know its photoset_id. For example, the photoset_id of the photo set located in the URL: http://www.flickr.com/photos/miro-mannino/sets/72157629228993613/ is: 72157629228993613', 'auxin-elements'),
97 'param_name' => 'photoset_id',
98 'type' => 'textfield',
99 'value' => '',
100 'def_value' => '',
101 'holder' => 'textfield',
102 'class' => 'photoset_id',
103 'admin_label' => false,
104 'dependency' => array(
105 'element' => 'flickr_type',
106 'value' => 'album'
107 ),
108 'weight' => '',
109 'group' => '' ,
110 'edit_field_class' => ''
111 ),
112 array(
113 'heading' => __('Group pools', 'auxin-elements'),
114 'description' => sprintf(__('Display photos of a particular group pool, you need to know the group id, that you can retrieve using %sidgettr%s.', 'auxin-elements'), '<a target="_blank" href="http://idgettr.com/">','</a>'),
115 'param_name' => 'group_id',
116 'type' => 'textfield',
117 'value' => '',
118 'def_value' => '',
119 'holder' => 'textfield',
120 'class' => 'group_id',
121 'admin_label' => false,
122 'dependency' => array(
123 'element' => 'flickr_type',
124 'value' => 'group'
125 ),
126 'weight' => '',
127 'group' => '' ,
128 'edit_field_class' => ''
129 ),
130 array(
131 'heading' => __('Tags', 'auxin-elements'),
132 'description' => __('Display photos that have some particular tags, Seprate words with , for example: cat, square, nikon', 'auxin-elements'),
133 'param_name' => 'tags',
134 'type' => 'textfield',
135 'value' => '',
136 'def_value' => '',
137 'holder' => 'textfield',
138 'class' => 'tags',
139 'admin_label' => false,
140 'dependency' => array(
141 'element' => 'flickr_type',
142 'value' => 'tags'
143 ),
144 'weight' => '',
145 'group' => '' ,
146 'edit_field_class' => ''
147 ),
148 array(
149 'heading' => __('Lightbox','auxin-elements'),
150 'description' => __('In case of using Colorbox or Swipebox, you need to enable it on Flickr Justified Gallery plugin settings.','auxin-elements'),
151 'param_name' => 'lightbox',
152 'type' => 'dropdown',
153 'value' => array(
154 'none' => __('None' , 'auxin-elements'),
155 'colorbox' => __('Colorbox', 'auxin-elements'),
156 'swipebox' => __('Swipebox', 'auxin-elements'),
157 ),
158 'def_value' => 'none',
159 'holder' => '',
160 'class' => 'lightbox',
161 'admin_label' => true,
162 'dependency' => '',
163 'weight' => '',
164 'group' => '' ,
165 'edit_field_class' => ''
166 ),
167 array(
168 'heading' => __('Images height', 'auxin-elements'),
169 'description' => __('You can use the this option to set images height in px.', 'auxin-elements'),
170 'param_name' => 'images_height',
171 'type' => 'textfield',
172 'value' => '',
173 'def_value' => '',
174 'holder' => 'textfield',
175 'class' => 'images_height',
176 'admin_label' => false,
177 'dependency' => '',
178 'weight' => '',
179 'group' => '' ,
180 'edit_field_class' => ''
181 ),
182 array(
183 'heading' => __('Max number of photos','auxin-elements'),
184 'description' => __('Maximum number of photos. Please note if pagination option is activaited then this options is used as maximum number of photos per page.', 'auxin-elements'),
185 'param_name' => 'max_num_photos',
186 'type' => 'textfield',
187 'value' => '',
188 'def_value' => '',
189 'holder' => 'textfield',
190 'class' => 'max_num_photos',
191 'admin_label' => false,
192 'dependency' => '',
193 'weight' => '',
194 'group' => '' ,
195 'edit_field_class' => ''
196 ),
197 array(
198 'heading' => __('Pagination','auxin-elements'),
199 'description' => '',
200 'param_name' => 'pagination',
201 'type' => 'dropdown',
202 'value' => array(
203 'none' => __('None' , 'auxin-elements'),
204 'prevnext' => __('Previous and Next', 'auxin-elements'),
205 'numbers' => __('Page Numbers', 'auxin-elements'),
206 ),
207 'def_value' => 'none',
208 'holder' => '',
209 'class' => 'pagination',
210 'admin_label' => true,
211 'dependency' => '',
212 'weight' => '',
213 'group' => '' ,
214 'edit_field_class' => ''
215 ),
216 array(
217 'heading' => __('Fixed height', 'auxin-elements'),
218 'description' => __('Each row has the same height, but the images will be cut more.', 'auxin-elements'),
219 'param_name' => 'fixed_height',
220 'type' => 'aux_switch',
221 'value' => '0',
222 'class' => 'fixed_height',
223 'admin_label' => false,
224 'dependency' => '',
225 'weight' => '',
226 'group' => '' ,
227 'edit_field_class' => ''
228 ),
229 array(
230 'heading' => __('Randomize images order', 'auxin-elements'),
231 'description' => '',
232 'param_name' => 'randomize',
233 'type' => 'aux_switch',
234 'value' => '0',
235 'class' => 'randomize',
236 'admin_label' => 0,
237 'dependency' => '',
238 'weight' => '',
239 'group' => '' ,
240 'edit_field_class' => ''
241 ),
242 array(
243 'heading' => __('Margin between the images','auxin-elements'),
244 'description' => __('Specifies the space between images.', 'auxin-elements'),
245 'param_name' => 'margins',
246 'type' => 'textfield',
247 'value' => '',
248 'def_value' => '',
249 'holder' => 'textfield',
250 'class' => 'margins',
251 'admin_label' => false,
252 'dependency' => '',
253 'weight' => '',
254 'group' => '' ,
255 'edit_field_class' => ''
256 )
257 )
258 );
259
260 return $master_array;
261 }
262
263 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_flickr_master_array', 10, 1 );
264
265 function auxin_widget_flickr_callback( $atts, $shortcode_content = null ){
266
267 $default_atts = array(
268 'user_id' => '',
269 'flickr_type' => 'photostream',
270 'gallery_id' => '',
271 'photoset_id' => '',
272 'group_id' => '',
273 'tags' => '',
274 'max_num_photos' => '',
275 'images_height' => '',
276 'lightbox' => 'none',
277 'pagination' => 'none',
278 'margins' => '',
279 'fixed_height' => false,
280 'randomize' => false,
281 'custom_el_id' => '',
282 'base_class' => 'aux-widget-flickr'
283 );
284
285 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
286 extract( $result['parsed_atts'] );
287
288 $shortcode_name = "";
289 $justify_shortcode = "";
290
291 ob_start();
292
293
294 switch ($flickr_type) {
295 case 'photostream':
296 $shortcode_name = "flickr_photostream";
297 break;
298 case 'galleries':
299 $shortcode_name = 'flickr_gallery id="' . $gallery_id . '"';
300 break;
301 case 'album':
302 $shortcode_name = 'flickr_set id="' . $photoset_id . '"';
303 break;
304 case 'group':
305 $shortcode_name = 'flickr_group id="' . $group_id . '"';
306 break;
307 case 'tags':
308 $shortcode_name = 'flickr_tags tags="' . $tags . '"';
309 break;
310 }
311
312 if( ! empty( $user_id ) ) {
313 $user_id = 'user_id="' . $user_id . '"';
314 }
315
316 if( ! empty( $pagination ) ) {
317 $pagination = 'pagination="' . $pagination . '"';
318 }
319
320 if( ! empty( $max_num_photos ) ) {
321 $max_num_photos = 'max_num_photos="' . $max_num_photos . '"';
322 }
323
324 if( ! empty( $images_height ) ) {
325 $images_height = 'images_height="' . $images_height . '"';
326 }
327
328
329 if( ! empty( $lightbox ) ) {
330 $lightbox = 'lightbox="' . $lightbox . '"';
331 }
332
333 if( ! empty( $margins ) ) {
334 $margins = 'margins="' . $margins . '"';
335 }
336
337 if( empty( $fixed_height ) ){
338 $fixed_height = 0;
339 } else {
340 $fixed_height = 1;
341 }
342 $fixed_height = 'fixed_height="' . $fixed_height .'"';
343
344 if( empty( $randomize ) ){
345 $randomize = 0;
346 } else {
347 $randomize = 1;
348 }
349 $randomize = 'randomize="' . $randomize .'"';
350
351 $justify_shortcode = '[' . $shortcode_name . ' ' . $user_id . ' ' . $images_height . ' ' . $margins . ' ' . $fixed_height . ' ' . $max_num_photos . ' ' . $randomize . ' ' . $lightbox . ' ' . $pagination . ']';
352
353 echo do_shortcode( $justify_shortcode );
354
355 return ob_get_clean();
356
357 }
358
359