PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.9.22
Shortcodes and extra features for Phlox theme v2.9.22
2.17.21 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 4 years ago accordion-widget.php 4 years ago accordion.php 4 years ago attachment-url.php 4 years ago audio.php 4 years ago before-after.php 4 years ago button.php 4 years ago code.php 4 years ago contact-box.php 4 years ago contact-form.php 4 years ago custom-list.php 4 years ago divider.php 4 years ago dropcap.php 4 years ago facebook.php 4 years ago flickr.php 4 years ago gallery.php 4 years ago general-element-fields.php 4 years ago gmap.php 4 years ago highlight.php 4 years ago image.php 4 years ago instagram-feed.php 4 years ago latest-items.php 4 years ago latest-posts-slider.php 4 years ago popular-posts-widget.php 4 years ago products-grid.php 4 years ago quote.php 4 years ago recent-posts-grid-carousel.php 3 years ago recent-posts-land-style.php 4 years ago recent-posts-masonry.php 4 years ago recent-posts-tiles-carousel.php 4 years ago recent-posts-tiles.php 4 years ago recent-posts-timeline.php 4 years ago recent-posts-widget.php 4 years ago recent-products.php 4 years ago related-posts.php 8 years ago sample-element.php 4 years ago search.php 4 years ago socials-list.php 4 years ago staff.php 4 years ago tab-widget.php 4 years ago tabs.php 4 years ago testimonial.php 4 years ago text.php 4 years ago touch-slider.php 4 years ago video.php 4 years ago
flickr.php
360 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-2022 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 'is_vc' => true,
26 'category' => THEME_NAME,
27 'group' => '',
28 'admin_enqueue_js' => '',
29 'admin_enqueue_css' => '',
30 'front_enqueue_js' => '',
31 'front_enqueue_css' => '',
32 'icon' => 'aux-element aux-pb-icons-flickr',
33 'custom_markup' => '',
34 'js_view' => '',
35 'html_template' => '',
36 'deprecated' => '',
37 'content_element' => '',
38 'as_parent' => '',
39 'as_child' => '',
40 'params' => array(
41 array(
42 'heading' => __('User ID', 'auxin-elements'),
43 '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>'),
44 'param_name' => 'user_id',
45 'type' => 'textfield',
46 'value' => '',
47 'def_value' => '',
48 'holder' => 'textfield',
49 'class' => 'user_id',
50 'admin_label' => false,
51 'dependency' => '',
52 'weight' => '',
53 'group' => '' ,
54 'edit_field_class' => ''
55 ),
56 array(
57 'heading' => __('Flickr image type', 'auxin-elements'),
58 'description' => '',
59 'param_name' => 'flickr_type',
60 'type' => 'dropdown',
61 'value' => array(
62 'photostream' => __('Photostream' , 'auxin-elements'),
63 'galleries' => __('Galleries', 'auxin-elements'),
64 'album' => __('Album', 'auxin-elements'), // flickr set
65 'group' => __('Group pools', 'auxin-elements'),
66 'tags' => __('Tags', 'auxin-elements'),
67 ),
68 'def_value' => 'none',
69 'holder' => '',
70 'class' => 'flickr_type',
71 'admin_label' => true,
72 'dependency' => '',
73 'weight' => '',
74 'group' => '' ,
75 'edit_field_class' => ''
76 ),
77 array(
78 'heading' => __('Gallery ID', 'auxin-elements'),
79 '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'),
80 'param_name' => 'gallery_id',
81 'type' => 'textfield',
82 'value' => '',
83 'def_value' => '',
84 'holder' => 'textfield',
85 'class' => 'gallery_id',
86 'admin_label' => false,
87 'dependency' => array(
88 'element' => 'flickr_type',
89 'value' => 'galleries'
90 ),
91 'weight' => '',
92 'group' => '' ,
93 'edit_field_class' => ''
94 ),
95 array(
96 'heading' => __('Album ID', 'auxin-elements'),
97 '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'),
98 'param_name' => 'photoset_id',
99 'type' => 'textfield',
100 'value' => '',
101 'def_value' => '',
102 'holder' => 'textfield',
103 'class' => 'photoset_id',
104 'admin_label' => false,
105 'dependency' => array(
106 'element' => 'flickr_type',
107 'value' => 'album'
108 ),
109 'weight' => '',
110 'group' => '' ,
111 'edit_field_class' => ''
112 ),
113 array(
114 'heading' => __('Group pools', 'auxin-elements'),
115 '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>'),
116 'param_name' => 'group_id',
117 'type' => 'textfield',
118 'value' => '',
119 'def_value' => '',
120 'holder' => 'textfield',
121 'class' => 'group_id',
122 'admin_label' => false,
123 'dependency' => array(
124 'element' => 'flickr_type',
125 'value' => 'group'
126 ),
127 'weight' => '',
128 'group' => '' ,
129 'edit_field_class' => ''
130 ),
131 array(
132 'heading' => __('Tags', 'auxin-elements'),
133 'description' => __('Display photos that have some particular tags, Seprate words with , for example: cat, square, nikon', 'auxin-elements'),
134 'param_name' => 'tags',
135 'type' => 'textfield',
136 'value' => '',
137 'def_value' => '',
138 'holder' => 'textfield',
139 'class' => 'tags',
140 'admin_label' => false,
141 'dependency' => array(
142 'element' => 'flickr_type',
143 'value' => 'tags'
144 ),
145 'weight' => '',
146 'group' => '' ,
147 'edit_field_class' => ''
148 ),
149 array(
150 'heading' => __('Lightbox','auxin-elements'),
151 'description' => __('In case of using Colorbox or Swipebox, you need to enable it on Flickr Justified Gallery plugin settings.','auxin-elements'),
152 'param_name' => 'lightbox',
153 'type' => 'dropdown',
154 'value' => array(
155 'none' => __('None' , 'auxin-elements'),
156 'colorbox' => __('Colorbox', 'auxin-elements'),
157 'swipebox' => __('Swipebox', 'auxin-elements'),
158 ),
159 'def_value' => 'none',
160 'holder' => '',
161 'class' => 'lightbox',
162 'admin_label' => true,
163 'dependency' => '',
164 'weight' => '',
165 'group' => '' ,
166 'edit_field_class' => ''
167 ),
168 array(
169 'heading' => __('Images height', 'auxin-elements'),
170 'description' => __('You can use the this option to set images height in px.', 'auxin-elements'),
171 'param_name' => 'images_height',
172 'type' => 'textfield',
173 'value' => '',
174 'def_value' => '',
175 'holder' => 'textfield',
176 'class' => 'images_height',
177 'admin_label' => false,
178 'dependency' => '',
179 'weight' => '',
180 'group' => '' ,
181 'edit_field_class' => ''
182 ),
183 array(
184 'heading' => __('Max number of photos','auxin-elements'),
185 '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'),
186 'param_name' => 'max_num_photos',
187 'type' => 'textfield',
188 'value' => '',
189 'def_value' => '',
190 'holder' => 'textfield',
191 'class' => 'max_num_photos',
192 'admin_label' => false,
193 'dependency' => '',
194 'weight' => '',
195 'group' => '' ,
196 'edit_field_class' => ''
197 ),
198 array(
199 'heading' => __('Pagination','auxin-elements'),
200 'description' => '',
201 'param_name' => 'pagination',
202 'type' => 'dropdown',
203 'value' => array(
204 'none' => __('None' , 'auxin-elements'),
205 'prevnext' => __('Previous and Next', 'auxin-elements'),
206 'numbers' => __('Page Numbers', 'auxin-elements'),
207 ),
208 'def_value' => 'none',
209 'holder' => '',
210 'class' => 'pagination',
211 'admin_label' => true,
212 'dependency' => '',
213 'weight' => '',
214 'group' => '' ,
215 'edit_field_class' => ''
216 ),
217 array(
218 'heading' => __('Fixed height', 'auxin-elements'),
219 'description' => __('Each row has the same height, but the images will be cut more.', 'auxin-elements'),
220 'param_name' => 'fixed_height',
221 'type' => 'aux_switch',
222 'value' => '0',
223 'class' => 'fixed_height',
224 'admin_label' => false,
225 'dependency' => '',
226 'weight' => '',
227 'group' => '' ,
228 'edit_field_class' => ''
229 ),
230 array(
231 'heading' => __('Randomize images order', 'auxin-elements'),
232 'description' => '',
233 'param_name' => 'randomize',
234 'type' => 'aux_switch',
235 'value' => '0',
236 'class' => 'randomize',
237 'admin_label' => 0,
238 'dependency' => '',
239 'weight' => '',
240 'group' => '' ,
241 'edit_field_class' => ''
242 ),
243 array(
244 'heading' => __('Margin between the images','auxin-elements'),
245 'description' => __('Specifies the space between images.', 'auxin-elements'),
246 'param_name' => 'margins',
247 'type' => 'textfield',
248 'value' => '',
249 'def_value' => '',
250 'holder' => 'textfield',
251 'class' => 'margins',
252 'admin_label' => false,
253 'dependency' => '',
254 'weight' => '',
255 'group' => '' ,
256 'edit_field_class' => ''
257 )
258 )
259 );
260
261 return $master_array;
262 }
263
264 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_flickr_master_array', 10, 1 );
265
266 function auxin_widget_flickr_callback( $atts, $shortcode_content = null ){
267
268 $default_atts = array(
269 'user_id' => '',
270 'flickr_type' => 'photostream',
271 'gallery_id' => '',
272 'photoset_id' => '',
273 'group_id' => '',
274 'tags' => '',
275 'max_num_photos' => '',
276 'images_height' => '',
277 'lightbox' => 'none',
278 'pagination' => 'none',
279 'margins' => '',
280 'fixed_height' => false,
281 'randomize' => false,
282 'custom_el_id' => '',
283 'base_class' => 'aux-widget-flickr'
284 );
285
286 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
287 extract( $result['parsed_atts'] );
288
289 $shortcode_name = "";
290 $justify_shortcode = "";
291
292 ob_start();
293
294
295 switch ($flickr_type) {
296 case 'photostream':
297 $shortcode_name = "flickr_photostream";
298 break;
299 case 'galleries':
300 $shortcode_name = 'flickr_gallery id="' . $gallery_id . '"';
301 break;
302 case 'album':
303 $shortcode_name = 'flickr_set id="' . $photoset_id . '"';
304 break;
305 case 'group':
306 $shortcode_name = 'flickr_group id="' . $group_id . '"';
307 break;
308 case 'tags':
309 $shortcode_name = 'flickr_tags tags="' . $tags . '"';
310 break;
311 }
312
313 if( ! empty( $user_id ) ) {
314 $user_id = 'user_id="' . $user_id . '"';
315 }
316
317 if( ! empty( $pagination ) ) {
318 $pagination = 'pagination="' . $pagination . '"';
319 }
320
321 if( ! empty( $max_num_photos ) ) {
322 $max_num_photos = 'max_num_photos="' . $max_num_photos . '"';
323 }
324
325 if( ! empty( $images_height ) ) {
326 $images_height = 'images_height="' . $images_height . '"';
327 }
328
329
330 if( ! empty( $lightbox ) ) {
331 $lightbox = 'lightbox="' . $lightbox . '"';
332 }
333
334 if( ! empty( $margins ) ) {
335 $margins = 'margins="' . $margins . '"';
336 }
337
338 if( empty( $fixed_height ) ){
339 $fixed_height = 0;
340 } else {
341 $fixed_height = 1;
342 }
343 $fixed_height = 'fixed_height="' . $fixed_height .'"';
344
345 if( empty( $randomize ) ){
346 $randomize = 0;
347 } else {
348 $randomize = 1;
349 }
350 $randomize = 'randomize="' . $randomize .'"';
351
352 $justify_shortcode = '[' . $shortcode_name . ' ' . $user_id . ' ' . $images_height . ' ' . $margins . ' ' . $fixed_height . ' ' . $max_num_photos . ' ' . $randomize . ' ' . $lightbox . ' ' . $pagination . ']';
353
354 echo do_shortcode( $justify_shortcode );
355
356 return ob_get_clean();
357
358 }
359
360