| @@ -31,8 +31,10 @@ | ||
| 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 | + | |
| 35 | 37 | public $orientation = 'horizontal'; |
| 36 | 38 | public $display_mode = 'hidden'; |
| 37 | 39 | public $post_id; |
| 38 | 40 | |
| @@ -78,9 +80,9 @@ | ||
| 78 | 80 | } |
| 79 | 81 | |
| 80 | 82 | if ($collection_id > 0) |
| 81 | 83 | { |
| 82 | - $this->set($collection_id); | |
| 84 | + $this->set($collection_id); // set function loads the block values | |
| 83 | 85 | } |
| 84 | 86 | } |
| 85 | 87 | /* Get all buttons that are currently loaded */ |
| 86 | 88 | /*public function getLoadedButtons() |
| @@ -242,8 +244,9 @@ | ||
| 242 | 244 | // check if on some mobile |
| 243 | 245 | $mobileDetect = new Mobile_Detect; |
| 244 | 246 | $this->is_mobile = $mobileDetect->isMobile(); |
| 245 | 247 | $this->is_tablet = $mobileDetect->isTablet(); |
| 248 | + $this->is_desktop = ($this->is_mobile) ? false : true; | |
| 246 | 249 | |
| 247 | 250 | $options = isset($data['display'][$hook . '_options']) ? $data['display'][$hook . '_options'] : array(); |
| 248 | 251 | |
| 249 | 252 | $orientation = isset($options['orientation']) ? $options['orientation'] : 'auto'; |
| @@ -607,12 +610,12 @@ | ||
| 607 | 610 | if (! $this->is_showable) |
| 608 | 611 | return; |
| 609 | 612 | |
| 610 | 613 | |
| 611 | - /*if (method_exists(MB(), 'load_library')) | |
| 614 | + if (method_exists(MB(), 'load_library')) | |
| 612 | 615 | { |
| 613 | 616 | MB()->load_library('fontawesome'); // always load lib since change is about 100% this includes FA. |
| 614 | - } */ | |
| 617 | + } | |
| 615 | 618 | |
| 616 | 619 | maxUtils::startTime('collection-display-' . self::$count); |
| 617 | 620 | |
| 618 | 621 | $w = MBSocial()->whistle(); |
| @@ -690,9 +693,9 @@ | ||
| 690 | 693 | |
| 691 | 694 | if ($args["style_tag"]) |
| 692 | 695 | $output .= "<style type='text/css'>"; |
| 693 | 696 | |
| 694 | - $output .= $css; | |
| 697 | + $output .= apply_filters('mbsocial/displaycss/', $css); | |
| 695 | 698 | |
| 696 | 699 | if ($args["style_tag"]) |
| 697 | 700 | $output .= "</style>"; |
| 698 | 701 | |
| @@ -739,12 +742,9 @@ | ||
| 739 | 742 | |
| 740 | 743 | if ($args["js_tag"]) |
| 741 | 744 | { |
| 742 | 745 | $output .= "<script type='text/javascript'> "; |
| 743 | -// $output .= " if (typeof MBcollection" . $this->collection_id . " == 'undefined') { "; | |
| 744 | -// $output .= " function MBcollection" . $this->collection_id . "() { "; | |
| 745 | 746 | |
| 746 | - | |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | foreach($js as $index => $code) |
| 750 | 750 | { |
| @@ -804,8 +804,9 @@ | ||
| 804 | 804 | |
| 805 | 805 | $collectionObj->load($node); |
| 806 | 806 | |
| 807 | 807 | $active = ( isset($this->data['network']['network_active']) && is_array($this->data['network']['network_active']) ) ? $this->data['network']['network_active'] : array(); |
| 808 | + | |
| 808 | 809 | if (count($active) == 0 && $args['preview'] == true) |
| 809 | 810 | { |
| 810 | 811 | $networks = $admin->get_default_networks(); |
| 811 | 812 | $use_networks = $networks['unselected']; |
| @@ -825,8 +826,15 @@ | ||
| 825 | 826 | { |
| 826 | 827 | if (! is_object($network)) |
| 827 | 828 | { |
| 828 | 829 | continue; |
| 830 | + } | |
| 831 | + if (! $is_preview) | |
| 832 | + { | |
| 833 | + if ( ($this->is_mobile && ! $network->forMobile() ) || $this->is_desktop && ! $network->forDesktop() ) | |
| 834 | + { | |
| 835 | + continue; | |
| 836 | + } | |
| 829 | 837 | } |
| 830 | 838 | $w->tell('display/parse/network', $network); |
| 831 | 839 | |
| 832 | 840 | $button_args = array('link' => $network->get_url(), |