PluginProbe
Social Share Buttons / 1.2
Social Share Buttons v1.2
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/class-collection.php +9 -31 1.81.2 View file →
@@ -31,10 +31,8 @@
31 31 public $is_static = false;
32 32 public $is_post = false; // embedded in a post situation
33 33 public $is_mobile = false;
34 34 public $is_tablet = false;
35 - public $is_desktop = false;
36 -
37 35 public $orientation = 'horizontal';
38 36 public $display_mode = 'hidden';
39 37 public $post_id;
40 38
@@ -59,9 +57,9 @@
59 57 $block = collections::getBlock($block_name);
60 58 if ($block)
61 59 {
62 60 $block->setCollection($this);
63 - $default_data = $block->save_fields($default_data, array() ); // force the fields to set a default pos.
61 + $default_data = $block->save_fields($default_data, null ); // force the fields to set a default pos.
64 62
65 63 $this->blocks[$block_name] = $block;
66 64
67 65 }
@@ -80,9 +78,9 @@
80 78 }
81 79
82 80 if ($collection_id > 0)
83 81 {
84 - $this->set($collection_id); // set function loads the block values
82 + $this->set($collection_id);
85 83 }
86 84 }
87 85 /* Get all buttons that are currently loaded */
88 86 /*public function getLoadedButtons()
@@ -244,9 +242,8 @@
244 242 // check if on some mobile
245 243 $mobileDetect = new Mobile_Detect;
246 244 $this->is_mobile = $mobileDetect->isMobile();
247 245 $this->is_tablet = $mobileDetect->isTablet();
248 - $this->is_desktop = ($this->is_mobile) ? false : true;
249 246
250 247 $options = isset($data['display'][$hook . '_options']) ? $data['display'][$hook . '_options'] : array();
251 248
252 249 $orientation = isset($options['orientation']) ? $options['orientation'] : 'auto';
@@ -296,21 +293,8 @@
296 293 elseif (isset($meta['general']['active']) && $is_old_active === 0) // backward for 0.9.5 . Can go at some point
297 294 $this->is_showable = false;
298 295 }
299 296
300 - if ( Install::isPRO() ) {
301 - $show_mobile = (isset($data['display']['show_mobile']) && $data['display']['show_mobile'] == 0) ? false: true;
302 - $show_desktop = (isset($data['display']['show_desktop']) && $data['display']['show_desktop'] == 0) ? false: true;
303 -
304 - if ($this->is_mobile && ! $show_mobile)
305 - {
306 - $this->is_showable = false;
307 - }
308 - if ($this->is_desktop && ! $show_desktop)
309 - {
310 - $this->is_showable = false;
311 - }
312 - }
313 297 // new method of getting data around
314 298 $w->tell('display/env/hook', $hook);
315 299 $w->tell('display/env/post_id', $this->post_id);
316 300 $w->tell('display/env/is_static', $this->is_static );
@@ -623,14 +607,13 @@
623 607 if (! $this->is_showable)
624 608 return;
625 609
626 610
627 - /* 1.8 Deprecated. Not included in MB() anymore, using svg method.
628 - if (method_exists(MB(), 'load_library'))
611 + /*if (method_exists(MB(), 'load_library'))
629 612 {
630 613 MB()->load_library('fontawesome'); // always load lib since change is about 100% this includes FA.
631 - }
632 - */
614 + } */
615 +
633 616 maxUtils::startTime('collection-display-' . self::$count);
634 617
635 618 $w = MBSocial()->whistle();
636 619
@@ -707,9 +690,9 @@
707 690
708 691 if ($args["style_tag"])
709 692 $output .= "<style type='text/css'>";
710 693
711 - $output .= apply_filters('mbsocial/displaycss/', $css);
694 + $output .= $css;
712 695
713 696 if ($args["style_tag"])
714 697 $output .= "</style>";
715 698
@@ -756,9 +739,12 @@
756 739
757 740 if ($args["js_tag"])
758 741 {
759 742 $output .= "<script type='text/javascript'> ";
743 +// $output .= " if (typeof MBcollection" . $this->collection_id . " == 'undefined') { ";
744 +// $output .= " function MBcollection" . $this->collection_id . "() { ";
760 745
746 +
761 747 }
762 748
763 749 foreach($js as $index => $code)
764 750 {
@@ -818,9 +804,8 @@
818 804
819 805 $collectionObj->load($node);
820 806
821 807 $active = ( isset($this->data['network']['network_active']) && is_array($this->data['network']['network_active']) ) ? $this->data['network']['network_active'] : array();
822 -
823 808 if (count($active) == 0 && $args['preview'] == true)
824 809 {
825 810 $networks = $admin->get_default_networks();
826 811 $use_networks = $networks['unselected'];
@@ -840,15 +825,8 @@
840 825 {
841 826 if (! is_object($network))
842 827 {
843 828 continue;
844 - }
845 - if (! $is_preview)
846 - {
847 - if ( ($this->is_mobile && ! $network->forMobile() ) || $this->is_desktop && ! $network->forDesktop() )
848 - {
849 - continue;
850 - }
851 829 }
852 830 $w->tell('display/parse/network', $network);
853 831
854 832 $button_args = array('link' => $network->get_url(),