Version Description
Download this release
Release Info
Developer | slickremix |
Plugin | Feed Them Social – Facebook, Instagram, Twitter, YouTube, Pinterest |
Version | 2.9.6 |
Comparing to | |
See all releases |
Code changes from version 2.9.5 to 2.9.6
- feed-them.php +5 -5
- feeds/facebook/class-fts-facebook-feed-post-types.php +1188 -1168
- feeds/facebook/class-fts-facebook-feed.php +2257 -2245
- feeds/instagram/class-fts-instagram-feed.php +1 -1
- readme.txt +5 -2
feed-them.php
CHANGED
@@ -7,18 +7,18 @@
|
|
7 |
* Plugin Name: Feed Them Social - for Twitter feed, Youtube, and more
|
8 |
* Plugin URI: https://feedthemsocial.com/
|
9 |
* Description: Display a Custom Facebook feed, Instagram feed, Twitter feed and YouTube feed on pages, posts or widgets.
|
10 |
-
* Version: 2.9.
|
11 |
* Author: SlickRemix
|
12 |
* Author URI: https://www.slickremix.com/
|
13 |
* Text Domain: feed-them-social
|
14 |
* Domain Path: /languages
|
15 |
* Requires at least: WordPress 4.0.0
|
16 |
-
* Tested up to: WordPress 5.7.
|
17 |
-
* Stable tag: 2.9.
|
18 |
* License: GPLv2 or later
|
19 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
20 |
*
|
21 |
-
* @version 2.9.
|
22 |
* @package FeedThemSocial/Core
|
23 |
* @copyright Copyright (c) 2012-2021 SlickRemix
|
24 |
*
|
@@ -31,7 +31,7 @@
|
|
31 |
*
|
32 |
* Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
|
33 |
*/
|
34 |
-
define( 'FTS_CURRENT_VERSION', '2.9.
|
35 |
|
36 |
define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
|
37 |
|
7 |
* Plugin Name: Feed Them Social - for Twitter feed, Youtube, and more
|
8 |
* Plugin URI: https://feedthemsocial.com/
|
9 |
* Description: Display a Custom Facebook feed, Instagram feed, Twitter feed and YouTube feed on pages, posts or widgets.
|
10 |
+
* Version: 2.9.6
|
11 |
* Author: SlickRemix
|
12 |
* Author URI: https://www.slickremix.com/
|
13 |
* Text Domain: feed-them-social
|
14 |
* Domain Path: /languages
|
15 |
* Requires at least: WordPress 4.0.0
|
16 |
+
* Tested up to: WordPress 5.7.1
|
17 |
+
* Stable tag: 2.9.6
|
18 |
* License: GPLv2 or later
|
19 |
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
20 |
*
|
21 |
+
* @version 2.9.6
|
22 |
* @package FeedThemSocial/Core
|
23 |
* @copyright Copyright (c) 2012-2021 SlickRemix
|
24 |
*
|
31 |
*
|
32 |
* Makes sure any js or css changes are reloaded properly. Added to enqued css and js files throughout!
|
33 |
*/
|
34 |
+
define( 'FTS_CURRENT_VERSION', '2.9.6' );
|
35 |
|
36 |
define( 'FEED_THEM_SOCIAL_NOTICE_STATUS', get_option( 'rating_fts_slick_notice', false ) );
|
37 |
|
feeds/facebook/class-fts-facebook-feed-post-types.php
CHANGED
@@ -9,1175 +9,1195 @@
|
|
9 |
class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed {
|
10 |
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
|
|
|
|
|
|
|
|
|
|
647 |
>' . esc_html( 'Get Directions', 'feed-them-social' ) . '</a>';
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1135 |
$profile_photo_exists_check = isset( $post_data->fts_profile_pic_url ) && strpos( $post_data->fts_profile_pic_url, 'profilepic' ) !== false ? $post_data->fts_profile_pic_url : $avatar_id;
|
1136 |
-
|
1137 |
echo '</div>';
|
1138 |
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
}//end class
|
9 |
class FTS_Facebook_Feed_Post_Types extends FTS_Facebook_Feed {
|
10 |
|
11 |
|
12 |
+
/**
|
13 |
+
* Feed Location Option
|
14 |
+
*
|
15 |
+
* Display Location flag and text
|
16 |
+
*
|
17 |
+
* @param string $fb_places_id The ID.
|
18 |
+
* @param string $fb_name The facebook page name.
|
19 |
+
* @param string $fb_places_name The location name.
|
20 |
+
* @since 1.9.6
|
21 |
+
*/
|
22 |
+
public function feed_location_option( $fb_places_id, $fb_name, $fb_places_name ) {
|
23 |
+
echo '<div class="fts-fb-location-wrap">';
|
24 |
+
echo '<div class="fts-fb-location-img"></div>';
|
25 |
+
echo '<a href="' . esc_url( 'https://www.facebook.com/' . $fb_places_id . '/' ) . '" class="fts-fb-location-link" target="_blank" rel="noreferrer">' . esc_attr( $fb_name ) . '</a>';
|
26 |
+
echo '<div class="fts-fb-location-name">' . esc_html( $fb_places_name ) . '</div>';
|
27 |
+
echo '</div>';
|
28 |
+
}
|
29 |
+
/**
|
30 |
+
* Feed Post Types
|
31 |
+
*
|
32 |
+
* Display Facebook Feed.
|
33 |
+
*
|
34 |
+
* @param string $set_zero A way to skip posts.
|
35 |
+
* @param string $fb_type The type of Facebook Feed.
|
36 |
+
* @param string $post_data All post info.
|
37 |
+
* @param string $fb_shortcode All shortcode options picked.
|
38 |
+
* @param string $response_post_array All post info.
|
39 |
+
* @param string $single_event_array_response All post info.
|
40 |
+
* @since 1.9.6
|
41 |
+
*/
|
42 |
+
public function feed_post_types( $set_zero, $fb_type, $post_data, $fb_shortcode, $response_post_array, $single_event_array_response = null ) {
|
43 |
+
|
44 |
+
// echo '<pre>';
|
45 |
+
// print_r($lcs_array);
|
46 |
+
// echo '</pre>';
|
47 |
+
// echo 'ASDF';
|
48 |
+
// Reviews Plugin.
|
49 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
|
50 |
+
$fts_facebook_reviews = new FTS_Facebook_Reviews();
|
51 |
+
}
|
52 |
+
|
53 |
+
$fts_dynamic_vid_name_string = sanitize_key( $this->fts_rand_string( 10 ) . '_' . $fb_shortcode['type'] );
|
54 |
+
|
55 |
+
if ( $set_zero === $fb_shortcode['posts'] ) {
|
56 |
+
return;
|
57 |
+
}
|
58 |
+
// Create Facebook Variables.
|
59 |
+
$fb_final_story = '';
|
60 |
+
$first_dir = '';
|
61 |
+
$fb_picture = isset( $post_data->picture ) ? $post_data->picture : '';
|
62 |
+
$fb_link = isset( $post_data->attachments->data[0]->url ) ? $post_data->attachments->data[0]->url : '';
|
63 |
+
$fb_name = isset( $post_data->name ) ? $post_data->name : '';
|
64 |
+
$fb_caption = isset( $post_data->attachments->data[0]->caption ) ? $post_data->attachments->data[0]->caption : '';
|
65 |
+
$fb_description = isset( $post_data->attachments->data[0]->description ) ? $post_data->attachments->data[0]->description : '';
|
66 |
+
$fb_link_event_name = isset( $post_data->to->data[0]->name ) ? $post_data->to->data[0]->name : '';
|
67 |
+
$fb_story = isset( $post_data->story ) ? $post_data->story : '';
|
68 |
+
$fb_icon = isset( $post_data->icon ) ? $post_data->icon : '';
|
69 |
+
$fb_by = isset( $post_data->properties->text ) ? $post_data->properties->text : '';
|
70 |
+
$fb_bylink = isset( $post_data->properties->href ) ? $post_data->properties->href : '';
|
71 |
+
$fb_post_share_count = isset( $post_data->shares->count ) ? $post_data->shares->count : '';
|
72 |
+
$fb_post_like_count_array = isset( $post_data->likes->data ) ? $post_data->likes->data : '';
|
73 |
+
$fb_post_comments_count_array = isset( $post_data->comments->data ) ? $post_data->comments->data : '';
|
74 |
+
$fb_post_object_id = isset( $post_data->attachments->data[0]->id ) ? $post_data->attachments->data[0]->id : '';
|
75 |
+
$fb_album_photo_count = isset( $post_data->count ) ? $post_data->count : '';
|
76 |
+
$fb_album_cover = isset( $post_data->photos->data[0]->images[0]->source ) ? $post_data->photos->data[0]->images[0]->source : '';
|
77 |
+
$fb_album_picture = isset( $post_data->source ) ? $post_data->source : '';
|
78 |
+
$fb_places_name = isset( $post_data->place->name ) ? $post_data->place->name : '';
|
79 |
+
$fb_places_id = isset( $post_data->place->id ) ? $post_data->place->id : '';
|
80 |
+
|
81 |
+
$fb_attachments_title = isset( $post_data->attachments->data[0]->title ) ? $post_data->attachments->data[0]->title : '';
|
82 |
+
$fb_attachments = isset( $post_data->attachments ) ? $post_data->attachments : '';
|
83 |
+
$fb_picture_job = isset( $post_data->attachments->data[0]->media->image->src ) ? $post_data->attachments->data[0]->media->image->src : '';
|
84 |
+
// youtube and vimeo embed url.
|
85 |
+
$fb_video_embed = isset( $post_data->attachments->data[0]->media->source ) ? $post_data->attachments->data[0]->media->source : '';
|
86 |
+
|
87 |
+
$fb_post_from_id = isset( $post_data->from->id ) ? $post_data->from->id : '';
|
88 |
+
$from_id_picture = $fb_post_from_id !== $fb_shortcode['id'] ? $fb_shortcode['id'] : $fb_post_from_id;
|
89 |
+
|
90 |
+
// if (isset($post_data->format[1]->picture)) {.
|
91 |
+
// $video_photo = $post_data->format[1]->picture;.
|
92 |
+
// } elseif (isset($post_data->format[0]->picture)) {.
|
93 |
+
// $video_photo = $post_data->format[0]->picture;.
|
94 |
+
// } else {.
|
95 |
+
// $video_photo = $post_data->picture;.
|
96 |
+
// }.
|
97 |
+
if ( isset( $post_data->format[3]->picture ) ) {
|
98 |
+
$video_photo = $post_data->format[3]->picture;
|
99 |
+
} elseif ( isset( $post_data->format[2]->picture ) ) {
|
100 |
+
$video_photo = $post_data->format[2]->picture;
|
101 |
+
} elseif ( isset( $post_data->format[1]->picture ) ) {
|
102 |
+
$video_photo = $post_data->format[1]->picture;
|
103 |
+
} elseif ( isset( $post_data->format[0]->picture ) ) {
|
104 |
+
$video_photo = $post_data->format[0]->picture;
|
105 |
+
} else {
|
106 |
+
$video_photo = '';
|
107 |
+
}
|
108 |
+
|
109 |
+
if ( ! empty( $post_data->format[3]->height ) && '0' !== $post_data->format[3]->height ) {
|
110 |
+
$embed_html = $post_data->format[3]->embed_html;
|
111 |
+
|
112 |
+
$embed_width = $post_data->format[3]->width;
|
113 |
+
$embed_height = $post_data->format[3]->height;
|
114 |
+
} elseif ( ! empty( $post_data->format[2]->height ) && '0' !== $post_data->format[2]->height ) {
|
115 |
+
$embed_html = $post_data->format[2]->embed_html;
|
116 |
+
$embed_width = $post_data->format[2]->width;
|
117 |
+
$embed_height = $post_data->format[2]->height;
|
118 |
+
} elseif ( ! empty( $post_data->format[1]->height ) && '0' !== $post_data->format[1]->height ) {
|
119 |
+
$embed_html = $post_data->format[1]->embed_html;
|
120 |
+
$embed_width = $post_data->format[1]->width;
|
121 |
+
$embed_height = $post_data->format[1]->height;
|
122 |
+
} elseif ( ! empty( $post_data->format[0]->height ) && '0' !== $post_data->format[0]->height ) {
|
123 |
+
$embed_html = $post_data->format[0]->embed_html;
|
124 |
+
$embed_width = $post_data->format[0]->width;
|
125 |
+
$embed_height = $post_data->format[0]->height;
|
126 |
+
} else {
|
127 |
+
$embed_html = 'none';
|
128 |
+
$embed_width = '';
|
129 |
+
$embed_height = '';
|
130 |
+
}
|
131 |
+
|
132 |
+
// This will take our embed iframe from the array and then strip out the src url for the iframe so we can.
|
133 |
+
// add this to our maginific popup.
|
134 |
+
if ( 'none' !== $embed_html ) {
|
135 |
+
preg_match( '/src="([^"]+)"/', $embed_html, $match );
|
136 |
+
|
137 |
+
$embed_html = $match[1] . '&autoplay=true';
|
138 |
+
// we do this check so we can add a data-height class name for our popup to know that we need to add the height to the iframe.
|
139 |
+
// otherwise we let the magnific pop up scaler class do the work.
|
140 |
+
if ( $embed_height > $embed_width ) {
|
141 |
+
$data_height = 'fts-greater-than-width-height';
|
142 |
+
} elseif ( $embed_height === $embed_width ) {
|
143 |
+
$data_height = 'fts-equal-width-height';
|
144 |
+
} else {
|
145 |
+
$data_height = '';
|
146 |
+
}
|
147 |
+
// fts-view-fb-videos-btn.
|
148 |
+
$fts_view_fb_videos_btn = 'fts-view-fb-videos-btn';
|
149 |
+
|
150 |
+
} else {
|
151 |
+
$embed_html = $video_photo;
|
152 |
+
$fts_view_fb_videos_btn = '';
|
153 |
+
$data_height = '';
|
154 |
+
}
|
155 |
+
|
156 |
+
$fb_video = isset( $post_data->embed_html ) ? $post_data->embed_html : '';
|
157 |
+
$fb_video_picture = isset( $post_data->format[2]->picture ) ? $post_data->format[2]->picture : '';
|
158 |
+
|
159 |
+
if ( $fb_album_cover ) {
|
160 |
+
// $photo_data = json_decode( $response_post_array[ $fb_album_cover . '_photo' ] );
|
161 |
+
}
|
162 |
+
if ( isset( $post_data->id ) ) {
|
163 |
+
$fb_post_id = $post_data->id;
|
164 |
+
$fb_post_full_id = explode( '_', $fb_post_id );
|
165 |
+
if ( isset( $fb_post_full_id[0] ) ) {
|
166 |
+
$fb_post_user_id = $fb_post_full_id[0];
|
167 |
+
}
|
168 |
+
if ( isset( $fb_post_full_id[1] ) ) {
|
169 |
+
$fb_post_single_id = $fb_post_full_id[1];
|
170 |
+
} else {
|
171 |
+
$fb_post_single_id = '';
|
172 |
+
}
|
173 |
+
} else {
|
174 |
+
$fb_post_id = '';
|
175 |
+
$fb_post_user_id = '';
|
176 |
+
}
|
177 |
+
|
178 |
+
$fb_joblink = isset( $post_data->id, $post_data->from->id ) ? 'https://www.facebook.com/' . $post_data->from->id . '/posts/' . $fb_post_single_id . '' : '';
|
179 |
+
|
180 |
+
if ( 'albums' === $fb_shortcode['type'] && ! $fb_album_cover ) {
|
181 |
+
unset( $post_data );
|
182 |
+
}
|
183 |
+
// Create Post Data Key.
|
184 |
+
if ( isset( $post_data->attachments->data[0]->object_id ) ) {
|
185 |
+
$post_data_key = $post_data->attachments->data[0]->object_id;
|
186 |
+
} else {
|
187 |
+
$post_data_key = isset( $post_data->id ) ? $post_data->id : '';
|
188 |
+
}
|
189 |
+
// Count Likes/Shares/.
|
190 |
+
$lcs_array = $this->get_likes_shares_comments( $response_post_array, $post_data_key, $fb_post_share_count );
|
191 |
+
|
192 |
+
// echo '<pre>';
|
193 |
+
// print_r($fb_post_share_count);
|
194 |
+
// echo '</pre>';
|
195 |
+
|
196 |
+
// $fb_location = isset( $post_data->location ) ? $post_data->location : '';
|
197 |
+
$fb_embed_vid = isset( $post_data->embed_html ) ? $post_data->embed_html : '';
|
198 |
+
$fb_from_name = isset( $post_data->from->name ) ? $post_data->from->name : '';
|
199 |
+
$fb_from_name = preg_quote( $fb_from_name, '/' );
|
200 |
+
|
201 |
+
$fb_story = isset( $post_data->story ) ? $post_data->story : '';
|
202 |
+
$fts_custom_date = get_option( 'fts-custom-date' ) ? get_option( 'fts-custom-date' ) : '';
|
203 |
+
$fts_custom_time = get_option( 'fts-custom-time' ) ? get_option( 'fts-custom-time' ) : '';
|
204 |
+
$custom_date_check = get_option( 'fts-date-and-time-format' ) ? get_option( 'fts-date-and-time-format' ) : '';
|
205 |
+
|
206 |
+
$fb_picture_gallery1 = isset( $post_data->attachments->data[0]->subattachments->data[1]->media->image->src ) ? $post_data->attachments->data[0]->subattachments->data[1]->media->image->src : '';
|
207 |
+
$fb_picture_gallery2 = isset( $post_data->attachments->data[0]->subattachments->data[2]->media->image->src ) ? $post_data->attachments->data[0]->subattachments->data[2]->media->image->src : '';
|
208 |
+
$fb_picture_gallery3 = isset( $post_data->attachments->data[0]->subattachments->data[3]->media->image->src ) ? $post_data->attachments->data[0]->subattachments->data[3]->media->image->src : '';
|
209 |
+
|
210 |
+
// we get the width of the first attachment so we can set the max width for the frame around the main image and thumbs.. this makes it so our percent width on thumbnails are nice and aligned.
|
211 |
+
$fb_picture_gallery0_width = isset( $post_data->attachments->data[0]->subattachments->data[0]->media->image->src ) ? $post_data->attachments->data[0]->subattachments->data[0]->media->image->width : '';
|
212 |
+
|
213 |
+
// June 22, 2017 - Going to leave the attachments description idea for a future update, lots more work to get the likes and comments for attachments and have that info be in the popup.
|
214 |
+
// $fb_pictureGalleryDescription0 = isset($post_data->attachments->data[0]->subattachments->data[1]->description) ? $post_data->attachments->data[0]->subattachments->data[1]->media->image->src : '';.
|
215 |
+
// $fb_pictureGalleryDescription1 = isset($post_data->attachments->data[0]->subattachments->data[2]->description)? $post_data->attachments->data[0]->subattachments->data[2]->media->image->src : '';.
|
216 |
+
// $fb_pictureGalleryDescription2 = isset($post_data->attachments->data[0]->subattachments->data[3]->description) ? $post_data->attachments->data[0]->subattachments->data[3]->media->image->src : '';.
|
217 |
+
// KZeni Edit: https://github.com/KZeni
|
218 |
+
// February 25, 2019 - Uncommented Description variables so they can be used when making it so the pictures meet accessibility standards.
|
219 |
+
$picture_from_fb = __( 'Picture from Facebook', 'feed-them-social' );
|
220 |
+
$fb_pictureGalleryDescription0 = isset( $post_data->attachments->data[0]->subattachments->data[1]->description ) ? $post_data->attachments->data[0]->subattachments->data[1]->description : $picture_from_fb;
|
221 |
+
$fb_pictureGalleryDescription1 = isset( $post_data->attachments->data[0]->subattachments->data[2]->description ) ? $post_data->attachments->data[0]->subattachments->data[2]->description : $picture_from_fb;
|
222 |
+
$fb_pictureGalleryDescription2 = isset( $post_data->attachments->data[0]->subattachments->data[3]->description ) ? $post_data->attachments->data[0]->subattachments->data[3]->description : $picture_from_fb;
|
223 |
+
|
224 |
+
$fb_picture_gallery_link1 = isset( $post_data->attachments->data[0]->subattachments->data[1]->target->url ) ? $post_data->attachments->data[0]->subattachments->data[1]->target->url : '';
|
225 |
+
$fb_picture_gallery_link2 = isset( $post_data->attachments->data[0]->subattachments->data[2]->target->url ) ? $post_data->attachments->data[0]->subattachments->data[2]->target->url : '';
|
226 |
+
$fb_picture_gallery_link3 = isset( $post_data->attachments->data[0]->subattachments->data[3]->target->url ) ? $post_data->attachments->data[0]->subattachments->data[3]->target->url : '';
|
227 |
+
|
228 |
+
if ( isset( $fb_shortcode['scrollhorz_or_carousel'], $fb_shortcode['slider_spacing'] ) && ! empty( $fb_shortcode['slider_spacing'] ) && 'carousel' === $fb_shortcode['scrollhorz_or_carousel'] ) {
|
229 |
+
|
230 |
+
$fb_shortcode['space_between_photos'] = '0 ' . $fb_shortcode['slider_spacing'];
|
231 |
+
|
232 |
+
}
|
233 |
+
|
234 |
+
if ( empty( $fts_custom_date ) && empty( $fts_custom_time ) && 'fts-custom-date' !== $custom_date_check ) {
|
235 |
+
$custom_date_format = $custom_date_check;
|
236 |
+
} elseif ( ! empty( $fts_custom_date ) && 'fts-custom-date' === $custom_date_check || ! empty( $fts_custom_time ) && 'fts-custom-date' === $custom_date_check ) {
|
237 |
+
$custom_date_format = $fts_custom_date . ' ' . $fts_custom_time;
|
238 |
+
} else {
|
239 |
+
$custom_date_format = 'F jS, Y \a\t g:ia';
|
240 |
+
}
|
241 |
+
|
242 |
+
$album_created_time = isset( $post_data->photos->data[0]->created_time ) ? $post_data->photos->data[0]->created_time : '';
|
243 |
+
$other_created_time = isset( $post_data->created_time ) ? $post_data->created_time : '';
|
244 |
+
$created_time = '' !== $album_created_time ? $album_created_time : $other_created_time;
|
245 |
+
$custom_time_format = strtotime( $created_time );
|
246 |
+
|
247 |
+
if ( ! empty( $fb_story ) ) {
|
248 |
+
$fb_final_story = preg_replace( '/\b' . $fb_from_name . 's*?\b(?=([^"]*"[^"]*")*[^"]*$)/i', '', $fb_story, 1 );
|
249 |
+
}
|
250 |
+
|
251 |
+
$fts_hide_photos_type = get_option( 'fb_hide_images_in_posts' ) ? get_option( 'fb_hide_images_in_posts' ) : 'no';
|
252 |
+
|
253 |
+
if ( strpos( $fb_link, 'youtube' ) > 0 || strpos( $fb_link, 'youtu.be' ) > 0 || strpos( $fb_link, 'vimeo' ) > 0 ) {
|
254 |
+
$fb_type = 'video_inline';
|
255 |
+
}
|
256 |
+
switch ( $fb_type ) {
|
257 |
+
case 'video_direct_response' :
|
258 |
+
case 'video_inline' :
|
259 |
+
echo '<div class="fts-jal-single-fb-post fts-fb-video-post-wrap" ';
|
260 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
261 |
+
echo 'style="width:' . esc_attr( $fb_shortcode['colmn_width'] ) . '!important; margin:' . esc_attr( $fb_shortcode['space_between_posts'] ) . '!important"';
|
262 |
+
}
|
263 |
+
echo '>';
|
264 |
+
|
265 |
+
break;
|
266 |
+
case 'app':
|
267 |
+
case 'cover':
|
268 |
+
case 'profile':
|
269 |
+
case 'mobile':
|
270 |
+
case 'wall':
|
271 |
+
case 'normal':
|
272 |
+
case 'photo':
|
273 |
+
echo "<div class='fts-fb-photo-post-wrap fts-jal-single-fb-post' ";
|
274 |
+
if ( 'album_photos' === $fb_shortcode['type'] || 'albums' === $fb_shortcode['type'] ) {
|
275 |
+
|
276 |
+
if ( isset( $fb_shortcode['scrollhorz_or_carousel'] ) && 'scrollhorz' === $fb_shortcode['scrollhorz_or_carousel'] ) {
|
277 |
+
echo 'style="max-width:' . esc_attr( $fb_shortcode['image_width'] ) . ';height:100%; margin:' . esc_attr( $fb_shortcode['space_between_photos'] ) . '!important"';
|
278 |
+
} else {
|
279 |
+
echo 'style="width:' . esc_attr( $fb_shortcode['image_width'] ) . ' !important; height:' . esc_attr( $fb_shortcode['image_height'] ) . '!important; margin:' . esc_attr( $fb_shortcode['space_between_photos'] ) . '!important"';
|
280 |
+
}
|
281 |
+
}
|
282 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
283 |
+
echo 'style="width:' . esc_attr( $fb_shortcode['colmn_width'] ) . '!important; margin:' . esc_attr( $fb_shortcode['space_between_posts'] ) . '!important"';
|
284 |
+
}
|
285 |
+
echo '>';
|
286 |
+
|
287 |
+
break;
|
288 |
+
case 'album':
|
289 |
+
default:
|
290 |
+
echo '<div class="fts-jal-single-fb-post"';
|
291 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
292 |
+
echo 'style="width:' . esc_attr( $fb_shortcode['colmn_width'] ) . '!important; margin:' . esc_attr( $fb_shortcode['space_between_posts'] ) . '!important"';
|
293 |
+
}
|
294 |
+
echo '>';
|
295 |
+
break;
|
296 |
+
}
|
297 |
+
// output Single Post Wrap.
|
298 |
+
// Don't echo if Events Feed.
|
299 |
+
if ( 'events' !== $fb_shortcode['type'] ) {
|
300 |
+
|
301 |
+
// Reviews.
|
302 |
+
$itemscope_reviews = 'reviews' === $fb_shortcode['type'] && isset( $post_data->rating ) ? 'itemscope itemtype="http://schema.org/Review"' : '';
|
303 |
+
|
304 |
+
// Right Wrap.
|
305 |
+
// $review_rating CANNOT be esc at this time.
|
306 |
+
echo '<div ' . esc_attr( $itemscope_reviews ) . ' class="fts-jal-fb-right-wrap">';
|
307 |
+
if ( 'reviews' === $fb_shortcode['type'] && isset( $post_data->rating ) ) {
|
308 |
+
echo '<meta itemprop="itemReviewed" itemscope itemtype="http://schema.org/CreativeWork"><div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating" style="display: none;"><meta itemprop="worstRating" content = "1"><meta itemprop="ratingValue" content = "' . esc_attr( $post_data->rating ) . '"><meta itemprop="bestRating" content = "5"></div>';
|
309 |
+
}
|
310 |
+
// Top Wrap (Excluding : albums, album_photos, and hiding).
|
311 |
+
$hide_date_likes_comments = 'album_photos' === $fb_shortcode['type'] && 'yes' === $fb_shortcode['hide_date_likes_comments'] || 'albums' === $fb_shortcode['type'] && 'yes' === $fb_shortcode['hide_date_likes_comments'] ? 'hide-date-likes-comments-etc' : '';
|
312 |
+
|
313 |
+
$show_media = isset( $fb_shortcode['show_media'] ) ? $fb_shortcode['show_media'] : 'bottom';
|
314 |
+
|
315 |
+
if ( 'top' !== $show_media ) {
|
316 |
+
echo '<div class="fts-jal-fb-top-wrap ' . esc_attr( $hide_date_likes_comments ) . '">';
|
317 |
+
}
|
318 |
+
// if ($fb_shortcode['type'] == 'album_photos' || $fb_shortcode['type'] == 'albums') {.
|
319 |
+
// } else {.
|
320 |
+
// User Thumbnail.
|
321 |
+
$fb_hide_shared_by_etc_text = get_option( 'fb_hide_shared_by_etc_text' );
|
322 |
+
$fb_hide_shared_by_etc_text = isset( $fb_hide_shared_by_etc_text ) && 'no' === $fb_hide_shared_by_etc_text ? '' : $fb_final_story;
|
323 |
+
|
324 |
+
if ( 'top' !== $show_media ) {
|
325 |
+
|
326 |
+
if ( 'albums' !== $fb_shortcode['type'] ) {
|
327 |
+
echo '<div class="fts-jal-fb-user-thumb">';
|
328 |
+
|
329 |
+
$avatar_id = plugin_dir_url( __DIR__ ) . 'images/slick-comment-pic.png';
|
330 |
+
$profile_photo_exists_check = isset( $post_data->fts_profile_pic_url ) && strpos( $post_data->fts_profile_pic_url, 'profilepic' ) !== false ? $post_data->fts_profile_pic_url : $avatar_id;
|
331 |
+
|
332 |
+
echo ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? '' : '<a href="https://www.facebook.com/' . esc_attr( $from_id_picture ) . '" target="_blank" rel="noreferrer">' ) . '<img border="0" alt="' . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? esc_attr( $post_data->reviewer->name ) : esc_attr( $post_data->from->name ) ) . '" src="' . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? esc_url( $profile_photo_exists_check ) . '"/>' : 'https://graph.facebook.com/' . esc_attr( $from_id_picture ) ) . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? '' : '/picture"/></a>' );
|
333 |
+
|
334 |
+
echo '</div>';
|
335 |
+
|
336 |
+
}
|
337 |
+
|
338 |
+
// UserName.
|
339 |
+
// $fts_facebook_reviews->reviews_rating_format CANNOT be esc at this time.
|
340 |
+
$hide_name = 'albums' === $fb_shortcode['type'] ? ' fts-fb-album-hide' : '';
|
341 |
+
|
342 |
+
echo ( 'reviews' === $fb_shortcode['type'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ? '<span class="fts-jal-fb-user-name fts-review-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">' . esc_attr( $post_data->reviewer->name ) . '</span>' . $fts_facebook_reviews->reviews_rating_format( $fb_shortcode, isset( $post_data->rating ) ? esc_html( $post_data->rating ) : '' ) . '</span>' : '<span class="fts-jal-fb-user-name' . $hide_name . '"><a href="https://www.facebook.com/' . esc_attr( $from_id_picture ) . '" target="_blank" rel="noreferrer">' . esc_html( $post_data->from->name ) . '</a>' . esc_html( $fb_hide_shared_by_etc_text ) . '</span>' );
|
343 |
+
|
344 |
+
// tied to date function.
|
345 |
+
$feed_type = 'facebook';
|
346 |
+
$times = $custom_time_format;
|
347 |
+
$fts_final_date = $this->fts_custom_date( $times, $feed_type );
|
348 |
+
// PostTime.
|
349 |
+
// $fts_final_date CANNOT be esc at this time.
|
350 |
+
if ( 'albums' !== $fb_shortcode['type'] ) {
|
351 |
+
echo '<span class="fts-jal-fb-post-time">' . $fts_final_date . '</span><div class="fts-clear"></div>';
|
352 |
+
}
|
353 |
+
}
|
354 |
+
|
355 |
+
if ( 'reviews' !== $fb_shortcode['type'] ) {
|
356 |
+
// Comments Count.
|
357 |
+
$fb_post_id_final = substr( $fb_post_id, strpos( $fb_post_id, '_' ) + 1 );
|
358 |
+
}
|
359 |
+
|
360 |
+
$fb_title_job_opening = isset( $post_data->attachments->data[0]->title ) && 'job_search_job_opening' === $post_data->attachments->data[0]->type ? $post_data->attachments->data[0]->title : '';
|
361 |
+
|
362 |
+
// filter messages to have urls.
|
363 |
+
// Output Message.
|
364 |
+
$fb_message = ( isset( $post_data->message ) ? $post_data->message : ( isset( $post_data->review_text ) ? $post_data->review_text : '' ) . '' );
|
365 |
+
if ( empty( $fb_message ) ) {
|
366 |
+
|
367 |
+
if ( isset( $post_data->description ) ) {
|
368 |
+
$fb_message = isset( $post_data->description ) ? $post_data->description : '';
|
369 |
+
} elseif ( isset( $post_data->attachments->data[0]->description ) ) {
|
370 |
+
$fb_message = isset( $post_data->attachments->data[0]->description ) ? $post_data->attachments->data[0]->description : '';
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
if ( $fb_message && 'top' !== $show_media ) {
|
375 |
+
|
376 |
+
if ( ! empty( $fb_places_id ) ) {
|
377 |
+
$this->feed_location_option( $fb_places_id, $fb_name, $fb_places_name );
|
378 |
+
}
|
379 |
+
|
380 |
+
$itemprop_description_reviews = is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ? ' itemprop="description"' : '';
|
381 |
+
|
382 |
+
// here we trim the words for the premium version. The $fb_shortcode['words'] string actually comes from the javascript.
|
383 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && array_key_exists( 'words', $fb_shortcode ) && 'top' !== $show_media || is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) && array_key_exists( 'words', $fb_shortcode ) && ! empty( $fb_shortcode['words'] ) && 'top' !== $show_media || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && array_key_exists( 'words', $fb_shortcode ) && 'top' !== $show_media ) {
|
384 |
+
$more = isset( $more ) ? $more : '';
|
385 |
+
|
386 |
+
$trimmed_content = $this->fts_custom_trim_words( $fb_message, $fb_shortcode['words'], $more );
|
387 |
+
|
388 |
+
// Going to consider this for the future if facebook fixes the api to define when are checking in. Add '.$checked_in.' inside the fts-jal-fb-message div.
|
389 |
+
// $checked_in = '<a target="_blank" class="fts-checked-in-img" href="https://www.facebook.com/'.$post_data->place->id.'"><img src="https://graph.facebook.com/'.$post_data->place->id.'/picture?width=150"/></a><a target="_blank" class="fts-checked-in-text-link" href="https://www.facebook.com/'.$post_data->place->id.'">'.esc_html("Checked in at", "feed-them-social").' '.$post_data->place->name.'</a><br/> '.esc_html("Location", "feed-them-social").': '.$post_data->place->location->city.', '.$post_data->place->location->country.' '.$post_data->place->location->zip.'<br/><a target="_blank" class="fts-fb-get-directions fts-checked-in-get-directions" href="https://www.facebook.com/'.$post_data->place->id.'">'.esc_html("Get Direction", "feed-them-social").'</a>';.
|
390 |
+
echo '<div class="fts-jal-fb-message"' . esc_attr( $itemprop_description_reviews ) . '>';
|
391 |
+
|
392 |
+
echo esc_html( $fb_title_job_opening );
|
393 |
+
// $trimmed_content CANNOT be esc at this time.
|
394 |
+
echo ! empty( $trimmed_content ) ? $trimmed_content : '';
|
395 |
+
// The Popup.
|
396 |
+
// echo $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html__('View on Facebook', 'feed-them-social') . '</a></div> ' : '';.
|
397 |
+
echo '<div class="fts-clear"></div></div> ';
|
398 |
+
|
399 |
+
} elseif ( 'top' !== $show_media ) {
|
400 |
+
$fb_final_message = $this->fts_facebook_tag_filter( $fb_message );
|
401 |
+
echo '<div class="fts-jal-fb-message"' . esc_attr( $itemprop_description_reviews ) . '>';
|
402 |
+
// $fb_final_message CANNOT be esc at this time.
|
403 |
+
echo nl2br( $fb_final_message );
|
404 |
+
// If POPUP.
|
405 |
+
// echo isset($fb_shortcode['popup']) && $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';.
|
406 |
+
echo '<div class="fts-clear"></div></div>';
|
407 |
+
}
|
408 |
+
} elseif ( ! $fb_message && 'album_photos' === $fb_shortcode['type'] || ! $fb_message && 'albums' === $fb_shortcode['type'] ) {
|
409 |
+
|
410 |
+
echo '<div class="fts-jal-fb-description-wrap">';
|
411 |
+
|
412 |
+
$fb_caption ? $this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type ) : '';
|
413 |
+
// Output Photo Caption.
|
414 |
+
// if ( !is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && 'albums' === $fb_shortcode['type'] ){
|
415 |
+
// Album Post Description.
|
416 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
417 |
+
echo '<div class="fts-fb-album-name-and-count ">';
|
418 |
+
}
|
419 |
+
$fb_name ? $this->fts_facebook_post_desc( $fb_name, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
420 |
+
// echo $fb_type;
|
421 |
+
// echo 'asdfasdf';
|
422 |
+
// Albums Photo Count.
|
423 |
+
echo $fb_album_photo_count ? esc_html( $fb_album_photo_count ) . ' Photos' : '';
|
424 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
425 |
+
echo '</div>';
|
426 |
+
}
|
427 |
+
// }
|
428 |
+
// Location.
|
429 |
+
// $fb_location ? $this->fts_facebook_location( $fb_type, $fb_location ) : '';
|
430 |
+
// Output Photo Description.
|
431 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
432 |
+
|
433 |
+
// Output Photo Description.
|
434 |
+
if ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ) {
|
435 |
+
echo '<div class="fts-fb-caption fts-fb-album-view-link">';
|
436 |
+
// Album Covers.
|
437 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
438 |
+
|
439 |
+
echo '<div class="fts-fb-album-additional-pics">';
|
440 |
+
// Album Covers. <img src="' . esc_url( $fb_album_additional_pic->images[1]->source ) . '"/>
|
441 |
+
$isFirst = true;
|
442 |
+
foreach ( $post_data->photos->data as $key => $fb_album_additional_pic ) {
|
443 |
+
// $fb_album_additional_pic_check = isset( $fb_album_additional_pic->name ) ? $this->fts_facebook_post_desc( $fb_album_additional_pic->name, $fb_shortcode, $fb_type, null, $fb_by ): '';
|
444 |
+
// $fb_album_additional_pic ? $fb_album_additional_pic_check : '';
|
445 |
+
echo '<div class="fts-fb-album-additional-pics-content">';
|
446 |
+
|
447 |
+
$hide_all_but_one_link = ! $isFirst ? 'style="display:none"' : '';
|
448 |
+
|
449 |
+
echo '<a href="' . esc_url( $fb_album_additional_pic->images[0]->source ) . '" class="fts-view-album-photos-large data-fb-album-photo-description" target="_blank" rel="noreferrer" ' . $hide_all_but_one_link . '>' . esc_html__( 'View Album', 'feed-them-social' ) . '</a>';
|
450 |
+
echo '<div class="fts-fb-album-additional-pics-description-wrap">';
|
451 |
+
echo '<div class="fts-jal-fb-description-wrap fts-fb-album-description-content fts-jal-fb-description-popup">';
|
452 |
+
|
453 |
+
// tied to date function.
|
454 |
+
$feed_type = 'facebook';
|
455 |
+
$album_created_time = isset( $fb_album_additional_pic->created_time ) ? $fb_album_additional_pic->created_time : '';
|
456 |
+
$times = $album_created_time;
|
457 |
+
$fts_final_date = $this->fts_custom_date( $times, $feed_type );
|
458 |
+
echo '<div class="fts-jal-fb-user-thumb">';
|
459 |
+
echo '<a href="https://www.facebook.com/' . esc_attr( $from_id_picture ) . '" target="_blank" rel="noreferrer"><img border="0" alt="' . esc_attr( $post_data->from->name ) . '" src="' . 'https://graph.facebook.com/' . esc_attr( $from_id_picture ) . '/picture"/></a>';
|
460 |
+
echo '</div>';
|
461 |
+
|
462 |
+
// UserName.
|
463 |
+
// $fts_facebook_reviews->reviews_rating_format CANNOT be esc at this time.
|
464 |
+
echo '<span class="fts-jal-fb-user-name"><a href="https://www.facebook.com/' . esc_attr( $from_id_picture ) . '" target="_blank" rel="noreferrer">' . esc_html( $post_data->from->name ) . '</a>' . esc_html( $fb_hide_shared_by_etc_text ) . '</span>';
|
465 |
+
|
466 |
+
echo '<div class="fts-fb-album-date-wrap">' . $fts_final_date . '</div>';
|
467 |
+
|
468 |
+
echo '<div class="fts-clear"></div>';
|
469 |
+
|
470 |
+
// Album Post Description.
|
471 |
+
// $fb_name ? $this->fts_facebook_post_desc( $fb_name, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
472 |
+
// Albums Photo Count.
|
473 |
+
$fb_name ? $this->fts_facebook_post_desc( $fb_name, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
474 |
+
$view_additional_album_photos = '24' == $key ? '. <a href="' . $fb_link . '" target="_blank" rel="noreferrer">' . esc_html__( 'View more for this Album', 'feed-them-social' ) . '</a>' : '';
|
475 |
+
echo $fb_album_photo_count ? ' ' . esc_html( $key + 1 ) . ' ' . esc_html__( 'of', 'feed-them-social' ) . ' ' . esc_html( $fb_album_photo_count ) . ' ' . esc_html__( 'Photos', 'feed-them-social' ) . ' ' . $view_additional_album_photos : '';
|
476 |
+
echo '<br/><br/>';
|
477 |
+
|
478 |
+
$fb_album_additional_pic_name = isset( $fb_album_additional_pic->name ) ? $fb_album_additional_pic->name : '';
|
479 |
+
$fb_album_additional_pic_name ? $this->fts_facebook_post_desc( $fb_album_additional_pic_name, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
480 |
+
echo '</div>';
|
481 |
+
echo '</div>';
|
482 |
+
echo '</div>';
|
483 |
+
$isFirst = false;
|
484 |
+
}
|
485 |
+
|
486 |
+
echo '</div>';
|
487 |
+
echo '</div>';
|
488 |
+
} elseif (
|
489 |
+
|
490 |
+
// Album Photos.
|
491 |
+
'album_photos' === $fb_shortcode['type'] && ( isset( $fb_shortcode['video_album'] ) && 'yes' !== $fb_shortcode['video_album'] || ! isset( $fb_shortcode['video_album'] ) ) ) {
|
492 |
+
echo '<a href="' . esc_url( $fb_album_picture ) . '" class="fts-view-album-photos-large" target="_blank" rel="noreferrer">' . esc_html__( 'View Photo', 'feed-them-social' ) . '</a></div>';
|
493 |
+
|
494 |
+
} elseif (
|
495 |
+
// Video Albums.
|
496 |
+
isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
497 |
+
if ( 'yes' !== $fb_shortcode['play_btn'] ) {
|
498 |
+
|
499 |
+
echo '<a href="' . esc_url( $embed_html ) . '" data-poster="' . esc_url( $video_photo ) . '" id="fts-view-vid1-' . esc_attr( $fts_dynamic_vid_name_string ) . '" class="fts-jal-fb-vid-html5video ' . esc_attr( $fts_view_fb_videos_btn ) . ' fts-view-fb-videos-large fts-view-fb-videos-btn fb-video-popup-' . esc_attr( $fts_dynamic_vid_name_string ) . '">' . esc_html__( 'View Video', 'feed-them-social' ) . '</a>';
|
500 |
+
|
501 |
+
echo '<div class="fts-fb-embed-iframe-check-used-for-popup fts-fb-embed-yes">';
|
502 |
+
if ( $embed_height >= $embed_width ) {
|
503 |
+
echo '<div class=' . esc_url( $data_height ) . ' data-width="' . esc_attr( $embed_width ) . '" data-height="' . esc_attr( $embed_height ) . '"></div>';
|
504 |
+
}
|
505 |
+
echo '</div>';
|
506 |
+
}
|
507 |
+
echo '</div>';
|
508 |
+
} else {
|
509 |
+
// photos.
|
510 |
+
echo '<a href="' . esc_url( $post_data->source ) . '" class="fts-view-album-photos-large" target="_blank" rel="noreferrer">' . esc_html__( 'View Photo', 'feed-them-social' ) . '</a></div>';
|
511 |
+
}
|
512 |
+
|
513 |
+
// echo '<div class="fts-fb-caption"><a class="view-on-facebook-albums-link" href="' . $fb_link . '" target="_blank">' . esc_html('View on Facebook', 'feed-them-social') . '</a></div>';.
|
514 |
+
}
|
515 |
+
|
516 |
+
echo '<div class="fts-clear"></div></div>';
|
517 |
+
} //END Output Message
|
518 |
+
// elseif ($fb_message == '' && $fb_shortcode['type'] !== 'album_photos' || $fb_message == '' && $fb_shortcode['type'] !== 'albums') {.
|
519 |
+
// If POPUP.
|
520 |
+
// echo $fb_shortcode['popup'] == 'yes' ? '<div class="fts-jal-fb-message"><div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View on Facebook', 'feed-them-facebook') . '</a></div></div>' : '';.
|
521 |
+
// }.
|
522 |
+
if ( 'top' !== $show_media ) {
|
523 |
+
echo '</div>';
|
524 |
+
// end .fts-jal-fb-top-wrap <!--end fts-jal-fb-top-wrap -->.
|
525 |
+
}
|
526 |
+
}
|
527 |
+
// Post Type Build.
|
528 |
+
$fts_show_post = false;
|
529 |
+
|
530 |
+
switch ( $fb_type ) {
|
531 |
+
|
532 |
+
// START NOTE POST.
|
533 |
+
case 'knowledge_note':
|
534 |
+
// && !$fb_picture == '' makes it so the attachment unavailable message does not show up.
|
535 |
+
// if (!$fb_picture && !$fb_name && !$fb_description && !$fb_picture == '') {.
|
536 |
+
echo '<div class="fts-jal-fb-link-wrap">';
|
537 |
+
// Output Link Picture.
|
538 |
+
$fb_picture ? $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->attachments->data[0]->media->image->src ) : '';
|
539 |
+
|
540 |
+
if ( $fb_name || $fb_caption || $fb_description ) {
|
541 |
+
echo '<div class="fts-jal-fb-description-wrap">';
|
542 |
+
// Output Link Name.
|
543 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type ) : '';
|
544 |
+
// Output Link Caption.
|
545 |
+
if ( 'Attachment Unavailable. This attachment may have been removed or the person who shared it may not have permission to share it with you.' === $fb_caption ) {
|
546 |
+
echo '<div class="fts-jal-fb-caption" style="width:100% !important">';
|
547 |
+
esc_html( 'This user\'s permissions are keeping you from seeing this post. Please Click "View on Facebook" to view this post on this group\'s facebook wall.', 'feed-them-social' );
|
548 |
+
echo '</div>';
|
549 |
+
} else {
|
550 |
+
$this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type );
|
551 |
+
}
|
552 |
+
// If POPUP.
|
553 |
+
// echo $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View on Facebook', 'feed-them-facebook') . '</a></div> ' : '';.
|
554 |
+
// Output Link Description.
|
555 |
+
// echo $fb_description ? $this->fts_facebook_post_desc($fb_description, $fb_shortcode, $fb_type) : '';.
|
556 |
+
echo '<div class="fts-clear"></div></div>';
|
557 |
+
}
|
558 |
+
echo '<div class="fts-clear"></div></div>';
|
559 |
+
// }.
|
560 |
+
break;
|
561 |
+
|
562 |
+
// START STATUS POST.
|
563 |
+
case 'status':
|
564 |
+
// && !$fb_picture == '' makes it so the attachment unavailable message does not show up.
|
565 |
+
// if (!$fb_picture && !$fb_name && !$fb_description && !$fb_picture == '') {.
|
566 |
+
echo '<div class="fts-jal-fb-link-wrap">';
|
567 |
+
// Output Link Picture.
|
568 |
+
if ( $fb_picture_job ) {
|
569 |
+
$this->fts_facebook_post_photo( $fb_joblink, $fb_shortcode, $post_data->from->name, $fb_picture_job );
|
570 |
+
} else {
|
571 |
+
$fb_picture ? $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->picture ) : '';
|
572 |
+
}
|
573 |
+
|
574 |
+
if ( $fb_name || $fb_caption || $fb_description ) {
|
575 |
+
echo '<div class="fts-jal-fb-description-wrap">';
|
576 |
+
// Output Link Name.
|
577 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type ) : '';
|
578 |
+
// Output Link Caption.
|
579 |
+
if ( 'Attachment Unavailable. This attachment may have been removed or the person who shared it may not have permission to share it with you.' === $fb_caption ) {
|
580 |
+
echo '<div class="fts-jal-fb-caption" style="width:100% !important">';
|
581 |
+
echo esc_html( 'This user\'s permissions are keeping you from seeing this post. Please Click "View on Facebook" to view this post on this group\'s facebook wall.', 'feed-them-social' );
|
582 |
+
echo '</div>';
|
583 |
+
} else {
|
584 |
+
$this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type );
|
585 |
+
}
|
586 |
+
// Output Link Description.
|
587 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type ) : '';
|
588 |
+
echo '<div class="fts-clear"></div></div>';
|
589 |
+
}
|
590 |
+
echo '<div class="fts-clear"></div></div>';
|
591 |
+
// }
|
592 |
+
break;
|
593 |
+
// Start Multiple Events.
|
594 |
+
case 'events':
|
595 |
+
$single_event_id = $post_data->id;
|
596 |
+
$single_event_info = json_decode( $single_event_array_response[ 'event_single_' . $single_event_id . '_info' ] );
|
597 |
+
$single_event_location = json_decode( $single_event_array_response[ 'event_single_' . $single_event_id . '_location' ] );
|
598 |
+
$single_event_cover_photo = json_decode( $single_event_array_response[ 'event_single_' . $single_event_id . '_cover_photo' ] );
|
599 |
+
$single_event_ticket_info = json_decode( $single_event_array_response[ 'event_single_' . $single_event_id . '_ticket_info' ] );
|
600 |
+
// echo'<pre>';.
|
601 |
+
// print_r($single_event_info);.
|
602 |
+
// echo'</pre>';.
|
603 |
+
// Event Cover Photo.
|
604 |
+
$event_cover_photo = isset( $single_event_cover_photo->cover->source ) ? $single_event_cover_photo->cover->source : '';
|
605 |
+
$event_description = isset( $single_event_info->description ) ? $single_event_info->description : '';
|
606 |
+
echo '<div class="fts-jal-fb-right-wrap fts-events-list-wrap">';
|
607 |
+
// Link Picture.
|
608 |
+
$fb_event_name = isset( $single_event_info->name ) ? $single_event_info->name : '';
|
609 |
+
$fb_event_location = isset( $single_event_location->place->name ) ? $single_event_location->place->name : '';
|
610 |
+
$fb_event_city = isset( $single_event_location->place->location->city ) ? $single_event_location->place->location->city . ', ' : '';
|
611 |
+
$fb_event_state = isset( $single_event_location->place->location->state ) ? $single_event_location->place->location->state : '';
|
612 |
+
$fb_event_street = isset( $single_event_location->place->location->street ) ? $single_event_location->place->location->street : '';
|
613 |
+
$fb_event_zip = isset( $single_event_location->place->location->zip ) ? ' ' . $single_event_location->place->location->zip : '';
|
614 |
+
$fb_event_latitude = isset( $single_event_location->place->location->latitude ) ? $single_event_location->place->location->latitude : '';
|
615 |
+
$fb_event_longitude = isset( $single_event_location->place->location->longitude ) ? $single_event_location->place->location->longitude : '';
|
616 |
+
$fb_event_ticket_info = isset( $single_event_ticket_info->ticket_uri ) ? $single_event_ticket_info->ticket_uri : '';
|
617 |
+
date_default_timezone_set( get_option( 'fts-timezone' ) );
|
618 |
+
|
619 |
+
// custom one day ago check.
|
620 |
+
if ( 'one-day-ago' === $custom_date_check ) {
|
621 |
+
$fb_event_start_time = date_i18n( 'l, F jS, Y \a\t g:ia', strtotime( $single_event_info->start_time ) );
|
622 |
+
} else {
|
623 |
+
$fb_event_start_time = date_i18n( $custom_date_format, strtotime( $single_event_info->start_time ) );
|
624 |
+
}
|
625 |
+
|
626 |
+
// Output Photo Description.
|
627 |
+
if ( ! empty( $event_cover_photo ) ) {
|
628 |
+
echo isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] && is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ? '<a href="' . esc_url( $event_cover_photo ) . '" class="fts-jal-fb-picture fts-fb-large-photo" target="_blank" rel="noreferrer"><img class="fts-fb-event-photo" src="' . esc_url( $event_cover_photo ) . '"></a>' : '<a href="https://www.facebook.com/events/' . esc_attr( $single_event_id ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-picture fts-fb-large-photo"><img class="fts-fb-event-photo" src="' . esc_url( $event_cover_photo ) . '" /></a>';
|
629 |
+
}
|
630 |
+
echo '<div class="fts-jal-fb-top-wrap">';
|
631 |
+
echo '<div class="fts-jal-fb-message">';
|
632 |
+
// Link Name.
|
633 |
+
echo '<div class="fts-event-title-wrap">';
|
634 |
+
$fb_event_name ? $this->fts_facebook_post_name( 'https://www.facebook.com/events/' . esc_attr( $single_event_id ) . '', esc_attr( $fb_event_name ), esc_attr( $fb_type ) ) : '';
|
635 |
+
echo '</div>';
|
636 |
+
// Link Caption.
|
637 |
+
if ( $fb_event_start_time ) {
|
638 |
+
echo '<div class="fts-fb-event-time">' . $fb_event_start_time . '</div>';
|
639 |
+
}
|
640 |
+
// Link Description.
|
641 |
+
if ( ! empty( $fb_event_location ) ) {
|
642 |
+
echo '<div class="fts-fb-location"><span class="fts-fb-location-title">' . esc_html( $fb_event_location ) . '</span>';
|
643 |
+
// Street Adress.
|
644 |
+
echo esc_html( $fb_event_street );
|
645 |
+
// City & State.
|
646 |
+
echo $fb_event_city || $fb_event_state ? '<br/>' . esc_html( $fb_event_city . $fb_event_state . $fb_event_zip ) : '';
|
647 |
+
echo '</div>';
|
648 |
+
}
|
649 |
+
// Get Directions.
|
650 |
+
if ( ! empty( $fb_event_latitude ) && ! empty( $fb_event_longitude ) ) {
|
651 |
+
echo '<a target="_blank" class="fts-fb-get-directions" href="' . esc_html( 'https://www.google.com/maps/dir/Current+Location/' . $fb_event_latitude . ',' . $fb_event_longitude . '' ) . '"
|
652 |
>' . esc_html( 'Get Directions', 'feed-them-social' ) . '</a>';
|
653 |
+
}
|
654 |
+
if ( ! empty( $fb_event_ticket_info ) && ! empty( $fb_event_ticket_info ) ) {
|
655 |
+
echo '<a target="_blank" rel="noreferrer" class="fts-fb-ticket-info" href="' . esc_url( $single_event_ticket_info->ticket_uri ) . '">' . esc_html( 'Ticket Info', 'feed-them-social' ) . '</a>';
|
656 |
+
}
|
657 |
+
// Output Message.
|
658 |
+
if ( ! empty( $fb_shortcode['words'] ) && $event_description && is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
659 |
+
// here we trim the words for the premium version. The $fb_shortcode['words'] string actually comes from the javascript.
|
660 |
+
$this->fts_facebook_post_desc( $event_description, $fb_shortcode, $fb_type, null, $fb_by, $fb_shortcode['type'] );
|
661 |
+
} else {
|
662 |
+
// if the premium plugin is not active we will just show the regular full description.
|
663 |
+
$this->fts_facebook_post_desc( $event_description, $fb_type, null, $fb_by, $fb_shortcode['type'] );
|
664 |
+
}
|
665 |
+
// Our POPUP.
|
666 |
+
// echo $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="https://www.facebook.com/events/' . $single_event_id . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View Event on Facebook', 'feed-them-facebook') . '</a></div> ' : '';.
|
667 |
+
echo '<div class="fts-clear"></div></div></div>';
|
668 |
+
break;
|
669 |
+
|
670 |
+
// START LINK POST.
|
671 |
+
case 'share':
|
672 |
+
echo '<div class="fts-jal-fb-link-wrap">';
|
673 |
+
// start url check.
|
674 |
+
if ( ! empty( $fb_link ) ) {
|
675 |
+
$url = $fb_link;
|
676 |
+
$url_parts = parse_url( $url );
|
677 |
+
$host = $url_parts['host'];
|
678 |
+
}
|
679 |
+
|
680 |
+
if ( isset( $host ) && 'www.facebook.com' === $host ) {
|
681 |
+
$spliturl = $url_parts['path'];
|
682 |
+
$path_components = explode( '/', $spliturl );
|
683 |
+
$first_dir = $path_components[1];
|
684 |
+
}
|
685 |
+
// end url check.
|
686 |
+
// Output Link Picture.
|
687 |
+
// echo isset($fb_shortcode['popup']) && $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View on Facebook', 'feed-them-social') . '</a></div> ' : '';.
|
688 |
+
if ( isset( $host ) && 'www.facebook.com' === $host && 'events' === $first_dir ) {
|
689 |
+
$fb_picture ? $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->picture ) : '';
|
690 |
+
} elseif ( strpos( $fb_link, 'soundcloud' ) > 0 ) {
|
691 |
+
// Get the SoundCloud URL.
|
692 |
+
$url = $fb_link;
|
693 |
+
// Get the JSON data of song details with embed code from SoundCloud oEmbed.
|
694 |
+
$get_values = file_get_contents( 'http://soundcloud.com/oembed?format=js&url=' . $url . '&auto_play=true&iframe=true' );
|
695 |
+
// Clean the Json to decode.
|
696 |
+
$decode_iframe = substr( $get_values, 1, -2 );
|
697 |
+
// json decode to convert it as an array.
|
698 |
+
$json_obj = json_decode( $decode_iframe );
|
699 |
+
// Change the height of the embed player if you want else uncomment below line.
|
700 |
+
// echo str_replace('height="400"', 'height="140"', $json_obj->html);.
|
701 |
+
$fts_dynamic_vid_name_string = sanitize_key( $this->fts_rand_string( 10 ) . '_' . $fb_shortcode['type'] );
|
702 |
+
$fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string;
|
703 |
+
echo '<div class="fts-jal-fb-vid-picture ' . esc_attr( $fts_dynamic_vid_name ) . '">';
|
704 |
+
if ( ! empty( $post_data->attachments->data[0]->media->image->src ) ) {
|
705 |
+
$fb_picture ? $this->fts_facebook_post_photo( 'javascript:;', $fb_shortcode, $post_data->from->name, $post_data->attachments->data[0]->media->image->src ) : '';
|
706 |
+
} elseif ( ! empty( $post_data->picture ) ) {
|
707 |
+
$fb_picture ? $this->fts_facebook_post_photo( 'javascript:;', $fb_shortcode, $post_data->from->name, $post_data->picture ) : '';
|
708 |
+
}
|
709 |
+
echo '<div class="fts-jal-fb-vid-play-btn"></div>';
|
710 |
+
echo '</div>';
|
711 |
+
echo '<script>';
|
712 |
+
echo 'jQuery(document).ready(function() {';
|
713 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_vid_name ) . '").click(function() {';
|
714 |
+
echo 'jQuery(this).addClass("fts-vid-div");';
|
715 |
+
echo 'jQuery(this).removeClass("fts-jal-fb-vid-picture");';
|
716 |
+
echo ' jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper">' . $json_obj->html . '</div>\');';
|
717 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
718 |
+
echo 'jQuery(".fts-slicker-facebook-posts").masonry( "reloadItems");';
|
719 |
+
echo 'jQuery(".fts-slicker-facebook-posts").masonry( "layout" );';
|
720 |
+
}
|
721 |
+
echo '});';
|
722 |
+
echo '});';
|
723 |
+
echo '</script>';
|
724 |
+
} elseif ( ! empty( $post_data->attachments->data[0]->media->image->src ) ) {
|
725 |
+
$fb_picture ? $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->attachments->data[0]->media->image->src ) : '';
|
726 |
+
} elseif ( ! empty( $post_data->picture ) ) {
|
727 |
+
$fb_picture ? $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->picture ) : '';
|
728 |
+
}
|
729 |
+
|
730 |
+
$fb_shortcode['words'] = isset( $fb_shortcode['words'] ) ? $fb_shortcode['words'] : '';
|
731 |
+
// Description Wrap.
|
732 |
+
echo '<div class="fts-jal-fb-description-wrap">';
|
733 |
+
// Output Link Name.
|
734 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type ) : '';
|
735 |
+
if ( isset( $host ) && 'www.facebook.com' === $host && 'events' === $first_dir ) {
|
736 |
+
echo ' ► ';
|
737 |
+
echo '<a href="' . esc_url( $fb_link ) . '" class="fts-jal-fb-name" target="_blank" rel="noreferrer">' . esc_html( $fb_link_event_name ) . '</a>';
|
738 |
+
}//end if event.
|
739 |
+
// Output Link Description.
|
740 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type ) : '';
|
741 |
+
|
742 |
+
// Output Link Caption.
|
743 |
+
$fb_caption ? $this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type ) : '';
|
744 |
+
echo '<div class="fts-clear"></div></div>';
|
745 |
+
echo '<div class="fts-clear"></div></div>';
|
746 |
+
break;
|
747 |
+
|
748 |
+
// START VIDEO POST.
|
749 |
+
case 'video_direct_response' :
|
750 |
+
case 'video_inline' :
|
751 |
+
// $video_data = json_decode($response_post_array[$post_data_key . '_video']);.
|
752 |
+
// echo '<pre>';.
|
753 |
+
// print_r($video_data);.
|
754 |
+
// echo '</pre>';.
|
755 |
+
echo '<div class="fts-jal-fb-vid-wrap">';
|
756 |
+
|
757 |
+
if ( ! empty( $fb_picture ) ) {
|
758 |
+
|
759 |
+
// Create Dynamic Class Name.
|
760 |
+
$fts_dynamic_vid_name_string = sanitize_key( $this->fts_rand_string( 10 ) . '_' . $fb_shortcode['type'] );
|
761 |
+
$fts_dynamic_vid_name = 'feed_dynamic_video_class' . $fts_dynamic_vid_name_string;
|
762 |
+
echo '<div class="fts-jal-fb-vid-picture ' . esc_html( $fts_dynamic_vid_name ) . '">';
|
763 |
+
|
764 |
+
if ( strpos( $fb_link, 'youtube' ) > 0 || strpos( $fb_link, 'youtu.be' ) > 0 ) {
|
765 |
+
preg_match( "/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed|v|vi|user)\/))([^\?&\"'>]+)/", $fb_video_embed, $matches );
|
766 |
+
$video_url_final = 'https://www.youtube.com/watch?v=' . $matches[1];
|
767 |
+
} else {
|
768 |
+
$video_url_final = esc_url( $embed_html );
|
769 |
+
}
|
770 |
+
|
771 |
+
// This puts the video in a popup instead of displaying it directly on the page.
|
772 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ) {
|
773 |
+
|
774 |
+
if ( strpos( $fb_link, 'youtube' ) > 0 || strpos( $fb_link, 'youtu.be' ) > 0 || strpos( $fb_link, 'vimeo' ) > 0 ) {
|
775 |
+
echo '<a href="' . esc_url( $video_url_final ) . '" class="fts-facebook-link-target fts-jal-fb-vid-image fts-iframe-type">';
|
776 |
+
} else {
|
777 |
+
|
778 |
+
if ( 'video_direct_response' === $post_data->attachments->data[0]->type || 'video_inline' === $post_data->attachments->data[0]->type ) {
|
779 |
+
$page_id = $post_data->from->id;
|
780 |
+
$video_id = $post_data->attachments->data[0]->target->id;
|
781 |
+
$fb_embed_url = 'https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2F' . $page_id . '%2Fvideos%2F' . $video_id . '%2F&autoplay=true';
|
782 |
+
echo '<a href="' . esc_url( $fb_embed_url ) . '" class="fts-jal-fb-vid-image ' . esc_attr( $fts_view_fb_videos_btn ) . ' fts-jal-fb-vid-html5video ">';
|
783 |
+
|
784 |
+
} else {
|
785 |
+
echo '<a href="' . esc_url( $embed_html ) . '" class="fts-facebook-link-target fts-jal-fb-vid-html5video ">';
|
786 |
+
}
|
787 |
+
}
|
788 |
+
}
|
789 |
+
// srl: 8/27/17 - FB BUG: for some reason the full_picture for animated gifs is not correct so we dig deeper and grab another image size fb has set.
|
790 |
+
if ( isset( $post_data->attachments->data[0]->type ) && 'animated_image_video' === $post_data->attachments->data[0]->type ) {
|
791 |
+
$vid_pic = $post_data->attachments->data[0]->media->image->src;
|
792 |
+
} else {
|
793 |
+
$vid_pic = $post_data->attachments->data[0]->media->image->src;
|
794 |
+
}
|
795 |
+
echo '<img class="fts-jal-fb-vid-image" border="0" alt="' . esc_attr( $post_data->from->name ) . '" src="' . esc_url( $vid_pic ) . '"/>';
|
796 |
+
|
797 |
+
// This puts the video in a popup instead of displaying it directly on the page.
|
798 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ) {
|
799 |
+
echo '</a>';
|
800 |
+
}
|
801 |
+
|
802 |
+
echo '<div class="fts-jal-fb-vid-play-btn"></div></div>';
|
803 |
+
|
804 |
+
// If this is a facebook embed video then ouput Iframe and script.
|
805 |
+
$embed_height = isset( $post_data->attachments->data[0]->media->image->height ) ? $post_data->attachments->data[0]->media->image->height : '';
|
806 |
+
$embed_width = isset( $post_data->attachments->data[0]->media->image->width ) ? $post_data->attachments->data[0]->media->image->width : '';
|
807 |
+
$video_type = isset( $post_data->attachments->data[0]->type ) ? $post_data->attachments->data[0]->type : '';
|
808 |
+
// $video_inline = isset( $post_data->attachments->data[0]->type ) ? $post_data->attachments->data[0]->type : '';
|
809 |
+
|
810 |
+
// && $video_inline == 'video_inline'. /////// || 'video' === $video_type && 'animated_image_video' === $video_inline
|
811 |
+
if ( 'video_direct_response' === $video_type || 'video_inline' === $video_type ) {
|
812 |
+
|
813 |
+
if ( $embed_height > $embed_width ) {
|
814 |
+
$data_height = 'fts-greater-than-width-height';
|
815 |
+
} elseif ( $embed_height === $embed_width ) {
|
816 |
+
$data_height = 'fts-equal-width-height fts-fluid-videoWrapper ';
|
817 |
+
} else {
|
818 |
+
$data_height = 'fts-fluid-videoWrapper';
|
819 |
+
}
|
820 |
+
|
821 |
+
echo '<div class="fts-fb-embed-iframe-check-used-for-popup fts-fb-embed-yes">';
|
822 |
+
if ( $embed_height >= $embed_width ) {
|
823 |
+
echo '<div class=' . esc_attr( $data_height ) . ' data-width="' . esc_attr( $embed_width ) . '" data-height="' . esc_attr( $embed_height ) . '"></div>';
|
824 |
+
}
|
825 |
+
echo '</div>';
|
826 |
+
// This puts the video on the page instead of the popup if you don't have the premium version.
|
827 |
+
if ( ! isset( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'yes' !== $fb_shortcode['popup'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || isset( $fb_shortcode['popup'] ) && empty( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'no' === $fb_shortcode['popup'] ) {
|
828 |
+
|
829 |
+
$page_id = isset( $post_data->from->id ) ? $post_data->from->id : '';
|
830 |
+
$video_id = isset( $post_data->attachments->data[0]->target->id ) ? $post_data->attachments->data[0]->target->id : '';
|
831 |
+
|
832 |
+
$fb_embed_url = 'https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2F' . $page_id . '%2Fvideos%2F' . $video_id . '%2F&autoplay=true';
|
833 |
+
|
834 |
+
echo '<script>';
|
835 |
+
echo 'jQuery(document).ready(function() {';
|
836 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_vid_name ) . '").click(function() {';
|
837 |
+
echo 'jQuery(this).addClass("fts-vid-div");';
|
838 |
+
echo 'jQuery(this).removeClass("fts-jal-fb-vid-picture");';
|
839 |
+
// echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video'.$fb_post_id.'" src="http://www.youtube.com/embed/'.$youtubeURLfinal.'?autoplay=1" frameborder="0" allowfullscreen></iframe></div>\');';.
|
840 |
+
echo 'jQuery(this).prepend(\'<div class="' . esc_js( $data_height ) . ' fts-fb-video-on-page" ><iframe style="background:none !important" class="video-' . esc_js( $fb_post_id ) . '" src="' . esc_url( $fb_embed_url ) . '" frameborder="0" allowfullscreen></iframe></div>\');';
|
841 |
+
echo 'jQuery( ".' . esc_js( $fts_dynamic_vid_name ) . ' .fts-greater-than-width-height.fts-fb-video-on-page, .' . esc_js( $fts_dynamic_vid_name ) . ' iframe" ).css({"height": "' . esc_js( $embed_height ) . 'px", "width": "' . esc_js( $embed_width ) . 'px"});';
|
842 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] || isset( $fb_shortcode['grid_combined'] ) && 'yes' === $fb_shortcode['grid_combined'] ) {
|
843 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "reloadItems");';
|
844 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "layout" );';
|
845 |
+
}
|
846 |
+
echo '});';
|
847 |
+
echo '});';
|
848 |
+
echo '</script>';
|
849 |
+
}
|
850 |
+
}
|
851 |
+
// strip Youtube URL then ouput Iframe and script.
|
852 |
+
if ( strpos( $fb_link, 'youtube' ) > 0 ) {
|
853 |
+
// $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x';.
|
854 |
+
// preg_match($pattern, $fb_link, $matches);.
|
855 |
+
// $youtubeURLfinal = $matches[1];.
|
856 |
+
// This puts the video on the page instead of the popup if you don't have the premium version.
|
857 |
+
if ( ! isset( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'yes' !== $fb_shortcode['popup'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || isset( $fb_shortcode['popup'] ) && empty( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'no' === $fb_shortcode['popup'] ) {
|
858 |
+
echo '<script>jQuery(document).ready(function() {';
|
859 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_vid_name ) . '").click(function() {';
|
860 |
+
echo 'jQuery(this).addClass("fts-vid-div");';
|
861 |
+
echo 'jQuery(this).removeClass("fts-jal-fb-vid-picture");';
|
862 |
+
// echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video'.$fb_post_id.'" src="https://www.youtube.com/embed/'.$youtubeURLfinal.'?autoplay=1" frameborder="0" allowfullscreen></iframe></div>\');';.
|
863 |
+
echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video' . esc_js( $fb_post_id ) . '" src="' . esc_url( $fb_video_embed ) . '" frameborder="0" allowfullscreen></iframe></div>\');';
|
864 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] || isset( $fb_shortcode['grid_combined'] ) && 'yes' === $fb_shortcode['grid_combined'] ) {
|
865 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "reloadItems");';
|
866 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "layout" );';
|
867 |
+
}
|
868 |
+
echo '});';
|
869 |
+
echo '});</script>';
|
870 |
+
}
|
871 |
+
} elseif (
|
872 |
+
// strip Youtube URL then ouput Iframe and script.
|
873 |
+
strpos( $fb_link, 'youtu.be' ) > 0 ) {
|
874 |
+
// $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x';.
|
875 |
+
// preg_match($pattern, $fb_link, $matches);.
|
876 |
+
// $youtubeURLfinal = $matches[1];.
|
877 |
+
// This puts the video in a popup instead of displaying it directly on the page.
|
878 |
+
if ( ! isset( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'yes' !== $fb_shortcode['popup'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || isset( $fb_shortcode['popup'] ) && empty( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'no' === $fb_shortcode['popup'] ) {
|
879 |
+
echo '<script>';
|
880 |
+
echo 'jQuery(document).ready(function() {';
|
881 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_vid_name ) . '").click(function() {';
|
882 |
+
echo 'jQuery(this).addClass("fts-vid-div");';
|
883 |
+
echo 'jQuery(this).removeClass("fts-jal-fb-vid-picture");';
|
884 |
+
// echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video'.$fb_post_id.'" src="http://www.youtube.com/embed/'.$youtubeURLfinal.'?autoplay=1" frameborder="0" allowfullscreen></iframe></div>\');';.
|
885 |
+
echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe height="281" class="video' . esc_js( $fb_post_id ) . '" src="' . esc_url( $fb_video_embed ) . '" frameborder="0" allowfullscreen></iframe></div>\');';
|
886 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] || isset( $fb_shortcode['grid_combined'] ) && 'yes' === $fb_shortcode['grid_combined'] ) {
|
887 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "reloadItems");';
|
888 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "layout" );';
|
889 |
+
}
|
890 |
+
echo '});';
|
891 |
+
echo '});';
|
892 |
+
echo '</script>';
|
893 |
+
}
|
894 |
+
} elseif (
|
895 |
+
// strip Vimeo URL then ouput Iframe and script.
|
896 |
+
strpos( $fb_link, 'vimeo' ) > 0 ) {
|
897 |
+
// $pattern = '/(\d+)/';.
|
898 |
+
// preg_match($pattern, $fb_link, $matches);.
|
899 |
+
// $vimeoURLfinal = $matches[0];.
|
900 |
+
// This puts the video in a popup instead of displaying it directly on the page.
|
901 |
+
if ( ! isset( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'yes' !== $fb_shortcode['popup'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) || isset( $fb_shortcode['popup'] ) && empty( $fb_shortcode['popup'] ) || isset( $fb_shortcode['popup'] ) && 'no' === $fb_shortcode['popup'] ) {
|
902 |
+
echo '<script>';
|
903 |
+
echo 'jQuery(document).ready(function() {';
|
904 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_vid_name ) . '").click(function() {';
|
905 |
+
echo 'jQuery(this).addClass("fts-vid-div");';
|
906 |
+
echo 'jQuery(this).removeClass("fts-jal-fb-vid-picture");';
|
907 |
+
// echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe src="http://player.vimeo.com/video/'.$vimeoURLfinal.'?autoplay=1" class="video'.$fb_post_id.'" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\');';.
|
908 |
+
echo 'jQuery(this).prepend(\'<div class="fts-fluid-videoWrapper"><iframe src="' . esc_url( $fb_video_embed ) . '" class="video' . esc_js( $fb_post_id ) . '" height="390" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\');';
|
909 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] || isset( $fb_shortcode['grid_combined'] ) && 'yes' === $fb_shortcode['grid_combined'] ) {
|
910 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "reloadItems");';
|
911 |
+
echo 'jQuery(".fts-slicker-facebook-posts, .fts-mashup").masonry( "layout" );';
|
912 |
+
}
|
913 |
+
echo '});';
|
914 |
+
echo '});';
|
915 |
+
echo '</script>';
|
916 |
+
}
|
917 |
+
}
|
918 |
+
}
|
919 |
+
if ( $fb_name || $fb_caption || $fb_description ) {
|
920 |
+
echo '<div class="fts-jal-fb-description-wrap fb-id' . esc_attr( $fb_post_id ) . '">';
|
921 |
+
// Output Video Name.
|
922 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type, $fb_post_id ) : '';
|
923 |
+
// Output Video Description.
|
924 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type, $fb_post_id ) : '';
|
925 |
+
// Output Video Caption.
|
926 |
+
$fb_caption ? $this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type, $fb_post_id ) : '';
|
927 |
+
echo '<div class="fts-clear"></div></div>';
|
928 |
+
}
|
929 |
+
echo '<div class="fts-clear"></div></div>';
|
930 |
+
break;
|
931 |
+
// START PHOTO POST.
|
932 |
+
case 'photo':
|
933 |
+
if ( isset( $fts_hide_photos_type ) && 'yes' === $fts_hide_photos_type && 'album_photos' !== $fb_shortcode['type'] && 'yes' !== $fb_shortcode['video_album'] ) {
|
934 |
+
break;
|
935 |
+
}
|
936 |
+
|
937 |
+
// Wrapping with if statement to prevent Notice on some facebook page feeds.
|
938 |
+
if ( 'group' === $fb_shortcode['type'] ) {
|
939 |
+
$photo_source = json_decode( $response_post_array[ $post_data_key . '_group_post_photo' ] );
|
940 |
+
}
|
941 |
+
|
942 |
+
echo '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"';
|
943 |
+
if ( 'album_photos' === $fb_shortcode['type'] || 'albums' === $fb_shortcode['type'] ) {
|
944 |
+
echo ' style="line-height:' . esc_attr( $fb_shortcode['image_height'] ) . ' !important;"';
|
945 |
+
}
|
946 |
+
echo '>';
|
947 |
+
// echo isset($fb_shortcode['popup']) && $fb_shortcode['popup'] == 'yes' ? '<div class="fts-fb-caption"><a href="' . $fb_link . '" class="fts-view-on-facebook-link" target="_blank">' . esc_html('View on Facebook', 'feed-them-social') . '</a></div> ' : '';.
|
948 |
+
// Output Photo Picture.
|
949 |
+
if ( $fb_picture ) {
|
950 |
+
if ( $fb_post_object_id ) {
|
951 |
+
$this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, 'https://graph.facebook.com/' . $fb_post_object_id . '/picture' );
|
952 |
+
} else {
|
953 |
+
if ( isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ){
|
954 |
+
echo $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $video_photo );
|
955 |
+
}
|
956 |
+
elseif ( isset( $fb_shortcode['type'] ) && 'album_photos' === $fb_shortcode['type'] ) {
|
957 |
+
echo $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->source );
|
958 |
+
}
|
959 |
+
else {
|
960 |
+
echo $this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $post_data->attachments->data[0]->media->image->src );
|
961 |
+
}
|
962 |
+
}
|
963 |
+
}
|
964 |
+
echo '<div class="slicker-facebook-album-photoshadow"></div>';
|
965 |
+
// FB Video play button for facebook videos. This button takes data from our a tag and along with additional js in the magnific-popup.js we can now load html5 videos. SO lightweight this way because no pre-loading of videos are on the page. We only show the posterboard on mobile devices because tablets and desktops will auto load the videos. SRL.
|
966 |
+
if ( isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
967 |
+
if ( isset( $fb_shortcode['play_btn'] ) && 'yes' === $fb_shortcode['play_btn'] ) {
|
968 |
+
$fb_play_btn_visible = isset( $fb_shortcode['play_btn_visible'] ) && 'yes' === $fb_shortcode['play_btn_visible'] ? ' visible-video-button' : '';
|
969 |
+
|
970 |
+
// $post_data_source = isset($post_data->source) ? $post_data->source : $embed_html;.
|
971 |
+
// $post_data_source = isset($embed_html) ? $embed_html : '';.
|
972 |
+
// $post_data_format_3_picture = isset($post_data->format[3]->picture) ? $post_data->format[3]->picture : '';.
|
973 |
+
echo '<a href="' . esc_url( $embed_html ) . '" data-poster="" id="fts-view-vid1-' . esc_attr( $fts_dynamic_vid_name_string ) . '" title="' . esc_html( $fb_description ) . '" class="fts-jal-fb-vid-html5video ' . esc_attr( $fts_view_fb_videos_btn . ' fb-video-popup-' . $fts_dynamic_vid_name_string . ' ' . $fb_play_btn_visible ) . ' fts-slicker-backg" style="height:' . esc_attr( $fb_shortcode['play_btn_size'] ) . ' !important; width:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '; line-height: ' . esc_attr( $fb_shortcode['play_btn_size'] ) . '; font-size:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '"><span class="fts-fb-video-icon" style="height:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '; width:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '; line-height:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '; font-size:' . esc_attr( $fb_shortcode['play_btn_size'] ) . '"></span></a>';
|
974 |
+
|
975 |
+
echo '<div class="fts-fb-embed-iframe-check-used-for-popup fts-fb-embed-yes">';
|
976 |
+
if ( $embed_height >= $embed_width ) {
|
977 |
+
echo '<div class=' . esc_attr( $data_height ) . ' data-width="' . esc_attr( $embed_width ) . '" data-height="' . esc_attr( $embed_height ) . '"></div>';
|
978 |
+
}
|
979 |
+
echo '</div>';
|
980 |
+
}
|
981 |
+
}
|
982 |
+
if ( 'album_photos' === ! $fb_shortcode['type'] ) {
|
983 |
+
echo '<div class="fts-jal-fb-description-wrap" style="display:none">';
|
984 |
+
// Output Photo Name.
|
985 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type ) : '';
|
986 |
+
// Output Photo Caption.
|
987 |
+
$fb_caption ? $this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type ) : '';
|
988 |
+
// Output Photo Description.
|
989 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
990 |
+
echo '<div class="fts-clear"></div></div>';
|
991 |
+
}
|
992 |
+
echo '<div class="fts-clear"></div></div>';
|
993 |
+
break;
|
994 |
+
|
995 |
+
// START ALBUM POST.
|
996 |
+
case 'app':
|
997 |
+
case 'cover':
|
998 |
+
case 'profile':
|
999 |
+
case 'mobile':
|
1000 |
+
case 'wall':
|
1001 |
+
case 'normal':
|
1002 |
+
case 'album':
|
1003 |
+
echo '<div class="fts-jal-fb-link-wrap fts-album-photos-wrap"';
|
1004 |
+
if ( 'album_photos' === $fb_shortcode['type'] || 'albums' === $fb_shortcode['type'] ) {
|
1005 |
+
echo ' style="line-height:' . esc_attr( $fb_shortcode['image_height'] ) . ' !important;"';
|
1006 |
+
}
|
1007 |
+
echo '>';
|
1008 |
+
|
1009 |
+
// echo '<pre>rrr';
|
1010 |
+
// print_r($fb_album_cover);
|
1011 |
+
// echo '</pre>';
|
1012 |
+
// Output Photo Picture.
|
1013 |
+
|
1014 |
+
// if ( $fb_post_object_id ) {
|
1015 |
+
// if ( $fb_post_object_id ) {
|
1016 |
+
|
1017 |
+
$photo_source_final = isset( $post_data->attachments->data[0]->media->image->src ) ? $post_data->attachments->data[0]->media->image->src : 'https://graph.facebook.com/' . $fb_post_object_id . '/picture';
|
1018 |
+
|
1019 |
+
// if we have more than one attachment we get the first image width and set that for the max width.
|
1020 |
+
$fts_fb_image_count = isset( $post_data->attachments->data[0]->subattachments->data ) ? count( $post_data->attachments->data[0]->subattachments->data ) : '0';
|
1021 |
+
// TESTING: lets see how many images are being output per post.
|
1022 |
+
// echo $fts_fb_image_count;.
|
1023 |
+
// echo $fts_fb_image_count;.
|
1024 |
+
if ( '0' === $fts_fb_image_count || '1' === $fts_fb_image_count || $fts_fb_image_count > 2 ) {
|
1025 |
+
|
1026 |
+
// echo $fts_fb_image_count;.
|
1027 |
+
echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $photo_source_final ) : esc_url( $fb_link ) ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . esc_attr( $post_data->from->name ) . '" src="' . esc_url( $photo_source_final ) . '"></a>';
|
1028 |
+
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
if ( '' !== $fb_picture_gallery1 ) {
|
1032 |
+
|
1033 |
+
// we count the number of attachments in the subattachments->data portion of the array and count the objects http://php.net/manual/en/function.count.php.
|
1034 |
+
$fts_fb_image_counter = $fts_fb_image_count - 3;
|
1035 |
+
|
1036 |
+
$fts_fb_image_count_check = $fts_fb_image_count < 3 ? ' fts-more-images-tint' : '';
|
1037 |
+
|
1038 |
+
$fb_picture_gallery1_check = '' === $fb_picture_gallery2 ? '100%;' : $fb_picture_gallery0_width . 'px';
|
1039 |
+
// if we only have 2 photos we show them side by side.
|
1040 |
+
$fb_picture_gallery2_check = '' === $fb_picture_gallery2 ? ' fts-more-photos-auto-width' : '';
|
1041 |
+
// if we have 3 photos we add this class so we can make the 2 attachments below the large image will fit side by side.
|
1042 |
+
$fb_picture_gallery3_check = '' === $fb_picture_gallery3 && '' !== $fb_picture_gallery2 ? ' fts-more-photos-three-photo-wrap' : '';
|
1043 |
+
|
1044 |
+
$columns_css = '';
|
1045 |
+
|
1046 |
+
// print $fts_fb_image_count;.
|
1047 |
+
if ( 2 === $fts_fb_image_count ) {
|
1048 |
+
$columns = '2';
|
1049 |
+
$columns_css = 'fts-more-photos-2-or-3-photos ';
|
1050 |
+
$morethan3 = 'fts-2-photos ';
|
1051 |
+
} elseif ( 3 === $fts_fb_image_count ) {
|
1052 |
+
$columns = '2';
|
1053 |
+
$columns_css = 'fts-more-photos-2-or-3-photos ';
|
1054 |
+
$morethan3 = 'fts-3-photos ';
|
1055 |
+
} elseif ( $fts_fb_image_count >= 4 ) {
|
1056 |
+
$columns = '3';
|
1057 |
+
$columns_css = 'fts-more-photos-4-photos ';
|
1058 |
+
$morethan3 = 'fts-4-photos ';
|
1059 |
+
}
|
1060 |
+
|
1061 |
+
echo '<div class="fts-clear"></div><div class="' . esc_attr( $columns_css . 'fts-fb-more-photos-wrap fts-facebook-inline-block-centered' . $fb_picture_gallery2_check . $fb_picture_gallery3_check ) . '" style="max-width:' . esc_attr( $fb_picture_gallery1_check ) . '" data-ftsi-id=' . esc_attr( $fts_dynamic_vid_name_string ) . ' data-ftsi-columns="' . esc_attr( $columns ) . '" data-ftsi-margin="1px" data-ftsi-force-columns="yes">';
|
1062 |
+
}
|
1063 |
+
if ( 2 === $fts_fb_image_count ) {
|
1064 |
+
echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $photo_source_final ) : esc_url( $fb_link ) ) . '" target="_blank" rel="noreferrer" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . esc_attr( $morethan3 ) . 'fts-fb-thumb-zero-wrap fts-fb-large-photo" style="background:url(' . esc_url( $photo_source_final ) . ');" title="' . esc_attr( $fb_pictureGalleryDescription0 ) . '" aria-label="' . esc_attr( $fb_pictureGalleryDescription0 ) . '"></a>';
|
1065 |
+
|
1066 |
+
}
|
1067 |
+
if ( '' !== $fb_picture_gallery1 ) {
|
1068 |
+
echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $fb_picture_gallery1 ) : esc_url( $fb_picture_gallery_link1 ) ) . '" target="_blank" rel="noreferrer" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . esc_attr( $morethan3 ) . 'fts-fb-thumb-zero-wrap fts-fb-large-photo" style="background:url(' . esc_url( $fb_picture_gallery1 ) . ');" title="' . esc_attr( $fb_pictureGalleryDescription1 ) . '" aria-label="' . esc_attr( $fb_pictureGalleryDescription1 ) . '"></a>';
|
1069 |
+
|
1070 |
+
if ( '' !== $fb_picture_gallery2 ) {
|
1071 |
+
echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $fb_picture_gallery2 ) : esc_url( $fb_picture_gallery_link2 ) ) . '" target="_blank" rel="noreferrer" class="fts-2-or-3-photos slicker-facebook-placeholder fts-fb-thumbs-wrap ' . esc_attr( $morethan3 ) . 'fts-fb-thumb-one-wrap fts-fb-large-photo" style="background:url(' . esc_url( $fb_picture_gallery2 ) . ');" title="' . esc_attr( $fb_pictureGalleryDescription1 ) . '" aria-label="' . esc_attr( $fb_pictureGalleryDescription1 ) . '"></a>';
|
1072 |
+
|
1073 |
+
}
|
1074 |
+
if ( '' !== $fb_picture_gallery3 ) {
|
1075 |
+
echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $fb_picture_gallery3 ) : esc_url( $fb_picture_gallery_link3 ) ) . '" target="_blank" rel="noreferrer" class="slicker-facebook-placeholder fts-fb-thumbs-wrap ' . esc_attr( $morethan3 ) . 'fts-fb-thumb-two-wrap fts-fb-large-photo' . esc_attr( $fts_fb_image_count_check ) . '" style="background:url(' . esc_url( $fb_picture_gallery3 ) . ');" title="' . esc_attr( $fb_pictureGalleryDescription2 ) . '" aria-label="' . esc_attr( $fb_pictureGalleryDescription2 ) . '"><div class="fts-image-count-tint-underlay"></div><div class="fts-image-count"><span>+</span>' . esc_html( $fts_fb_image_counter ) . '</div></a>';
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
if ( '' !== $fb_picture_gallery1 ) {
|
1079 |
+
echo '</div>';
|
1080 |
+
}
|
1081 |
+
// }
|
1082 |
+
// else {
|
1083 |
+
// echo '<a href="' . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? esc_url( $photo_source_final ) : esc_url( $fb_link ) ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . esc_attr( $post_data->from->name ) . '" src="' . esc_url( $photo_source_final ) . '" title="' . $fb_pictureGalleryDescription0 . '" aria-label="' . $fb_pictureGalleryDescription0 . '"></a>';
|
1084 |
+
// }
|
1085 |
+
// }
|
1086 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
1087 |
+
$this->fts_facebook_post_photo( $fb_link, $fb_shortcode, $post_data->from->name, $fb_album_cover );
|
1088 |
+
}
|
1089 |
+
echo '<div class="slicker-facebook-album-photoshadow"></div>';
|
1090 |
+
if ( 'albums' === ! $fb_shortcode['type'] ) {
|
1091 |
+
echo '<div class="fts-jal-fb-description-wrap">';
|
1092 |
+
// Output Photo Name.
|
1093 |
+
$fb_name ? $this->fts_facebook_post_name( $fb_link, $fb_name, $fb_type ) : '';
|
1094 |
+
// Output Photo Caption.
|
1095 |
+
$fb_caption ? $this->fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type ) : '';
|
1096 |
+
// Output Photo Description.
|
1097 |
+
$fb_description ? $this->fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type, null, $fb_by ) : '';
|
1098 |
+
echo '<div class="fts-clear"></div></div>';
|
1099 |
+
}
|
1100 |
+
echo '<div class="fts-clear"></div></div>';
|
1101 |
+
break;
|
1102 |
+
|
1103 |
+
}
|
1104 |
+
// This puts the video in a popup instead of displaying it directly on the page.
|
1105 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ) {
|
1106 |
+
// Post Comments.
|
1107 |
+
echo '<div class="fts-fb-comments-wrap">';
|
1108 |
+
$hide_comments_popup = isset( $fb_shortcode['hide_comments_popup'] ) ? $fb_shortcode['hide_comments_popup'] : 'no';
|
1109 |
+
if ( isset( $lcs_array['comments_thread']->data ) && ! empty( $lcs_array['comments_thread']->data ) && 'yes' !== $hide_comments_popup || isset( $lcs_array['comments_thread']->data ) && ! empty( $lcs_array['comments_thread']->data ) && empty( $hide_comments_popup ) ) {
|
1110 |
+
// Post Comments.
|
1111 |
+
echo '<div class="fts-fb-comments-content fts-comments-post-' . esc_attr( $fb_post_id ) . '">';
|
1112 |
+
|
1113 |
+
foreach ( $lcs_array['comments_thread']->data as $comment ) {
|
1114 |
+
if ( ! empty( $comment->message ) ) {
|
1115 |
+
echo '<div class="fts-fb-comment fts-fb-comment-' . esc_attr( $comment->id ) . '">';
|
1116 |
+
// User Profile Img.
|
1117 |
+
// Not having page public content access persmission anymore is not allowing us to get profile pics anymore, and the link to personal accounts won't work anymore either for people posting to our page.
|
1118 |
+
// $avatar_id = isset( $comment->from->id ) ? 'https://graph.facebook.com/'.$comment->from->id.'/picture?redirect=1&type=square' : plugin_dir_url( dirname( __FILE__ ) ) . 'images/slick-comment-pic.png';
|
1119 |
+
$avatar_id = plugin_dir_url( __DIR__ ) . 'images/slick-comment-pic.png';
|
1120 |
+
echo '<img class="fts-fb-comment-user-pic" src="' . esc_url( $avatar_id ) . '"/>';
|
1121 |
+
echo '<div class="fts-fb-comment-msg">';
|
1122 |
+
if ( isset( $comment->from->name ) ) {
|
1123 |
+
echo '<span class="fts-fb-comment-user-name">' . esc_html( $comment->from->name ) . '</span> ';
|
1124 |
+
}
|
1125 |
+
echo esc_html( $comment->message ) . '</div>';
|
1126 |
+
|
1127 |
+
// Comment Message.
|
1128 |
+
echo '</div>';
|
1129 |
+
}
|
1130 |
+
}
|
1131 |
+
echo '</div>';
|
1132 |
+
|
1133 |
+
// echo '<pre>';
|
1134 |
+
// print_r( $lcs_array['comments_thread']->data );
|
1135 |
+
// echo '</pre>';
|
1136 |
+
}
|
1137 |
+
echo '</div><!-- END Comments Wrap -->';
|
1138 |
+
}
|
1139 |
+
|
1140 |
+
// filter messages to have urls.
|
1141 |
+
// Output Message For combined feeds in the bottom.
|
1142 |
+
if ( isset( $fb_shortcode['show_media'] ) && 'top' === $show_media ) {
|
1143 |
+
|
1144 |
+
if ( isset( $fb_shortcode['show_social_icon'] ) && 'right' === $fb_shortcode['show_social_icon'] ) {
|
1145 |
+
echo '<div class="fts-mashup-icon-wrap-right fts-mashup-facebook-icon"><a href="' . esc_url( 'https://www.facebook.com/' . $from_id_picture ) . '" target="_blank" rel="noreferrer"></a></div>';
|
1146 |
+
}
|
1147 |
+
// show icon.
|
1148 |
+
if ( isset( $fb_shortcode['show_social_icon'] ) && 'left' === $fb_shortcode['show_social_icon'] ) {
|
1149 |
+
echo '<div class="fts-mashup-icon-wrap-left fts-mashup-facebook-icon"><a href="' . esc_url( 'https://www.facebook.com/' . $from_id_picture ) . '" target="_blank" rel="noreferrer"></a></div>';
|
1150 |
+
}
|
1151 |
+
echo '<div class="fts-jal-fb-top-wrap ' . esc_attr( $hide_date_likes_comments ) . '" style="display:block !important;">';
|
1152 |
+
echo '<div class="fts-jal-fb-user-thumb">';
|
1153 |
+
|
1154 |
+
$avatar_id = plugin_dir_url( __DIR__ ) . 'images/slick-comment-pic.png';
|
1155 |
$profile_photo_exists_check = isset( $post_data->fts_profile_pic_url ) && strpos( $post_data->fts_profile_pic_url, 'profilepic' ) !== false ? $post_data->fts_profile_pic_url : $avatar_id;
|
1156 |
+
echo ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? '' : '<a href="' . esc_url( 'https://www.facebook.com/' . $from_id_picture ) . '" target="_blank" rel="noreferrer">' ) . '<img border="0" alt="' . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? esc_attr( $post_data->reviewer->name ) : esc_attr( $post_data->from->name ) ) . '" src="' . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? esc_url( $profile_photo_exists_check ) . '"/>' : 'https://graph.facebook.com/' . esc_attr( $from_id_picture ) ) . ( 'reviews' === esc_attr( $fb_shortcode['type'] ) ? '' : '/picture"/></a>' );
|
1157 |
echo '</div>';
|
1158 |
|
1159 |
+
// UserName.
|
1160 |
+
echo '<span class="fts-jal-fb-user-name"><a href="' . esc_url( 'https://www.facebook.com/' . $from_id_picture ) . '" target="_blank" rel="noreferrer">' . esc_html( $post_data->from->name ) . '</a>' . esc_html( $fb_hide_shared_by_etc_text ) . '</span>';
|
1161 |
+
|
1162 |
+
// tied to date function.
|
1163 |
+
$feed_type = 'facebook';
|
1164 |
+
$times = $custom_time_format;
|
1165 |
+
$fts_final_date = $this->fts_custom_date( $times, $feed_type );
|
1166 |
+
// PostTime.
|
1167 |
+
echo '<span class="fts-jal-fb-post-time">' . $fts_final_date . '</span><div class="fts-clear"></div>';
|
1168 |
+
|
1169 |
+
if ( ! empty( $fb_places_id ) ) {
|
1170 |
+
$this->feed_location_option( $fb_places_id, $fb_name, $fb_places_name );
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
// here we trim the words for the premium version. The $fb_shortcode['words'] string actually comes from the javascript.
|
1174 |
+
if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) && array_key_exists( 'words', $fb_shortcode ) || is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && array_key_exists( 'words', $fb_shortcode ) ) {
|
1175 |
+
$more = isset( $more ) ? $more : '';
|
1176 |
+
$trimmed_content = $this->fts_custom_trim_words( $fb_message, $fb_shortcode['words'], $more );
|
1177 |
+
|
1178 |
+
echo '<div class="fts-jal-fb-message">';
|
1179 |
+
|
1180 |
+
echo esc_html( $fb_title_job_opening );
|
1181 |
+
echo ! empty( $trimmed_content ) ? $trimmed_content : '';
|
1182 |
+
echo '<div class="fts-clear"></div></div> ';
|
1183 |
+
|
1184 |
+
} else {
|
1185 |
+
$fb_final_message = $this->fts_facebook_tag_filter( $fb_message );
|
1186 |
+
echo '<div class="fts-jal-fb-message">';
|
1187 |
+
echo nl2br( $fb_final_message );
|
1188 |
+
echo '<div class="fts-clear"></div></div>';
|
1189 |
+
}
|
1190 |
+
echo '</div>';
|
1191 |
+
|
1192 |
+
}
|
1193 |
+
|
1194 |
+
echo '<div class="fts-clear"></div>';
|
1195 |
+
echo '</div>';
|
1196 |
+
$fb_post_single_id = isset( $fb_post_single_id ) ? $fb_post_single_id : '';
|
1197 |
+
$single_event_id = isset( $single_event_id ) ? $single_event_id : '';
|
1198 |
+
$this->fts_facebook_post_see_more( $fb_link, $lcs_array, $fb_type, $fb_post_id, $fb_shortcode, $fb_post_user_id, $fb_post_single_id, $single_event_id, $post_data );
|
1199 |
+
echo '<div class="fts-clear"></div>';
|
1200 |
+
echo '</div>';
|
1201 |
+
|
1202 |
+
}//end feed_post_types()
|
1203 |
+
}//end class
|
feeds/facebook/class-fts-facebook-feed.php
CHANGED
@@ -7,2251 +7,2263 @@
|
|
7 |
* @since 1.9.6
|
8 |
*/
|
9 |
class FTS_Facebook_Feed extends feed_them_social_functions {
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
|
|
627 |
|
628 |
style="margin:' . ( isset( $fb_shortcode['slider_margin'] ) && '' !== $fb_shortcode['slider_margin'] ? esc_attr( $fb_shortcode['slider_margin'] ) : 'auto' ) . ';' . ( isset( $fts_cycle_type ) && 'carousel' === $fts_cycle_type ? 'width:100%; max-width:100%; overflow:hidden;height:' . esc_attr( $fb_shortcode['image_height'] ) . ';' : 'overflow:hidden; height:' . esc_attr( $fb_shortcode['image_height'] ) . '; max-width:' . ( isset( $fb_shortcode['image_width'] ) && '' !== $fb_shortcode['image_width'] ? esc_attr( $fb_shortcode['image_width'] ) : 'auto' ) ) . ';" data-cycle-caption="#fts-custom-caption-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-caption-template="{{slideNum}} / {{slideCount}}" data-cycle-pager=".fts-custom-pager-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-pause-on-hover="true" data-cycle-prev=".fts-prevControl-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-next=".fts-nextControl-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-timeout="' . ( ! empty( $fb_shortcode['slider_timeout'] ) ? esc_attr( $fb_shortcode['slider_timeout'] ) : '0' ) . '" data-cycle-manual-speed="' . ( ! empty( $fb_shortcode['slider_speed'] ) ? esc_attr( $fb_shortcode['slider_speed'] ) : '400' ) . '" data-cycle-auto-height="false" data-cycle-slides="> div" data-cycle-fx="' . ( ! empty( $fb_shortcode['scrollhorz_or_carousel'] ) ? esc_attr( $fb_shortcode['scrollhorz_or_carousel'] ) : '' ) . '" data-cycle-carousel-visible=' . ( ! empty( $fb_shortcode['slides_visible'] ) ? esc_attr( $fb_shortcode['slides_visible'] ) : '4' ) . ' data-cycle-swipe=true data-cycle-swipe-fx=' . ( ! empty( $fb_shortcode['scrollhorz_or_carousel'] ) ? esc_attr( $fb_shortcode['scrollhorz_or_carousel'] ) : '' ) . '>';
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2257 |
}//end class
|
7 |
* @since 1.9.6
|
8 |
*/
|
9 |
class FTS_Facebook_Feed extends feed_them_social_functions {
|
10 |
+
/**
|
11 |
+
* Construct
|
12 |
+
*
|
13 |
+
* Facebook Feed constructor.
|
14 |
+
*
|
15 |
+
* @since 1.9.6
|
16 |
+
*/
|
17 |
+
public function __construct() {
|
18 |
+
add_shortcode( 'fts_facebook_group', array( $this, 'fts_fb_func' ) );
|
19 |
+
add_shortcode( 'fts_facebook_page', array( $this, 'fts_fb_func' ) );
|
20 |
+
add_shortcode( 'fts_facebook_event', array( $this, 'fts_fb_func' ) );
|
21 |
+
add_shortcode( 'fts_facebook', array( $this, 'fts_fb_func' ) );
|
22 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'fts_fb_head' ) );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* FTS FB Head
|
27 |
+
*
|
28 |
+
* Add Styles and Scripts functions.
|
29 |
+
*
|
30 |
+
* @since 1.9.6
|
31 |
+
*/
|
32 |
+
public function fts_fb_head() {
|
33 |
+
wp_enqueue_style( 'fts-feeds', plugins_url( 'feed-them-social/feeds/css/styles.css' ), array(), FTS_CURRENT_VERSION, false );
|
34 |
+
|
35 |
+
if ( is_plugin_active( 'feed-them-social/feed-them.php' ) && is_plugin_active( 'feed-them-carousel-premium/feed-them-carousel-premium.php' ) && is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
36 |
+
wp_enqueue_script( 'fts-feeds', plugins_url( 'feed-them-carousel-premium/feeds/js/jquery.cycle2.js' ), array(), FTS_CURRENT_VERSION, false );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Date Sort
|
42 |
+
*
|
43 |
+
* Date sort option for multiple feeds in a shortcode.
|
44 |
+
*
|
45 |
+
* @param string $a First Date.
|
46 |
+
* @param string $b Second Date.
|
47 |
+
* @return false|int
|
48 |
+
* @since 1.9.6
|
49 |
+
*/
|
50 |
+
public function dateSort( $a, $b ) {
|
51 |
+
$date_a = strtotime( $a->created_time );
|
52 |
+
$date_b = strtotime( $b->created_time );
|
53 |
+
return ( $date_b - $date_a );
|
54 |
+
}
|
55 |
+
|
56 |
+
|
57 |
+
/**
|
58 |
+
* FTS FB Func
|
59 |
+
*
|
60 |
+
* Display Facebook Feed.
|
61 |
+
*
|
62 |
+
* @param string $atts Shortcode attributes.
|
63 |
+
* @return string
|
64 |
+
* @since 1.9.6
|
65 |
+
*/
|
66 |
+
public function fts_fb_func( $atts ) {
|
67 |
+
// masonry snippet in fts-global.
|
68 |
+
wp_enqueue_script( 'fts-global', plugins_url( 'feed-them-social/feeds/js/fts-global.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
|
69 |
+
$developer_mode = 'on';
|
70 |
+
// Make sure everything is reset.
|
71 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
72 |
+
// Eventually add premium page file.
|
73 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
|
74 |
+
|
75 |
+
$fts_facebook_reviews = new FTS_Facebook_Reviews();
|
76 |
+
$review_atts = $fts_facebook_reviews->shortcode_attributes();
|
77 |
+
$fb_shortcode = shortcode_atts( $review_atts, $atts );
|
78 |
+
// Load up some scripts for popup.
|
79 |
+
$this->load_popup_scripts( $fb_shortcode );
|
80 |
+
} elseif ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
81 |
+
include WP_PLUGIN_DIR . '/feed-them-premium/feeds/facebook/facebook-premium-feed.php';
|
82 |
+
// Doing this to phase out the invalid snake case.
|
83 |
+
$fb_shortcode = $FB_Shortcode;
|
84 |
+
// Load up some scripts for popup.
|
85 |
+
$this->load_popup_scripts( $fb_shortcode );
|
86 |
+
} elseif ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) && ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
87 |
+
// Doing this to phase out the invalid snake case.
|
88 |
+
$fb_shortcode = $FB_Shortcode;
|
89 |
+
$fb_shortcode = shortcode_atts(
|
90 |
+
array(
|
91 |
+
'id' => '',
|
92 |
+
'type' => '',
|
93 |
+
'posts' => '',
|
94 |
+
'posts_displayed' => '',
|
95 |
+
'height' => '',
|
96 |
+
'album_id' => '',
|
97 |
+
'image_width' => '',
|
98 |
+
'image_height' => '',
|
99 |
+
'space_between_photos' => '',
|
100 |
+
'hide_date_likes_comments' => '',
|
101 |
+
'center_container' => '',
|
102 |
+
'image_stack_animation' => '',
|
103 |
+
'image_position_lr' => '',
|
104 |
+
'image_position_top' => '',
|
105 |
+
'hide_comments_popup' => '',
|
106 |
+
// only works with combined FB streams otherwise you need the premium version.
|
107 |
+
'popup' => '',
|
108 |
+
'words' => '',
|
109 |
+
'grid' => '',
|
110 |
+
'colmn_width' => '',
|
111 |
+
'space_between_posts' => '',
|
112 |
+
// new show media on top options.
|
113 |
+
'show_media' => '',
|
114 |
+
'show_date' => '',
|
115 |
+
'show_name' => '',
|
116 |
+
// 'access_token' => '',
|
117 |
+
),
|
118 |
+
$atts
|
119 |
+
);
|
120 |
+
if ( null === $fb_shortcode['posts'] ) {
|
121 |
+
$fb_shortcode['posts'] = '6';
|
122 |
+
}
|
123 |
+
} else {
|
124 |
+
$fb_shortcode = shortcode_atts(
|
125 |
+
array(
|
126 |
+
'id' => '',
|
127 |
+
'type' => '',
|
128 |
+
'posts' => '',
|
129 |
+
'description' => 'yes',
|
130 |
+
'posts_displayed' => '',
|
131 |
+
'height' => '',
|
132 |
+
'album_id' => '',
|
133 |
+
'image_width' => '',
|
134 |
+
'image_height' => '',
|
135 |
+
'space_between_photos' => '',
|
136 |
+
'hide_date_likes_comments' => '',
|
137 |
+
'center_container' => '',
|
138 |
+
'image_stack_animation' => '',
|
139 |
+
'image_position_lr' => '',
|
140 |
+
'image_position_top' => '',
|
141 |
+
'hide_comments_popup' => '',
|
142 |
+
'access_token' => '',
|
143 |
+
),
|
144 |
+
$atts
|
145 |
+
);
|
146 |
+
if ( null === $fb_shortcode['posts'] ) {
|
147 |
+
$fb_shortcode['posts'] = '6';
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
if ( 'album_videos' === $fb_shortcode['type'] ) {
|
152 |
+
$fb_shortcode['type'] = 'album_photos';
|
153 |
+
$fb_shortcode['video_album'] = 'yes';
|
154 |
+
$fb_shortcode['album_id'] = 'photo_stream';
|
155 |
+
if ( isset( $fb_shortcode['loadmore_btn_maxwidth'] ) && ! empty( $fb_shortcode['loadmore_btn_maxwidth'] ) ) {
|
156 |
+
$fb_shortcode['loadmore'] = 'button';
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
if ( ! is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && ! is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && ! is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) && $fb_shortcode['posts'] > '6' ) {
|
161 |
+
$fb_shortcode['posts'] = '6';
|
162 |
+
}
|
163 |
+
|
164 |
+
// Get Access Token.
|
165 |
+
$access_token = isset( $fb_shortcode['access_token'] ) ? $fb_shortcode['access_token'] : '';
|
166 |
+
if ( ! empty( $access_token ) ) {
|
167 |
+
$access_token = $fb_shortcode['access_token'];
|
168 |
+
} else {
|
169 |
+
$access_token = $this->get_access_token();
|
170 |
+
}
|
171 |
+
|
172 |
+
// UserName?.
|
173 |
+
if ( ! $fb_shortcode['id'] ) {
|
174 |
+
return 'Please enter a username for this feed.';
|
175 |
+
}
|
176 |
+
if ( 'reviews' === $fb_shortcode['type'] && ! is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
|
177 |
+
return '<div style="clear:both; padding:15px 0;">You must have FTS Facebook Reviews extension active to see this feed.</div>';
|
178 |
+
}
|
179 |
+
|
180 |
+
$type = isset( $fb_shortcode['type'] ) ? $fb_shortcode['type'] : '';
|
181 |
+
if ( 'group' === $type || 'page' === $type || 'event' === $type ) {
|
182 |
+
|
183 |
+
// EMPTY FACEBOOK POSTS OFFSET AND COUNT.
|
184 |
+
// Option Now Being Removed from here and the Facebook Settings Page.
|
185 |
+
// Setting it to blank so no matter what it will never error get_option('fb_count_offset');.
|
186 |
+
$fb_count_offset = '';
|
187 |
+
|
188 |
+
// View Link.
|
189 |
+
$fts_view_fb_link = '';
|
190 |
+
// Get Cache Name.
|
191 |
+
$fb_cache_name = '';
|
192 |
+
// Get language.
|
193 |
+
$language = '';
|
194 |
+
|
195 |
+
// Get Response (AKA Page & Feed Information) ERROR CHECK inside this function.
|
196 |
+
$response2 = $this->get_facebook_feed_response( $fb_shortcode, $fb_cache_name, $access_token, $language );
|
197 |
+
|
198 |
+
// Test to see if the re-sort date option is working from function above.
|
199 |
+
// print $this->dateSort;.
|
200 |
+
$feed_data_check = json_decode( $response2['feed_data'] );
|
201 |
+
|
202 |
+
// SHOW THE REGULAR FEEDS PRINT_R
|
203 |
+
// echo '<pre>';
|
204 |
+
// print_r($feed_data_check);
|
205 |
+
// echo '</pre>';
|
206 |
+
// $idNew = array();
|
207 |
+
// $idNew = explode(',', $fb_shortcode['id']);
|
208 |
+
// Testing options before foreach loop
|
209 |
+
// $idNew = 'tonyhawk';
|
210 |
+
// print_r($feed_data_check->$idNew->data);.
|
211 |
+
if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
|
212 |
+
$fts_count_ids = substr_count( $fb_shortcode['id'], ',' );
|
213 |
+
} else {
|
214 |
+
$fts_count_ids = '';
|
215 |
+
}
|
216 |
+
|
217 |
+
if ( isset( $feed_data_check->data ) ) {
|
218 |
+
if ( $fts_count_ids >= 1 && 'reviews' !== $fb_shortcode['type'] ) {
|
219 |
+
$fts_list_arrays = array();
|
220 |
+
foreach ( $feed_data_check as $feed_data_name ) {
|
221 |
+
|
222 |
+
if ( isset( $feed_data_name->data ) ) {
|
223 |
+
$fts_list_arrays = array_merge_recursive( $fts_list_arrays, $feed_data_name->data );
|
224 |
+
}
|
225 |
+
// var_dump( $fts_list_arrays[$i]);.
|
226 |
+
}
|
227 |
+
$merged_array['data'] = $fts_list_arrays;
|
228 |
+
$feed_data_check = (object) $merged_array;
|
229 |
+
}
|
230 |
+
|
231 |
+
// Test the created dataes are being sorted properly
|
232 |
+
// foreach($merged_array['data'] as $newSort) {
|
233 |
+
// print date("jS F, Y", strtotime($newSort->created_time));
|
234 |
+
// print '<br/>';
|
235 |
+
// }.
|
236 |
+
$set_zero = 0;
|
237 |
+
foreach ( $feed_data_check->data as $post_count ) {
|
238 |
+
|
239 |
+
$fb_message = isset( $post_count->message ) ? $post_count->message : '';
|
240 |
+
$fb_story = isset( $post_count->story ) ? $post_count->story : '';
|
241 |
+
$fb_type = isset( $post_count->attachments->data[0]->type ) ? $post_count->attachments->data[0]->type : '';
|
242 |
+
$fb_status_type = isset( $post_count->status_type ) ? $post_count->status_type : '';
|
243 |
+
|
244 |
+
// This is the method to skip empty posts or posts that are simply about changing settings or other non important post types
|
245 |
+
// We will count all the ones that are like this and add that number to the output of posts to offset the posts we are filtering out. Line 278 needs the same treatment of if options.
|
246 |
+
if ( 'status' === $fb_type && empty( $fb_message ) && empty( $fb_story ) || 'event' === $fb_type || 'event' === $fb_type && false !== strpos( $fb_story, 'shared their event' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'changed the name of the event to' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'changed the privacy setting' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'an admin of the group' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'created the group' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'added an event' ) || 'event' === $fb_type && false !== strpos( $fb_story, 'added an event' ) ) {
|
247 |
+
$set_zero++;
|
248 |
+
} elseif ( '0' === $feed_data_check->data ) {
|
249 |
+
// If more than the 5 posts(default in free) or the post= from shortcode is set to the amount of posts that are being filtered above we will add 7 to the post count to try and get at some posts.
|
250 |
+
// This will only happen for Page and Group feeds.
|
251 |
+
$set_zero = '7';
|
252 |
+
}
|
253 |
+
}// END POST foreach.
|
254 |
+
|
255 |
+
// Result of the foreach loop above minus the empty posts and offset by those posts the actual number of posts entered is shown
|
256 |
+
// $fb_shortcode['posts'] = $result;.
|
257 |
+
if ( ! empty( $fb_count_offset ) ) {
|
258 |
+
$set_zero = $fb_count_offset;
|
259 |
+
$unset_count = $fb_shortcode['posts'] + $set_zero;
|
260 |
+
$fb_shortcode['posts'] = $unset_count;
|
261 |
+
} else {
|
262 |
+
$unset_count = $fb_shortcode['posts'] + $set_zero;
|
263 |
+
$fb_shortcode['posts'] = $unset_count;
|
264 |
+
}
|
265 |
+
|
266 |
+
// SHOW THE $feed_data_check PRINT_R
|
267 |
+
// echo '<pre>';
|
268 |
+
// print_r($feed_data_check);
|
269 |
+
// echo '</pre>, ';.
|
270 |
+
}
|
271 |
+
// END.
|
272 |
+
}
|
273 |
+
|
274 |
+
ob_start();
|
275 |
+
// Uncomment these for testing purposes to see the actual count and the offset count
|
276 |
+
// print $set_zero;
|
277 |
+
// print $fb_shortcode['posts'];
|
278 |
+
// print 'asdfasdfasdf<br/>';
|
279 |
+
// print $fb_type;
|
280 |
+
// View Link.
|
281 |
+
$fts_view_fb_link = $this->get_view_link( $fb_shortcode );
|
282 |
+
// Get Cache Name.
|
283 |
+
$fb_cache_name = $this->get_fb_cache_name( $fb_shortcode );
|
284 |
+
// Get language.
|
285 |
+
$language = $this->get_language( $fb_shortcode );
|
286 |
+
if ( 'reviews' !== $fb_shortcode['type'] ) {
|
287 |
+
// Get Response (AKA Page & Feed Information) ERROR CHECK inside this function.
|
288 |
+
$response = $this->get_facebook_feed_response( $fb_shortcode, $fb_cache_name, $access_token, $language );
|
289 |
+
// Json decode data and build it from cache or response.
|
290 |
+
$page_data = json_decode( $response['page_data'] );
|
291 |
+
$feed_data = json_decode( $response['feed_data'] );
|
292 |
+
}
|
293 |
+
|
294 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && true == get_option( 'fts_facebook_custom_api_token_biz' ) && 'reviews' === $fb_shortcode['type'] ||
|
295 |
+
is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && ! empty( $fb_shortcode['token'] ) && 'reviews' === $fb_shortcode['type'] ||
|
296 |
+
is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && ! empty( $fb_shortcode['access_token'] ) && 'reviews' === $fb_shortcode['type'] ) {
|
297 |
+
|
298 |
+
if ( 'yes' === $fb_shortcode['remove_reviews_no_description'] && ! isset( $_GET['load_more_ajaxing'] ) ) {
|
299 |
+
|
300 |
+
$fts_facebook_reviews = new FTS_Facebook_Reviews();
|
301 |
+
$no_description_count = $fts_facebook_reviews->review_count_check( $fb_shortcode );
|
302 |
+
|
303 |
+
// testing purposes
|
304 |
+
// print ''. $no_description_count - $fb_shortcode['posts'] .' = The amount of posts with no review text.';
|
305 |
+
// this count includes our original posts count + the amount of posts we found with no description.
|
306 |
+
$fb_shortcode['posts'] = $no_description_count;
|
307 |
+
}
|
308 |
+
if ( ! empty( $fb_shortcode['token'] ) ) {
|
309 |
+
$biz_access_token = $fb_shortcode['token'];
|
310 |
+
} elseif ( ! empty( $fb_shortcode['access_token'] ) ) {
|
311 |
+
$biz_access_token = $fb_shortcode['access_token'];
|
312 |
+
} else {
|
313 |
+
$biz_access_token = get_option( 'fts_facebook_custom_api_token_biz' );
|
314 |
+
}
|
315 |
+
|
316 |
+
// Get Response (AKA Page & Feed Information) ERROR CHECK inside this function.
|
317 |
+
$response = $this->get_facebook_feed_response( $fb_shortcode, $fb_cache_name, $biz_access_token, $language );
|
318 |
+
|
319 |
+
$feed_data = json_decode( $response['feed_data'] );
|
320 |
+
|
321 |
+
$feed_data = (object) $feed_data;
|
322 |
+
// Add Feed Type to post array.
|
323 |
+
// SHOW THE REVIEWS FEED PRINT_R
|
324 |
+
// echo '<pre>';
|
325 |
+
// print_r($feed_data );
|
326 |
+
// echo '</pre>';
|
327 |
+
if ( 'yes' === $fb_shortcode['remove_reviews_no_description'] ) {
|
328 |
+
// $no_description_count2 = 0;.
|
329 |
+
foreach ( $feed_data->data as $k => $v ) {
|
330 |
+
if ( ! isset( $v->review_text ) ) {
|
331 |
+
// print $v->reviewer->name . ' (Key# ' . $k . ') : Now Unset from array<br/>';.
|
332 |
+
unset( $feed_data->data[ $k ] );
|
333 |
+
// $no_description_count2++;.
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
$ratings_data = json_decode( $response['ratings_data'] );
|
338 |
+
|
339 |
+
// SHOW THE REVIEWS RATING INFO PRINT_R
|
340 |
+
// echo '<pre>';
|
341 |
+
// print_r($ratings_data );
|
342 |
+
// echo '</pre>';.
|
343 |
+
// Add fts_profile_pic_url to the array so we can show profile photos for reviews and comments in popup
|
344 |
+
foreach ( $feed_data->data as $post_array ) {
|
345 |
+
|
346 |
+
$the_image = 'https://graph.facebook.com/' . $post_array->reviewer->id . '/picture?redirect=false&access_token=' . $biz_access_token . '';
|
347 |
+
|
348 |
+
$profile_pic_response = wp_remote_get( $the_image );
|
349 |
+
$profile_pic_data = wp_remote_retrieve_body( $profile_pic_response );
|
350 |
+
$profile_pic_output = json_decode( $profile_pic_data );
|
351 |
+
|
352 |
+
// echo '<pre>';
|
353 |
+
// print_r($profile_pic_output->data->url);
|
354 |
+
// echo '</pre>';
|
355 |
+
$post_array->fts_profile_pic_url = $profile_pic_output->data->url;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
|
360 |
+
$fts_count_ids = substr_count( $fb_shortcode['id'], ',' );
|
361 |
+
} else {
|
362 |
+
$fts_count_ids = '';
|
363 |
+
}
|
364 |
+
|
365 |
+
if ( $fts_count_ids >= 1 && 'reviews' !== $fb_shortcode['type'] ) {
|
366 |
+
|
367 |
+
$fts_list_arrays = array();
|
368 |
+
foreach ( $feed_data as $feed_data_name ) {
|
369 |
+
|
370 |
+
$fts_list_arrays = array_merge_recursive( $fts_list_arrays, $feed_data_name->data );
|
371 |
+
// var_dump( $fts_list_arrays[$i]);.
|
372 |
+
}
|
373 |
+
// Sort the array using the call back function.
|
374 |
+
usort( $fts_list_arrays, array( $this, 'dateSort' ) );
|
375 |
+
|
376 |
+
$merged_array['data'] = $fts_list_arrays;
|
377 |
+
$feed_data = (object) $merged_array;
|
378 |
+
}
|
379 |
+
// SHOW THE REGULAR FEEDS PRINT_R (WORKS FOR VIDEOS AND ALBUMS TOO)
|
380 |
+
// echo '<pre>';
|
381 |
+
// print_r($feed_data );
|
382 |
+
// echo '</pre>';
|
383 |
+
// If No Response or Error then return.
|
384 |
+
if ( is_array( $response ) && isset( $response[0] ) && isset( $response[1] ) && false === $response[0] ) {
|
385 |
+
return $response[1];
|
386 |
+
}
|
387 |
+
|
388 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
389 |
+
// Make sure it's not ajaxing and we will allow the omition of certain album covers from the list by using omit_album_covers=0,1,2,3 in the shortcode.
|
390 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) && 'albums' === $fb_shortcode['type'] ) {
|
391 |
+
|
392 |
+
// omit_album_covers=0,1,2,3 for example.
|
393 |
+
$omit_album_covers = $fb_shortcode['omit_album_covers'];
|
394 |
+
$omit_album_covers_new = array();
|
395 |
+
$omit_album_covers_new = explode( ',', $omit_album_covers );
|
396 |
+
foreach ( $feed_data->data as $post_data ) {
|
397 |
+
foreach ( $omit_album_covers_new as $omit ) {
|
398 |
+
unset( $feed_data->data[ $omit ] );
|
399 |
+
}
|
400 |
+
}
|
401 |
+
}
|
402 |
+
}
|
403 |
+
// Reviews Rating Filter.
|
404 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && 'reviews' === $fb_shortcode['type'] ) {
|
405 |
+
foreach ( $feed_data->data as $key => $post_data ) {
|
406 |
+
// we are not going to show the unrecommended reviews in the feed at this point, no options in our plugin srl 8-28-18.
|
407 |
+
if ( isset( $post_data->rating ) && $post_data->rating < $fb_shortcode['reviews_type_to_show'] || isset( $post_data->recommendation_type ) && 'negative' === $post_data->recommendation_type ) {
|
408 |
+
unset( $feed_data->data[ $key ] );
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
|
413 |
+
// Make sure it's not ajaxing.
|
414 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
415 |
+
// Get Response (AKA Page & Feed Information).
|
416 |
+
$_REQUEST['fts_dynamic_name'] = sanitize_key( $this->fts_rand_string( 10 ) . '_' . $fb_shortcode['type'] );
|
417 |
+
// Create Dynamic Class Name.
|
418 |
+
$fts_dynamic_class_name = $this->get_fts_dynamic_class_name();
|
419 |
+
// SOCIAL BUTTON.
|
420 |
+
if ( ! $fts_count_ids >= 1 ) {
|
421 |
+
$this->fb_social_btn_placement( $fb_shortcode, $access_token, 'fb-like-top-above-title' );
|
422 |
+
}
|
423 |
+
|
424 |
+
if ( 'reviews' !== $fb_shortcode['type'] ) {
|
425 |
+
$page_data->description = isset( $page_data->description ) ? $page_data->description : '';
|
426 |
+
$page_data->name = isset( $page_data->name ) ? $page_data->name : '';
|
427 |
+
}
|
428 |
+
// fts-fb-header-wrapper (for grid).
|
429 |
+
echo isset( $fb_shortcode['grid'] ) && 'yes' !== $fb_shortcode['grid'] && 'album_photos' !== $fb_shortcode['type'] && 'albums' !== $fb_shortcode['type'] ? '<div class="fts-fb-header-wrapper">' : '';
|
430 |
+
|
431 |
+
// Header.
|
432 |
+
echo '<div class="fts-jal-fb-header">';
|
433 |
+
|
434 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && isset( $fb_shortcode['overall_rating'] ) && 'yes' === $fb_shortcode['overall_rating'] ) {
|
435 |
+
|
436 |
+
// echo $this->get_facebook_overall_rating_response($fb_shortcode, $fb_cache_name, $access_token);.
|
437 |
+
$fb_reviews_overall_rating_of_5_stars_text = get_option( 'fb_reviews_overall_rating_of_5_stars_text' );
|
438 |
+
$fb_reviews_overall_rating_of_5_stars_text = ! empty( $fb_reviews_overall_rating_of_5_stars_text ) ? ' ' . $fb_reviews_overall_rating_of_5_stars_text : ' of 5 stars';
|
439 |
+
$fb_reviews_overall_rating_reviews_text = get_option( 'fb_reviews_overall_rating_reviews_text' );
|
440 |
+
$fb_reviews_overall_rating_reviews_text = ! empty( $fb_reviews_overall_rating_reviews_text ) ? ' ' . $fb_reviews_overall_rating_reviews_text : ' reviews';
|
441 |
+
$fb_reviews_overall_rating_background_border_hide = get_option( 'fb_reviews_overall_rating_background_border_hide' );
|
442 |
+
$fb_reviews_overall_rating_background_border_hide = ! empty( $fb_reviews_overall_rating_background_border_hide ) && 'yes' === $fb_reviews_overall_rating_background_border_hide ? ' fts-review-details-master-wrap-no-background-or-border' : '';
|
443 |
+
echo '<div class="fts-review-details-master-wrap' . esc_attr( $fb_reviews_overall_rating_background_border_hide ) . '" itemscope itemtype="http://schema.org/CreativeWork"><i class="fts-review-star">' . esc_html( $ratings_data->overall_star_rating ) . ' ★</i>';
|
444 |
+
echo '<div class="fts-review-details-wrap" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><div class="fts-review-details"><span itemprop="ratingValue">' . esc_html( $ratings_data->overall_star_rating ) . '</span>' . esc_html( $fb_reviews_overall_rating_of_5_stars_text ) . '</div>';
|
445 |
+
echo '<div class="fts-review-details-count"><span itemprop="reviewCount">' . esc_html( $ratings_data->rating_count ) . '</span>' . esc_html( $fb_reviews_overall_rating_reviews_text ) . '</div></div></div>';
|
446 |
+
|
447 |
+
}
|
448 |
+
if ( 'reviews' !== $fb_shortcode['type'] ) {
|
449 |
+
|
450 |
+
$fb_title_htag = get_option( 'fb_title_htag' ) ? get_option( 'fb_title_htag' ) : 'h1';
|
451 |
+
|
452 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) ) {
|
453 |
+
// echo our Facebook Page Title or About Text. Commented out the group description because in the future we will be adding the about description.
|
454 |
+
$fb_title_htag_size = get_option( 'fb_title_htag_size' ) ? 'font-size:' . get_option( 'fb_title_htag_size' ) . ';' : '';
|
455 |
+
$fts_align_title = isset( $fb_shortcode['title_align'] ) && '' !== $fb_shortcode['title_align'] ? 'style=text-align:' . $fb_shortcode['title_align'] . ';' . $fb_title_htag_size . '' : $fb_title_htag_size;
|
456 |
+
echo isset( $fb_shortcode['title'] ) && 'no' !== $fb_shortcode['title'] ? '<' . esc_html( $fb_title_htag ) . ' ' . esc_attr( $fts_align_title ) . '><a href="' . esc_url( $fts_view_fb_link ) . '" target="_blank" rel="noreferrer">' . esc_html( $page_data->name ) . '</a></' . esc_html( $fb_title_htag ) . '>' : '';
|
457 |
+
|
458 |
+
} else {
|
459 |
+
// echo our Facebook Page Title or About Text. Commented out the group description because in the future we will be adding the about description.
|
460 |
+
$fb_title_htag_size = get_option( 'fb_title_htag_size' ) ? 'style=font-size:' . get_option( 'fb_title_htag_size' ) . ';' : '';
|
461 |
+
echo '<' . esc_html( $fb_title_htag ) . ' ' . esc_attr( $fb_title_htag_size ) . '><a href="' . esc_url( $fts_view_fb_link ) . '" target="_blank" rel="noreferrer">' . esc_html( $page_data->name ) . '</a></' . esc_html( $fb_title_htag ) . '>';
|
462 |
+
}
|
463 |
+
// Description.
|
464 |
+
echo isset( $fb_shortcode['description'] ) && 'no' !== $fb_shortcode['description'] ? '<div class="fts-jal-fb-group-header-desc">' . wp_kses(
|
465 |
+
$this->fts_facebook_tag_filter( $page_data->description ),
|
466 |
+
array(
|
467 |
+
'a' => array(
|
468 |
+
'href' => array(),
|
469 |
+
'title' => array(),
|
470 |
+
),
|
471 |
+
'br' => array(),
|
472 |
+
'em' => array(),
|
473 |
+
'strong' => array(),
|
474 |
+
'small' => array(),
|
475 |
+
)
|
476 |
+
) . '</div>' : '';
|
477 |
+
}
|
478 |
+
// END Header.
|
479 |
+
echo '</div>';
|
480 |
+
// Close fts-fb-header-wrapper.
|
481 |
+
echo isset( $fb_shortcode['grid'] ) && 'yes' !== $fb_shortcode['grid'] && 'album_photos' !== $fb_shortcode['type'] && 'albums' !== $fb_shortcode['type'] ? '</div>' : '';
|
482 |
+
} //End check.
|
483 |
+
|
484 |
+
// SOCIAL BUTTON.
|
485 |
+
if ( ! $fts_count_ids >= 1 ) {
|
486 |
+
$this->fb_social_btn_placement( $fb_shortcode, $access_token, 'fb-like-top-below-title' );
|
487 |
+
}
|
488 |
+
|
489 |
+
// Feed Header.
|
490 |
+
// Make sure it's not ajaxing.
|
491 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
492 |
+
|
493 |
+
$fts_mashup_media_top = isset( $fb_shortcode['show_media'] ) && 'top' === $fb_shortcode['show_media'] ? 'fts-mashup-media-top ' : '';
|
494 |
+
$fts_mashup_show_name = isset( $fb_shortcode['show_name'] ) && 'no' === $fb_shortcode['show_name'] ? ' fts-mashup-hide-name ' : '';
|
495 |
+
$fts_mashup_show_date = isset( $fb_shortcode['show_date'] ) && 'no' === $fb_shortcode['show_date'] ? ' fts-mashup-hide-date ' : '';
|
496 |
+
$fts_mashup_show_thumbnail = isset( $fb_shortcode['show_thumbnail'] ) && 'no' === $fb_shortcode['show_thumbnail'] ? ' fts-mashup-hide-thumbnail ' : '';
|
497 |
+
|
498 |
+
if ( ! isset( $fb_type ) && 'albums' === $fb_shortcode['type'] || ! isset( $fb_type ) && 'album_photos' === $fb_shortcode['type'] || isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
499 |
+
|
500 |
+
if ( isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
501 |
+
echo '';
|
502 |
+
} elseif ( isset( $fb_shortcode['slider'] ) && 'yes' !== $fb_shortcode['slider'] && 'yes' === $fb_shortcode['image_stack_animation'] || isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] || isset( $fb_shortcode['image_stack_animation'] ) && 'yes' === $fb_shortcode['image_stack_animation'] ) {
|
503 |
+
wp_enqueue_script( 'fts-masonry-pkgd', plugins_url( 'feed-them-social/feeds/js/masonry.pkgd.min.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
|
504 |
+
echo '<script>';
|
505 |
+
echo 'jQuery(window).on(\'load\', function(){';
|
506 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").masonry({';
|
507 |
+
echo 'itemSelector: ".fts-jal-single-fb-post"';
|
508 |
+
echo '});';
|
509 |
+
echo '});';
|
510 |
+
echo '</script>';
|
511 |
+
}
|
512 |
+
|
513 |
+
if ( ! isset( $fb_type ) && 'albums' === $fb_shortcode['type'] || ! isset( $fb_type ) && 'album_photos' === $fb_shortcode['type'] && ! isset( $fb_type ) && ! isset( $fb_shortcode['slider'] ) || ! isset( $fb_type ) && 'album_photos' === $fb_shortcode['type'] && ! isset( $fb_type ) && isset( $fb_shortcode['slider'] ) && 'yes' !== $fb_shortcode['slider'] ) {
|
514 |
+
echo '<div class="fts-slicker-facebook-photos fts-slicker-facebook-albums' . ( isset( $fb_shortcode['video_album'] ) && $fb_shortcode['video_album'] && 'yes' === $fb_shortcode['video_album'] ? ' popup-video-gallery-fb' : '' ) . ( isset( $fb_shortcode['image_stack_animation'] ) && 'yes' === $fb_shortcode['image_stack_animation'] ? ' masonry js-masonry' : '' ) . ( isset( $fb_shortcode['images_align'] ) && $fb_shortcode['images_align'] ? ' popup-video-gallery-align-' . esc_attr( $fb_shortcode['images_align'] ) : '' ) . ' popup-gallery-fb ' . esc_attr( $fts_dynamic_class_name ) . '"';
|
515 |
+
if ( 'yes' === $fb_shortcode['image_stack_animation'] ) {
|
516 |
+
echo 'data-masonry-options=\'{ "isFitWidth": ' . ( 'no' === $fb_shortcode['center_container'] ? 'false' : 'true' ) . ' ' . ( 'no' === $fb_shortcode['image_stack_animation'] ? ', "transitionDuration": 0' : '' ) . '}\' style="margin:auto;"';
|
517 |
+
}
|
518 |
+
echo '>';
|
519 |
+
} elseif (
|
520 |
+
// slideshow scrollHorz or carousel.
|
521 |
+
! isset( $fb_type ) && isset( $fb_shortcode['slider'] ) && 'yes' === $fb_shortcode['slider'] ) {
|
522 |
+
$fts_cycle_type = isset( $fb_shortcode['scrollhorz_or_carousel'] ) ? $fb_shortcode['scrollhorz_or_carousel'] : 'scrollHorz';
|
523 |
+
|
524 |
+
if ( isset( $fts_cycle_type ) && 'carousel' === $fts_cycle_type ) {
|
525 |
+
$fts_cycle_slideshow = 'slideshow';
|
526 |
+
} else {
|
527 |
+
$fts_cycle_slideshow = 'cycle-slideshow';
|
528 |
+
}
|
529 |
+
echo '';
|
530 |
+
|
531 |
+
// none
|
532 |
+
// dots_above_feed
|
533 |
+
// dots_and_arrows_above_feed
|
534 |
+
// dots_and_numbers_above_feed
|
535 |
+
// dots_arrows_and_numbers_above_feed
|
536 |
+
// arrows_and_numbers_above_feed
|
537 |
+
// arrows_above_feed
|
538 |
+
// numbers_above_feed
|
539 |
+
// dots_below_feed
|
540 |
+
// dots_and_arrows_below_feed
|
541 |
+
// dots_and_numbers_below_feed
|
542 |
+
// dots_arrows_and_numbers_below_feed
|
543 |
+
// arrows_and_numbers_below_feed
|
544 |
+
// arrows_below_feed
|
545 |
+
// numbers_below_feed.
|
546 |
+
$fts_controls_bar_color = ! empty( $fb_shortcode['slider_controls_bar_color'] ) ? $fb_shortcode['slider_controls_bar_color'] : '#000';
|
547 |
+
$fts_controls_text_color = ! empty( $fb_shortcode['slider_controls_text_color'] ) ? $fb_shortcode['slider_controls_text_color'] : '#ddd';
|
548 |
+
if ( isset( $fb_shortcode['slider_controls_width'] ) && 'carousel' !== $fb_shortcode['scrollhorz_or_carousel'] ) {
|
549 |
+
$max_width_set = isset( $fb_shortcode['image_width'] ) && '' !== $fb_shortcode['image_width'] && 'carousel' !== $fb_shortcode['scrollhorz_or_carousel'] ? $fb_shortcode['image_width'] : '100%';
|
550 |
+
} else {
|
551 |
+
$max_width_set = isset( $fb_shortcode['slider_controls_width'] ) && '' !== $fb_shortcode['slider_controls_width'] && 'carousel' === $fb_shortcode['scrollhorz_or_carousel'] ? $fb_shortcode['slider_controls_width'] : '100%';
|
552 |
+
}
|
553 |
+
if (
|
554 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_above_feed' === $fb_shortcode['slider_controls'] ||
|
555 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
556 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
557 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
558 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
559 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
560 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_above_feed' === $fb_shortcode['slider_controls']
|
561 |
+
) {
|
562 |
+
|
563 |
+
// Slider Dots Wrapper.
|
564 |
+
if (
|
565 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_above_feed' === $fb_shortcode['slider_controls'] ||
|
566 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
567 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
568 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls']
|
569 |
+
) {
|
570 |
+
|
571 |
+
echo '<div class="fts-slider-icons-center fts-pager-option-dots-only-top" style="margin:auto; width:100%;max-width:' . esc_attr( $max_width_set . ';background:' . $fts_controls_bar_color . ';color:' . $fts_controls_text_color ) . '"><div class="fts-pager-option fts-custom-pager-' . esc_attr( $fts_dynamic_class_name ) . '"></div></div>';
|
572 |
+
}
|
573 |
+
|
574 |
+
// Slider Arrow and Numbers Wrapper.
|
575 |
+
if (
|
576 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
577 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
578 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
579 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
580 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
581 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_above_feed' === $fb_shortcode['slider_controls']
|
582 |
+
) {
|
583 |
+
echo '<div class="fts-slider-center" style="margin:auto; width:100%; max-width:' . esc_attr( $max_width_set . ';background:' . $fts_controls_bar_color . ';color:' . $fts_controls_text_color ) . '">';
|
584 |
+
}
|
585 |
+
|
586 |
+
// Previous Arrow.
|
587 |
+
if (
|
588 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
589 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
590 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
591 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_above_feed' === $fb_shortcode['slider_controls']
|
592 |
+
) {
|
593 |
+
echo '<span class="fts-prevControl-icon fts-prevControl-' . esc_attr( $fts_dynamic_class_name ) . '"></span>';
|
594 |
+
}
|
595 |
+
// Numbers.
|
596 |
+
if (
|
597 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
598 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
599 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
600 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_above_feed' === $fb_shortcode['slider_controls']
|
601 |
+
) {
|
602 |
+
echo '<span id="fts-custom-caption-' . esc_attr( $fts_dynamic_class_name ) . '" class="fts-custom-caption" ></span>';
|
603 |
+
}
|
604 |
+
// Next Arrow.
|
605 |
+
if (
|
606 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
607 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
608 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
609 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_above_feed' === $fb_shortcode['slider_controls']
|
610 |
+
) {
|
611 |
+
echo '<span class="fts-nextControl-icon fts-nextControl-' . esc_attr( $fts_dynamic_class_name ) . '"></span>';
|
612 |
+
}
|
613 |
+
|
614 |
+
// Slider Arrow and Numbers Wrapper.
|
615 |
+
if (
|
616 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
617 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
618 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
619 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_above_feed' === $fb_shortcode['slider_controls'] ||
|
620 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_above_feed' === $fb_shortcode['slider_controls'] ||
|
621 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_above_feed' === $fb_shortcode['slider_controls']
|
622 |
+
) {
|
623 |
+
echo '</div>';
|
624 |
+
}
|
625 |
+
}
|
626 |
+
|
627 |
+
echo '<div class="popup-gallery-fb fts-fb-slideshow fts-slicker-facebook-photos fts-slicker-facebook-albums ' . esc_attr( $fts_cycle_slideshow ) . ' ' . ( isset( $fb_shortcode['video_album'] ) && $fb_shortcode['video_album'] && 'yes' === $fb_shortcode['video_album'] ? 'popup-video-gallery-fb' : '' ) . ' ' . ( isset( $fb_shortcode['images_align'] ) && $fb_shortcode['images_align'] ? ' popup-video-gallery-align-' . esc_attr( $fb_shortcode['images_align'] ) : '' ) . ' popup-gallery-fb ' . esc_attr( $fts_dynamic_class_name ) . '"
|
628 |
|
629 |
style="margin:' . ( isset( $fb_shortcode['slider_margin'] ) && '' !== $fb_shortcode['slider_margin'] ? esc_attr( $fb_shortcode['slider_margin'] ) : 'auto' ) . ';' . ( isset( $fts_cycle_type ) && 'carousel' === $fts_cycle_type ? 'width:100%; max-width:100%; overflow:hidden;height:' . esc_attr( $fb_shortcode['image_height'] ) . ';' : 'overflow:hidden; height:' . esc_attr( $fb_shortcode['image_height'] ) . '; max-width:' . ( isset( $fb_shortcode['image_width'] ) && '' !== $fb_shortcode['image_width'] ? esc_attr( $fb_shortcode['image_width'] ) : 'auto' ) ) . ';" data-cycle-caption="#fts-custom-caption-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-caption-template="{{slideNum}} / {{slideCount}}" data-cycle-pager=".fts-custom-pager-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-pause-on-hover="true" data-cycle-prev=".fts-prevControl-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-next=".fts-nextControl-' . esc_attr( $fts_dynamic_class_name ) . '" data-cycle-timeout="' . ( ! empty( $fb_shortcode['slider_timeout'] ) ? esc_attr( $fb_shortcode['slider_timeout'] ) : '0' ) . '" data-cycle-manual-speed="' . ( ! empty( $fb_shortcode['slider_speed'] ) ? esc_attr( $fb_shortcode['slider_speed'] ) : '400' ) . '" data-cycle-auto-height="false" data-cycle-slides="> div" data-cycle-fx="' . ( ! empty( $fb_shortcode['scrollhorz_or_carousel'] ) ? esc_attr( $fb_shortcode['scrollhorz_or_carousel'] ) : '' ) . '" data-cycle-carousel-visible=' . ( ! empty( $fb_shortcode['slides_visible'] ) ? esc_attr( $fb_shortcode['slides_visible'] ) : '4' ) . ' data-cycle-swipe=true data-cycle-swipe-fx=' . ( ! empty( $fb_shortcode['scrollhorz_or_carousel'] ) ? esc_attr( $fb_shortcode['scrollhorz_or_carousel'] ) : '' ) . '>';
|
630 |
+
}
|
631 |
+
|
632 |
+
if ( isset( $fb_shortcode['grid'] ) && 'yes' === $fb_shortcode['grid'] ) {
|
633 |
+
echo '<div class="fts-slicker-facebook-posts masonry js-masonry ' . esc_attr( $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail ) . ( 'yes' === $fb_shortcode['popup'] ? 'popup-gallery-fb-posts ' : '' ) . ( 'reviews' === $fb_shortcode['type'] ? 'fts-reviews-feed ' : '' ) . esc_attr( $fts_dynamic_class_name ) . ' " style="margin:auto;" data-masonry-options=\'{ "isFitWidth": ' . ( 'no' === $fb_shortcode['center_container'] ? 'false' : 'true' ) . ' ' . ( 'no' === $fb_shortcode['image_stack_animation'] ? ', "transitionDuration": 0' : '' ) . '}\'>';
|
634 |
+
}
|
635 |
+
} else {
|
636 |
+
echo '<div class="fts-jal-fb-group-display fts-simple-fb-wrapper ' . esc_attr( $fts_mashup_media_top . $fts_mashup_show_name . $fts_mashup_show_date . $fts_mashup_show_thumbnail ) . ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ? ' popup-gallery-fb-posts ' : '' ) . ( 'reviews' === $fb_shortcode['type'] ? 'fts-reviews-feed ' : '' ) . esc_attr( $fts_dynamic_class_name ) . ' ' . ( 'auto' !== $fb_shortcode['height'] && ! empty( $fb_shortcode['height'] ) ? 'fts-fb-scrollable" style="height:' . esc_attr( $fb_shortcode['height'] ) . '"' : '"' ) . '>';
|
637 |
+
}
|
638 |
+
} //End ajaxing Check
|
639 |
+
|
640 |
+
// *********************
|
641 |
+
// Post Information
|
642 |
+
// *********************
|
643 |
+
$fb_load_more_text = get_option( 'fb_load_more_text' ) ? get_option( 'fb_load_more_text' ) : esc_html( 'Load More', 'feed-them-social' );
|
644 |
+
$response_post_array = $this->get_post_info( $feed_data, $fb_shortcode, $access_token, $language, $fb_cache_name );
|
645 |
+
|
646 |
+
// Single event info call.
|
647 |
+
if ( 'events' === $fb_shortcode['type'] ) {
|
648 |
+
$single_event_array_response = $this->get_event_post_info( $feed_data, $fb_shortcode, $access_token, $language );
|
649 |
+
}
|
650 |
+
|
651 |
+
$set_zero = 0;
|
652 |
+
|
653 |
+
// echo '<br/><br/>feed array<br/><br/>';.
|
654 |
+
// echo '<pre>';
|
655 |
+
// print_r($feed_data );
|
656 |
+
// echo '</pre>';.
|
657 |
+
// THE MAIN FEED
|
658 |
+
// LOOP to fix Post count!
|
659 |
+
foreach ( $feed_data->data as $k => $v ) {
|
660 |
+
if ( $k >= $fb_shortcode['posts'] ) {
|
661 |
+
unset( $feed_data->data[ $k ] );
|
662 |
+
}
|
663 |
+
}
|
664 |
+
|
665 |
+
// Nov. 4th. 2016 // Uncomment this to sort the dates proper if facebook is returning them out of order.
|
666 |
+
// We had one case of this here for a list of posts coming from an event.
|
667 |
+
// https://wordpress.org/support/topic/facebook-event-posts-not-ordered-by-date/
|
668 |
+
// usort($feed_data->data, array($this, "dateSort"));
|
669 |
+
// Loop for all facebook feeds.
|
670 |
+
foreach ( $feed_data->data as $post_data ) {
|
671 |
+
|
672 |
+
$fb_message = isset( $post_data->message ) ? $post_data->message : '';
|
673 |
+
$fb_status_type = isset( $post_data->status_type ) ? $post_data->status_type : '';
|
674 |
+
|
675 |
+
$fb_story = isset( $post_data->story ) ? $post_data->story : '';
|
676 |
+
|
677 |
+
if( 'albums' === $fb_shortcode['type'] ){
|
678 |
+
$fb_type = isset( $post_data->type ) ? $post_data->type : '';
|
679 |
+
}
|
680 |
+
else {
|
681 |
+
$fb_type = isset( $post_data->attachments->data[0]->type ) ? $post_data->attachments->data[0]->type : '';
|
682 |
+
}
|
683 |
+
|
684 |
+
// This is the method to skip empty posts or posts that are simply about changing settings or other non important post types.
|
685 |
+
if ( 'status' === $fb_type && empty( $fb_message ) && empty( $fb_story ) || 'event' === $fb_type || 'event' === $fb_type && false !== strpos( $fb_story, 'shared their event' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'changed the name of the event to' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'changed the privacy setting' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'an admin of the group' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'created the group' ) || 'status' === $fb_type && false !== strpos( $fb_story, 'added an event' ) || 'event' === $fb_type && false !== strpos( $fb_story, 'added an event' ) ) {
|
686 |
+
} else {
|
687 |
+
// define type note also affects load more fucntion call.
|
688 |
+
if ( ! $fb_type && 'album_photos' === $fb_shortcode['type'] ) {
|
689 |
+
$fb_type = 'photo';
|
690 |
+
}
|
691 |
+
if ( ! $fb_type && 'events' === $fb_shortcode['type'] ) {
|
692 |
+
$fb_type = 'events';
|
693 |
+
|
694 |
+
}
|
695 |
+
|
696 |
+
$post_types = new fts_facebook_feed_post_types();
|
697 |
+
$single_event_array_response = isset( $single_event_array_response ) ? $single_event_array_response : '';
|
698 |
+
|
699 |
+
// echo '<br/><br/>were function gets called <br/><br/>' .
|
700 |
+
// print_r( $post_data );.
|
701 |
+
$post_types->feed_post_types( $set_zero, $fb_type, $post_data, $fb_shortcode, $response_post_array, $single_event_array_response );
|
702 |
+
|
703 |
+
}
|
704 |
+
|
705 |
+
$set_zero++;
|
706 |
+
}// END POST foreach
|
707 |
+
|
708 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && 'reviews' !== $fb_shortcode['type'] || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && 'reviews' === $fb_shortcode['type'] ) {
|
709 |
+
if ( ! empty( $feed_data->data ) ) {
|
710 |
+
$this->fts_facebook_loadmore( $atts, $feed_data, $fb_type, $fb_shortcode, sanitize_key( $_REQUEST['fts_dynamic_name'] ) );
|
711 |
+
}
|
712 |
+
}
|
713 |
+
|
714 |
+
echo '</div>'; // closing main div for fb photos, groups etc
|
715 |
+
// only show this script if the height option is set to a number.
|
716 |
+
if ( 'auto' !== $fb_shortcode['height'] && ! empty( $fb_shortcode['height'] ) ) {
|
717 |
+
echo '<script>';
|
718 |
+
// this makes it so the page does not scroll if you reach the end of scroll bar or go back to top'.
|
719 |
+
echo 'jQuery.fn.isolatedScrollFacebookFTS = function() {';
|
720 |
+
echo 'this.bind("mousewheel DOMMouseScroll", function (e) {';
|
721 |
+
echo 'var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.detail,';
|
722 |
+
echo 'bottomOverflow = this.scrollTop + jQuery(this).outerHeight() - this.scrollHeight >= 0,';
|
723 |
+
echo 'topOverflow = this.scrollTop <= 0;';
|
724 |
+
echo 'if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) {';
|
725 |
+
echo 'e.preventDefault();';
|
726 |
+
echo '}';
|
727 |
+
echo '});';
|
728 |
+
echo 'return this;';
|
729 |
+
echo '};';
|
730 |
+
echo 'jQuery(".fts-fb-scrollable").isolatedScrollFacebookFTS();';
|
731 |
+
echo '</script>';
|
732 |
+
} //end $fb_shortcode['height'] !== 'auto' && empty($fb_shortcode['height']) == NULL
|
733 |
+
// Make sure it's not ajaxing.
|
734 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
735 |
+
echo '<div class="fts-clear"></div><div id="fb-root"></div>';
|
736 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && 'reviews' !== $fb_shortcode['type'] || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && 'reviews' === $fb_shortcode['type'] ) {
|
737 |
+
if ( 'button' === $fb_shortcode['loadmore'] ) {
|
738 |
+
|
739 |
+
echo '<div class="fts-fb-load-more-wrapper">';
|
740 |
+
echo '<div id="loadMore_' . esc_attr( $_REQUEST['fts_dynamic_name'] ) . '" style="';
|
741 |
+
if ( isset( $fb_shortcode['loadmore_btn_maxwidth'] ) && '' !== $fb_shortcode['loadmore_btn_maxwidth'] ) {
|
742 |
+
echo 'max-width:' . esc_attr( $fb_shortcode['loadmore_btn_maxwidth'] ) . ';';
|
743 |
+
}
|
744 |
+
$loadmore_btn_margin = isset( $fb_shortcode['loadmore_btn_margin'] ) ? $fb_shortcode['loadmore_btn_margin'] : '20px';
|
745 |
+
echo 'margin:' . esc_attr( $loadmore_btn_margin ) . ' auto ' . esc_attr( $loadmore_btn_margin ) . '" class="fts-fb-load-more">' . esc_html( $fb_load_more_text ) . '</div>';
|
746 |
+
echo '</div>';
|
747 |
+
}
|
748 |
+
}
|
749 |
+
}//End Check
|
750 |
+
|
751 |
+
// Checks for sliders.
|
752 |
+
if (
|
753 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_below_feed' === $fb_shortcode['slider_controls'] ||
|
754 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
755 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
756 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
757 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
758 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
759 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_below_feed' === $fb_shortcode['slider_controls']
|
760 |
+
) {
|
761 |
+
|
762 |
+
// Slider Dots Wrapper.
|
763 |
+
if (
|
764 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_below_feed' === $fb_shortcode['slider_controls'] ||
|
765 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
766 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
767 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls']
|
768 |
+
) {
|
769 |
+
if ( isset( $fb_shortcode['slider_controls_width'] ) && 'carousel' !== $fb_shortcode['scrollhorz_or_carousel'] ) {
|
770 |
+
$max_width_set = isset( $fb_shortcode['image_width'] ) && '' !== $fb_shortcode['image_width'] && 'carousel' !== $fb_shortcode['scrollhorz_or_carousel'] ? $fb_shortcode['image_width'] : '100%';
|
771 |
+
} else {
|
772 |
+
$max_width_set = isset( $fb_shortcode['slider_controls_width'] ) && '' !== $fb_shortcode['slider_controls_width'] && 'carousel' === $fb_shortcode['scrollhorz_or_carousel'] ? $fb_shortcode['slider_controls_width'] : '100%';
|
773 |
+
}
|
774 |
+
|
775 |
+
echo '<div class="fts-slider-icons-center" style="margin:auto; width:100%;max-width:' . esc_attr( $max_width_set ) . ';background:' . esc_attr( $fts_controls_bar_color ) . ';color:' . esc_attr( $fts_controls_text_color ) . '"><div class="fts-pager-option fts-custom-pager-' . esc_attr( $fts_dynamic_class_name ) . '"></div></div>';
|
776 |
+
}
|
777 |
+
|
778 |
+
// Slider Arrow and Numbers Wrapper.
|
779 |
+
if (
|
780 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
781 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
782 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
783 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
784 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
785 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_below_feed' === $fb_shortcode['slider_controls']
|
786 |
+
) {
|
787 |
+
echo '<div class="fts-slider-center" style="margin:auto; width:100%; max-width:' . esc_attr( $max_width_set ) . ';background:' . esc_attr( $fts_controls_bar_color ) . ';color:' . esc_attr( $fts_controls_text_color ) . '">';
|
788 |
+
}
|
789 |
+
|
790 |
+
// Previous Arrow.
|
791 |
+
if (
|
792 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
793 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
794 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
795 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_below_feed' === $fb_shortcode['slider_controls']
|
796 |
+
) {
|
797 |
+
echo '<span class="fts-prevControl-icon fts-prevControl-' . esc_attr( $fts_dynamic_class_name ) . '"></span>';
|
798 |
+
}
|
799 |
+
// Numbers.
|
800 |
+
if (
|
801 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
802 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
803 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
804 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_below_feed' === $fb_shortcode['slider_controls']
|
805 |
+
) {
|
806 |
+
echo '<span id="fts-custom-caption-' . esc_attr( $fts_dynamic_class_name ) . '" class="fts-custom-caption" ></span>';
|
807 |
+
}
|
808 |
+
// Next Arrow.
|
809 |
+
if (
|
810 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
811 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
812 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
813 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_below_feed' === $fb_shortcode['slider_controls']
|
814 |
+
) {
|
815 |
+
echo '<span class="fts-nextControl-icon fts-nextControl-' . esc_attr( $fts_dynamic_class_name ) . '"></span>';
|
816 |
+
}
|
817 |
+
|
818 |
+
// Slider Arrow and Numbers Wrapper.
|
819 |
+
if (
|
820 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
821 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
822 |
+
isset( $fb_shortcode['slider_controls'] ) && 'dots_arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
823 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_and_numbers_below_feed' === $fb_shortcode['slider_controls'] ||
|
824 |
+
isset( $fb_shortcode['slider_controls'] ) && 'arrows_below_feed' === $fb_shortcode['slider_controls'] ||
|
825 |
+
isset( $fb_shortcode['slider_controls'] ) && 'numbers_below_feed' === $fb_shortcode['slider_controls']
|
826 |
+
) {
|
827 |
+
echo '</div>';
|
828 |
+
}
|
829 |
+
}
|
830 |
+
|
831 |
+
unset( $_REQUEST['next_url'] );
|
832 |
+
|
833 |
+
// ******************
|
834 |
+
// SOCIAL BUTTON
|
835 |
+
// ******************
|
836 |
+
if ( ! $fts_count_ids >= 1 ) {
|
837 |
+
$this->fb_social_btn_placement( $fb_shortcode, $access_token, 'fb-like-below' );
|
838 |
+
}
|
839 |
+
|
840 |
+
return ob_get_clean();
|
841 |
+
}
|
842 |
+
|
843 |
+
/**
|
844 |
+
* Get FTS Dnamic Class Name
|
845 |
+
*
|
846 |
+
* @return string
|
847 |
+
* @since 1.9.6
|
848 |
+
*/
|
849 |
+
public function get_fts_dynamic_class_name() {
|
850 |
+
$fts_dynamic_class_name = '';
|
851 |
+
if ( isset( $_REQUEST['fts_dynamic_name'] ) ) {
|
852 |
+
$fts_dynamic_class_name = 'feed_dynamic_class' . sanitize_key( $_REQUEST['fts_dynamic_name'] );
|
853 |
+
}
|
854 |
+
return $fts_dynamic_class_name;
|
855 |
+
}
|
856 |
+
|
857 |
+
/**
|
858 |
+
* FTS Facebook Location
|
859 |
+
*
|
860 |
+
* Facebook Post Location.
|
861 |
+
*
|
862 |
+
* @param null $fb_type What kind of facebook feed it is.
|
863 |
+
* @param string $location The location of the photo or video.
|
864 |
+
* @since 1.9.6
|
865 |
+
*/
|
866 |
+
public function fts_facebook_location( $fb_type = null, $location ) {
|
867 |
+
switch ( $fb_type ) {
|
868 |
+
case 'app':
|
869 |
+
case 'cover':
|
870 |
+
case 'profile':
|
871 |
+
case 'mobile':
|
872 |
+
case 'wall':
|
873 |
+
case 'normal':
|
874 |
+
case 'album':
|
875 |
+
echo '<div class="fts-fb-location">' . esc_html( $location ) . '</div>';
|
876 |
+
}
|
877 |
+
}
|
878 |
+
|
879 |
+
/**
|
880 |
+
* FTS Facebook Post Photo
|
881 |
+
*
|
882 |
+
* @param string $fb_link The link to post.
|
883 |
+
* @param string $fb_shortcode The shortcode.
|
884 |
+
* @param string $photo_from Who it's from.
|
885 |
+
* @param string $photo_source The source url.
|
886 |
+
* @since 1.9.6
|
887 |
+
*/
|
888 |
+
public function fts_facebook_post_photo( $fb_link, $fb_shortcode, $photo_from, $photo_source ) {
|
889 |
+
if ( 'album_photos' === $fb_shortcode['type'] || 'albums' === $fb_shortcode['type'] ) {
|
890 |
+
echo '<a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-picture album-photo-fts" style="width:' . esc_attr( $fb_shortcode['image_width'] . ';height:' . $fb_shortcode['image_height'] ) . ';';
|
891 |
+
echo 'background-image:url(' . esc_url( $photo_source ) . ');">';
|
892 |
+
echo '</a>';
|
893 |
+
} else {
|
894 |
+
$fb_shortcode_popup = isset( $fb_shortcode['popup'] ) ? $fb_shortcode['popup'] : '';
|
895 |
+
if ( 'yes' === $fb_shortcode_popup && 'javascript:;' !== $fb_link ) {
|
896 |
+
echo '<a href="' . esc_url( $photo_source ) . '" target="_blank" rel="noreferrer" class="fts-facebook-link-target fts-jal-fb-picture fts-fb-large-photo"><img border="0" alt="' . esc_html( $photo_from ) . '" src="' . esc_url( $photo_source ) . '"/></a>';
|
897 |
+
|
898 |
+
} else {
|
899 |
+
echo '<a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-picture"><img border="0" alt="' . esc_html( $photo_from ) . '" src="' . esc_url( $photo_source ) . '"/></a>';
|
900 |
+
}
|
901 |
+
}
|
902 |
+
}
|
903 |
+
|
904 |
+
/**
|
905 |
+
* FTS Facebook Post Name
|
906 |
+
*
|
907 |
+
* @param string $fb_link The post link.
|
908 |
+
* @param string $fb_name The facebook name.
|
909 |
+
* @param string $fb_type The type of feed.
|
910 |
+
* @param null $fb_post_id The facebook post ID.
|
911 |
+
* @since 1.9.6
|
912 |
+
*/
|
913 |
+
public function fts_facebook_post_name( $fb_link, $fb_name, $fb_type, $fb_post_id = null ) {
|
914 |
+
|
915 |
+
switch ( $fb_type ) {
|
916 |
+
case 'video_direct_response' :
|
917 |
+
case 'video_inline' :
|
918 |
+
echo '<a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-name fb-id' . esc_attr( $fb_post_id ) . '">' . wp_kses(
|
919 |
+
$this->fts_facebook_tag_filter( $fb_name ),
|
920 |
+
array(
|
921 |
+
'a' => array(
|
922 |
+
'href' => array(),
|
923 |
+
'title' => array(),
|
924 |
+
),
|
925 |
+
'br' => array(),
|
926 |
+
'em' => array(),
|
927 |
+
'strong' => array(),
|
928 |
+
'small' => array(),
|
929 |
+
)
|
930 |
+
) . '</a>';
|
931 |
+
break;
|
932 |
+
default:
|
933 |
+
$fb_name = $this->fts_facebook_tag_filter( $fb_name );
|
934 |
+
echo '<a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-name">' . wp_kses(
|
935 |
+
$this->fts_facebook_tag_filter( $fb_name ),
|
936 |
+
array(
|
937 |
+
'a' => array(
|
938 |
+
'href' => array(),
|
939 |
+
'title' => array(),
|
940 |
+
),
|
941 |
+
'br' => array(),
|
942 |
+
'em' => array(),
|
943 |
+
'strong' => array(),
|
944 |
+
'small' => array(),
|
945 |
+
)
|
946 |
+
) . '</a>';
|
947 |
+
break;
|
948 |
+
}
|
949 |
+
}
|
950 |
+
|
951 |
+
/**
|
952 |
+
* FTS Facebook Post Description
|
953 |
+
*
|
954 |
+
* @param string $fb_description The post description.
|
955 |
+
* @param string $fb_shortcode The shortcode.
|
956 |
+
* @param string $fb_type The type of feed.
|
957 |
+
* @param null $fb_post_id The post ID.
|
958 |
+
* @param null $fb_by The post by.
|
959 |
+
* @since 1.9.6
|
960 |
+
*/
|
961 |
+
public function fts_facebook_post_desc( $fb_description, $fb_shortcode, $fb_type, $fb_post_id = null, $fb_by = null ) {
|
962 |
+
$trunacate_words = new \FeedThemSocialTruncateHTML();
|
963 |
+
|
964 |
+
$fb_description = $this->fts_facebook_tag_filter( $fb_description );
|
965 |
+
$more = isset( $more ) ? $more : '...';
|
966 |
+
|
967 |
+
switch ( $fb_type ) {
|
968 |
+
case 'video_direct_response' :
|
969 |
+
case 'video_inline' :
|
970 |
+
echo '<div class="fts-jal-fb-description fb-id' . esc_attr( $fb_post_id ) . '">' . wp_kses(
|
971 |
+
nl2br( $fb_description ),
|
972 |
+
array(
|
973 |
+
'a' => array(
|
974 |
+
'href' => array(),
|
975 |
+
'title' => array(),
|
976 |
+
),
|
977 |
+
'br' => array(),
|
978 |
+
'em' => array(),
|
979 |
+
'strong' => array(),
|
980 |
+
'small' => array(),
|
981 |
+
)
|
982 |
+
) . '</div>';
|
983 |
+
break;
|
984 |
+
case 'photo':
|
985 |
+
if ( 'album_photos' === $fb_shortcode['type'] ) {
|
986 |
+
if ( array_key_exists( 'words', $fb_shortcode ) ) {
|
987 |
+
$trimmed_content = $trunacate_words->fts_custom_trim_words( $fb_description, $fb_shortcode['words'], $more );
|
988 |
+
echo '<div class="fts-jal-fb-description fts-non-popup-text">' . wp_kses(
|
989 |
+
nl2br( $trimmed_content ),
|
990 |
+
array(
|
991 |
+
'a' => array(
|
992 |
+
'href' => array(),
|
993 |
+
'title' => array(),
|
994 |
+
),
|
995 |
+
'br' => array(),
|
996 |
+
'em' => array(),
|
997 |
+
'strong' => array(),
|
998 |
+
'small' => array(),
|
999 |
+
)
|
1000 |
+
) . '</div>';
|
1001 |
+
// Here we display the full description in the popup.
|
1002 |
+
if ( 'yes' === $fb_shortcode['popup'] || 'yes' === $fb_shortcode['video_album'] ) {
|
1003 |
+
echo '<div class="fts-jal-fb-description fts-jal-fb-description-popup" style="display: none;">' . wp_kses(
|
1004 |
+
nl2br( $fb_description ),
|
1005 |
+
array(
|
1006 |
+
'a' => array(
|
1007 |
+
'href' => array(),
|
1008 |
+
'title' => array(),
|
1009 |
+
),
|
1010 |
+
'br' => array(),
|
1011 |
+
'em' => array(),
|
1012 |
+
'strong' => array(),
|
1013 |
+
'small' => array(),
|
1014 |
+
)
|
1015 |
+
) . '</div>';
|
1016 |
+
}
|
1017 |
+
} elseif ( isset( $fb_shortcode['words'] ) && '0' !== $fb_shortcode['words'] ) {
|
1018 |
+
echo '<div class="fts-jal-fb-description">' . wp_kses(
|
1019 |
+
nl2br( $fb_description ),
|
1020 |
+
array(
|
1021 |
+
'a' => array(
|
1022 |
+
'href' => array(),
|
1023 |
+
'title' => array(),
|
1024 |
+
),
|
1025 |
+
'br' => array(),
|
1026 |
+
'em' => array(),
|
1027 |
+
'strong' => array(),
|
1028 |
+
'small' => array(),
|
1029 |
+
)
|
1030 |
+
) . '</div>';
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
break;
|
1034 |
+
case 'albums':
|
1035 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
1036 |
+
if ( array_key_exists( 'words', $fb_shortcode ) ) {
|
1037 |
+
$trimmed_content = $trunacate_words->fts_custom_trim_words( $fb_description, $fb_shortcode['words'], $more );
|
1038 |
+
echo '<div class="fts-jal-fb-description">' . wp_kses(
|
1039 |
+
nl2br( $trimmed_content ),
|
1040 |
+
array(
|
1041 |
+
'a' => array(
|
1042 |
+
'href' => array(),
|
1043 |
+
'title' => array(),
|
1044 |
+
),
|
1045 |
+
'br' => array(),
|
1046 |
+
'em' => array(),
|
1047 |
+
'strong' => array(),
|
1048 |
+
'small' => array(),
|
1049 |
+
)
|
1050 |
+
) . '</div>';
|
1051 |
+
} else {
|
1052 |
+
echo '<div class="fts-jal-fb-description">' . wp_kses(
|
1053 |
+
nl2br( $fb_description ),
|
1054 |
+
array(
|
1055 |
+
'a' => array(
|
1056 |
+
'href' => array(),
|
1057 |
+
'title' => array(),
|
1058 |
+
),
|
1059 |
+
'br' => array(),
|
1060 |
+
'em' => array(),
|
1061 |
+
'strong' => array(),
|
1062 |
+
'small' => array(),
|
1063 |
+
)
|
1064 |
+
) . '</div>';
|
1065 |
+
}
|
1066 |
+
} else {
|
1067 |
+
// Do for Default feeds or the video gallery feed.
|
1068 |
+
if ( isset( $fb_shortcode['words'] ) && '0' !== $fb_shortcode['words'] ) {
|
1069 |
+
if ( is_array( $fb_shortcode ) && array_key_exists( 'words', $fb_shortcode ) && '0' !== $fb_shortcode['words'] ) {
|
1070 |
+
$trimmed_content = $trunacate_words->fts_custom_trim_words( $fb_description, $fb_shortcode['words'], $more );
|
1071 |
+
echo '<div class="fts-jal-fb-description">' . wp_kses(
|
1072 |
+
$trimmed_content,
|
1073 |
+
array(
|
1074 |
+
'a' => array(
|
1075 |
+
'href' => array(),
|
1076 |
+
'title' => array(),
|
1077 |
+
'target' => array(),
|
1078 |
+
'rel' => array(),
|
1079 |
+
),
|
1080 |
+
'br' => array(),
|
1081 |
+
'em' => array(),
|
1082 |
+
'strong' => array(),
|
1083 |
+
'small' => array(),
|
1084 |
+
)
|
1085 |
+
) . '</div>';
|
1086 |
+
} else {
|
1087 |
+
echo '<div class="fts-jal-fb-description">';
|
1088 |
+
echo wp_kses(
|
1089 |
+
nl2br( $fb_description ),
|
1090 |
+
array(
|
1091 |
+
'a' => array(
|
1092 |
+
'href' => array(),
|
1093 |
+
'title' => array(),
|
1094 |
+
'target' => array(),
|
1095 |
+
'rel' => array(),
|
1096 |
+
),
|
1097 |
+
'br' => array(),
|
1098 |
+
'em' => array(),
|
1099 |
+
'strong' => array(),
|
1100 |
+
'small' => array(),
|
1101 |
+
)
|
1102 |
+
);
|
1103 |
+
echo '</div>';
|
1104 |
+
}
|
1105 |
+
if ( ! empty( $fb_link ) ) {
|
1106 |
+
echo '<div>By: <a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer">' . esc_html( $fb_by ) . '<a/></div>';
|
1107 |
+
}
|
1108 |
+
}
|
1109 |
+
}
|
1110 |
+
break;
|
1111 |
+
default:
|
1112 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
1113 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
|
1114 |
+
// here we trim the words for the links description text... for the premium version. The $fb_shortcode['words'] string actually comes from the javascript.
|
1115 |
+
if ( is_array( $fb_shortcode ) && array_key_exists( 'words', $fb_shortcode ) && ! empty( $fb_shortcode['words'] ) ) {
|
1116 |
+
|
1117 |
+
$trimmed_content = $trunacate_words->fts_custom_trim_words( $fb_description, $fb_shortcode['words'], $more );
|
1118 |
+
echo '<div class="jal-fb-description">' . wp_kses(
|
1119 |
+
nl2br( $trimmed_content ),
|
1120 |
+
array(
|
1121 |
+
'a' => array(
|
1122 |
+
'href' => array(),
|
1123 |
+
'title' => array(),
|
1124 |
+
'target' => array(),
|
1125 |
+
'rel' => array(),
|
1126 |
+
),
|
1127 |
+
'br' => array(),
|
1128 |
+
'em' => array(),
|
1129 |
+
'strong' => array(),
|
1130 |
+
'small' => array(),
|
1131 |
+
)
|
1132 |
+
) . '</div>';
|
1133 |
+
} elseif ( is_array( $fb_shortcode ) && array_key_exists( 'words', $fb_shortcode ) && '0' !== $fb_shortcode['words'] ) {
|
1134 |
+
echo '<div class="jal-fb-description">' . wp_kses(
|
1135 |
+
nl2br( $fb_description ),
|
1136 |
+
array(
|
1137 |
+
'a' => array(
|
1138 |
+
'href' => array(),
|
1139 |
+
'title' => array(),
|
1140 |
+
'target' => array(),
|
1141 |
+
'rel' => array(),
|
1142 |
+
),
|
1143 |
+
'br' => array(),
|
1144 |
+
'em' => array(),
|
1145 |
+
'strong' => array(),
|
1146 |
+
'small' => array(),
|
1147 |
+
)
|
1148 |
+
) . '</div>';
|
1149 |
+
}
|
1150 |
+
} else {
|
1151 |
+
// if the premium plugin is not active we will just show the regular full description.
|
1152 |
+
echo '<div class="jal-fb-description">' . wp_kses(
|
1153 |
+
nl2br( $fb_description ),
|
1154 |
+
array(
|
1155 |
+
'a' => array(
|
1156 |
+
'href' => array(),
|
1157 |
+
'title' => array(),
|
1158 |
+
'target' => array(),
|
1159 |
+
'rel' => array(),
|
1160 |
+
),
|
1161 |
+
'br' => array(),
|
1162 |
+
'em' => array(),
|
1163 |
+
'strong' => array(),
|
1164 |
+
'small' => array(),
|
1165 |
+
)
|
1166 |
+
) . '</div>';
|
1167 |
+
}
|
1168 |
+
}
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
/**
|
1172 |
+
* FTS Facebook Post Caption
|
1173 |
+
*
|
1174 |
+
* @param string $fb_caption The post caption.
|
1175 |
+
* @param string $fb_shortcode The shortcode.
|
1176 |
+
* @param string $fb_type The type of feed.
|
1177 |
+
* @param null $fb_post_id The post ID.
|
1178 |
+
* @since 1.9.6
|
1179 |
+
*/
|
1180 |
+
public function fts_facebook_post_cap( $fb_caption, $fb_shortcode, $fb_type, $fb_post_id = null ) {
|
1181 |
+
$trunacate_words = new \FeedThemSocialTruncateHTML();
|
1182 |
+
|
1183 |
+
switch ( $fb_type ) {
|
1184 |
+
case 'video_direct_response' :
|
1185 |
+
case 'video_inline' :
|
1186 |
+
$fb_caption = $this->fts_facebook_tag_filter( str_replace( 'www.', '', $fb_caption ) );
|
1187 |
+
echo '<div class="fts-jal-fb-caption fb-id' . esc_attr( $fb_post_id ) . '">' . wp_kses(
|
1188 |
+
$fb_caption,
|
1189 |
+
array(
|
1190 |
+
'a' => array(
|
1191 |
+
'href' => array(),
|
1192 |
+
'title' => array(),
|
1193 |
+
),
|
1194 |
+
'br' => array(),
|
1195 |
+
'em' => array(),
|
1196 |
+
'strong' => array(),
|
1197 |
+
'small' => array(),
|
1198 |
+
)
|
1199 |
+
) . '</div>';
|
1200 |
+
break;
|
1201 |
+
default:
|
1202 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
1203 |
+
if ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) || is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
|
1204 |
+
// here we trim the words for the links description text... for the premium version. The $fb_shortcode['words'] string actually comes from the javascript.
|
1205 |
+
if ( array_key_exists( 'words', $fb_shortcode ) ) {
|
1206 |
+
$more = isset( $more ) ? $more : '';
|
1207 |
+
$trimmed_content = $trunacate_words->fts_custom_trim_words( $fb_caption, $fb_shortcode['words'], $more );
|
1208 |
+
echo '<div class="jal-fb-caption">' . wp_kses(
|
1209 |
+
$trimmed_content,
|
1210 |
+
array(
|
1211 |
+
'a' => array(
|
1212 |
+
'href' => array(),
|
1213 |
+
'title' => array(),
|
1214 |
+
),
|
1215 |
+
'br' => array(),
|
1216 |
+
'em' => array(),
|
1217 |
+
'strong' => array(),
|
1218 |
+
'small' => array(),
|
1219 |
+
)
|
1220 |
+
) . '</div>';
|
1221 |
+
} else {
|
1222 |
+
$fb_caption = $this->fts_facebook_tag_filter( $fb_caption );
|
1223 |
+
echo '<div class="jal-fb-caption">' . wp_kses(
|
1224 |
+
nl2br( $fb_caption ),
|
1225 |
+
array(
|
1226 |
+
'a' => array(
|
1227 |
+
'href' => array(),
|
1228 |
+
'title' => array(),
|
1229 |
+
),
|
1230 |
+
'br' => array(),
|
1231 |
+
'em' => array(),
|
1232 |
+
'strong' => array(),
|
1233 |
+
'small' => array(),
|
1234 |
+
)
|
1235 |
+
) . '</div>';
|
1236 |
+
}
|
1237 |
+
} else {
|
1238 |
+
// if the premium plugin is not active we will just show the regular full description.
|
1239 |
+
$fb_caption = $this->fts_facebook_tag_filter( $fb_caption );
|
1240 |
+
echo '<div class="jal-fb-caption">' . wp_kses(
|
1241 |
+
nl2br( $fb_caption ),
|
1242 |
+
array(
|
1243 |
+
'a' => array(
|
1244 |
+
'href' => array(),
|
1245 |
+
'title' => array(),
|
1246 |
+
),
|
1247 |
+
'br' => array(),
|
1248 |
+
'em' => array(),
|
1249 |
+
'strong' => array(),
|
1250 |
+
'small' => array(),
|
1251 |
+
)
|
1252 |
+
) . '</div>';
|
1253 |
+
}
|
1254 |
+
}
|
1255 |
+
}
|
1256 |
+
|
1257 |
+
/**
|
1258 |
+
* Get Likes Shares Comments
|
1259 |
+
*
|
1260 |
+
* Get the total count for all.
|
1261 |
+
*
|
1262 |
+
* @param string $response_post_array The array from facebook.
|
1263 |
+
* @param string $post_data_key The post data Key.
|
1264 |
+
* @param string $fb_post_share_count The post Share Count.
|
1265 |
+
* @return array
|
1266 |
+
* @since 1.9.6
|
1267 |
+
*/
|
1268 |
+
public function get_likes_shares_comments( $response_post_array, $post_data_key, $fb_post_share_count ) {
|
1269 |
+
$lsc_array = array();
|
1270 |
+
// Get Likes & Comments.
|
1271 |
+
if ( $response_post_array ) {
|
1272 |
+
if ( isset( $response_post_array[ $post_data_key . '_likes' ] ) ) {
|
1273 |
+
$like_count_data = json_decode( $response_post_array[ $post_data_key . '_likes' ] );
|
1274 |
+
|
1275 |
+
// Like Count.
|
1276 |
+
if ( ! empty( $like_count_data->summary->total_count ) ) {
|
1277 |
+
$fb_post_like_count = $like_count_data->summary->total_count;
|
1278 |
+
} else {
|
1279 |
+
$fb_post_like_count = 0;
|
1280 |
+
}
|
1281 |
+
if ( 0 === $fb_post_like_count ) {
|
1282 |
+
$lsc_array['likes'] = '';
|
1283 |
+
}
|
1284 |
+
if ( 1 === $fb_post_like_count ) {
|
1285 |
+
$lsc_array['likes'] = "<i class='icon-thumbs-up'></i> 1";
|
1286 |
+
}
|
1287 |
+
if ( $fb_post_like_count > '1' ) {
|
1288 |
+
$lsc_array['likes'] = "<i class='icon-thumbs-up'></i> " . esc_html( $fb_post_like_count );
|
1289 |
+
}
|
1290 |
+
}
|
1291 |
+
if ( isset( $response_post_array[ $post_data_key . '_comments' ] ) ) {
|
1292 |
+
$comment_count_data = json_decode( $response_post_array[ $post_data_key . '_comments' ] );
|
1293 |
+
|
1294 |
+
if ( ! empty( $comment_count_data->summary->total_count ) ) {
|
1295 |
+
$fb_post_comments_count = $comment_count_data->summary->total_count;
|
1296 |
+
} else {
|
1297 |
+
$fb_post_comments_count = 0;
|
1298 |
+
}
|
1299 |
+
if ( 0 === $fb_post_comments_count ) {
|
1300 |
+
$lsc_array['comments'] = '';
|
1301 |
+
}
|
1302 |
+
if ( 1 === $fb_post_comments_count ) {
|
1303 |
+
$lsc_array['comments'] = "<i class='icon-comments'></i> 1";
|
1304 |
+
$lsc_array['comments_thread'] = $comment_count_data;
|
1305 |
+
|
1306 |
+
}
|
1307 |
+
if ( $fb_post_comments_count > '1' ) {
|
1308 |
+
$lsc_array['comments'] = "<i class='icon-comments'></i> " . $fb_post_comments_count;
|
1309 |
+
$lsc_array['comments_thread'] = $comment_count_data;
|
1310 |
+
}
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
// Shares Count.
|
1314 |
+
if ( 0 === $fb_post_share_count || ! $fb_post_share_count ) {
|
1315 |
+
$lsc_array['shares'] = '';
|
1316 |
+
}
|
1317 |
+
if ( 1 === $fb_post_share_count ) {
|
1318 |
+
$lsc_array['shares'] = "<i class='icon-file'></i> 1";
|
1319 |
+
}
|
1320 |
+
if ( $fb_post_share_count > '1' ) {
|
1321 |
+
$lsc_array['shares'] = "<i class='icon-file'></i> " . $fb_post_share_count;
|
1322 |
+
}
|
1323 |
+
return $lsc_array;
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* FTS Facebook Post See More
|
1329 |
+
*
|
1330 |
+
* Generate See More Button.
|
1331 |
+
*
|
1332 |
+
* @param string $fb_link The facebook link.
|
1333 |
+
* @param string $lcs_array The lcs array.
|
1334 |
+
* @param string $fb_type The type of feed.
|
1335 |
+
* @param null $fb_post_id The post id.
|
1336 |
+
* @param string $fb_shortcode The shortcode.
|
1337 |
+
* @param null $fb_post_user_id The user id.
|
1338 |
+
* @param null $fb_post_single_id The single post id.
|
1339 |
+
* @param null $single_event_id The event id.
|
1340 |
+
* @param string $post_data The post data.
|
1341 |
+
* @since 1.9.6
|
1342 |
+
*/
|
1343 |
+
public function fts_facebook_post_see_more( $fb_link, $lcs_array, $fb_type, $fb_post_id = null, $fb_shortcode, $fb_post_user_id = null, $fb_post_single_id = null, $single_event_id = null, $post_data ) {
|
1344 |
+
|
1345 |
+
$description = isset( $post_data->message ) ? $post_data->message : '';
|
1346 |
+
// SHOW THE FB FEED PRINT_R
|
1347 |
+
// echo'<pre>';.
|
1348 |
+
// print_r();.
|
1349 |
+
// echo'</pre>';.
|
1350 |
+
$view_on_facebook = get_option( 'fb_view_on_fb_fts' ) ? get_option( 'fb_view_on_fb_fts' ) : __( 'View on Facebook', 'feed-them-social' );
|
1351 |
+
$share_this = new feed_them_social_functions();
|
1352 |
+
switch ( $fb_type ) {
|
1353 |
+
case 'events':
|
1354 |
+
$single_event_id = 'https://www.facebook.com/events/' . $single_event_id;
|
1355 |
+
echo '<div class="fts-likes-shares-etc-wrap">';
|
1356 |
+
echo $share_this->fts_share_option( $single_event_id, $description );
|
1357 |
+
echo '<a href="' . esc_attr( $single_event_id ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">' . esc_html( $view_on_facebook ) . '</a></div>';
|
1358 |
+
break;
|
1359 |
+
case 'photo':
|
1360 |
+
if ( ! empty( $fb_link ) ) {
|
1361 |
+
echo '<div class="fts-likes-shares-etc-wrap">';
|
1362 |
+
echo $share_this->fts_share_option( $fb_link, $description );
|
1363 |
+
echo '<a href="' . esc_url( $fb_link ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">';
|
1364 |
+
} else {
|
1365 |
+
// exception for videos.
|
1366 |
+
$single_video_id = 'https://www.facebook.com/' . $fb_post_id;
|
1367 |
+
echo '<div class="fts-likes-shares-etc-wrap">';
|
1368 |
+
echo $share_this->fts_share_option( $single_video_id, $description );
|
1369 |
+
echo '<a href="' . esc_url( $single_video_id ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">';
|
1370 |
+
}
|
1371 |
+
if ( 'album_photos' === $fb_shortcode['type'] && 'yes' === $fb_shortcode['hide_date_likes_comments'] ) {
|
1372 |
+
|
1373 |
+
echo '<div class="hide-date-likes-comments-etc">' . wp_kses(
|
1374 |
+
$lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . $lcs_array['shares'],
|
1375 |
+
array(
|
1376 |
+
'a' => array(
|
1377 |
+
'href' => array(),
|
1378 |
+
'title' => array(),
|
1379 |
+
),
|
1380 |
+
'i' => array(
|
1381 |
+
'class' => array(),
|
1382 |
+
),
|
1383 |
+
)
|
1384 |
+
) . ' </div>';
|
1385 |
+
} else {
|
1386 |
+
|
1387 |
+
echo '' . wp_kses(
|
1388 |
+
$lcs_array['likes'] . ' ' . $lcs_array['comments'] . ' ' . $lcs_array['shares'],
|
1389 |
+
array(
|
1390 |
+
'a' => array(
|
1391 |
+
'href' => array(),
|
1392 |
+
'title' => array(),
|
1393 |
+
),
|
1394 |
+
'i' => array(
|
1395 |
+
'class' => array(),
|
1396 |
+
),
|
1397 |
+
)
|
1398 |
+
) . ' ';
|
1399 |
+
}
|
1400 |
+
echo ' ' . esc_html( $view_on_facebook ) . '</a></div>';
|
1401 |
+
break;
|
1402 |
+
case 'app':
|
1403 |
+
case 'cover':
|
1404 |
+
case 'profile':
|
1405 |
+
case 'mobile':
|
1406 |
+
case 'wall':
|
1407 |
+
case 'normal':
|
1408 |
+
case 'albums':
|
1409 |
+
$url_parsed = parse_url( $fb_link, PHP_URL_QUERY );
|
1410 |
+
$params = parse_str( $url_parsed, $params );
|
1411 |
+
$new_album_url = str_replace( 'album.php?fbid=' . $params['fbid'] . '&id=' . $params['id'] . '&aid=' . $params['aid'], 'media/set/?set=a.' . $params['fbid'] . '.' . $params['aid'] . '.' . $params['id'], $fb_link );
|
1412 |
+
|
1413 |
+
echo '<div class="fts-likes-shares-etc-wrap">';
|
1414 |
+
echo $share_this->fts_share_option( $new_album_url, $description );
|
1415 |
+
echo '<a href="' . esc_url( $new_album_url ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">';
|
1416 |
+
if ( 'albums' === $fb_shortcode['type'] && 'yes' === $fb_shortcode['hide_date_likes_comments'] ) {
|
1417 |
+
} else {
|
1418 |
+
|
1419 |
+
echo '' . wp_kses(
|
1420 |
+
$lcs_array['likes'] . ' ' . $lcs_array['comments'],
|
1421 |
+
array(
|
1422 |
+
'a' => array(
|
1423 |
+
'href' => array(),
|
1424 |
+
'title' => array(),
|
1425 |
+
),
|
1426 |
+
'i' => array(
|
1427 |
+
'class' => array(),
|
1428 |
+
),
|
1429 |
+
)
|
1430 |
+
) . ' ';
|
1431 |
+
}
|
1432 |
+
echo ' ' . esc_html( $view_on_facebook ) . '</a></div>';
|
1433 |
+
break;
|
1434 |
+
default:
|
1435 |
+
if ( 'yes' !== get_option( 'fb_reviews_remove_see_reviews_link' ) ) {
|
1436 |
+
if ( 'reviews' === $fb_shortcode['type'] && is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
|
1437 |
+
$fb_reviews_see_more_reviews_language = get_option( 'fb_reviews_see_more_reviews_language' ) ? get_option( 'fb_reviews_see_more_reviews_language' ) : 'See More Reviews';
|
1438 |
+
|
1439 |
+
$hide_see_more = isset( $fb_shortcode['hide_see_more_reviews_link'] ) ? $fb_shortcode['hide_see_more_reviews_link'] : 'yes';
|
1440 |
+
if ( 'yes' !== $hide_see_more ) {
|
1441 |
+
echo ' <a href="' . esc_url( 'https://www.facebook.com/' . $fb_shortcode['id'] . '/reviews' ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">' . esc_html( $fb_reviews_see_more_reviews_language, 'feed-them-social' ) . '</a>';
|
1442 |
+
}
|
1443 |
+
} else {
|
1444 |
+
$post_single_id = 'https://www.facebook.com/' . $fb_post_user_id . '/posts/' . $fb_post_single_id;
|
1445 |
+
echo '<div class="fts-likes-shares-etc-wrap">';
|
1446 |
+
echo $share_this->fts_share_option( $post_single_id, $description );
|
1447 |
+
echo '<a href="' . esc_url( $post_single_id ) . '" target="_blank" rel="noreferrer" class="fts-jal-fb-see-more">';
|
1448 |
+
|
1449 |
+
echo '' . wp_kses(
|
1450 |
+
$lcs_array['likes'] . ' ' . $lcs_array['comments'],
|
1451 |
+
array(
|
1452 |
+
'a' => array(
|
1453 |
+
'href' => array(),
|
1454 |
+
'title' => array(),
|
1455 |
+
),
|
1456 |
+
'i' => array(
|
1457 |
+
'class' => array(),
|
1458 |
+
),
|
1459 |
+
)
|
1460 |
+
) . ' ' . esc_html( $view_on_facebook ) . '</a></div>';
|
1461 |
+
}
|
1462 |
+
}
|
1463 |
+
break;
|
1464 |
+
}
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
/**
|
1468 |
+
* Get Access Token
|
1469 |
+
*
|
1470 |
+
* @return mixed
|
1471 |
+
* @since 1.9.6
|
1472 |
+
*/
|
1473 |
+
public function get_access_token() {
|
1474 |
+
// The API Access Token.
|
1475 |
+
// $custom_access_token = get_option('fts_facebook_custom_api_token');
|
1476 |
+
// if (!empty($custom_access_token)) {
|
1477 |
+
// return $access_token;
|
1478 |
+
// } else {
|
1479 |
+
// Randomizer
|
1480 |
+
// $values = array(
|
1481 |
+
// '431287540548931|4A23YYIFqhd-gpz_E4Fy6U_Seo0',
|
1482 |
+
// '1748446362151826|epVUmLiKT8QhLN63iRvvXXHwxqk',
|
1483 |
+
// '1875381106044241|KmWz3mtzGye0M5HTdX0SK7rqpIU',
|
1484 |
+
// '754106341419549|AMruxCJ_ly8825VXeLhBKo_kOfs',
|
1485 |
+
// '438563519819257|1GJ8GLl1AQ7ZTvXV_Xpok_QpH6s',
|
1486 |
+
// '753693994788276|xm_PXoNRWW8WPQdcQArRpBgWn5Q',
|
1487 |
+
// '644818402385988|sABEvG0QiOaJRlNLC2NphfQLlfg',
|
1488 |
+
// '292500071162951|9MA-kzWVs6HTEybpdxKjgF_gqeo',
|
1489 |
+
// '263710677420086|Jpui2CFig7RbtdHaHPN_fiEa77U',
|
1490 |
+
// '1850081601881384|u2JcPCn7TH40MY5BwC-i4PMHGm8',
|
1491 |
+
// );
|
1492 |
+
// $access_token = $values[array_rand($values, 1)];.
|
1493 |
+
return get_option( 'fts_facebook_custom_api_token' );
|
1494 |
+
// }
|
1495 |
+
}
|
1496 |
+
|
1497 |
+
/**
|
1498 |
+
* Get View Link
|
1499 |
+
*
|
1500 |
+
* @param string $fb_shortcode The facebook feed shortcode.
|
1501 |
+
* @return string
|
1502 |
+
* @since 1.9.6
|
1503 |
+
*/
|
1504 |
+
public function get_view_link( $fb_shortcode ) {
|
1505 |
+
switch ( $fb_shortcode['type'] ) {
|
1506 |
+
case 'group':
|
1507 |
+
$fts_view_fb_link = 'https://www.facebook.com/groups/' . $fb_shortcode['id'] . '/';
|
1508 |
+
break;
|
1509 |
+
case 'page':
|
1510 |
+
$fts_view_fb_link = 'https://www.facebook.com/' . $fb_shortcode['id'] . '/';
|
1511 |
+
break;
|
1512 |
+
case 'event':
|
1513 |
+
$fts_view_fb_link = 'https://www.facebook.com/events/' . $fb_shortcode['id'] . '/';
|
1514 |
+
break;
|
1515 |
+
case 'events':
|
1516 |
+
$fts_view_fb_link = 'https://www.facebook.com/' . $fb_shortcode['id'] . '/events/';
|
1517 |
+
break;
|
1518 |
+
case 'albums':
|
1519 |
+
$fts_view_fb_link = 'https://www.facebook.com/' . $fb_shortcode['id'] . '/photos_stream?tab=photos_albums';
|
1520 |
+
break;
|
1521 |
+
// album photos and videos album.
|
1522 |
+
case 'album_photos':
|
1523 |
+
$fts_view_fb_link = isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ? 'https://www.facebook.com/' . $fb_shortcode['id'] . '/videos/' : 'https://www.facebook.com/' . $fb_shortcode['id'] . '/photos_stream/';
|
1524 |
+
break;
|
1525 |
+
case 'hashtag':
|
1526 |
+
$fts_view_fb_link = 'https://www.facebook.com/hashtag/' . $fb_shortcode['id'] . '/';
|
1527 |
+
break;
|
1528 |
+
case 'reviews':
|
1529 |
+
$fts_view_fb_link = 'https://www.facebook.com/' . $fb_shortcode['id'] . '/reviews/';
|
1530 |
+
break;
|
1531 |
+
}
|
1532 |
+
$fts_view_fb_link = isset( $fts_view_fb_link ) ? $fts_view_fb_link : '';
|
1533 |
+
return $fts_view_fb_link;
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
/**
|
1537 |
+
* Get FB Cache Name
|
1538 |
+
*
|
1539 |
+
* @param string $fb_shortcode The facebook feed shortcode.
|
1540 |
+
* @return string
|
1541 |
+
* @since 1.9.6
|
1542 |
+
*/
|
1543 |
+
public function get_fb_cache_name( $fb_shortcode ) {
|
1544 |
+
// URL to get page info.
|
1545 |
+
$r_count = substr_count( $fb_shortcode['id'], ',' );
|
1546 |
+
|
1547 |
+
if ( $r_count >= 1 ) {
|
1548 |
+
$result = preg_replace( '/[ ,]+/', '-', trim( $fb_shortcode['id'] ) );
|
1549 |
+
$fb_shortcode['id'] = $result;
|
1550 |
+
}
|
1551 |
+
|
1552 |
+
switch ( $fb_shortcode['type'] ) {
|
1553 |
+
case 'album_photos':
|
1554 |
+
$fb_data_cache_name = 'fb_' . $fb_shortcode['type'] . '_' . $fb_shortcode['id'] . '_' . $fb_shortcode['album_id'] . '_num' . $fb_shortcode['posts'] . '';
|
1555 |
+
break;
|
1556 |
+
default:
|
1557 |
+
$fb_data_cache_name = 'fb_' . $fb_shortcode['type'] . '_' . $fb_shortcode['id'] . '_num' . $fb_shortcode['posts'] . '';
|
1558 |
+
break;
|
1559 |
+
}
|
1560 |
+
return $fb_data_cache_name;
|
1561 |
+
}
|
1562 |
+
|
1563 |
+
/**
|
1564 |
+
* Get Language
|
1565 |
+
*
|
1566 |
+
* @return string
|
1567 |
+
* @since 1.9.6
|
1568 |
+
*/
|
1569 |
+
public function get_language() {
|
1570 |
+
// this check is in place because we used this option and it failed for many people because we use wp get contents instead of curl.
|
1571 |
+
// this can be removed in a future update and just keep the $language_option = get_option('fb_language', 'en_US');.
|
1572 |
+
$language_option_check = get_option( 'fb_language' );
|
1573 |
+
if ( isset( $language_option_check ) && 'Please Select Option' !== $language_option_check ) {
|
1574 |
+
$language_option = get_option( 'fb_language', 'en_US' );
|
1575 |
+
} else {
|
1576 |
+
$language_option = 'en_US';
|
1577 |
+
}
|
1578 |
+
return ! empty( $language_option ) ? '&locale=' . $language_option : '';
|
1579 |
+
}
|
1580 |
+
|
1581 |
+
/**
|
1582 |
+
* Get Facebook Overall Rating Response
|
1583 |
+
*
|
1584 |
+
* @param string $fb_shortcode The facebook feed shortcode.
|
1585 |
+
* @param string $fb_cache_name The Cache Name.
|
1586 |
+
* @param string $access_token The Access Token.
|
1587 |
+
* @since 2.1.3
|
1588 |
+
*/
|
1589 |
+
public function get_facebook_overall_rating_response( $fb_shortcode, $fb_cache_name, $access_token ) {
|
1590 |
+
|
1591 |
+
// $mulit_data_rating = $this->fts_get_feed_json($mulit_data_rating);.
|
1592 |
+
// Error Check
|
1593 |
+
// $feed_data_rating_overall = json_decode($mulit_data['rating_data']);.
|
1594 |
+
$fb_reviews_overall_rating_of_5_stars_text = get_option( 'fb_reviews_overall_rating_of_5_stars_text' );
|
1595 |
+
$fb_reviews_overall_rating_of_5_stars_text = ! empty( $fb_reviews_overall_rating_of_5_stars_text ) ? ' ' . $fb_reviews_overall_rating_of_5_stars_text : ' of 5 stars';
|
1596 |
+
$fb_reviews_overall_rating_reviews_text = get_option( 'fb_reviews_overall_rating_reviews_text' );
|
1597 |
+
$fb_reviews_overall_rating_reviews_text = ! empty( $fb_reviews_overall_rating_reviews_text ) ? ' ' . $fb_reviews_overall_rating_reviews_text : ' reviews';
|
1598 |
+
$fb_reviews_overall_rating_background_border_hide = get_option( 'fb_reviews_overall_rating_background_border_hide' );
|
1599 |
+
$fb_reviews_overall_rating_background_border_hide = ! empty( $fb_reviews_overall_rating_background_border_hide ) && 'yes' === $fb_reviews_overall_rating_background_border_hide ? ' fts-review-details-master-wrap-no-background-or-border' : '';
|
1600 |
+
|
1601 |
+
echo '<div class="fts-review-details-master-wrap' . esc_attr( $fb_reviews_overall_rating_background_border_hide ) . '"><i class="fts-review-star">' . esc_html( $feed_data_rating_overall->overall_star_rating ) . ' ★</i>';
|
1602 |
+
echo '<div class="fts-review-details-wrap" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><div class="fts-review-details"><span itemprop="ratingValue">' . esc_html( $feed_data_rating_overall->overall_star_rating ) . '</span>' . esc_html( $fb_reviews_overall_rating_of_5_stars_text ) . '</div>';
|
1603 |
+
echo '<div class="fts-review-details-count"><span itemprop="reviewCount">' . esc_html( $feed_data_rating_overall->rating_count ) . '</span>' . esc_html( $fb_reviews_overall_rating_reviews_text ) . '</div></div></div>';
|
1604 |
+
|
1605 |
+
// $fb_cache_name = $fb_shortcode['id'] . $this->rand_string(10);
|
1606 |
+
// Make sure it's not ajaxing
|
1607 |
+
// if (!isset($_GET['load_more_ajaxing'])) {
|
1608 |
+
// Create Cache
|
1609 |
+
// $FTS_FB_OUTPUT = $this->fts_create_feed_cache($fb_cache_name, $feed_data_rating_overall);
|
1610 |
+
// }.
|
1611 |
+
}
|
1612 |
+
|
1613 |
+
|
1614 |
+
/**
|
1615 |
+
* Get Facebook Feed Response
|
1616 |
+
*
|
1617 |
+
* @param string $fb_shortcode The facebook shortcode.
|
1618 |
+
* @param string $fb_cache_name FB cache name.
|
1619 |
+
* @param string $access_token The Access Token.
|
1620 |
+
* @param string $language Language.
|
1621 |
+
* @return array|mixed
|
1622 |
+
* @throws \Exception
|
1623 |
+
* @since 1.9.6
|
1624 |
+
*/
|
1625 |
+
public function get_facebook_feed_response( $fb_shortcode, $fb_cache_name, $access_token, $language ) {
|
1626 |
+
|
1627 |
+
if ( is_plugin_active( 'feed-them-social-combined-streams/feed-them-social-combined-streams.php' ) ) {
|
1628 |
+
$fts_count_ids = substr_count( $fb_shortcode['id'], ',' );
|
1629 |
+
} else {
|
1630 |
+
$fts_count_ids = '';
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
if ( false !== $this->fts_check_feed_cache_exists( $fb_cache_name ) && ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1634 |
+
$response = $this->fts_get_feed_cache( $fb_cache_name );
|
1635 |
+
} else {
|
1636 |
+
// Page.
|
1637 |
+
if ( 'page' === $fb_shortcode['type'] && 'page_only' === $fb_shortcode['posts_displayed'] ) {
|
1638 |
+
$mulit_data = array( 'page_data' => 'https://graph.facebook.com/' . $fb_shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '' );
|
1639 |
+
|
1640 |
+
if ( isset( $_REQUEST['next_url'] ) ) {
|
1641 |
+
$_REQUEST['next_url'] = str_replace( 'access_token=XXX', 'access_token=' . get_option( 'fts_facebook_custom_api_token' ), $_REQUEST['next_url'] );
|
1642 |
+
}
|
1643 |
+
|
1644 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1645 |
+
// We cannot add sanitize_text_field here on the $_REQUEST['next_url'] otherwise it will fail to load the contents from the facebook API.
|
1646 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/posts?fields=id,attachments,created_time,from,icon,message,picture,full_picture,place,shares,status_type,story,to&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1647 |
+
} else {
|
1648 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/posts?ids=' . $fb_shortcode['id'] . '&fields=id,attachments,created_time,from,icon,message,picture,full_picture,place,shares,status_type,story,to&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1649 |
+
}
|
1650 |
+
} elseif (
|
1651 |
+
// Albums.
|
1652 |
+
'albums' === $fb_shortcode['type'] ) {
|
1653 |
+
$mulit_data = array( 'page_data' => 'https://graph.facebook.com/' . $fb_shortcode['id'] . '?fields=id,name,description,link&access_token=' . $access_token . $language . '' );
|
1654 |
+
if ( isset( $_REQUEST['next_url'] ) ) {
|
1655 |
+
$_REQUEST['next_url'] = str_replace( 'access_token=XXX', 'access_token=' . get_option( 'fts_facebook_custom_api_token' ), $_REQUEST['next_url'] );
|
1656 |
+
}
|
1657 |
+
// Check If Ajax next URL needs to be used.
|
1658 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1659 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : wp_unslash( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/albums?fields=id,photos{images,name,created_time},created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1660 |
+
} else {
|
1661 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : wp_unslash( 'https://graph.facebook.com/albums?ids=' . $fb_shortcode['id'] . '&fields=id,photos{images,name,created_time},created_time,name,from,link,cover_photo,count,updated_time,type&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1662 |
+
}
|
1663 |
+
|
1664 |
+
// $mulit_data['feed_data'] = isset($_REQUEST['next_url']) ? esc_url_raw($_REQUEST['next_url']) : 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/albums?fields=id,created_time,name,from,cover_photo,count,updated_time&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '';
|
1665 |
+
} elseif (
|
1666 |
+
// Album Photos.
|
1667 |
+
'album_photos' === $fb_shortcode['type'] ) {
|
1668 |
+
$mulit_data = array( 'page_data' => 'https://graph.facebook.com/' . $fb_shortcode['id'] . '?fields=id,name,description&access_token=' . $access_token . $language . '' );
|
1669 |
+
if ( isset( $_REQUEST['next_url'] ) ) {
|
1670 |
+
$_REQUEST['next_url'] = str_replace( 'access_token=XXX', 'access_token=' . get_option( 'fts_facebook_custom_api_token' ), $_REQUEST['next_url'] );
|
1671 |
+
}
|
1672 |
+
// Check If Ajax next URL needs to be used
|
1673 |
+
// The reason I did not create a whole new else if for the video album is because I did not want to duplicate all the code required to make the video because the videos gallery comes from the photo albums on facebook.
|
1674 |
+
if ( isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
1675 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1676 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/videos?fields=id,created_time,description,from,icon,link,message,object_id,picture,place,source,to,type,format,embed_html&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1677 |
+
} else {
|
1678 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/videos?ids=' . $fb_shortcode['id'] . '&fields=id,created_time,description,from,icon,link,message,object_id,picture,place,source,to,type,format,embed_html&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1679 |
+
}
|
1680 |
+
} elseif ( isset( $fb_shortcode['album_id'] ) && 'photo_stream' === $fb_shortcode['album_id'] ) {
|
1681 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1682 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1683 |
+
} else {
|
1684 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/photos?ids=' . $fb_shortcode['id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&type=uploaded&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1685 |
+
}
|
1686 |
+
} else {
|
1687 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1688 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['album_id'] . '/photos?fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1689 |
+
} else {
|
1690 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/photos?ids=' . $fb_shortcode['album_id'] . '&fields=id,caption,created_time,description,from,icon,link,message,name,object_id,picture,place,shares,source,status_type,story,to,type&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1691 |
+
}
|
1692 |
+
}
|
1693 |
+
} elseif ( 'reviews' === $fb_shortcode['type'] ) {
|
1694 |
+
|
1695 |
+
// Reviews.
|
1696 |
+
if ( is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ) {
|
1697 |
+
$fts_facebook_reviews = new FTS_Facebook_Reviews();
|
1698 |
+
$mulit_data = $fts_facebook_reviews->review_connection( $fb_shortcode, $access_token, $language );
|
1699 |
+
|
1700 |
+
$mulit_data['ratings_data'] = esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/?fields=overall_star_rating,rating_count&access_token=' . $access_token . '' );
|
1701 |
+
|
1702 |
+
} else {
|
1703 |
+
return 'Please Purchase and Activate the Feed Them Social Reviews plugin.';
|
1704 |
+
exit;
|
1705 |
+
}
|
1706 |
+
} else {
|
1707 |
+
$mulit_data = array( 'page_data' => 'https://graph.facebook.com/' . $fb_shortcode['id'] . '?fields=feed,id,name,description&access_token=' . $access_token . $language . '' );
|
1708 |
+
|
1709 |
+
// Check If Ajax next URL needs to be used.
|
1710 |
+
if ( ! $fts_count_ids >= 1 ) {
|
1711 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/' . $fb_shortcode['id'] . '/feed?fields=id,created_time,from,icon,message,name_id,picture,full_picture,place,shares,status_type,story,to&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1712 |
+
} else {
|
1713 |
+
$mulit_data['feed_data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : esc_url_raw( 'https://graph.facebook.com/feed?ids=' . $fb_shortcode['id'] . '&fields=id,created_time,from,icon,message,name_id,picture,full_picture,place,shares,status_type,story,to&limit=' . $fb_shortcode['posts'] . '&access_token=' . $access_token . $language . '' );
|
1714 |
+
}
|
1715 |
+
}
|
1716 |
+
$response = $this->fts_get_feed_json( $mulit_data );
|
1717 |
+
|
1718 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1719 |
+
// Error Check.
|
1720 |
+
$feed_data = json_decode( $response['feed_data'] );
|
1721 |
+
$fts_error_check = new fts_error_handler();
|
1722 |
+
$fts_error_check_complete = $fts_error_check->facebook_error_check( $fb_shortcode, $feed_data );
|
1723 |
+
if ( is_array( $fts_error_check_complete ) && true === $fts_error_check_complete[0] ) {
|
1724 |
+
|
1725 |
+
// If old Cache exists use it instead of showing an error.
|
1726 |
+
if ( true === $this->fts_check_feed_cache_exists( $fb_cache_name, true ) ) {
|
1727 |
+
|
1728 |
+
// If Current user is Admin and Cache exists for use then still show Admin the error for debugging purposes.
|
1729 |
+
if ( current_user_can( 'administrator' ) ) {
|
1730 |
+
echo wp_kses(
|
1731 |
+
$fts_error_check_complete[1] . ' <em>**NOTE** This error is only shown to logged in Admins of this WordPress install</em>',
|
1732 |
+
array(
|
1733 |
+
'a' => array(
|
1734 |
+
'href' => array(),
|
1735 |
+
'title' => array(),
|
1736 |
+
),
|
1737 |
+
'br' => array(),
|
1738 |
+
'em' => array(),
|
1739 |
+
'strong' => array(),
|
1740 |
+
)
|
1741 |
+
);
|
1742 |
+
}
|
1743 |
+
|
1744 |
+
// Return Cache because it exists in Database. Better than showing nothing right?
|
1745 |
+
return $this->fts_get_feed_cache( $fb_cache_name, true );
|
1746 |
+
}
|
1747 |
+
// If User is Admin and no Old cache is saved in database for use.
|
1748 |
+
if ( current_user_can( 'administrator' ) ) {
|
1749 |
+
return array( false, $fts_error_check_complete[1] );
|
1750 |
+
}
|
1751 |
+
}
|
1752 |
+
}
|
1753 |
+
|
1754 |
+
// Make sure it's not ajaxing.
|
1755 |
+
if ( ! empty( $response['feed_data'] ) ) {
|
1756 |
+
// Create Cache.
|
1757 |
+
$this->fts_create_feed_cache( $fb_cache_name, $response );
|
1758 |
+
}
|
1759 |
+
} // end main else.
|
1760 |
+
|
1761 |
+
return $response;
|
1762 |
+
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
|
1766 |
+
/**
|
1767 |
+
* Get Facebook Feed Dynamic Name
|
1768 |
+
*
|
1769 |
+
* @param string $fb_shortcode The facebook feed shortcode.
|
1770 |
+
* @return mixed
|
1771 |
+
* @since 1.9.6
|
1772 |
+
*/
|
1773 |
+
public function get_facebook_feed_dynamic_name( $fb_shortcode ) {
|
1774 |
+
|
1775 |
+
return $_REQUEST['fts_dynamic_name'] = sanitize_key( $this->fts_rand_string( 10 ) . '_' . $fb_shortcode['type'] );
|
1776 |
+
|
1777 |
+
}
|
1778 |
+
|
1779 |
+
/**
|
1780 |
+
* Get Facebook Feed Dynamic Class Name
|
1781 |
+
*
|
1782 |
+
* @param null $fts_dynamic_name Our Dynamic Name for ajax.
|
1783 |
+
* @return string
|
1784 |
+
* @since 1.9.6
|
1785 |
+
*/
|
1786 |
+
public function get_facebook_feed_dynamic_class_name( $fts_dynamic_name = null ) {
|
1787 |
+
$fts_dynamic_class_name = '';
|
1788 |
+
if ( isset( $fts_dynamic_name ) ) {
|
1789 |
+
$fts_dynamic_class_name = 'feed_dynamic_class' . sanitize_key( $_REQUEST['fts_dynamic_name'] );
|
1790 |
+
}
|
1791 |
+
return $fts_dynamic_class_name;
|
1792 |
+
}
|
1793 |
+
|
1794 |
+
|
1795 |
+
/**
|
1796 |
+
* Get Post Info
|
1797 |
+
*
|
1798 |
+
* For Facebook.
|
1799 |
+
*
|
1800 |
+
* @param string $feed_data The facebook contents.
|
1801 |
+
* @param string $fb_shortcode FB cache name.
|
1802 |
+
* @param string $access_token The Access Token.
|
1803 |
+
* @param string $language Language.
|
1804 |
+
* @return array|mixed
|
1805 |
+
* @since 1.9.6
|
1806 |
+
*/
|
1807 |
+
public function get_post_info( $feed_data, $fb_shortcode, $access_token, $language, $fb_cache_name ) {
|
1808 |
+
$developer_mode = get_option( 'fts_clear_cache_developer_mode' );
|
1809 |
+
|
1810 |
+
if ( 'album_photos' === $fb_shortcode['type'] ) {
|
1811 |
+
$fb_post_data_cache = 'fb_' . $fb_shortcode['type'] . '_post_' . $fb_shortcode['album_id'] . '_num' . $fb_shortcode['posts'] . '';
|
1812 |
+
} else {
|
1813 |
+
$fb_post_data_cache = 'fb_' . $fb_shortcode['type'] . '_post_' . $fb_shortcode['id'] . '_num' . $fb_shortcode['posts'] . '';
|
1814 |
+
}
|
1815 |
+
if ( false !== $this->fts_check_feed_cache_exists( $fb_post_data_cache ) && ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1816 |
+
$response_post_array = $this->fts_get_feed_cache( $fb_post_data_cache );
|
1817 |
+
|
1818 |
+
} else {
|
1819 |
+
// Build the big post counter.
|
1820 |
+
$fb_post_array = array();
|
1821 |
+
// Single Events Array.
|
1822 |
+
$set_zero = 0;
|
1823 |
+
foreach ( $feed_data->data as $counter ) {
|
1824 |
+
|
1825 |
+
$counter->id = isset( $counter->id ) ? $counter->id : '';
|
1826 |
+
|
1827 |
+
if ( $set_zero === $fb_shortcode['posts'] ) {
|
1828 |
+
break;
|
1829 |
+
}
|
1830 |
+
|
1831 |
+
$fb_type = isset( $counter->attachments->data[0]->type ) ? $counter->attachments->data[0]->type : '';
|
1832 |
+
$post_data_key = isset( $counter->attachments->data[0]->object_id) ? $counter->attachments->data[0]->object_id: $counter->id;
|
1833 |
+
|
1834 |
+
// Likes & Comments.
|
1835 |
+
$fb_post_array[ $post_data_key . '_likes' ] = 'https://graph.facebook.com/' . $post_data_key . '/reactions?summary=1&access_token=' . $access_token;
|
1836 |
+
$fb_post_array[ $post_data_key . '_comments' ] = 'https://graph.facebook.com/' . $post_data_key . '/comments?summary=1&access_token=' . $access_token;
|
1837 |
+
// Video.
|
1838 |
+
if ( 'video' === $fb_type ) {
|
1839 |
+
$fb_post_array[ $post_data_key . '_video' ] = 'https://graph.facebook.com/' . $post_data_key;
|
1840 |
+
}
|
1841 |
+
// Photo.
|
1842 |
+
$fb_album_cover = isset( $counter->cover_photo->id ) ? $counter->cover_photo->id : '';
|
1843 |
+
if ( 'albums' === $fb_shortcode['type'] && ! $fb_album_cover ) {
|
1844 |
+
unset( $counter );
|
1845 |
+
continue;
|
1846 |
+
}
|
1847 |
+
if ( 'albums' === $fb_shortcode['type'] ) {
|
1848 |
+
$fb_post_array[ $fb_album_cover . '_photo' ] = 'https://graph.facebook.com/' . $fb_album_cover;
|
1849 |
+
}
|
1850 |
+
if ( 'hashtag' === $fb_shortcode['type'] ) {
|
1851 |
+
$fb_post_array[ $post_data_key . '_photo' ] = 'https://graph.facebook.com/' . $counter->source;
|
1852 |
+
}
|
1853 |
+
// GROUP Photo.
|
1854 |
+
if ( 'group' === $fb_shortcode['type'] ) {
|
1855 |
+
$fb_post_array[ $post_data_key . '_group_post_photo' ] = 'https://graph.facebook.com/' . $counter->id . '?fields=picture,full_picture&access_token=' . $access_token;
|
1856 |
+
}
|
1857 |
+
|
1858 |
+
$set_zero++;
|
1859 |
+
}
|
1860 |
+
|
1861 |
+
$fts_error_check = new fts_error_handler();
|
1862 |
+
$fts_error_check_complete = $fts_error_check->facebook_error_check( $fb_shortcode, $feed_data );
|
1863 |
+
if ( is_array( $fts_error_check_complete ) && true === $fts_error_check_complete[0] ) {
|
1864 |
+
|
1865 |
+
// If old Cache exists use it instead of showing an error.
|
1866 |
+
if ( true === $this->fts_check_feed_cache_exists( $fb_cache_name, true ) ) {
|
1867 |
+
|
1868 |
+
// Return Cache because it exists in Database. Better than showing nothing right?
|
1869 |
+
return $this->fts_get_feed_cache( $fb_cache_name, true );
|
1870 |
+
}
|
1871 |
+
}
|
1872 |
+
|
1873 |
+
// Response.
|
1874 |
+
$response_post_array = $this->fts_get_feed_json( $fb_post_array );
|
1875 |
+
// Make sure it's not ajaxing.
|
1876 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1877 |
+
// Create Cache.
|
1878 |
+
$this->fts_create_feed_cache( $fb_post_data_cache, $response_post_array );
|
1879 |
+
}
|
1880 |
+
}
|
1881 |
+
// SHOW THE POST RESPONSE PRINT_R
|
1882 |
+
// echo'<pre>';
|
1883 |
+
// print_r($response_post_array);
|
1884 |
+
// echo'</pre>';.
|
1885 |
+
return $response_post_array;
|
1886 |
+
}
|
1887 |
+
|
1888 |
+
|
1889 |
+
/**
|
1890 |
+
* Get Post Info
|
1891 |
+
*
|
1892 |
+
* For Facebook.
|
1893 |
+
*
|
1894 |
+
* @param string $feed_data The facebook contents.
|
1895 |
+
* @param string $fb_shortcode FB cache name.
|
1896 |
+
* @param string $access_token The Access Token.
|
1897 |
+
* @param string $language Language.
|
1898 |
+
* @return array|mixed
|
1899 |
+
* @since 2.1.6
|
1900 |
+
*/
|
1901 |
+
public function get_event_post_info( $feed_data, $fb_shortcode, $access_token, $language ) {
|
1902 |
+
$developer_mode = get_option( 'fts_clear_cache_developer_mode' );
|
1903 |
+
|
1904 |
+
$fb_event_post_data_cache = 'fbe_' . $fb_shortcode['type'] . '_post_' . $fb_shortcode['id'] . '_num' . $fb_shortcode['posts'] . '';
|
1905 |
+
if ( false !== $this->fts_check_feed_cache_exists( $fb_event_post_data_cache ) && ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1906 |
+
$response_event_post_array = $this->fts_get_feed_cache( $fb_event_post_data_cache );
|
1907 |
+
} else {
|
1908 |
+
// Single Events Array.
|
1909 |
+
$fb_single_events_array = array();
|
1910 |
+
$set_zero = 0;
|
1911 |
+
foreach ( $feed_data->data as $counter ) {
|
1912 |
+
|
1913 |
+
$counter->id = isset( $counter->id ) ? $counter->id : '';
|
1914 |
+
|
1915 |
+
if ( $set_zero === $fb_shortcode['posts'] ) {
|
1916 |
+
break;
|
1917 |
+
}
|
1918 |
+
|
1919 |
+
$single_event_id = $counter->id;
|
1920 |
+
$language = isset( $language ) ? $language : '';
|
1921 |
+
// Event Info, Time etc.
|
1922 |
+
$fb_single_events_array[ 'event_single_' . $single_event_id . '_info' ] = 'https://graph.facebook.com/' . $single_event_id . '/?access_token=' . $access_token . $language;
|
1923 |
+
// Event Location.
|
1924 |
+
$fb_single_events_array[ 'event_single_' . $single_event_id . '_location' ] = 'https://graph.facebook.com/' . $single_event_id . '/?fields=place&access_token=' . $access_token . $language;
|
1925 |
+
// Event Cover Photo.
|
1926 |
+
$fb_single_events_array[ 'event_single_' . $single_event_id . '_cover_photo' ] = 'https://graph.facebook.com/' . $single_event_id . '/?fields=cover&access_token=' . $access_token . $language;
|
1927 |
+
// Event Ticket Info.
|
1928 |
+
$fb_single_events_array[ 'event_single_' . $single_event_id . '_ticket_info' ] = 'https://graph.facebook.com/' . $single_event_id . '/?fields=ticket_uri&access_token=' . $access_token . $language;
|
1929 |
+
|
1930 |
+
$set_zero++;
|
1931 |
+
}
|
1932 |
+
|
1933 |
+
$response_event_post_array = $this->fts_get_feed_json( $fb_single_events_array );
|
1934 |
+
// Create Cache.
|
1935 |
+
$this->fts_create_feed_cache( $fb_event_post_data_cache, $response_event_post_array );
|
1936 |
+
|
1937 |
+
}
|
1938 |
+
// SHOW THE $response_event_post_array FEED PRINT_R
|
1939 |
+
// '<pre>';.
|
1940 |
+
// print_r($response_event_post_array);
|
1941 |
+
// echo'</pre>';.
|
1942 |
+
return $response_event_post_array;
|
1943 |
+
}
|
1944 |
+
|
1945 |
+
|
1946 |
+
/**
|
1947 |
+
* FB Social Button Placement
|
1948 |
+
*
|
1949 |
+
* @param string $fb_shortcode The facebook contents.
|
1950 |
+
* @param string $access_token The Access Token.
|
1951 |
+
* @param string $share_loc Language.
|
1952 |
+
* @return string|void
|
1953 |
+
* @since 2.0.1
|
1954 |
+
*/
|
1955 |
+
public function fb_social_btn_placement( $fb_shortcode, $access_token, $share_loc ) {
|
1956 |
+
// Don't do it for these!
|
1957 |
+
if ( 'group' === $fb_shortcode['type'] || 'event' === $fb_shortcode['type'] || isset( $fb_shortcode['hide_like_option'] ) && 'yes' === $fb_shortcode['hide_like_option'] ) {
|
1958 |
+
return;
|
1959 |
+
}
|
1960 |
+
// Facebook Follow Button Options.
|
1961 |
+
$fb_show_follow_btn = get_option( 'fb_show_follow_btn' );
|
1962 |
+
|
1963 |
+
if ( isset( $fb_shortcode['show_follow_btn_where'] ) && '' !== $fb_shortcode['show_follow_btn_where'] ) {
|
1964 |
+
if ( 'above_title' === $fb_shortcode['show_follow_btn_where'] ) {
|
1965 |
+
$fb_show_follow_btn_where = 'fb-like-top-above-title';
|
1966 |
+
} elseif ( 'below_title' === $fb_shortcode['show_follow_btn_where'] ) {
|
1967 |
+
$fb_show_follow_btn_where = 'fb-like-top-below-title';
|
1968 |
+
} elseif ( 'bottom' === $fb_shortcode['show_follow_btn_where'] ) {
|
1969 |
+
$fb_show_follow_btn_where = 'fb-like-below';
|
1970 |
+
}
|
1971 |
+
} else {
|
1972 |
+
$fb_show_follow_btn_where = get_option( 'fb_show_follow_btn_where' );
|
1973 |
+
}
|
1974 |
+
|
1975 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
1976 |
+
|
1977 |
+
$like_option_align_final = isset( $fb_shortcode['like_option_align'] ) ? 'fts-fb-social-btn-' . $fb_shortcode['like_option_align'] . '' : '';
|
1978 |
+
|
1979 |
+
if ( $share_loc === $fb_show_follow_btn_where ) {
|
1980 |
+
switch ( $fb_show_follow_btn_where ) {
|
1981 |
+
case 'fb-like-top-above-title':
|
1982 |
+
// Top Above Title.
|
1983 |
+
if ( isset( $fb_show_follow_btn ) && 'dont-display' !== $fb_show_follow_btn ) {
|
1984 |
+
echo '<div class="fb-social-btn-top ' . esc_attr( $like_option_align_final ) . '">';
|
1985 |
+
$this->social_follow_button( 'facebook', $fb_shortcode['id'], $access_token, $fb_shortcode );
|
1986 |
+
echo '</div>';
|
1987 |
+
}
|
1988 |
+
break;
|
1989 |
+
// Top Below Title.
|
1990 |
+
case 'fb-like-top-below-title':
|
1991 |
+
if ( isset( $fb_show_follow_btn ) && 'dont-display' !== $fb_show_follow_btn ) {
|
1992 |
+
echo '<div class="fb-social-btn-below-description ' . esc_attr( $like_option_align_final ) . '">';
|
1993 |
+
$this->social_follow_button( 'facebook', $fb_shortcode['id'], $access_token, $fb_shortcode );
|
1994 |
+
echo '</div>';
|
1995 |
+
}
|
1996 |
+
break;
|
1997 |
+
// Bottom.
|
1998 |
+
case 'fb-like-below':
|
1999 |
+
if ( isset( $fb_show_follow_btn ) && 'dont-display' !== $fb_show_follow_btn ) {
|
2000 |
+
echo '<div class="fb-social-btn-bottom ' . esc_attr( $like_option_align_final ) . '">';
|
2001 |
+
$this->social_follow_button( 'facebook', $fb_shortcode['id'], $access_token, $fb_shortcode );
|
2002 |
+
echo '</div>';
|
2003 |
+
}
|
2004 |
+
break;
|
2005 |
+
}
|
2006 |
+
}
|
2007 |
+
}
|
2008 |
+
}
|
2009 |
+
|
2010 |
+
/**
|
2011 |
+
* FTS Custom Trim Words
|
2012 |
+
*
|
2013 |
+
* Not using this anymore but keeping it as a fallback function for the combined if user has not updated the free version before the combined extension
|
2014 |
+
*
|
2015 |
+
* @param string $text The description text.
|
2016 |
+
* @param int $num_words Number of words you want to be showm.
|
2017 |
+
* @param string $more The ...
|
2018 |
+
* @return mixed
|
2019 |
+
* @since 1.9.6
|
2020 |
+
*/
|
2021 |
+
public function fts_custom_trim_words( $text, $num_words = 45, $more ) {
|
2022 |
+
! empty( $num_words ) && 0 !== $num_words ? $more = __( '...' ) : '';
|
2023 |
+
$text = nl2br( $text );
|
2024 |
+
// Filter for Hashtags and Mentions Before returning.
|
2025 |
+
$text = $this->fts_facebook_tag_filter( $text );
|
2026 |
+
$text = strip_shortcodes( $text );
|
2027 |
+
// Add tags that you don't want stripped.
|
2028 |
+
$text = strip_tags( $text, '<strong><br><em><i><a>' );
|
2029 |
+
$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
|
2030 |
+
$sep = ' ';
|
2031 |
+
if ( count( $words_array ) > $num_words ) {
|
2032 |
+
array_pop( $words_array );
|
2033 |
+
$text = implode( $sep, $words_array );
|
2034 |
+
$text = $text . $more;
|
2035 |
+
} else {
|
2036 |
+
$text = implode( $sep, $words_array );
|
2037 |
+
}
|
2038 |
+
return wpautop( $text );
|
2039 |
+
}
|
2040 |
+
|
2041 |
+
/**
|
2042 |
+
* FTS Facebook Tag Filter
|
2043 |
+
*
|
2044 |
+
* Tags Filter (return clean tags)
|
2045 |
+
*
|
2046 |
+
* @param string $fb_description Facebook Description.
|
2047 |
+
* @return mixed
|
2048 |
+
* @since 1.9.6
|
2049 |
+
*/
|
2050 |
+
public function fts_facebook_tag_filter( $fb_description ) {
|
2051 |
+
// Converts URLs to Links.
|
2052 |
+
$fb_description = preg_replace( '@(?!(?!.*?<a)[^<]*<\/a>)(?:(?:https?|ftp|file)://|www\.|ftp\.)[-A-Z0-9+&#/%=~_|$?!:,.]*[A-Z0-9+&#/%=~_|$]@i', '<a href="\0" target="_blank" rel="noreferrer">\0</a>', $fb_description );
|
2053 |
+
|
2054 |
+
$splitano = explode( 'www', $fb_description );
|
2055 |
+
$count = count( $splitano );
|
2056 |
+
$return_value = '';
|
2057 |
+
|
2058 |
+
for ( $i = 0; $i < $count; $i++ ) {
|
2059 |
+
if ( 'href=' === substr( $splitano[ $i ], -6, 5 ) ) {
|
2060 |
+
$return_value .= $splitano[ $i ] . 'http://www';
|
2061 |
+
} elseif ( $i < $count - 1 ) {
|
2062 |
+
$return_value .= $splitano[ $i ] . 'www';
|
2063 |
+
} else {
|
2064 |
+
$return_value .= $splitano[ $i ];
|
2065 |
+
}
|
2066 |
+
}
|
2067 |
+
// Mentions.
|
2068 |
+
$return_value = preg_replace( '/@+(\w+)/u', '<a href="https://www.facebook.com/$1" target="_blank" rel="noreferrer">@$1</a>', $return_value );
|
2069 |
+
// Hash tags.
|
2070 |
+
$return_value = preg_replace( '/#+(\w+)/u', '<a href="https://www.facebook.com/hashtag/$1" target="_blank" rel="noreferrer">#$1</a>', $return_value );
|
2071 |
+
|
2072 |
+
return $return_value;
|
2073 |
+
}
|
2074 |
+
|
2075 |
+
/**
|
2076 |
+
* Load PopUp Scripts
|
2077 |
+
*
|
2078 |
+
* @param string $fb_shortcode The Facebook feed shortcode.
|
2079 |
+
* @since 1.9.6
|
2080 |
+
*/
|
2081 |
+
public function load_popup_scripts( $fb_shortcode ) {
|
2082 |
+
if ( 'yes' === $fb_shortcode['popup'] ) {
|
2083 |
+
// it's ok if these styles & scripts load at the bottom of the page.
|
2084 |
+
$fts_fix_magnific = get_option( 'fts_fix_magnific' ) ? get_option( 'fts_fix_magnific' ) : '';
|
2085 |
+
if ( isset( $fts_fix_magnific ) && '1' !== $fts_fix_magnific ) {
|
2086 |
+
wp_enqueue_style( 'fts-popup', plugins_url( 'feed-them-social/feeds/css/magnific-popup.css' ), array(), FTS_CURRENT_VERSION, false );
|
2087 |
+
}
|
2088 |
+
wp_enqueue_script( 'fts-popup-js', plugins_url( 'feed-them-social/feeds/js/magnific-popup.js' ), array(), FTS_CURRENT_VERSION, false );
|
2089 |
+
wp_enqueue_script( 'fts-images-loaded', plugins_url( 'feed-them-social/feeds/js/imagesloaded.pkgd.min.js' ), array(), FTS_CURRENT_VERSION, false );
|
2090 |
+
if ( ! isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
2091 |
+
wp_enqueue_script( 'fts-global', plugins_url( 'feed-them-social/feeds/js/fts-global.js' ), array( 'jquery' ), FTS_CURRENT_VERSION, false );
|
2092 |
+
}
|
2093 |
+
}
|
2094 |
+
}
|
2095 |
+
|
2096 |
+
/**
|
2097 |
+
* FTS Facebook LoadMore
|
2098 |
+
*
|
2099 |
+
* @param string $atts The shortcode attributes.
|
2100 |
+
* @param string $feed_data The Feed data.
|
2101 |
+
* @param string $fb_type The type of facebook feed.
|
2102 |
+
* @param string $fb_shortcode The Facebook feed shortcode.
|
2103 |
+
* @since 1.9.6
|
2104 |
+
*/
|
2105 |
+
public function fts_facebook_loadmore( $atts, $feed_data, $fb_type, $fb_shortcode ) {
|
2106 |
+
if ( ( isset( $fb_shortcode['loadmore'] ) && 'button' === $fb_shortcode['loadmore'] || isset( $fb_shortcode['loadmore'] ) && 'autoscroll' === $fb_shortcode['loadmore'] ) && ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && 'reviews' !== $fb_shortcode['type'] || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && 'reviews' === $fb_shortcode['type'] ) ) {
|
2107 |
+
|
2108 |
+
$fb_load_more_text = get_option( 'fb_load_more_text' ) ? get_option( 'fb_load_more_text' ) : esc_html( 'Load More', 'feed-them-social' );
|
2109 |
+
$fb_no_more_posts_text = get_option( 'fb_no_more_posts_text' ) ? get_option( 'fb_no_more_posts_text' ) : esc_html( 'No More Posts', 'feed-them-social' );
|
2110 |
+
$fb_no_more_photos_text = get_option( 'fb_no_more_photos_text' ) ? get_option( 'fb_no_more_photos_text' ) : esc_html( 'No More Photos', 'feed-them-social' );
|
2111 |
+
$fb_no_more_videos_text = get_option( 'fb_no_more_videos_text' ) ? get_option( 'fb_no_more_videos_text' ) : esc_html( 'No More Videos', 'feed-them-social' );
|
2112 |
+
$fb_no_more_reviews_text = get_option( 'fb_no_more_reviews_text' ) ? get_option( 'fb_no_more_reviews_text' ) : esc_html( 'No More Reviews', 'feed-them-social' );
|
2113 |
+
|
2114 |
+
// Load More BUTTON Start.
|
2115 |
+
$next_url = isset( $feed_data->paging->next ) ? $feed_data->paging->next : '';
|
2116 |
+
|
2117 |
+
$posts = isset( $fb_shortcode['posts'] ) ? $fb_shortcode['posts'] : '';
|
2118 |
+
$loadmore_count = isset( $fb_shortcode['loadmore_count'] ) && '' !== $fb_shortcode['loadmore_count'] ? $fb_shortcode['loadmore_count'] : '';
|
2119 |
+
// we check to see if the loadmore count number is set and if so pass that as the new count number when fetching the next set of posts.
|
2120 |
+
$_REQUEST['next_url'] = '' !== $loadmore_count ? str_replace( "limit=$posts", "limit=$loadmore_count", $next_url ) : $next_url;
|
2121 |
+
|
2122 |
+
$access_token = is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) ? 'access_token=' . get_option( 'fts_facebook_custom_api_token_biz' ) : 'access_token=' . get_option( 'fts_facebook_custom_api_token' );
|
2123 |
+
$_REQUEST['next_url'] = str_replace( $access_token, 'access_token=XXX', $next_url );
|
2124 |
+
|
2125 |
+
echo '<script>';
|
2126 |
+
echo 'var nextURL_' . esc_js( $_REQUEST['fts_dynamic_name'] ) . '= "' . esc_url_raw( $_REQUEST['next_url'] ) . '";';
|
2127 |
+
echo '</script>';
|
2128 |
+
|
2129 |
+
// Make sure it's not ajaxing.
|
2130 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) && ! isset( $_REQUEST['fts_no_more_posts'] ) && ! empty( $fb_shortcode['loadmore'] ) ) {
|
2131 |
+
$fts_dynamic_name = $_REQUEST['fts_dynamic_name'];
|
2132 |
+
$time = time();
|
2133 |
+
$nonce = wp_create_nonce( $time . 'load-more-nonce' );
|
2134 |
+
$fts_dynamic_class_name = $this->get_fts_dynamic_class_name();
|
2135 |
+
echo '<script>';
|
2136 |
+
echo 'jQuery(document).ready(function() {';
|
2137 |
+
if ( 'autoscroll' === $fb_shortcode['loadmore'] ) {
|
2138 |
+
// this is where we do SCROLL function to LOADMORE if = autoscroll in shortcode.
|
2139 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").bind("scroll",function() {';
|
2140 |
+
echo 'if(jQuery(this).scrollTop() + jQuery(this).innerHeight() >= jQuery(this)[0].scrollHeight) {';
|
2141 |
+
} else {
|
2142 |
+
// this is where we do CLICK function to LOADMORE if = button in shortcode.
|
2143 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").click(function() {';
|
2144 |
+
}
|
2145 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").addClass("fts-fb-spinner");';
|
2146 |
+
echo 'var button = jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").html("<div class=\'bounce1\'></div><div class=\'bounce2\'></div><div class=\'bounce3\'></div>");';
|
2147 |
+
echo 'console.log(button);';
|
2148 |
+
|
2149 |
+
echo 'var yes_ajax = "yes";';
|
2150 |
+
echo 'var fts_d_name = "' . esc_js( $fts_dynamic_name ) . '";';
|
2151 |
+
echo 'var fts_security = "' . esc_js( $nonce ) . '";';
|
2152 |
+
echo 'var fts_time = "' . esc_js( $time ) . '";';
|
2153 |
+
|
2154 |
+
echo 'var feed_name = "fts_facebook";';
|
2155 |
+
echo 'var loadmore_count = "posts=' . esc_js( $fb_shortcode['loadmore_count'] ) . '";';
|
2156 |
+
echo 'var feed_attributes = ' . json_encode( $atts ) . ';';
|
2157 |
+
|
2158 |
+
echo 'jQuery.ajax({';
|
2159 |
+
echo 'data: {action: "my_fts_fb_load_more", next_url: nextURL_' . esc_js( $fts_dynamic_name ) . ', fts_dynamic_name: fts_d_name, feed_name: feed_name, loadmore_count: loadmore_count, feed_attributes: feed_attributes, load_more_ajaxing: yes_ajax, fts_security: fts_security, fts_time: fts_time},';
|
2160 |
+
echo 'type: "GET",';
|
2161 |
+
echo 'url: "' . esc_url( admin_url( 'admin-ajax.php' ) ) . '",';
|
2162 |
+
echo 'success: function( data ) {';
|
2163 |
+
echo 'console.log("Well Done and got this from sever: " + data);';
|
2164 |
+
if ( $fb_type && 'albums' === $fb_shortcode['type'] || $fb_type && 'album_photos' === $fb_shortcode['type'] && 'yes' !== $fb_shortcode['video_album'] || 'yes' === $fb_shortcode['grid'] ) {
|
2165 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").append(data).filter(".' . esc_js( $fts_dynamic_class_name ) . '").html();';
|
2166 |
+
// if (isset($fb_shortcode['image_stack_animation']) && $fb_shortcode['image_stack_animation'] == 'yes') {.
|
2167 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").masonry( "reloadItems");';
|
2168 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").masonry("layout");';
|
2169 |
+
|
2170 |
+
echo 'setTimeout(function() {';
|
2171 |
+
// Do something after 3 seconds
|
2172 |
+
// This can be direct code, or call to some other function.
|
2173 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").masonry("layout");';
|
2174 |
+
echo '}, 500);';
|
2175 |
+
|
2176 |
+
// }.
|
2177 |
+
echo 'if(!nextURL_' . esc_js( $_REQUEST['fts_dynamic_name'] ) . ' || nextURL_' . esc_js( $_REQUEST['fts_dynamic_name'] ) . ' == "no more"){';
|
2178 |
+
if ( 'reviews' === $fb_shortcode['type'] ) {
|
2179 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").replaceWith(\'<div class="fts-fb-load-more no-more-posts-fts-fb">' . esc_html( $fb_no_more_reviews_text ) . '</div>\');';
|
2180 |
+
} elseif ( 'videos' === $fb_shortcode['type'] ) {
|
2181 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").replaceWith(\'<div class="fts-fb-load-more no-more-posts-fts-fb">' . esc_html( $fb_no_more_videos_text ) . '</div>\');';
|
2182 |
+
} else {
|
2183 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").replaceWith(\'<div class="fts-fb-load-more no-more-posts-fts-fb">' . esc_html( $fb_no_more_photos_text ) . '</div>\');';
|
2184 |
+
}
|
2185 |
+
|
2186 |
+
echo ' jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").removeAttr("id");';
|
2187 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").unbind("scroll");';
|
2188 |
+
echo '}';
|
2189 |
+
} else {
|
2190 |
+
if ( isset( $fb_shortcode['video_album'] ) && 'yes' === $fb_shortcode['video_album'] ) {
|
2191 |
+
echo 'var result = jQuery(data).insertBefore( jQuery("#output_' . esc_js( $fts_dynamic_name ) . '") );';
|
2192 |
+
echo 'var result = jQuery(".feed_dynamic_' . esc_js( $fts_dynamic_name ) . '_album_photos").append(data).filter("#output_' . esc_js( $fts_dynamic_name ) . '").html();';
|
2193 |
+
} else {
|
2194 |
+
echo 'var result = jQuery("#output_' . esc_js( $fts_dynamic_name ) . '").append(data).filter("#output_' . esc_js( $fts_dynamic_name ) . '").html();';
|
2195 |
+
}
|
2196 |
+
echo 'jQuery("#output_' . esc_js( $fts_dynamic_name ) . '").html(result);';
|
2197 |
+
echo 'if(!nextURL_' . esc_js( $_REQUEST['fts_dynamic_name'] ) . ' || nextURL_' . esc_js( $_REQUEST['fts_dynamic_name'] ) . ' == "no more"){';
|
2198 |
+
// Reviews.
|
2199 |
+
if ( 'reviews' === $fb_shortcode['type'] ) {
|
2200 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").replaceWith(\'<div class="fts-fb-load-more no-more-posts-fts-fb">' . esc_html( $fb_no_more_reviews_text ) . '</div>\');';
|
2201 |
+
} else {
|
2202 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").replaceWith(\'<div class="fts-fb-load-more no-more-posts-fts-fb">' . esc_html( $fb_no_more_posts_text ) . '</div>\');';
|
2203 |
+
}
|
2204 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").removeAttr("id");';
|
2205 |
+
echo 'jQuery(".' . esc_js( $fts_dynamic_class_name ) . '").unbind("scroll");';
|
2206 |
+
echo '}';
|
2207 |
+
|
2208 |
+
}
|
2209 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").html("' . esc_html( $fb_load_more_text ) . '");';
|
2210 |
+
// jQuery("#loadMore_'.$fts_dynamic_name.'").removeClass("flip360-fts-load-more");.
|
2211 |
+
echo 'jQuery("#loadMore_' . esc_js( $fts_dynamic_name ) . '").removeClass("fts-fb-spinner");';
|
2212 |
+
if ( isset( $fb_shortcode['popup'] ) && 'yes' === $fb_shortcode['popup'] ) {
|
2213 |
+
// We return this function again otherwise the popup won't work correctly for the newly loaded items.
|
2214 |
+
echo 'jQuery.fn.slickFacebookPopUpFunction();';
|
2215 |
+
}
|
2216 |
+
// Reload the share each funcion otherwise you can't open share option..
|
2217 |
+
echo 'jQuery.fn.ftsShare();slickremixImageResizingFacebook2();slickremixImageResizingFacebook3();';
|
2218 |
+
|
2219 |
+
echo '}';
|
2220 |
+
echo '});';
|
2221 |
+
// end of ajax().
|
2222 |
+
echo 'return false;';
|
2223 |
+
// string $scrollMore is at top of this js script. acception for scroll option closing tag.
|
2224 |
+
if ( 'autoscroll' === $fb_shortcode['loadmore'] ) {
|
2225 |
+
echo '}';
|
2226 |
+
// end of scroll ajax load.
|
2227 |
+
}
|
2228 |
+
echo '});';
|
2229 |
+
// end of document.ready.
|
2230 |
+
echo '});';
|
2231 |
+
// end of form.submit.
|
2232 |
+
echo '</script>';
|
2233 |
+
}
|
2234 |
+
// End Check.
|
2235 |
+
// main closing div not included in ajax check so we can close the wrap at all times.
|
2236 |
+
// Make sure it's not ajaxing.
|
2237 |
+
if ( ! isset( $_GET['load_more_ajaxing'] ) ) {
|
2238 |
+
$fts_dynamic_name = $_REQUEST['fts_dynamic_name'];
|
2239 |
+
// this div returns outputs our ajax request via jquery appenc html from above style="display:nonee;".
|
2240 |
+
echo '<div id="output_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more-output"></div>';
|
2241 |
+
if ( ( is_plugin_active( 'feed-them-premium/feed-them-premium.php' ) && 'reviews' !== $fb_shortcode['type'] || is_plugin_active( 'feed-them-social-facebook-reviews/feed-them-social-facebook-reviews.php' ) && 'reviews' === $fb_shortcode['type'] ) && 'autoscroll' === $fb_shortcode['loadmore'] ) {
|
2242 |
+
echo '<div id="loadMore_' . esc_attr( $fts_dynamic_name ) . '" class="fts-fb-load-more fts-fb-autoscroll-loader">Facebook</div>';
|
2243 |
+
}
|
2244 |
+
}
|
2245 |
+
}
|
2246 |
+
// end of if loadmore is button or autoscroll.
|
2247 |
+
}
|
2248 |
+
// end fts_facebook_loadmore().
|
2249 |
+
|
2250 |
+
/**
|
2251 |
+
* Random String
|
2252 |
+
*
|
2253 |
+
* Create a random string
|
2254 |
+
*
|
2255 |
+
* @param string $length How many character to randomize.
|
2256 |
+
* @return mixed
|
2257 |
+
* @since 1.9.6
|
2258 |
+
*/
|
2259 |
+
public function fts_rand_string( $length = 10 ) {
|
2260 |
+
$characters = 'abcdefghijklmnopqrstuvwxyz';
|
2261 |
+
$characters_length = strlen( $characters );
|
2262 |
+
$random_string = '';
|
2263 |
+
for ( $i = 0; $i < $length; $i++ ) {
|
2264 |
+
$random_string .= $characters[ wp_rand( 0, $characters_length - 1 ) ];
|
2265 |
+
}
|
2266 |
+
|
2267 |
+
return $random_string;
|
2268 |
+
}
|
2269 |
}//end class
|
feeds/instagram/class-fts-instagram-feed.php
CHANGED
@@ -523,7 +523,7 @@ class FTS_Instagram_Feed extends feed_them_social_functions {
|
|
523 |
$business_cache = 'instagram_business_cache' . $instagram_id . '_num' . $pics_count . '';
|
524 |
|
525 |
// this is not getting cached currently
|
526 |
-
$instagram_data_array['user_info'] = 'https://graph.facebook.com/v3.
|
527 |
|
528 |
// This only returns the next url and a list of media ids. We then have to loop through the ids and make a call to get each ids data from the API.
|
529 |
$instagram_data_array['data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : 'https://graph.facebook.com/' . $instagram_id . '/media?limit=' . $pics_count . '&access_token=' . $fts_instagram_access_token_final;
|
523 |
$business_cache = 'instagram_business_cache' . $instagram_id . '_num' . $pics_count . '';
|
524 |
|
525 |
// this is not getting cached currently
|
526 |
+
$instagram_data_array['user_info'] = 'https://graph.facebook.com/v3.3/' . $instagram_id . '?fields=biography%2Cid%2Cig_id%2Cfollowers_count%2Cfollows_count%2Cmedia_count%2Cname%2Cprofile_picture_url%2Cusername%2Cwebsite&access_token=' . $fts_instagram_access_token_final;
|
527 |
|
528 |
// This only returns the next url and a list of media ids. We then have to loop through the ids and make a call to get each ids data from the API.
|
529 |
$instagram_data_array['data'] = isset( $_REQUEST['next_url'] ) ? esc_url_raw( $_REQUEST['next_url'] ) : 'https://graph.facebook.com/' . $instagram_id . '/media?limit=' . $pics_count . '&access_token=' . $fts_instagram_access_token_final;
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: slickremix, slickchris
|
3 |
Tags: Facebook, Instagram, Twitter, YouTube, Feed
|
4 |
Requires at least: 3.6.0
|
5 |
-
Tested up to: 5.7.
|
6 |
-
Stable tag: 2.9.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Display a Custom Facebook feed, Instagram feed, Twitter feed, and YouTube feed on pages, posts or widgets.
|
@@ -72,6 +72,9 @@ Feed Them Social was Developed By SlickRemix --> [https://www.slickremix.com/](h
|
|
72 |
* Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
|
73 |
|
74 |
== Changelog ==
|
|
|
|
|
|
|
75 |
= Version 2.9.5 Monday, April 12th, 2021 =
|
76 |
* FIX: PHP 8.0 compatible.
|
77 |
|
2 |
Contributors: slickremix, slickchris
|
3 |
Tags: Facebook, Instagram, Twitter, YouTube, Feed
|
4 |
Requires at least: 3.6.0
|
5 |
+
Tested up to: 5.7.1
|
6 |
+
Stable tag: 2.9.6
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
Display a Custom Facebook feed, Instagram feed, Twitter feed, and YouTube feed on pages, posts or widgets.
|
72 |
* Log into WordPress dashboard then click **Plugins** > **Add new** > Then under the title "Install Plugins" click **Upload** > **choose the zip** > **Activate the plugin!**
|
73 |
|
74 |
== Changelog ==
|
75 |
+
= Version 2.9.6 Friday, May 7th, 2021 =
|
76 |
+
* FIX: FACEBOOK FEED: 3.2 API depreciation
|
77 |
+
|
78 |
= Version 2.9.5 Monday, April 12th, 2021 =
|
79 |
* FIX: PHP 8.0 compatible.
|
80 |
|