public function like_box_ifreame_content_generator($atts) { self::$id_for_content++; $atts = shortcode_atts(array('profile_id' => '', 'animation_efect' => 'none', 'background_color' => '', 'theme_color' => 'light', 'border_color' => '#FFFFF', 'show_border' => 'yes', 'stream' => '0', 'connections' => '6', 'width' => '300', 'height' => '550', 'header' => '0', 'locale' => 'en_US'), $atts, 'wpdevart_like_box'); $output = '<iframe id="like_box_content_' . self::$id_for_content . '" src="http://www.facebook.com/plugins/fan.php?id=' . $atts['profile_id'] . '&width=' . $atts['width'] . '&colorscheme=' . $atts['theme_color'] . '&height=' . $atts['height'] . '&connections=' . $atts['connections'] . '&stream=' . $atts['stream'] . '&header=' . $atts['header'] . '&locale=' . $atts['locale'] . '&show_border=' . ($atts['show_border'] == 'yes' ? 'true' : 'false') . '" scrolling="no" frameborder="0" allowTransparency="true" style="' . ($atts['show_border'] == 'yes' ? 'border:1px solid ' . $atts['border_color'] . ';' : 'border:none') . ' overflow:hidden;visibility:hidden; max-width:100%; width:' . $atts['width'] . 'px; height:' . $atts['height'] . 'px;background-color:' . $atts['background_color'] . ';"></iframe>'; $output .= '<script>jQuery(document).ready(function(){like_box_animated_element("' . like_box_setting::get_animations_type_array($atts['animation_efect']) . '","like_box_content_' . self::$id_for_content . '"); jQuery(window).scroll(function(){like_box_animated_element("' . like_box_setting::get_animations_type_array($atts['animation_efect']) . '","like_box_content_' . self::$id_for_content . '");})});</script>'; return $output; }
public static function generete_iframe_by_array($params) { self::$id_for_iframe++; $output_code = ''; //default parametrs for iframe $defaults = array('iframe_id' => 'facbook_like_box_' . self::$id_for_iframe, 'profile_id' => '', 'width' => '300', 'height' => '550', 'show_border' => 'show', 'border_color' => '#FFFFF', 'header' => 'small', 'show_cover_photo' => 'true', 'connections' => 'show', 'stream' => '0', 'animation_efect' => 'none', 'locale' => 'en_US'); $params = array_merge($defaults, $params); $params['width'] = max((int) $params['width'], 180); $params['width'] = min((int) $params['width'], 500); if ($params['header'] == 'small' || $params['header'] == '0' || $params['header'] == 'no') { $params['header'] = 'true'; } else { $params['header'] = 'false'; } if ((int) $params['connections'] > 0 || $params['connections'] == "show") { $params['connections'] = 'true'; } else { $params['connections'] = 'false'; } if ($params['stream'] == '0' || $params['stream'] == 'hide') { $params['stream'] = 'false'; } else { $params['stream'] = 'true'; } if ($params['show_cover_photo'] == 'true' || $params['show_cover_photo'] == 'show') { $params['show_cover_photo'] = 'false'; } else { $params['show_cover_photo'] = 'true'; } $like_box_array_query = array('adapt_container_width' => 'true', 'container_width' => $params['width'], 'width' => $params['width'], 'height' => $params['height'], 'hide_cover' => $params['show_cover_photo'], 'href' => urlencode("https://www.facebook.com/" . $params['profile_id']), 'locale' => $params['locale'], 'sdk' => 'joey', 'show_facepile' => $params['connections'], 'show_posts' => $params['stream'], 'small_header' => $params['header']); $like_box_src = add_query_arg($like_box_array_query, 'http://www.facebook.com/v2.4/plugins/page.php'); $output_code .= '<iframe id="' . $params['iframe_id'] . '" src="' . $like_box_src . '" scrolling="no" allowTransparency="true" style="' . ($params['show_border'] == 'yes' || $params['show_border'] == 'show' ? 'border:1px solid ' . $params['border_color'] . ';' : 'border:none') . ' overflow:hidden;visibility:hidden; max-width:500px; width:' . $params['width'] . 'px; height:' . $params['height'] . 'px;"></iframe>'; $output_code .= '<script> if(typeof(jQuery)=="undefined") jQuery=window.parent.jQuery; if(typeof(like_box_animated_element)=="undefined") like_box_animated_element=window.parent.like_box_animated_element; if(typeof(like_box_set_width_cur_element)=="undefined") like_box_set_width_cur_element=window.parent.like_box_animated_element; jQuery(document).ready(function(){'; if ($params['animation_efect'] != 'none') { $output_code .= ' like_box_animated_element("' . like_box_setting::get_animations_type_array($params['animation_efect']) . '","' . $params['iframe_id'] . '"); like_box_set_width_cur_element("' . $params['iframe_id'] . '",' . $params['width'] . ') jQuery(window).scroll(function(){ like_box_animated_element("' . self::get_animations_type_array($params['animation_efect']) . '","' . $params['iframe_id'] . '"); })'; } else { $output_code .= ' document.getElementById("' . $params['iframe_id'] . '").style.visibility="visible" like_box_set_width_cur_element("' . $params['iframe_id'] . '",' . $params['width'] . ') '; } $output_code .= '});</script>'; return $output_code; }
public function like_box_sibar_slider_in_footer() { if ($this->params['like_box_sidebar_slide_mode'] == 'yes') { $width = $this->params['like_box_sidebar_slide_width']; $width = min(500, (int) $width); $width = max(180, (int) $width); $height = $this->params['like_box_sidebar_slide_height']; $params_of_slideup = array('iframe_id' => 'like_box_slideup', 'profile_id' => $this->params['like_box_sidebar_slide_profile_id'], 'width' => (int) $this->params['like_box_sidebar_slide_width'], 'height' => (int) $this->params['like_box_sidebar_slide_height'], 'show_border' => 'hide', 'border_color' => '#FFFFF', 'header' => $this->params['like_box_sidebar_slide_header'], 'show_cover_photo' => $this->params['like_box_sidebar_slide_cover_photo'], 'connections' => $this->params['like_box_sidebar_slide_connections'], 'stream' => 'hide', 'animation_efect' => 'none', 'locale' => $this->params['like_box_sidebar_slide_locale']); ?> <div class="main_sidbar_slide like_box_slideup_close"> <div class="sidbar_slide_inner_main "> <div class="sidbar_slide_header"> <span class="sidbar_slide_title"><?php echo $this->params['like_box_sidebar_slide_title']; ?> </span> </div> <div class="sidbar_slide_content"> <div class="sidbar_slide_inner"> <?php echo like_box_setting::generete_iframe_by_array($params_of_slideup); ?> </div> </div> </div> </div> </div> <?php $this->css_like_box_sibar_slider_in_footer($width, $height); } }
public function like_box_window_insert_content() { ?> <style> #miain_like_box_window_manager > tbody > tr:nth-child(odd) { background-color: rgba(176, 176, 176, 0.07); } #miain_like_box_window_manager>tfoot>tr>td{ border-top:1px solid #ccc; } #TB_window{ overflow-y: auto; } #TB_ajaxContent{ width:95% !important; } .wp-picker-holder{ position: absolute; z-index: 100000; } .desription_class{ float: right; cursor: default; color: #0074a2; font-size: 18px; font-weight: bold; border: 1px solid #000000; border-radius: 200px; height: 20px; padding-left: 6px; padding-right: 6px; margin-left: 15px; } .pro_feature { font-size: 13px; font-weight: bold; color: rgba(10, 154, 62, 1); } .input_placholder_small{ width: 85%;} .input_placholder_small::-webkit-input-placeholder { font-size:11px; } .input_placholder_small::-moz-placeholder {font-size:11px; } /* firefox 19+ */ .input_placholder_small:-ms-input-placeholder { font-size:11px; } /* ie */ .input_placholder_smallinput:-moz-placeholder { font-size:11px; } </style> <script>var pro_text='"If you want to use this feature upgrade to Like box Pro"'</script> <table id="miain_like_box_window_manager" class="wp-list-table widefat fixed posts section_parametrs_table"> <tbody> <tr> <td> Page ID <span class="desription_class" title="Type here your Facebook like box page url(without https://www.facebook.com/, if your Facebook page url is https://www.facebook.com/uefacom then type here just uefacom).">?</span> </td> <td> <input id="like_box_profile_id" type="text" value="" class="widefat"> </td> </tr> <tr> <td> Like box Animation <span class="pro_feature"> (pro)</span><span class="desription_class" title="Choose Facebook like box Animation type.">?</span> </td> <td> <?php like_box_setting::generete_animation_select('animation_efect', 'none'); ?> </td> </tr> <tr> <td> Show/Hide Like box border <span class="pro_feature"> (pro)</span><span title="Show/Hide Facebook like box border." class="desription_class">?</span> </td> <td> <select onMouseDown="alert(pro_text); return false;" id="like_box_show_border"> <option selected="selected" value="show">Show</option> <option value="hide">Hide</option> </select> </td> </tr> <tr> <td> Like box Border color <span class="pro_feature"> (pro)</span><span title="Type the Border Color of your Facebook Like box." class="desription_class">?</span> </td> <td> <div onClick="alert(pro_text); return false;" class="disabled_picker"> <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div> </div> </td> </tr> <tr> <td> Show/Hide Page Posts <span class="pro_feature"> (pro)</span><span class="desription_class" title="Show/Hide the Page Posts from your Facebook Like box.">?</span> </td> <td> <select onMouseDown="alert(pro_text); return false;" id="like_box_stream"> <option value="show">Show</option> <option selected="selected" value="hide">Hide</option> </select> </td> </tr> <tr> <td> Show/Hide Friends Faces <span title="Select to Show/Hide Friends Faces" class="desription_class">?</span> </td> <td> <select id="like_box_connections"> <option selected="selected" value="show">Show</option> <option value="hide">Hide</option> </select> </td> </tr> <tr id="like_box_static_width"> <td> Like box Width <span title="Type Facebook Like box width" class="desription_class">?</span> </td> <td> <input placeholder="The pixel width of the embed (Min. 180 to Max. 500)" id="like_box_width" type="text" value="300" class="input_placholder_small" ><small>(px)</small> </td> </tr> <tr> <td> Like box Height <span title="Type Facebook Like box height." class="desription_class">?</span> </td> <td> <input placeholder="The pixel height of the embed (Min. 70)" id="like_box_height" type="text" value="550" class="input_placholder_small" ><small>(px)</small> </td> </tr> <tr> <td> Select Like box Header size<span title="Select Like box Header size" class="desription_class">?</span> </td> <td> <select id="like_box_header_size"> <option selected="selected" value="small">Small</option> <option value="big">Big</option> </select> </td> </tr> <tr> <td> Like box cover photo<span title="Select to show/hide Like box cover photo" class="desription_class">?</span> </td> <td> <select id="like_box_cover_photo"> <option selected="selected" value="show">Show</option> <option value="hide">Hide</option> </select> </td> </tr> <tr> <td> Like box language <span title="Type the Facebook Like box language code." class="desription_class">?</span> </td> <td> <input id="like_box_locale" type="text" value="en_US" class="" size="4"><small>(en_US, de_DE...)</small> </td> </tr> </tbody> <tfoot> <tr> <td colspan="2"> <div style="display:inline-block; float:left;" class="mceActionPanel"><input type="button" id="cancel" name="cancel" value="Insert Like Box" class="button button-primary" onClick="insert_like_box();"/></div> <span style="float:right"><a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br></span> </td> </tr> </tfoot> </table> <script type="text/javascript"> jQuery('#TB_window').css('max-height',(jQuery('#miain_like_box_window_manager').height()+66)+'px'); jQuery('#TB_ajaxContent').css('max-height',(jQuery('#miain_like_box_window_manager').height()+16)+'px'); jQuery('#miain_like_box_window_manager').ready(function(e) { jQuery(".color_my_likbox").wpColorPicker(); }); function insert_like_box() { if(jQuery('#like_box_profile_id').val()!=''){ var tagtext; var generete_atributes = 'profile_id="'+jQuery('#like_box_profile_id').val()+'" connections="'+jQuery('#like_box_connections').val()+'" width="'+jQuery('#like_box_width').val()+'" height="'+jQuery('#like_box_height').val()+'" header="'+jQuery('#like_box_header_size').val()+'" cover_photo="'+jQuery('#like_box_cover_photo').val()+'" locale="'+jQuery('#like_box_locale').val()+'"' tagtext = '[wpdevart_like_box '+generete_atributes+']'; window.send_to_editor(tagtext); tb_remove() } else{ alert('Page id field is required') } } </script> </body> </html> <?php die; }
function form($instance) { $defaults = array('title' => '', 'profile_id' => '', 'stream' => 'true', 'connections' => 'show', 'width' => '300', 'height' => '550', 'header' => 'small', 'cover_photo' => 'show', 'locale' => 'en_US'); $instance = wp_parse_args((array) $instance, $defaults); ?> <p class="flb_field"> <label for="title">Title:</label> <br> <input id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo $instance['title']; ?> " class="widefat"> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('profile_id'); ?> ">Page ID:</label> <br> <input id="<?php echo $this->get_field_id('profile_id'); ?> " name="<?php echo $this->get_field_name('profile_id'); ?> " type="text" value="<?php echo $instance['profile_id']; ?> " class="widefat"> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('width'); ?> ">Like box Width:</label> <br> <input id="<?php echo $this->get_field_id('width'); ?> " name="<?php echo $this->get_field_name('width'); ?> " type="text" value="<?php echo $instance['width']; ?> " class="" size="3"> <small>(px)</small> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('height'); ?> ">Like box Height:</label> <br> <input id="<?php echo $this->get_field_id('height'); ?> " name="<?php echo $this->get_field_name('height'); ?> " type="text" value="<?php echo $instance['height']; ?> " class="" size="3"> <small>(px)</small> </p> <label for="this_is_a_bad">Facebook Like box Animation: <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <?php like_box_setting::generete_animation_select('this_is_a_bad', 'none'); ?> <br> <br> <label for="<?php echo $this->get_field_id('show_border'); ?> ">Show Facebook Like box border: <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <select id="show_like_box_border" name="show_like_box_border_name" onMouseDown="alert('If you want to use this feature upgrade to Like box Pro')"> <option selected="selected" value="show">Show</option> <option value="hide">Hide</option> </select> <br> <br> <label for="border_color">Facebook Like box Border Color: <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <div class="disabled_for_pro" onclick="alert('If you want to use this feature upgrade to Like box Pro')"> <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div> </div> <p class="flb_field"> <label for="<?php echo $this->get_field_id('stream'); ?> ">Show Facebook latest posts: <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <select onMouseDown="alert('If you want to use this feature upgrade to Like box Pro')" id="like_box_latest_post" name="like_box_latest_post_name"> <option value="show">Show</option> <option selected="selected" value="hide">Hide</option> </select> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('connections'); ?> ">Show/Hide Friends Faces:</label> <br> <select id="<?php echo $this->get_field_id('connections'); ?> " name="<?php echo $this->get_field_name('connections'); ?> "> <option <?php selected($instance['connections'], 'show'); ?> value="show">Show</option> <option <?php selected($instance['connections'], 'hide'); ?> value="hide">Hide</option> </select> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('header'); ?> ">Select Like box Header size:</label> <br> <select id="<?php echo $this->get_field_id('header'); ?> " name="<?php echo $this->get_field_name('header'); ?> "> <option <?php selected($instance['header'], 'small'); ?> value="small">Small</option> <option <?php selected($instance['header'], 'big'); ?> value="big">Big</option> </select> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('header'); ?> ">Like box cover photo:</label> <br> <select id="<?php echo $this->get_field_id('cover_photo'); ?> " name="<?php echo $this->get_field_name('cover_photo'); ?> "> <option <?php selected($instance['cover_photo'], 'show'); ?> value="show">Show</option> <option <?php selected($instance['cover_photo'], 'hide'); ?> value="hide">Hide</option> </select> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('locale'); ?> ">Like box language:</label> <br> <input id="<?php echo $this->get_field_id('locale'); ?> " name="<?php echo $this->get_field_name('locale'); ?> " type="text" value="<?php echo $instance['locale']; ?> " class="" size="4"> <small>(en_US, de_DE...)</small> </p> <a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br> <br> <br> <input type="hidden" id="flb-submit" name="flb-submit" value="1"> <script> var pro_text='If you want to use this feature upgrade to Like box Pro'; jQuery(".color_my_likbox").ready(function(e) { jQuery(".color_my_likbox").each(function(index, element) { if(!jQuery(this).hasClass('wp-color-picker') && jQuery(this).attr('name').indexOf('__i__')==-1){ jQuery(this).wpColorPicker()}; }); }); </script> <?php }
function form($instance) { $defaults = array('title' => '', 'profile_id' => '', 'connections' => '6', 'width' => '300', 'height' => '550', 'header' => false, 'locale' => 'en_US'); $instance = wp_parse_args((array) $instance, $defaults); ?> <p class="flb_field"> <label for="title">Title:</label> <br> <input id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " type="text" value="<?php echo $instance['title']; ?> " class="widefat"> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('profile_id'); ?> ">Page ID:</label> <br> <input id="<?php echo $this->get_field_id('profile_id'); ?> " name="<?php echo $this->get_field_name('profile_id'); ?> " type="text" value="<?php echo $instance['profile_id']; ?> " class="widefat"> </p> <label>Facebook Like box Theme <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <select onclick="alert('If you want to use this feature upgrade to Like box Pro')"> <option selected="selected" value="light">Light</option> <option value="dark">Dark</option> </select> <br> <br> <label>Facebook Like box Animation<span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <?php like_box_setting::generete_animation_select('gagggoo', 'none'); ?> <br> <br> <label>Facebook Like box background color <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <div class="disabled_for_pro" onclick="alert('If you want to use this feature upgrade to Like box Pro')"> <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div> </div> <br> <label>Facebook Like box Border Color<span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <div class="disabled_for_pro" onclick="alert('If you want to use this feature upgrade to Like box Pro')"> <div class="wp-picker-container"><a tabindex="0" class="wp-color-result" title="Select Color" data-current="Current Color" style="background-color: rgb(255, 255, 255);"></a></div> </div> <br> <label>Show Facebook Like box border <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <br> <input onMouseDown="alert('If you want to use this feature upgrade to Like box Pro')" name="<?php echo $this->get_field_name('show_border'); ?> " type="radio" value="yes" checked='checked'>Yes <input onMouseDown="alert('If you want to use this feature upgrade to Like box Pro')" name="<?php echo $this->get_field_name('show_border'); ?> " type="radio" value="no">No <br> <p class="flb_field"> <label >Show Facebook latest posts: <span style="color:rgba(10, 154, 62, 1);;font-weight:bold;">Pro feature!</span></label> <input onMouseDown="alert('If you want to use this feature upgrade to Like box Pro')" type="checkbox" value="1" > </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('connections'); ?> ">Number of connections:</label> <br> <input id="<?php echo $this->get_field_id('connections'); ?> " name="<?php echo $this->get_field_name('connections'); ?> " type="text" value="<?php echo $instance['connections']; ?> " class="" size="3"> <small>(Max. 100)</small> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('width'); ?> ">Like box Width:</label> <br> <input id="<?php echo $this->get_field_id('width'); ?> " name="<?php echo $this->get_field_name('width'); ?> " type="text" value="<?php echo $instance['width']; ?> " class="" size="3"> <small>(px)</small> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('height'); ?> ">Like box Height:</label> <br> <input id="<?php echo $this->get_field_id('height'); ?> " name="<?php echo $this->get_field_name('height'); ?> " type="text" value="<?php echo $instance['height']; ?> " class="" size="3"> <small>(px)</small> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('header'); ?> ">Facebook Like box header:</label> <input id="<?php echo $this->get_field_id('header'); ?> " name="<?php echo $this->get_field_name('header'); ?> " type="checkbox" value="1" class="" size="" <?php checked($instance['header'], 1); ?> > <small>Show/Hide</small> </p> <p class="flb_field"> <label for="<?php echo $this->get_field_id('locale'); ?> ">Like box language:</label> <br> <input id="<?php echo $this->get_field_id('locale'); ?> " name="<?php echo $this->get_field_name('locale'); ?> " type="text" value="<?php echo $instance['locale']; ?> " class="" size="4"> <small>(en_US, de_DE...)</small> </p> <a href="http://wpdevart.com/wordpress-facebook-like-box-plugin/" target="_blank" style="color: rgba(10, 154, 62, 1);; font-weight: bold; font-size: 18px; text-decoration: none;">Upgrade to Pro Version</a><br> <br> <input type="hidden" id="flb-submit" name="flb-submit" value="1"> <script> var pro_text='If you want to use this feature upgrade to Like box Pro'; jQuery(".color_my_likbox").ready(function(e) { jQuery(".color_my_likbox").each(function(index, element) { if(!jQuery(this).hasClass('wp-color-picker') && jQuery(this).attr('name').indexOf('__i__')==-1){console.log(this); jQuery(this).wpColorPicker()}; }); }); </script> <?php }