Exemplo n.º 1
0
function _likebtn_set_post_type_hooks()
{
    $post_types = _likebtn_get_entities(true, false, false, 'keys');
    if (is_array($post_types) && !empty($post_types)) {
        foreach ($post_types as $pt) {
            if (_likebtn_is_metabox_hidden($pt) === false) {
                add_filter('manage_' . $pt . '_posts_columns', 'likebtn_column_heading', 10, 1);
                add_action('manage_' . $pt . '_posts_custom_column', 'likebtn_column_content', 10, 2);
                add_action('manage_edit-' . $pt . '_sortable_columns', 'likebtn_column_sort', 10, 2);
                /*
                 * Use the `get_user_option_{$option}` filter to change the output of the get_user_option
                 * function for the `manage{$screen}columnshidden` option, which is based on the current
                 * admin screen. The admin screen we want to target is the `edit-{$post_type}` screen.
                 */
                $filter = sprintf('get_user_option_%s', sprintf('manage%scolumnshidden', 'edit-' . $pt));
                add_filter($filter, 'likebtn_column_hidden', 10, 3);
            }
        }
    }
}
Exemplo n.º 2
0
 /**
  * Update entity custom fields
  */
 public function deleteCustomFields($identifier)
 {
     global $wpdb;
     $likebtn_entities = _likebtn_get_entities(true, true);
     list($entity_name, $entity_id) = $this->parseIdentifier($identifier);
     $entity_updated = false;
     if (array_key_exists($entity_name, $likebtn_entities) && is_numeric($entity_id)) {
         // set Custom fields
         switch ($entity_name) {
             case LIKEBTN_ENTITY_COMMENT:
                 // Comment
                 $comment = get_comment($entity_id);
                 // check if post exists and is not revision
                 if (!empty($comment) && $comment->comment_type != 'revision') {
                     delete_comment_meta($entity_id, LIKEBTN_META_KEY_LIKES);
                     delete_comment_meta($entity_id, LIKEBTN_META_KEY_DISLIKES);
                     delete_comment_meta($entity_id, LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES);
                     $entity_updated = true;
                 }
                 break;
             case LIKEBTN_ENTITY_BP_ACTIVITY_POST:
             case LIKEBTN_ENTITY_BP_ACTIVITY_UPDATE:
             case LIKEBTN_ENTITY_BP_ACTIVITY_COMMENT:
             case LIKEBTN_ENTITY_BP_ACTIVITY_TOPIC:
                 if (!_likebtn_is_bp_active()) {
                     break;
                 }
                 $bp_activity = $wpdb->get_row("\n                        SELECT id\n                        FROM " . $wpdb->prefix . "bp_activity\n                        WHERE id = {$entity_id}\n                    ");
                 if (!empty($bp_activity)) {
                     bp_activity_delete_meta($entity_id, LIKEBTN_META_KEY_LIKES);
                     bp_activity_delete_meta($entity_id, LIKEBTN_META_KEY_DISLIKES);
                     bp_activity_delete_meta($entity_id, LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES);
                     $entity_updated = true;
                 }
                 break;
             case LIKEBTN_ENTITY_BP_MEMBER:
                 // BuddyPress Member Profile
                 _likebtn_delete_bp_member_votes($entity_id);
                 $entity_updated = true;
                 break;
             case LIKEBTN_ENTITY_BBP_USER:
                 // bbPress Member Profile
                 _likebtn_delete_user_votes($entity_id);
                 $entity_updated = true;
                 break;
             case LIKEBTN_ENTITY_USER:
                 // BuddyPress Member Profile
                 $entity_updated = _likebtn_delete_bp_member_votes($entity_id);
                 // General user and bbPress Member Profile
                 $entity_updated = $entity_updated || _likebtn_delete_user_votes($entity_id);
                 break;
             default:
                 // Post
                 $post = get_post($entity_id);
                 // check if post exists and is not revision
                 if (!empty($post) && !empty($post->post_type) && $post->post_type != 'revision') {
                     delete_post_meta($entity_id, LIKEBTN_META_KEY_LIKES);
                     delete_post_meta($entity_id, LIKEBTN_META_KEY_DISLIKES);
                     delete_post_meta($entity_id, LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES);
                     $entity_updated = true;
                 }
                 break;
         }
     }
     // Check custom item
     $item_db = $wpdb->get_row($wpdb->prepare("SELECT likes, dislikes\n                FROM " . $wpdb->prefix . LIKEBTN_TABLE_ITEM . "\n                WHERE identifier = %s", $identifier));
     // Custom identifier
     if ($item_db || !$entity_updated) {
         $where = array('identifier' => $identifier);
         $result = $wpdb->delete($wpdb->prefix . LIKEBTN_TABLE_ITEM, $where);
         if ($result) {
             $entity_updated = true;
         }
     }
     return $entity_updated;
 }
    function form($instance)
    {
        global $likebtn_entities;
        $instance = LikeBtnLikeButtonMostLikedWidget::prepareInstance($instance);
        $widget_mnemonic = time() + mt_rand(0, 10000000);
        $likebtn_entities = _likebtn_get_entities(true);
        // Custom item
        $likebtn_entities[LIKEBTN_ENTITY_CUSTOM_ITEM] = __('Custom item');
        $order_list = array('likes' => __('Likes', LIKEBTN_I18N_DOMAIN), 'dislikes' => __('Dislikes', LIKEBTN_I18N_DOMAIN), 'likes_minus_dislikes' => __('Likes minus dislikes', LIKEBTN_I18N_DOMAIN));
        $thumbnail_size_list = array('thumbnail' => __('Thumbnail', LIKEBTN_I18N_DOMAIN), 'medium' => __('Medium', LIKEBTN_I18N_DOMAIN), 'large' => __('Large', LIKEBTN_I18N_DOMAIN), 'full' => __('Full size', LIKEBTN_I18N_DOMAIN));
        $time_range_list = array('all' => __('All time', LIKEBTN_I18N_DOMAIN), '1' => __('1 day', LIKEBTN_I18N_DOMAIN), '2' => __('2 days', LIKEBTN_I18N_DOMAIN), '3' => __('3 days', LIKEBTN_I18N_DOMAIN), '7' => __('1 week', LIKEBTN_I18N_DOMAIN), '14' => __('2 weeks', LIKEBTN_I18N_DOMAIN), '21' => __('3 weeks', LIKEBTN_I18N_DOMAIN), '1m' => __('1 month', LIKEBTN_I18N_DOMAIN), '2m' => __('2 months', LIKEBTN_I18N_DOMAIN), '3m' => __('3 months', LIKEBTN_I18N_DOMAIN), '6m' => __('6 months', LIKEBTN_I18N_DOMAIN), '1y' => __('1 year', LIKEBTN_I18N_DOMAIN));
        // Normalize instance
        if (!isset($instance['title'])) {
            $instance['title'] = __('Most Liked Content', LIKEBTN_I18N_DOMAIN);
        }
        if (empty($instance['entity_name']) || !is_array($instance['entity_name'])) {
            $instance['entity_name'] = self::$instance_default['entity_name'];
        }
        if (empty($instance['number']) || (int) $instance['number'] < 1) {
            $instance['number'] = self::$instance_default['number'];
        }
        if (empty($instance['order'])) {
            $instance['order'] = self::$instance_default['order'];
        }
        if (empty($instance['time_range'])) {
            $instance['time_range'] = self::$instance_default['time_range'];
        }
        if (empty($instance['thumbnail_size'])) {
            $instance['thumbnail_size'] = self::$instance_default['thumbnail_size'];
        }
        /*if (empty($instance['show_likes'])) {
              $instance['show_likes'] = '';
          }
          if (empty($instance['show_dislikes'])) {
              $instance['show_dislikes'] = '';
          }
          if (empty($instance['show_thumbnail'])) {
              $instance['show_thumbnail'] = '1';
          }
          if (empty($instance['show_excerpt'])) {
              $instance['show_excerpt'] = '';
          }
          if (empty($instance['show_date'])) {
              $instance['show_date'] = '';
          }*/
        ?>
        <div id="likebtn_widget_<?php 
        echo $widget_mnemonic;
        ?>
">
            <p>
                <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title', LIKEBTN_I18N_DOMAIN);
        ?>
:</label>
                <input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo $instance['title'];
        ?>
" data-property="title" />
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('entity_name');
        ?>
"><?php 
        _e('Items to show', LIKEBTN_I18N_DOMAIN);
        ?>
:</label><br/>
                <?php 
        /*<select name="<?php echo $this->get_field_name('entity_name'); ?>[]" id="<?php echo $this->get_field_id('entity_name'); ?>" multiple="multiple" size="6" style="height:auto !important;">
              <?php foreach ($likebtn_entities as $entity_name_value => $entity_title): ?>
                  <option value="<?php echo $entity_name_value; ?>" <?php echo (in_array($entity_name_value, $instance['entity_name']) ? 'selected="selected"' : ''); ?> ><?php _e($entity_title, LIKEBTN_I18N_DOMAIN); ?></option>
              <?php endforeach ?>
          </select>*/
        ?>
                <?php 
        foreach ($likebtn_entities as $entity_name_value => $entity_title) {
            ?>
                    <input type="checkbox" name="<?php 
            echo $this->get_field_name('entity_name');
            ?>
[]" id="<?php 
            echo $this->get_field_id('entity_name');
            ?>
_<?php 
            echo $entity_name_value;
            ?>
" value="<?php 
            echo $entity_name_value;
            ?>
" <?php 
            echo in_array($entity_name_value, $instance['entity_name']) ? 'checked="checked"' : '';
            ?>
 data-property="entity_name" /> <label for="<?php 
            echo $this->get_field_id('entity_name');
            ?>
_<?php 
            echo $entity_name_value;
            ?>
"><?php 
            _e($entity_title, LIKEBTN_I18N_DOMAIN);
            ?>
</label><br/>
                <?php 
        }
        ?>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('number');
        ?>
"><?php 
        _e('Number of items to show:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <input type="text" id="<?php 
        echo $this->get_field_id('number');
        ?>
" name="<?php 
        echo $this->get_field_name('number');
        ?>
" value="<?php 
        echo $instance['number'];
        ?>
" size="3" data-property="number" />
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('order');
        ?>
"><?php 
        _e('Order by:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('order');
        ?>
" id="<?php 
        echo $this->get_field_id('order');
        ?>
" data-property="order" >
                    <?php 
        foreach ($order_list as $order_value => $order_name) {
            ?>
                        <option value="<?php 
            echo $order_value;
            ?>
" <?php 
            selected($order_value, $instance['order']);
            ?>
 ><?php 
            _e($order_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('time_range');
        ?>
"><?php 
        _e('Time range:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('time_range');
        ?>
" id="<?php 
        echo $this->get_field_id('time_range');
        ?>
" data-property="time_range" >
                    <?php 
        foreach ($time_range_list as $time_range_value => $time_range_name) {
            ?>
                        <option value="<?php 
            echo $time_range_value;
            ?>
" <?php 
            selected($time_range_value, $instance['time_range']);
            ?>
 ><?php 
            _e($time_range_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <input class="checkbox" type="checkbox" id="<?php 
        echo $this->get_field_id('show_likes');
        ?>
" name="<?php 
        echo $this->get_field_name('show_likes');
        ?>
" value="1" <?php 
        checked($instance['show_likes']);
        ?>
 data-property="show_likes" />
                <label for="<?php 
        echo $this->get_field_id('show_likes');
        ?>
"><?php 
        _e('Display likes count', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" id="<?php 
        echo $this->get_field_id('show_dislikes');
        ?>
" name="<?php 
        echo $this->get_field_name('show_dislikes');
        ?>
" value="1" <?php 
        checked($instance['show_dislikes']);
        ?>
 data-property="show_dislikes" />
                <label for="<?php 
        echo $this->get_field_id('show_dislikes');
        ?>
"><?php 
        _e('Display dislikes count', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_thumbnail']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_thumbnail');
        ?>
" name="<?php 
        echo $this->get_field_name('show_thumbnail');
        ?>
" value="1" data-property="show_thumbnail" />
                <label for="<?php 
        echo $this->get_field_id('show_thumbnail');
        ?>
"><?php 
        _e('Display featured image', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('thumbnail_size');
        ?>
" id="<?php 
        echo $this->get_field_id('thumbnail_size');
        ?>
" data-property="thumbnail_size" >
                    <?php 
        foreach ($thumbnail_size_list as $thumbnail_size_value => $thumbnail_size_name) {
            ?>
                        <option value="<?php 
            echo $thumbnail_size_value;
            ?>
" <?php 
            selected($thumbnail_size_value, $instance['thumbnail_size']);
            ?>
 ><?php 
            _e($thumbnail_size_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_excerpt']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
" name="<?php 
        echo $this->get_field_name('show_excerpt');
        ?>
" value="1" data-property="show_excerpt" />
                <label for="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
"><?php 
        _e('Display excerpt', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_date']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_date');
        ?>
" name="<?php 
        echo $this->get_field_name('show_date');
        ?>
" value="1" data-property="show_date" />
                <label for="<?php 
        echo $this->get_field_id('show_date');
        ?>
"><?php 
        _e('Display item date', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <a href="javascript:likebtnWidgetShortcode('<?php 
        echo $widget_mnemonic;
        ?>
')"><?php 
        _e('Get shortcode', LIKEBTN_I18N_DOMAIN);
        ?>
</a> <small>▼</small>
            </p>
            <p id="likebtn_sc_wr_<?php 
        echo $widget_mnemonic;
        ?>
" class="likebtn_sc_wr">
                <textarea class="likebtn_input likebtn_disabled" rows="5" id="likebtn_sc_<?php 
        echo $widget_mnemonic;
        ?>
" readonly="readonly"></textarea>
            </p>
        </div>
        <script type="text/javascript">
            jQuery(document).ready(function() {
                jQuery("#likebtn_widget_<?php 
        echo $widget_mnemonic;
        ?>
 :input").on("keyup change", function(event) {
                    likebtnWidgetShortcode('<?php 
        echo $widget_mnemonic;
        ?>
', true);
                });
            });
        </script>
        <?php 
    }
Exemplo n.º 4
0
function likebtn_admin_votes()
{
    global $likebtn_page_sizes;
    global $wpdb;
    wp_enqueue_script('jquery-ui-dialog');
    wp_enqueue_style("wp-jquery-ui-dialog");
    $query_parameters = array();
    $likebtn_entities = _likebtn_get_entities(true);
    // Custom item
    $likebtn_entities[LIKEBTN_ENTITY_CUSTOM_ITEM] = __('Custom item');
    // Multisite - available for super admin only
    $blogs = array();
    $blog_list = array();
    $votes_blog_id = '';
    $prefix_prepared = $wpdb->prefix;
    if (is_multisite() && is_super_admin()) {
        global $blog_id;
        $blog_list = $wpdb->get_results("\n            SELECT blog_id, domain\n            FROM {$wpdb->blogs}\n            WHERE site_id = '{$wpdb->siteid}'\n            AND spam = '0'\n            AND deleted = '0'\n            AND archived = '0'\n            ORDER BY blog_id\n        ");
        // Place current blog on the first place
        foreach ($blog_list as $blog) {
            if ($blog->blog_id == $blog_id) {
                $blogs["{$blog->blog_id}"] = get_blog_option($blog->blog_id, 'blogname') . ' - ' . $blog->domain;
                break;
            }
        }
        foreach ($blog_list as $blog) {
            if ($blog->blog_id != $blog_id) {
                $blogs["{$blog->blog_id}"] = get_blog_option($blog->blog_id, 'blogname') . ' - ' . $blog->domain;
            }
        }
        // Add all
        $blogs['all'] = __('All Sites');
        // Determine selected blog id
        if (isset($_GET['likebtn_blog_id'])) {
            if ($_GET['likebtn_blog_id'] == 'all') {
                $votes_blog_id = $_GET['likebtn_blog_id'];
            } else {
                // Check if blog with ID exists
                foreach ($blog_list as $blog) {
                    if ($blog->blog_id == (int) $_GET['likebtn_blog_id']) {
                        $votes_blog_id = (int) $_GET['likebtn_blog_id'];
                        break;
                    }
                }
            }
        }
        // Prepare prefix if this is not main blog
        if ($blog_id != 1) {
            $prefix_prepared = substr($wpdb->prefix, 0, strlen($wpdb->prefix) - strlen($blog_id) - 1);
        }
    }
    $entity_name = '';
    if (!empty($_GET['likebtn_entity_name'])) {
        $entity_name = $_GET['likebtn_entity_name'];
    }
    $page_size = LIKEBTN_STATISTIC_PAGE_SIZE;
    if (isset($_GET['likebtn_page_size'])) {
        $page_size = LIKEBTN_STATISTIC_PAGE_SIZE;
    }
    $post_id = '';
    if (isset($_GET['likebtn_post_id'])) {
        $post_id = trim(stripcslashes($_GET['likebtn_post_id']));
    }
    $user_id = '';
    if (isset($_GET['likebtn_user_id'])) {
        $user_id = trim(stripcslashes($_GET['likebtn_user_id']));
    }
    $ip = '';
    if (isset($_GET['likebtn_ip'])) {
        $ip = trim($_GET['likebtn_ip']);
    }
    $vote_type = '';
    if (isset($_GET['likebtn_vote_type'])) {
        $vote_type = trim($_GET['likebtn_vote_type']);
    }
    // pagination
    require_once dirname(__FILE__) . '/likebtn_like_button_pagination.class.php';
    $pagination_target = "admin.php?page=likebtn_votes";
    foreach ($_GET as $get_parameter => $get_value) {
        $pagination_target .= '&' . $get_parameter . '=' . stripcslashes($get_value);
    }
    $p = new LikeBtnLikeButtonPagination();
    $p->limit($page_size);
    // Limit entries per page
    $p->target($pagination_target);
    //$p->currentPage(); // Gets and validates the current page
    $p->prevLabel(__('Previous', LIKEBTN_I18N_DOMAIN));
    $p->nextLabel(__('Next', LIKEBTN_I18N_DOMAIN));
    if (!isset($_GET['paging'])) {
        $p->page = 1;
    } else {
        $p->page = $_GET['paging'];
    }
    $query_select = '';
    $query_join = '';
    // query for limit paging
    $query_limit = "LIMIT " . ($p->page - 1) * $p->limit . ", " . $p->limit;
    // query parameters
    $query_where = '';
    // Post type and ID
    if ($entity_name && $post_id && $entity_name != LIKEBTN_ENTITY_CUSTOM_ITEM) {
        $query_where .= ' AND v.identifier = %s ';
        $query_parameters[] = $entity_name . '_' . $post_id;
    } elseif ($entity_name == LIKEBTN_ENTITY_CUSTOM_ITEM && $post_id) {
        $query_where .= ' AND i.ID is not NULL AND v.identifier = %s ';
        $query_parameters[] = $post_id;
    } elseif ($entity_name == LIKEBTN_ENTITY_CUSTOM_ITEM) {
        $query_where .= ' AND i.ID is not NULL ';
    } elseif ($entity_name) {
        $query_where .= ' AND v.identifier LIKE "' . esc_sql($entity_name) . '_%%" ';
    } elseif ($post_id) {
        $query_where .= ' AND v.identifier LIKE "%%_%d" ';
        $query_parameters[] = $post_id;
    }
    // Order by
    $query_orderby = ' ORDER BY created_at DESC ';
    // User ID
    if ($user_id) {
        $query_where .= ' AND v.user_id = %d ';
        $query_parameters[] = $user_id;
    }
    // IP
    if ($ip) {
        $query_where .= ' AND v.ip = %s ';
        $query_parameters[] = $ip;
    }
    // Vote type
    if ($vote_type) {
        $query_where .= ' AND v.type = %d ';
        $query_parameters[] = $vote_type;
    }
    // For Multisite
    $query = '';
    if ($votes_blog_id && $votes_blog_id != 1 && $votes_blog_id != 'all') {
        $prefix = "{$prefix_prepared}{$votes_blog_id}_";
        $query = _likebtn_get_votes_sql($prefix, $query_where, $query_orderby, $query_limit, 'SQL_CALC_FOUND_ROWS ' . $query_select, $query_join);
        $query_prepared = $wpdb->prepare($query, $query_parameters);
    } else {
        if ($votes_blog_id == 'all') {
            foreach ($blog_list as $blog) {
                if ($blog->blog_id == 1) {
                    $prefix = $prefix_prepared;
                } else {
                    $prefix = "{$prefix_prepared}{$blog->blog_id}_";
                }
                $query_list[] = $wpdb->prepare(_likebtn_get_votes_sql($prefix, $query_where, '', '', $blog->blog_id . ' as blog_id, ' . $query_select, $query_join), $query_parameters);
            }
            $query_prepared = ' SELECT SQL_CALC_FOUND_ROWS * from (' . implode(' UNION ', $query_list) . ") query {$query_orderby} {$query_limit} ";
        } else {
            $query = _likebtn_get_votes_sql($prefix_prepared, $query_where, $query_orderby, $query_limit, 'SQL_CALC_FOUND_ROWS ' . $query_select, $query_join);
            if (count($query_parameters)) {
                $query_prepared = $wpdb->prepare($query, $query_parameters);
            } else {
                $query_prepared = $query;
            }
        }
    }
    // echo "<pre>";
    // echo $query;
    // echo $query_prepared;
    // echo $wpdb->prepare($query, $query_parameters);
    // $wpdb->show_errors();
    // exit();
    $votes = $wpdb->get_results($query_prepared);
    $total_found = 0;
    if (isset($votes[0])) {
        $query_found_rows = "SELECT FOUND_ROWS() as found_rows";
        $found_rows = $wpdb->get_results($query_found_rows);
        $total_found = (int) $found_rows[0]->found_rows;
        $p->items($total_found);
        $p->calculate();
        // Calculates what to show
        $p->parameterName('paging');
        $p->adjacents(1);
        // No. of page away from the current page
    } else {
        $votes = array();
    }
    $loader = _likebtn_get_public_url() . 'img/ajax_loader_hor.gif';
    likebtn_admin_header();
    ?>

    <script type="text/javascript">
        var likebtn_msg_ip_info = '<?php 
    _e("IP Info", LIKEBTN_I18N_DOMAIN);
    ?>
';
    </script>

    <div>
        <a href="javascript:jQuery('#likebtn_no_vts').toggle();void(0);"><?php 
    _e('Do not see votes?', LIKEBTN_I18N_DOMAIN);
    ?>
</a>
        <div id="likebtn_no_vts">
            <p class="description">
                ● <?php 
    _e('Votes for Custom items appear in the list after synchronization.', LIKEBTN_I18N_DOMAIN);
    ?>
            </p>
        </div>
        <br/><br/>
        <form action="" method="get" id="votes_form" autocomplete="off">
            <input type="hidden" name="page" value="likebtn_votes" />
            <div class="postbox statistics_filter_container">
                <div class="inside">
                    <label><?php 
    _e('Item Type', LIKEBTN_I18N_DOMAIN);
    ?>
:</label>
                    <select name="likebtn_entity_name" >
                        <option value="">-- <?php 
    _e('Any', LIKEBTN_I18N_DOMAIN);
    ?>
 --</option>
                        <?php 
    foreach ($likebtn_entities as $entity_name_value => $entity_title) {
        ?>
                            <option value="<?php 
        echo $entity_name_value;
        ?>
" <?php 
        selected($entity_name, $entity_name_value);
        ?>
 ><?php 
        _e($entity_title, LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                        <?php 
    }
    ?>
                    </select>
                    &nbsp;&nbsp;
                    <label><?php 
    _e('Item ID', LIKEBTN_I18N_DOMAIN);
    ?>
:</label>
                    <input type="text" name="likebtn_post_id" value="<?php 
    echo htmlspecialchars($post_id);
    ?>
" size="10" />
                    <br/><br/>
                    <label><?php 
    _e('User ID', LIKEBTN_I18N_DOMAIN);
    ?>
:</label>
                    <input type="text" name="likebtn_user_id" value="<?php 
    echo htmlspecialchars($user_id);
    ?>
" size="10" />
                    &nbsp;&nbsp;
                    <label><?php 
    _e('IP');
    ?>
:</label>
                    <input type="text" name="likebtn_ip" value="<?php 
    echo htmlspecialchars($ip);
    ?>
" size="20"/>
                    &nbsp;&nbsp;
                    <label><?php 
    _e('Vote Type', LIKEBTN_I18N_DOMAIN);
    ?>
:</label>
                    <select name="likebtn_vote_type" >
                        <option value="">-- <?php 
    _e('Likes & Dislikes', LIKEBTN_I18N_DOMAIN);
    ?>
 --</option>
                        <option value="1" <?php 
    selected((int) $vote_type, 1);
    ?>
 ><?php 
    _e('Likes', LIKEBTN_I18N_DOMAIN);
    ?>
</option>
                        <option value="-1" <?php 
    selected((int) $vote_type, -1);
    ?>
 ><?php 
    _e('Dislikes', LIKEBTN_I18N_DOMAIN);
    ?>
</option>
                    </select>

                    &nbsp;&nbsp;
                    <input class="button-secondary" type="button" name="reset" value="<?php 
    _e('Reset filter', LIKEBTN_I18N_DOMAIN);
    ?>
" onClick="jQuery('.statistics_filter_container :input[type!=button]').val('');
                jQuery('#votes_form').submit();"/>
                </div>
            </div>

            <?php 
    if ($blogs) {
        ?>
                <label><?php 
        _e('Site', LIKEBTN_I18N_DOMAIN);
        ?>
:</label>
                <select name="likebtn_blog_id" >
                    <?php 
        foreach ($blogs as $blog_id_value => $blog_title) {
            ?>
                        <option value="<?php 
            echo $blog_id_value;
            ?>
" <?php 
            selected($votes_blog_id, $blog_id_value);
            ?>
 ><?php 
            echo $blog_title;
            ?>
</option>
                    <?php 
        }
        ?>
                </select>&nbsp;&nbsp;
            <?php 
    }
    ?>
            
            <label><?php 
    _e('Page Size', LIKEBTN_I18N_DOMAIN);
    ?>
:</label>
            <select name="likebtn_page_size" >
                <?php 
    foreach ($likebtn_page_sizes as $page_size_value) {
        ?>
                    <option value="<?php 
        echo $page_size_value;
        ?>
" <?php 
        selected($page_size, $page_size_value);
        ?>
 ><?php 
        echo $page_size_value;
        ?>
</option>
                <?php 
    }
    ?>

            </select><br/><br/>
            <input class="button-primary" type="submit" name="show" value="<?php 
    _e('View', LIKEBTN_I18N_DOMAIN);
    ?>
" /> 
            &nbsp;
            <?php 
    _e('Votes Found', LIKEBTN_I18N_DOMAIN);
    ?>
: <strong><?php 
    echo $total_found;
    ?>
</strong>
        </form>
        <br/>
        <form method="post" action="" id="votes_actions_form">
            <input type="hidden" name="bulk_action" value="" id="stats_bulk_action" />
        <?php 
    if (count($votes) && $p->lastpage > 1) {
        ?>
            <div class="tablenav">
                <div class="tablenav-pages">
                    <?php 
        echo $p->show();
        ?>
                </div>
            </div>
        <?php 
    }
    ?>
        <table class="widefat" id="votes_container">
            <thead>
                <tr>
                    <?php 
    /*<th><input type="checkbox" onclick="statisticsItemsCheckbox(this)" value="all" style="margin:0"></th>*/
    ?>
                    <?php 
    if ($blogs && $votes_blog_id == 'all') {
        ?>
                        <th><?php 
        _e('Site');
        ?>
</th>
                    <?php 
    }
    ?>
                    <th colspan="2"><?php 
    _e('User', LIKEBTN_I18N_DOMAIN);
    ?>
</th>
                    <th>IP</th>
                    <th><?php 
    _e('Date', LIKEBTN_I18N_DOMAIN);
    ?>
</th>
                    <th><?php 
    _e('Type', LIKEBTN_I18N_DOMAIN);
    ?>
</th>
                    <th><?php 
    _e('Item', LIKEBTN_I18N_DOMAIN);
    ?>
</th>
                </tr>
            </thead>
            <tbody>
                <?php 
    foreach ($votes as $votes_item) {
        ?>
                    <?php 
        $entity_info = _likebtn_parse_identifier($votes_item->identifier);
        $avatar_url = '';
        if ($votes_item->user_id) {
            $avatar_url = _likebtn_get_avatar_url($votes_item->user_id);
        }
        $user_url = '';
        if ($votes_item->user_id) {
            $user_url = _likebtn_get_entity_url(LIKEBTN_ENTITY_USER, $votes_item->user_id);
        }
        $item_title = '';
        $item_url = '';
        if ($votes_item->item_id) {
            $item_title = $votes_item->identifier;
            $item_url = $votes_item->url;
            $entity_type_name = __('Custom Item', LIKEBTN_I18N_DOMAIN);
        } else {
            if ($entity_info['entity_name'] && $entity_info['entity_id']) {
                $item_title = _likebtn_get_entity_title($entity_info['entity_name'], $entity_info['entity_id']);
                $item_title = _likebtn_prepare_title($entity_info['entity_name'], $item_title);
                $item_url = _likebtn_get_entity_url($entity_info['entity_name'], $entity_info['entity_id'], '', $votes_blog_id);
            }
            $entity_type_name = _likebtn_get_entity_name_title($entity_info['entity_name']);
        }
        if ((int) $votes_item->type == 1) {
            $entity_vote_type = 'like';
        } else {
            $entity_vote_type = 'dislike';
        }
        ?>

                    <tr id="vote_<?php 
        echo $votes_item->id;
        ?>
">
                        <?php 
        /*<td><input type="checkbox" class="item_checkbox" value="<?php echo $votes_item->post_id; ?>" name="item[]" <?php if ($blogs && $votes_item->blog_id != $blog_id): ?>disabled="disabled"<?php endif ?>></td>*/
        ?>
                        <?php 
        if ($blogs && $votes_blog_id == 'all') {
            ?>
                            <td><?php 
            echo get_blog_option($votes_item->blog_id, 'blogname');
            ?>
</td>
                        <?php 
        }
        ?>
                        <?php 
        if ($avatar_url) {
            ?>
                            <td width="32">
                                <a href="<?php 
            echo $user_url;
            ?>
" target="_blank"><img src="<?php 
            echo $avatar_url;
            ?>
" width="32" height="32" /></a>
                            </td>
                        <?php 
        }
        ?>
                        <td <?php 
        if (!$avatar_url) {
            ?>
colspan="2"<?php 
        }
        ?>
>
                            <?php 
        if ($votes_item->user_id) {
            ?>
                                <a href="<?php 
            echo $user_url;
            ?>
" target="_blank"><?php 
            echo _likebtn_get_entity_title(LIKEBTN_ENTITY_USER, $votes_item->user_id);
            ?>
</a>
                            <?php 
        } else {
            ?>
                                <?php 
            echo __('Anonymous', LIKEBTN_I18N_DOMAIN);
            ?>
                            <?php 
        }
        ?>
                        </td>
                        <td><a href="javascript:likebtnIpInfo('<?php 
        echo $votes_item->ip;
        ?>
');" class="likebtn_ttip" title="<?php 
        _e('View IP info', LIKEBTN_I18N_DOMAIN);
        ?>
"><?php 
        echo $votes_item->ip;
        ?>
</a></td>
                        <td><?php 
        echo date("Y.m.d H:i:s", strtotime($votes_item->created_at));
        ?>
</td>
                        <td>
                            <img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/thumb/<?php 
        echo $entity_vote_type;
        ?>
.png" alt="<?php 
        _e(ucfirst($entity_vote_type), LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e(ucfirst($entity_vote_type), LIKEBTN_I18N_DOMAIN);
        ?>
" class="likebtn_ttip" />
                        </td>
                        <td><a href="<?php 
        echo $item_url;
        ?>
" target="_blank"><?php 
        echo $item_title;
        ?>
</a> 
                            <?php 
        if ($entity_type_name) {
            ?>
                                — <?php 
            echo $entity_type_name;
            ?>
                            <?php 
        }
        ?>
                        </td>
                    </tr>
                <?php 
    }
    ?>
            </tbody>
        </table>
        </form>
        <?php 
    if (count($votes) && $p->lastpage > 1) {
        ?>
            <div class="tablenav">
                <div class="tablenav-pages">
                    <?php 
        echo $p->show();
        ?>
                </div>
            </div>
        <?php 
    }
    ?>

    </div>

    <div id="likebtn_ip_info" class="likebtn_ip_info hidden">
        <div class="likebtn_ip_info_map"></div>
        <table class="widefat">
            <tr>
                <th><strong>IP</strong></th>
                <td class="likebtn-ii-ip" width="50%"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('Country', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-country"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('City', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-city"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('Lat/Long', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-latlon"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('Postal Code', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-postal"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('Network', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-network"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
            <tr>
                <th><strong><?php 
    _e('Hostname', LIKEBTN_I18N_DOMAIN);
    ?>
</strong></th>
                <td class="likebtn-ii-hostname"><img src="<?php 
    echo $loader;
    ?>
" /></td>
            </tr>
        </table>
        <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
            <div class="ui-dialog-buttonset">
                <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only button-secondary likebtn-button-close" role="button"><span class="ui-button-text"><?php 
    _e('Close', LIKEBTN_I18N_DOMAIN);
    ?>
</span></button>
            </div>
        </div>
    </div>
    <script async defer
        src="https://maps.googleapis.com/maps/api/js?v=3.exp&callback=showMap">
    </script>
    <?php 
    _likebtn_admin_footer();
}
function likebtn_db_update_7()
{
    global $wpdb;
    //_likebtn_add_options();
    $likebtn_entities = _likebtn_get_entities();
    foreach ($likebtn_entities as $entity_name => $entity_title) {
        $option_name = 'likebtn_settings_popup_enabled_' . $entity_name;
        $option_exists = $wpdb->get_row("\n            SELECT option_value\n            FROM " . $wpdb->prefix . "options\n            WHERE option_name = '{$option_name}'\n        ");
        if ($option_exists) {
            if ((int) $option_exists->option_value != 1) {
                update_option('likebtn_settings_popup_disabled_' . $entity_name, '1');
            }
        }
    }
}
function likebtn_db_update_9()
{
    $likebtn_entities = _likebtn_get_entities();
    foreach ($likebtn_entities as $entity_name => $entity_title) {
        // New options added
        _likebtn_add_default_options($entity_name);
        // Backward compatibility
        if (get_option('likebtn_settings_display_only_' . $entity_name)) {
            if (get_option('likebtn_settings_display_only_' . $entity_name) == '1') {
                update_option('likebtn_settings_voting_enabled_' . $entity_name, '0');
            }
            delete_option('likebtn_settings_display_only_' . $entity_name);
        }
        if (get_option('likebtn_settings_unlike_allowed_' . $entity_name)) {
            if (get_option('likebtn_settings_unlike_allowed_' . $entity_name) == '1') {
                update_option('likebtn_settings_voting_cancelable_' . $entity_name, '1');
            }
            delete_option('likebtn_settings_unlike_allowed_' . $entity_name);
        }
        if (get_option('likebtn_settings_like_dislike_at_the_same_time_' . $entity_name)) {
            if (get_option('likebtn_settings_like_dislike_at_the_same_time_' . $entity_name) == '1') {
                update_option('likebtn_settings_voting_both_' . $entity_name, '1');
            }
            delete_option('likebtn_settings_like_dislike_at_the_same_time_' . $entity_name);
        }
        if (get_option('likebtn_settings_show_copyright_' . $entity_name) === '0') {
            update_option('likebtn_settings_white_label_' . $entity_name, '1');
            delete_option('likebtn_settings_show_copyright_' . $entity_name);
        }
        if (get_option('likebtn_settings_style_' . $entity_name)) {
            update_option('likebtn_settings_theme_' . $entity_name, get_option('likebtn_settings_style_' . $entity_name));
            delete_option('likebtn_settings_style_' . $entity_name);
        }
        if (get_option('likebtn_settings_revote_period_' . $entity_name)) {
            update_option('likebtn_settings_voting_frequency_' . $entity_name, get_option('likebtn_settings_revote_period_' . $entity_name));
            delete_option('likebtn_settings_revote_period_' . $entity_name);
        }
        // Process likebtn_post_view_mode_ for Excerpt entities
        if (_likebtn_has_list_flag($entity_name)) {
            $original_name = _likebtn_cut_list_flag($entity_name);
            if (get_option('likebtn_post_view_mode_' . $entity_name) && get_option('likebtn_show_' . $original_name) == '1') {
                if (in_array(get_option('likebtn_post_view_mode_' . $entity_name), array('excerpt', 'both')) && get_option('likebtn_show_' . $entity_name) != '1') {
                    update_option('likebtn_show_' . $entity_name, '1');
                    update_option('likebtn_use_settings_from_' . $entity_name, $original_name);
                }
                delete_option('likebtn_post_view_mode_' . $entity_name);
            }
        }
    }
}
    function form($instance)
    {
        global $likebtn_entities;
        // Enque scripts
        wp_register_script('select2', _likebtn_get_public_url() . 'js/jquery/select2/select2.js', array('jquery'), LIKEBTN_VERSION, true);
        wp_register_style('select2-css', _likebtn_get_public_url() . 'css/jquery/select2/select2.css', false, LIKEBTN_VERSION, 'all');
        wp_enqueue_script('select2');
        wp_enqueue_style('select2-css');
        $instance = LikeBtnLikeButtonMostLikedWidget::prepareInstance($instance);
        $widget_mnemonic = time() + mt_rand(0, 10000000);
        $likebtn_entities = _likebtn_get_entities(true);
        // Custom item
        $likebtn_entities[LIKEBTN_ENTITY_CUSTOM_ITEM] = __('Custom item');
        $order_list = array('likes' => __('Likes', LIKEBTN_I18N_DOMAIN), 'dislikes' => __('Dislikes', LIKEBTN_I18N_DOMAIN), 'likes_minus_dislikes' => __('Likes minus dislikes', LIKEBTN_I18N_DOMAIN));
        $thumbnail_size_list = array('thumbnail' => __('Thumbnail', LIKEBTN_I18N_DOMAIN), 'medium' => __('Medium', LIKEBTN_I18N_DOMAIN), 'large' => __('Large', LIKEBTN_I18N_DOMAIN), 'full' => __('Full size', LIKEBTN_I18N_DOMAIN));
        $time_range_list = array('all' => __('All time', LIKEBTN_I18N_DOMAIN), '1' => __('1 day', LIKEBTN_I18N_DOMAIN), '2' => __('2 days', LIKEBTN_I18N_DOMAIN), '3' => __('3 days', LIKEBTN_I18N_DOMAIN), '7' => __('1 week', LIKEBTN_I18N_DOMAIN), '14' => __('2 weeks', LIKEBTN_I18N_DOMAIN), '21' => __('3 weeks', LIKEBTN_I18N_DOMAIN), '1m' => __('1 month', LIKEBTN_I18N_DOMAIN), '2m' => __('2 months', LIKEBTN_I18N_DOMAIN), '3m' => __('3 months', LIKEBTN_I18N_DOMAIN), '6m' => __('6 months', LIKEBTN_I18N_DOMAIN), '1y' => __('1 year', LIKEBTN_I18N_DOMAIN));
        // Normalize instance
        if (!isset($instance['title'])) {
            $instance['title'] = __('Most Liked Content', LIKEBTN_I18N_DOMAIN);
        }
        if (empty($instance['entity_name']) || !is_array($instance['entity_name'])) {
            $instance['entity_name'] = self::$instance_default['entity_name'];
        }
        if (empty($instance['exclude_categories']) || !is_array($instance['exclude_categories'])) {
            $instance['exclude_categories'] = self::$instance_default['exclude_categories'];
        }
        if (empty($instance['number']) || (int) $instance['number'] < 1) {
            $instance['number'] = self::$instance_default['number'];
        }
        if (empty($instance['order'])) {
            $instance['order'] = self::$instance_default['order'];
        }
        if (empty($instance['time_range'])) {
            $instance['time_range'] = self::$instance_default['time_range'];
        }
        if (empty($instance['time_range'])) {
            $instance['time_range'] = self::$instance_default['time_range'];
        }
        if (empty($instance['title_length'])) {
            $instance['title_length'] = self::$instance_default['title_length'];
        }
        ?>
        <div id="likebtn_widget_<?php 
        echo $widget_mnemonic;
        ?>
">
            <p>
                <label for="<?php 
        echo $this->get_field_id('title');
        ?>
"><?php 
        _e('Title', LIKEBTN_I18N_DOMAIN);
        ?>
:</label>
                <input class="widefat" type="text" id="<?php 
        echo $this->get_field_id('title');
        ?>
" name="<?php 
        echo $this->get_field_name('title');
        ?>
" value="<?php 
        echo $instance['title'];
        ?>
" data-property="title" />
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('entity_name');
        ?>
"><?php 
        _e('Items to show', LIKEBTN_I18N_DOMAIN);
        ?>
:</label><br/>
                <?php 
        /*<select name="<?php echo $this->get_field_name('entity_name'); ?>[]" id="<?php echo $this->get_field_id('entity_name'); ?>" multiple="multiple" size="6" style="height:auto !important;">
              <?php foreach ($likebtn_entities as $entity_name_value => $entity_title): ?>
                  <option value="<?php echo $entity_name_value; ?>" <?php echo (in_array($entity_name_value, $instance['entity_name']) ? 'selected="selected"' : ''); ?> ><?php _e($entity_title, LIKEBTN_I18N_DOMAIN); ?></option>
              <?php endforeach ?>
          </select>*/
        ?>
                <?php 
        foreach ($likebtn_entities as $entity_name_value => $entity_title) {
            ?>
                    <input type="checkbox" name="<?php 
            echo $this->get_field_name('entity_name');
            ?>
[]" id="<?php 
            echo $this->get_field_id('entity_name');
            ?>
_<?php 
            echo $entity_name_value;
            ?>
" value="<?php 
            echo $entity_name_value;
            ?>
" <?php 
            echo in_array($entity_name_value, $instance['entity_name']) ? 'checked="checked"' : '';
            ?>
 data-property="entity_name" /> <label for="<?php 
            echo $this->get_field_id('entity_name');
            ?>
_<?php 
            echo $entity_name_value;
            ?>
"><?php 
            _e($entity_title, LIKEBTN_I18N_DOMAIN);
            ?>
</label><br/>
                <?php 
        }
        ?>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('exclude_categories');
        ?>
"><?php 
        _e('Exclude items by category', LIKEBTN_I18N_DOMAIN);
        ?>
:</label><br/>
                <select multiple="multiple" id="<?php 
        echo $this->get_field_id('exclude_categories');
        ?>
" name="<?php 
        echo $this->get_field_name('exclude_categories');
        ?>
[]" class="likebtn_exclude_categories widefat" data-property="exclude_categories" autocomplete="off">
                    <?php 
        $categories = _likebtn_get_categories();
        foreach ($categories as $category) {
            $selected = in_array($category->cat_ID, $instance['exclude_categories']) ? 'selected="selected"' : '';
            $option = '<option value="' . $category->cat_ID . '" ' . $selected . '>';
            $option .= $category->cat_name;
            $option .= ' (' . $category->category_count . ')';
            $option .= '</option>';
            echo $option;
        }
        ?>
                </select>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('author');
        ?>
"><?php 
        _e('Filter by author (comma separated IDs)', LIKEBTN_I18N_DOMAIN);
        ?>
:</label><br/>
                <input type="text" id="<?php 
        echo $this->get_field_id('author');
        ?>
" name="<?php 
        echo $this->get_field_name('author');
        ?>
" value="<?php 
        echo $instance['author'];
        ?>
" data-property="author" class="widefat"/>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('number');
        ?>
"><?php 
        _e('Number of items to show:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <input type="number" id="<?php 
        echo $this->get_field_id('number');
        ?>
" name="<?php 
        echo $this->get_field_name('number');
        ?>
" value="<?php 
        echo $instance['number'];
        ?>
" size="3" data-property="number" class="widefat" />
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('order');
        ?>
"><?php 
        _e('Order by:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('order');
        ?>
" id="<?php 
        echo $this->get_field_id('order');
        ?>
" data-property="order" >
                    <?php 
        foreach ($order_list as $order_value => $order_name) {
            ?>
                        <option value="<?php 
            echo $order_value;
            ?>
" <?php 
            selected($order_value, $instance['order']);
            ?>
 ><?php 
            _e($order_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('time_range');
        ?>
"><?php 
        _e('Time range:', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('time_range');
        ?>
" id="<?php 
        echo $this->get_field_id('time_range');
        ?>
" data-property="time_range" >
                    <?php 
        foreach ($time_range_list as $time_range_value => $time_range_name) {
            ?>
                        <option value="<?php 
            echo $time_range_value;
            ?>
" <?php 
            selected($time_range_value, $instance['time_range']);
            ?>
 ><?php 
            _e($time_range_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <label for="<?php 
        echo $this->get_field_id('title_length');
        ?>
"><?php 
        _e('Max title length', LIKEBTN_I18N_DOMAIN);
        ?>
:</label>
                <input type="number" id="<?php 
        echo $this->get_field_id('title_length');
        ?>
" name="<?php 
        echo $this->get_field_name('title_length');
        ?>
" value="<?php 
        echo $instance['title_length'];
        ?>
" data-property="title_length" class="widefat" />
            </p>
            <p>
                <input class="checkbox" type="checkbox" id="<?php 
        echo $this->get_field_id('show_likes');
        ?>
" name="<?php 
        echo $this->get_field_name('show_likes');
        ?>
" value="1" <?php 
        checked($instance['show_likes']);
        ?>
 data-property="show_likes" />
                <label for="<?php 
        echo $this->get_field_id('show_likes');
        ?>
"><?php 
        _e('Display likes count', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" id="<?php 
        echo $this->get_field_id('show_dislikes');
        ?>
" name="<?php 
        echo $this->get_field_name('show_dislikes');
        ?>
" value="1" <?php 
        checked($instance['show_dislikes']);
        ?>
 data-property="show_dislikes" />
                <label for="<?php 
        echo $this->get_field_id('show_dislikes');
        ?>
"><?php 
        _e('Display dislikes count', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_thumbnail']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_thumbnail');
        ?>
" name="<?php 
        echo $this->get_field_name('show_thumbnail');
        ?>
" value="1" data-property="show_thumbnail" />
                <label for="<?php 
        echo $this->get_field_id('show_thumbnail');
        ?>
"><?php 
        _e('Display featured image', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                <select name="<?php 
        echo $this->get_field_name('thumbnail_size');
        ?>
" id="<?php 
        echo $this->get_field_id('thumbnail_size');
        ?>
" data-property="thumbnail_size" class="widefat">
                    <?php 
        foreach ($thumbnail_size_list as $thumbnail_size_value => $thumbnail_size_name) {
            ?>
                        <option value="<?php 
            echo $thumbnail_size_value;
            ?>
" <?php 
            selected($thumbnail_size_value, $instance['thumbnail_size']);
            ?>
 ><?php 
            _e($thumbnail_size_name, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                    <?php 
        }
        ?>
                </select>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_excerpt']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
" name="<?php 
        echo $this->get_field_name('show_excerpt');
        ?>
" value="1" data-property="show_excerpt" />
                <label for="<?php 
        echo $this->get_field_id('show_excerpt');
        ?>
"><?php 
        _e('Display excerpt', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <input class="checkbox" type="checkbox" <?php 
        checked($instance['show_date']);
        ?>
 id="<?php 
        echo $this->get_field_id('show_date');
        ?>
" name="<?php 
        echo $this->get_field_name('show_date');
        ?>
" value="1" data-property="show_date" />
                <label for="<?php 
        echo $this->get_field_id('show_date');
        ?>
"><?php 
        _e('Display item date', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
            </p>
            <p>
                <a href="javascript:likebtnWidgetShortcode('<?php 
        echo $widget_mnemonic;
        ?>
')"><?php 
        _e('Get shortcode', LIKEBTN_I18N_DOMAIN);
        ?>
</a> <small>▼</small>
            </p>
            <p id="likebtn_sc_wr_<?php 
        echo $widget_mnemonic;
        ?>
" class="likebtn_sc_wr">
                <textarea class="likebtn_input likebtn_disabled" rows="5" id="likebtn_sc_<?php 
        echo $widget_mnemonic;
        ?>
" readonly="readonly"></textarea>
            </p>
        </div>
        <script type="text/javascript">
            jQuery(document).ready(function() {
                jQuery("#likebtn_widget_<?php 
        echo $widget_mnemonic;
        ?>
 :input").on("keyup change", function(event) {
                    likebtnWidgetShortcode('<?php 
        echo $widget_mnemonic;
        ?>
', true);
                });
                jQuery("#likebtn_widget_<?php 
        echo $widget_mnemonic;
        ?>
 .likebtn_exclude_categories:first").select2();
            });
        </script>
        <?php 
    }
Exemplo n.º 8
0
function _likebtn_get_item_votes($identifier, $type = '')
{
    global $wpdb;
    $votes = array(LIKEBTN_META_KEY_LIKES => null, LIKEBTN_META_KEY_DISLIKES => null);
    $likebtn_entities = _likebtn_get_entities(true, true);
    $entity_info = _likebtn_parse_identifier($identifier);
    if ($entity_info['entity_name'] && $entity_info['entity_id'] && array_key_exists($entity_info['entity_name'], $likebtn_entities) && is_numeric($entity_info['entity_id'])) {
        // Entity
        switch ($entity_info['entity_name']) {
            case LIKEBTN_ENTITY_COMMENT:
                // Comment
                if (!$type || $type == LIKEBTN_META_KEY_LIKES) {
                    $votes[LIKEBTN_META_KEY_LIKES] = (int) get_comment_meta($entity_info['entity_id'], LIKEBTN_META_KEY_LIKES, true);
                }
                if (!$type || $type == LIKEBTN_META_KEY_DISLIKES) {
                    $votes[LIKEBTN_META_KEY_DISLIKES] = (int) get_comment_meta($entity_info['entity_id'], LIKEBTN_META_KEY_DISLIKES, true);
                }
                break;
            case LIKEBTN_ENTITY_BP_ACTIVITY_POST:
            case LIKEBTN_ENTITY_BP_ACTIVITY_UPDATE:
            case LIKEBTN_ENTITY_BP_ACTIVITY_COMMENT:
            case LIKEBTN_ENTITY_BP_ACTIVITY_TOPIC:
                if (!_likebtn_is_bp_active()) {
                    break;
                }
                if (!$type || $type == LIKEBTN_META_KEY_LIKES) {
                    $votes[LIKEBTN_META_KEY_LIKES] = (int) bp_activity_get_meta($entity_info['entity_id'], LIKEBTN_META_KEY_LIKES, true);
                }
                if (!$type || $type == LIKEBTN_META_KEY_DISLIKES) {
                    $votes[LIKEBTN_META_KEY_DISLIKES] = (int) bp_activity_get_meta($entity_info['entity_id'], LIKEBTN_META_KEY_DISLIKES, true);
                }
                break;
            case LIKEBTN_ENTITY_BP_MEMBER:
                // BuddyPress Member Profile
                if (!$type || $type == LIKEBTN_META_KEY_LIKES) {
                    $votes[LIKEBTN_META_KEY_LIKES] = (int) bp_xprofile_get_meta($entity_info['entity_id'], LIKEBTN_META_KEY_LIKES, true);
                }
                if (!$type || $type == LIKEBTN_META_KEY_DISLIKES) {
                    $votes[LIKEBTN_META_KEY_DISLIKES] = (int) bp_xprofile_get_meta($entity_info['entity_id'], LIKEBTN_META_KEY_DISLIKES, true);
                }
                break;
            case LIKEBTN_ENTITY_BBP_USER:
            case LIKEBTN_ENTITY_USER:
                // bbPress Member Profile
                if (!$type || $type == LIKEBTN_META_KEY_LIKES) {
                    $votes[LIKEBTN_META_KEY_LIKES] = (int) get_user_meta($entity_info['entity_id'], LIKEBTN_META_KEY_LIKES, true);
                }
                if (!$type || $type == LIKEBTN_META_KEY_DISLIKES) {
                    $votes[LIKEBTN_META_KEY_DISLIKES] = (int) get_user_meta($entity_info['entity_id'], LIKEBTN_META_KEY_DISLIKES, true);
                }
                break;
            default:
                // Post
                if (!$type || $type == LIKEBTN_META_KEY_LIKES) {
                    $votes[LIKEBTN_META_KEY_LIKES] = get_post_meta($entity_info['entity_id'], LIKEBTN_META_KEY_LIKES, true);
                }
                if (!$type || $type == LIKEBTN_META_KEY_DISLIKES) {
                    $votes[LIKEBTN_META_KEY_DISLIKES] = (int) get_post_meta($entity_info['entity_id'], LIKEBTN_META_KEY_DISLIKES, true);
                }
                break;
        }
    } else {
        // Custom item
        $item_db = $wpdb->get_row($wpdb->prepare("SELECT likes, dislikes\n                FROM " . $wpdb->prefix . LIKEBTN_TABLE_ITEM . "\n                WHERE identifier = %s", $identifier));
        // Custom identifier
        if ($item_db) {
            $votes[LIKEBTN_META_KEY_LIKES] = $item_db->likes;
            $votes[LIKEBTN_META_KEY_DISLIKES] = $item_db->dislikes;
        }
    }
    return $votes;
}
Exemplo n.º 9
0
function _likebtn_get_subpage()
{
    $likebtn_entities = _likebtn_get_entities();
    $subpage = LIKEBTN_ENTITY_POST;
    if (!empty($_POST['likebtn_subpage']) && array_key_exists($_POST['likebtn_subpage'], $likebtn_entities)) {
        $subpage = $_POST['likebtn_subpage'];
    } elseif (!empty($_GET['likebtn_subpage']) && array_key_exists($_GET['likebtn_subpage'], $likebtn_entities)) {
        $subpage = $_GET['likebtn_subpage'];
    }
    return $subpage;
}
Exemplo n.º 10
0
function likebtn_admin_buttons()
{
    global $likebtn_styles;
    global $likebtn_default_locales;
    global $likebtn_settings;
    global $likebtn_buttons_options;
    global $likebtn_entities_config;
    global $likebtn_addthis_service_codes;
    global $likebtn_icons;
    global $likebtn_fonts;
    global $likebtn_fstyles;
    global $user_logged_in_alert_default;
    // Enque scripts
    wp_register_script('select2', _likebtn_get_public_url() . 'js/jquery/select2/select2.js', array('jquery'), LIKEBTN_VERSION, true);
    wp_register_script('select2-sortable', _likebtn_get_public_url() . 'js/jquery/select2/select2.sortable.js', array('select2'), LIKEBTN_VERSION, true);
    wp_register_style('select2-css', _likebtn_get_public_url() . 'css/jquery/select2/select2.css', false, LIKEBTN_VERSION, 'all');
    wp_register_script('likebtn-jquery-ui', _likebtn_get_public_url() . 'js/jquery/jquery-ui/jquery-ui.js', array('jquery'), LIKEBTN_VERSION, true);
    wp_register_style('likebtn-jquery-ui-css', _likebtn_get_public_url() . 'css/jquery/jquery-ui/jquery-ui.css', false, LIKEBTN_VERSION, 'all');
    wp_register_style('likebtn-addthis', _likebtn_get_public_url() . 'css/addthis.css', false, LIKEBTN_VERSION, 'all');
    wp_register_style('likebtn-icons', '//w.likebtn.com/css/w/icons.css', false, LIKEBTN_VERSION, 'all');
    // Select2 locale
    $blog_locale = get_locale();
    list($blog_locale_main) = explode("_", $blog_locale);
    $plugin_dir = plugin_dir_path(__FILE__);
    $select2_locale_script = '';
    if (file_exists($plugin_dir . 'public/js/jquery/select2/locale/select2_locale_' . $blog_locale . '.js')) {
        $select2_locale_script = _likebtn_get_public_url() . 'js/jquery/select2/locale/select2_locale_' . $blog_locale . '.js';
    } else {
        if (file_exists($plugin_dir . 'public/js/jquery/select2/locale/select2_locale_' . $blog_locale_main . '.js')) {
            $select2_locale_script = _likebtn_get_public_url() . 'js/jquery/select2/locale/select2_locale_' . $blog_locale_main . '.js';
        }
    }
    if ($select2_locale_script) {
        wp_register_script('select2-locale', $select2_locale_script, LIKEBTN_VERSION, true);
    }
    wp_enqueue_media();
    wp_enqueue_script('select2');
    wp_enqueue_script('select2-sortable');
    wp_enqueue_style('select2-css');
    if ($select2_locale_script) {
        wp_enqueue_script('select2-locale');
    }
    // wp_enqueue_script('likebtn-jquery-ui');
    // wp_enqueue_style('likebtn-jquery-ui-css');
    wp_enqueue_script('likebtn-jquery-ui');
    wp_enqueue_style('likebtn-jquery-ui-css');
    wp_enqueue_style('likebtn-addthis');
    wp_enqueue_style('likebtn-icons');
    wp_enqueue_script('wp-color-picker-alpha', _likebtn_get_public_url() . 'js/wp-color-picker-alpha.js', array('wp-color-picker'), LIKEBTN_VERSION);
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('likebtn-dateparse', _likebtn_get_public_url() . 'js/dateparse.js', array(), LIKEBTN_VERSION);
    wp_enqueue_script('likebtn-datetimepicker', _likebtn_get_public_url() . 'js/jquery/jquery.datetimepicker.js', array('jquery', 'likebtn-jquery-ui'), LIKEBTN_VERSION);
    wp_enqueue_style('likebtn-datetimepicker', _likebtn_get_public_url() . 'css/jquery/jquery.datetimepicker.css', array(), LIKEBTN_VERSION, 'all');
    wp_enqueue_script('likebtn-durationpicker', _likebtn_get_public_url() . 'js/jquery/jquery.ui.durationPicker.js', array('jquery', 'likebtn-jquery-ui'), LIKEBTN_VERSION);
    wp_enqueue_style('likebtn-durationpicker', _likebtn_get_public_url() . 'css/jquery/jquery.ui.durationPicker.css', array(), LIKEBTN_VERSION, 'all');
    $likebtn_entities = _likebtn_get_entities(false, false, false);
    // retrieve post formats
    $post_formats = _likebtn_get_post_formats();
    // run sunchronization
    require_once dirname(__FILE__) . '/../likebtn_like_button.class.php';
    $likebtn = new LikeBtnLikeButton();
    /*$likebtn->runSyncLocales();
      $likebtn->runSyncStyles();*/
    // Languages
    //$locales = get_option('likebtn_locales');
    $locales = $likebtn_default_locales;
    $languages = array();
    $languages['auto'] = array('name' => __("Automatic", LIKEBTN_I18N_DOMAIN), 'en_name' => __("Automatic", LIKEBTN_I18N_DOMAIN));
    /*if (!$locales) {
          $locales = $likebtn_default_locales;
      }*/
    foreach ($locales as $locale_code => $locale_info) {
        $languages[$locale_code] = array('name' => $locale_info['name'], 'en_name' => $locale_info['en_name']);
    }
    // Get styles
    $styles = get_option('likebtn_styles');
    $style_options = array();
    if (!$styles) {
        // Styles have not been loaded using API yet, load default languages
        $styles = $likebtn_styles;
    }
    foreach ($styles as $style) {
        $style_options[] = $style;
    }
    // Select tab
    $subpage = _likebtn_get_subpage();
    //$entity_title = $likebtn_entities[$entity_name];
    // JS and Styles
    global $likebtn_website_locales;
    $likebtn_website_locale = substr(get_bloginfo('language'), 0, 2);
    if (!in_array($likebtn_website_locale, $likebtn_website_locales)) {
        $likebtn_website_locale = 'en';
    }
    likebtn_admin_header();
    ?>
    
    <script>(function(d, e, s) {a = d.createElement(e);m = d.getElementsByTagName(e)[0];a.async = 1;a.src = s;m.parentNode.insertBefore(a, m)})(document, 'script', '//<?php 
    echo LIKEBTN_WEBSITE_DOMAIN;
    ?>
/<?php 
    echo $likebtn_website_locale;
    ?>
/js/donate_generator.js');
    </script>
    <?php 
    /*
    <link rel="stylesheet" type="text/css" href="<?php echo _likebtn_get_public_url() ?>js/jquery/select2/select2.js?ver=<?php echo LIKEBTN_VERSION ?>" />
    <link rel="stylesheet" type="text/css" href="<?php echo _likebtn_get_public_url() ?>js/jquery/jquery-ui/jquery-ui.js?ver=<?php echo LIKEBTN_VERSION ?>" />
    <link rel="stylesheet" type="text/css" href="<?php echo _likebtn_get_public_url() ?>css/jquery/select2/select2.css?ver=<?php echo LIKEBTN_VERSION ?>" />
    */
    ?>

    <script type="text/javascript">
        var reset_settings = [];
    <?php 
    foreach ($likebtn_buttons_options as $option_name => $option_value) {
        ?>
        <?php 
        if (is_array($option_value)) {
            ?>
            <?php 
            $option_value = array_shift($option_value);
            ?>
        <?php 
        }
        ?>
        reset_settings['<?php 
        echo str_replace('likebtn_', '', $option_name);
        ?>
'] = '<?php 
        echo $option_value;
        ?>
';
    <?php 
    }
    ?>
    <?php 
    foreach ($likebtn_settings as $option_name => $option_info) {
        ?>
        reset_settings['settings_<?php 
        echo $option_name;
        ?>
'] = '<?php 
        echo $option_info['default'];
        ?>
';
    <?php 
    }
    ?>

    <?php 
    /*
       var likebtn_entities = [
        <?php $entity_index = 0; ?>
        <?php foreach ($likebtn_entities as $entity_name => $entity_title): ?>
           <?php $entity_index++; ?>
           '<?php echo $entity_name; ?>'<?php if ($entity_index != count($likebtn_entities)-1): ?>,<?php endif ?>
        <?php endforeach ?>
       ];
    */
    ?>

        var likebtn_msg_reset = '<?php 
    _e('Are you sure you want to reset settings for this entity?', LIKEBTN_I18N_DOMAIN);
    ?>
';
        var likebtn_msg_set_img = '<?php 
    _e('Select image', LIKEBTN_I18N_DOMAIN);
    ?>
';
        //var likebtn_msg_identifier = '<?php 
    _e('likeButton1', LIKEBTN_I18N_DOMAIN);
    ?>
';

        var likebtn_path_settings_theme = '//<?php 
    echo LIKEBTN_WEBSITE_DOMAIN;
    ?>
/bundles/likebtnwebsite/i/theme/';
        var likebtn_path_settings_counter_type = '//<?php 
    echo LIKEBTN_WEBSITE_DOMAIN;
    ?>
/bundles/likebtnwebsite/i/counter/';
        var likebtn_default_settings = <?php 
    echo json_encode(array('addthis_service_codes' => $likebtn_settings['addthis_service_codes']));
    ?>
;
        var likebtn_prev_lang = '';
        var likebtn_wp_media = null;
        var likebtn_datetime = "<?php 
    echo date("Y/m/d H:i");
    ?>
";

        likebtnScriptButtons('<?php 
    echo $subpage;
    ?>
', '<?php 
    echo get_option('likebtn_plan');
    ?>
');
    </script>

    <div>
        <form method="post" action="options.php" onsubmit="return likebtnOnSaveButtons()" id="settings_form" autocomplete="off">
            <?php 
    settings_fields('likebtn_buttons');
    ?>
            <input type="hidden" name="likebtn_subpage" value="<?php 
    echo $subpage;
    ?>
" id="likebtn_entity_name_field">

            <h3 class="nav-tab-wrapper" style="padding: 0" id="likebtn_subpage_tab_wrapper">
                <?php 
    foreach ($likebtn_entities as $tab_entity_name => $tab_entity_title) {
        ?>
                    <a class="nav-tab likebtn_tab_<?php 
        echo $tab_entity_name;
        ?>
 <?php 
        echo $subpage == $tab_entity_name ? 'nav-tab-active' : '';
        ?>
" href="<?php 
        echo admin_url() . 'admin.php?page=likebtn_buttons&likebtn_subpage=' . $tab_entity_name;
        ?>
"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/check.png" class="likebtn_ttip likebtn_show_marker <?php 
        if (get_option('likebtn_show_' . $tab_entity_name) != '1') {
            ?>
hidden<?php 
        }
        ?>
" title="<?php 
        _e('Like Button enabled', LIKEBTN_I18N_DOMAIN);
        ?>
"><?php 
        _e($tab_entity_title, LIKEBTN_I18N_DOMAIN);
        ?>
</a>
                <?php 
    }
    ?>
            </h3>
            <?php 
    foreach ($likebtn_entities as $entity_name => $entity_title) {
        // Display one entity per page
        if ($subpage != $entity_name) {
            continue;
        }
        // Entity name without list suffix
        $entity_name_clean = str_replace(LIKEBTN_LIST_FLAG, '', $entity_name);
        $excluded_sections = get_option('likebtn_exclude_sections_' . $entity_name);
        if (!is_array($excluded_sections)) {
            $excluded_sections = array();
        }
        $excluded_categories = get_option('likebtn_exclude_categories_' . $entity_name);
        if (!is_array($excluded_categories)) {
            $excluded_categories = array();
        }
        if ($entity_name == LIKEBTN_ENTITY_BBP_POST) {
            $allow_forums = get_option('likebtn_allow_forums_' . $entity_name);
            if (!is_array($allow_forums)) {
                $allow_forums = array();
            }
        }
        // just in case
        if (!is_array(get_option('likebtn_post_format_' . $entity_name))) {
            update_option('likebtn_post_format_' . $entity_name, array('all'));
        }
        // AddThis service codes
        $value_addthis_service_codes = get_option('likebtn_settings_addthis_service_codes_' . $entity_name);
        if (!$value_addthis_service_codes) {
            $lang = get_option('likebtn_settings_lang_' . $entity_name);
            if (!empty($likebtn_settings['addthis_service_codes']['default_values'][$lang])) {
                $value_addthis_service_codes = $likebtn_settings['addthis_service_codes']['default_values'][$lang];
            } else {
                $value_addthis_service_codes = $likebtn_settings['addthis_service_codes']['default_values']['all'];
            }
        }
        // Login alert message
        $user_logged_in_alert = get_option('likebtn_user_logged_in_alert_' . $entity_name);
        if (!$user_logged_in_alert) {
            $user_logged_in_alert = '<p class="alert alert-info fade in" role="alert">' . __($user_logged_in_alert_default, LIKEBTN_I18N_DOMAIN) . '</p>';
        }
        ?>

                <div id="likebtn_subpage_wrapper_<?php 
        echo $entity_name;
        ?>
" class="likebtn_subpage <?php 
        if ($subpage !== $entity_name) {
            ?>
hidden<?php 
        }
        ?>
" >
                    <?php 
        /*<h3><?php _e($entity_title, LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                    <div class="inside entity_tab_container">

                        <table class="form-table">
                            <tr valign="top">
                                <th scope="row"><label><?php 
        _e('Enable Like Button', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                <td>
                                    <input type="checkbox" name="likebtn_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_show_' . $entity_name));
        ?>
 onClick="entityShowChange(this, '<?php 
        echo $entity_name;
        ?>
')" />
                                </td>
                            </tr>
                        </table>

                        <div id="entity_container_<?php 
        echo $entity_name;
        ?>
" <?php 
        if (!get_option('likebtn_show_' . $entity_name)) {
            ?>
style="display:none"<?php 
        }
        ?>
>
                            <table class="form-table" >
                                <tr valign="top">
                                    <th scope="row"><label><?php 
        _e('Copy Settings From', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                        <i class="likebtn_help" title="<?php 
        _e('Choose the entity from which you want to copy settings', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                    </th>
                                    <td>
                                        <select name="likebtn_use_settings_from_<?php 
        echo $entity_name;
        ?>
" onChange="userSettingsFromChange(this, '<?php 
        echo $entity_name;
        ?>
')">
                                            <option value="" <?php 
        selected('', get_option('likebtn_use_settings_from_' . $entity_name));
        ?>
 >&nbsp;</option>
                                            <?php 
        foreach ($likebtn_entities as $use_entity_name => $use_entity_title) {
            ?>
                                                <?php 
            if ($use_entity_name == $entity_name) {
                continue;
            }
            ?>
                                                <option value="<?php 
            echo $use_entity_name;
            ?>
" <?php 
            selected($use_entity_name, get_option('likebtn_use_settings_from_' . $entity_name));
            ?>
 ><?php 
            _e($use_entity_title, LIKEBTN_I18N_DOMAIN);
            ?>
</option>
                                            <?php 
        }
        ?>
                                        </select>
                                    </td>
                                </tr>
                            </table>

                            <?php 
        if (get_option('likebtn_show_' . $entity_name) == '1') {
            ?>
                                <br/>
                                <div id="preview_fixer" class="likebtn_preview_static postbox" <?php 
            if (get_option('likebtn_use_settings_from_' . $entity_name)) {
                ?>
style="display:none"<?php 
            }
            ?>
>

                                    <h3>
                                        <?php 
            _e('Preview', LIKEBTN_I18N_DOMAIN);
            ?>
                                        <label class="likebtn_pin">
                                            <input type="checkbox" value="1" id="likebtn_pin" <?php 
            if (!$_COOKIE || empty($_COOKIE['likebtn_pin'])) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <small><?php 
            _e('Sticky preview', LIKEBTN_I18N_DOMAIN);
            ?>
</small>
                                        </label>
                                    </h3>
                                    <div class="inside">
                                        <div class="preview_container">
                                            <?php 
            echo _likebtn_get_markup($entity_name, 'demo', array(), get_option('likebtn_use_settings_from_' . $entity_name), true, true, true);
            ?>
                                        </div>
                                        <input class="button-primary" type="submit" name="Save" value="<?php 
            _e('Save Changes', LIKEBTN_I18N_DOMAIN);
            ?>
" id="likebtn_save_preview"  <?php 
            if (get_option('likebtn_use_settings_from_' . $entity_name)) {
                ?>
style="display: none"<?php 
            }
            ?>
/>

                                        <span class="support_link">
                                            ♥ <?php 
            _e('Like it?', LIKEBTN_I18N_DOMAIN);
            ?>
                                            <a href="https://wordpress.org/support/view/plugin-reviews/likebtn-like-button?filter=5&rate=5#postform" target="_blank">
                                                <?php 
            _e('Support the plugin with ★ 5 Stars', LIKEBTN_I18N_DOMAIN);
            ?>
                                            </a>
                                        </span>
                                    </div>
                                </div>
                            <?php 
        }
        ?>

                            <div id="use_settings_from_container_<?php 
        echo $entity_name;
        ?>
" <?php 
        if (get_option('likebtn_use_settings_from_' . $entity_name)) {
            ?>
style="display:none"<?php 
        }
        ?>
>
                                <div class="postbox" id="settings_container">
                                    <?php 
        /*<h3><?php _e('Settings', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                    <div class="inside">

                                        <table class="form-table">
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Theme', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="radio" name="likebtn_theme_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_THEME_TYPE_PREDEFINED;
        ?>
" <?php 
        if (LIKEBTN_THEME_TYPE_PREDEFINED == get_option('likebtn_theme_type_' . $entity_name) || !get_option('likebtn_theme_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 class="theme_type_radio" /> 

                                                    <select name="likebtn_settings_theme_<?php 
        echo $entity_name;
        ?>
" class="image_dropdown" id="settings_theme">
                                                        <?php 
        foreach ($style_options as $style) {
            ?>
                                                            <option value="<?php 
            echo $style;
            ?>
" <?php 
            selected($style, get_option('likebtn_settings_theme_' . $entity_name));
            ?>
 ><?php 
            /*echo $style;*/
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                    <br/><br/>
                                                    <label>
                                                        <input type="radio" name="likebtn_theme_type_<?php 
        echo $entity_name;
        ?>
" class="theme_type_radio" value="<?php 
        echo LIKEBTN_THEME_TYPE_CUSTOM;
        ?>
" <?php 
        if (LIKEBTN_THEME_TYPE_CUSTOM == get_option('likebtn_theme_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> 
                                                        <?php 
        _e('Custom theme', LIKEBTN_I18N_DOMAIN);
        ?>
                                                    </label>
                                                    <input type="hidden" name="likebtn_settings_theme_<?php 
        echo $entity_name;
        ?>
" id="settings_theme_custom" value="custom" <?php 
        if (LIKEBTN_THEME_TYPE_CUSTOM != get_option('likebtn_theme_type_' . $entity_name)) {
            ?>
 class="disabled" disabled="disabled"<?php 
        }
        ?>
 />
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Button size', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="number" name="likebtn_settings_btn_size_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_btn_size_' . $entity_name) ? get_option('likebtn_settings_btn_size_' . $entity_name) : $likebtn_settings['btn_size']['default'];
        ?>
" class="likebtn_input likebtn_i_sm" min="5" max="500" maxlength="3"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Font size', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="number" name="likebtn_settings_f_size_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_f_size_' . $entity_name) ? get_option('likebtn_settings_f_size_' . $entity_name) : $likebtn_settings['f_size']['default'];
        ?>
" class="likebtn_input likebtn_i_sm" min="5" max="500" maxlength="3"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Like icon', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="radio" name="likebtn_icon_l_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_ICON_TYPE_ICON;
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_ICON == get_option('likebtn_icon_l_type_' . $entity_name) || !get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 class="icon_l_type_radio" /> 
                                                    <select name="likebtn_settings_icon_l_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_l" class="icon_dropdown likebtn_i_sm <?php 
        if (LIKEBTN_ICON_TYPE_ICON != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_ICON != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 >
                                                        <?php 
        foreach ($likebtn_icons as $icon) {
            ?>
                                                            <option value="<?php 
            echo $icon;
            ?>
" <?php 
            selected($icon, get_option('likebtn_settings_icon_l_' . $entity_name));
            ?>
 ><?php 
            echo $icon;
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                    <br/><br/>
                                                    <ul class="likebtn-is">
                                                        <li class="likebtn-is-radio">
                                                            <input type="radio" name="likebtn_icon_l_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_ICON_TYPE_URL;
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL == get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 class="icon_l_type_radio" /> 
                                                        </li>
                                                        <li class="likebtn-is-block likebtn-is-frst">
                                                            <?php 
        _e('Image', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            <br/>
                                                            <?php 
        $likebtn_icon_url = get_option('likebtn_settings_icon_l_url_' . $entity_name);
        ?>
                                                            <a title="<?php 
        _e('Select Icon', LIKEBTN_I18N_DOMAIN);
        ?>
" class="<?php 
        if (!$likebtn_icon_url) {
            ?>
button button-large <?php 
        }
        ?>
likebtn-i-pick" data-likebtn-wp-title="<?php 
        _e('Like Icon', LIKEBTN_I18N_DOMAIN);
        ?>
">
                                                                    <span class="likebtn-is-cap<?php 
        if ($likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><?php 
        _e('Select', LIKEBTN_I18N_DOMAIN);
        ?>
</span>
                                                                    <img class="attachment-medium<?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
" src="<?php 
        echo $likebtn_icon_url;
        ?>
 " />
                                                            </a>
                                                            <div class="likebtn-is-remove <?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><a onclick="likebtnIconRemove(this);return false;" href="#"><?php 
        _e('Remove', LIKEBTN_I18N_DOMAIN);
        ?>
</a></div>
                                                            <input type="hidden" name="likebtn_settings_icon_l_url_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_l_url" value="<?php 
        echo $likebtn_icon_url;
        ?>
" class="likebtn-is-inp <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 /> 
                                                        </li>
                                                        <li class="likebtn-is-block">
                                                            <?php 
        _e('Image after voting', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            <br/>
                                                            <?php 
        $likebtn_icon_url = get_option('likebtn_settings_icon_l_url_v_' . $entity_name);
        ?>
                                                            <a title="<?php 
        _e('Select Icon', LIKEBTN_I18N_DOMAIN);
        ?>
" class="<?php 
        if (!$likebtn_icon_url) {
            ?>
button button-large <?php 
        }
        ?>
likebtn-i-pick" data-likebtn-wp-title="<?php 
        _e('Image after voting', LIKEBTN_I18N_DOMAIN);
        ?>
">
                                                                    <span class="likebtn-is-cap<?php 
        if ($likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><?php 
        _e('Select', LIKEBTN_I18N_DOMAIN);
        ?>
</span>
                                                                    <img class="attachment-medium<?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
" src="<?php 
        echo $likebtn_icon_url;
        ?>
 " />
                                                            </a>
                                                            <div class="likebtn-is-remove <?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><a onclick="likebtnIconRemove(this);return false;" href="#"><?php 
        _e('Remove', LIKEBTN_I18N_DOMAIN);
        ?>
</a></div>
                                                            <input type="hidden" name="likebtn_settings_icon_l_url_v_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_l_url_v" value="<?php 
        echo $likebtn_icon_url;
        ?>
" class="likebtn-is-inp <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_l_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
/> 
                                                        </li>
                                                    </ul>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Dislike icon', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="radio" name="likebtn_icon_d_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_ICON_TYPE_ICON;
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_ICON == get_option('likebtn_icon_d_type_' . $entity_name) || !get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 class="icon_d_type_radio" /> 
                                                    <select name="likebtn_settings_icon_d_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_d" class="icon_dropdown likebtn_i_sm <?php 
        if (LIKEBTN_ICON_TYPE_ICON != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_ICON != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 >
                                                        <?php 
        foreach ($likebtn_icons as $icon) {
            ?>
                                                            <option value="<?php 
            echo $icon;
            ?>
" <?php 
            selected($icon, get_option('likebtn_settings_icon_d_' . $entity_name));
            ?>
 ><?php 
            echo $icon;
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                    <br/><br/>
                                                    <ul class="likebtn-is">
                                                        <li class="likebtn-is-radio">
                                                            <input type="radio" name="likebtn_icon_d_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_ICON_TYPE_URL;
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL == get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
checked="checked"<?php 
        }
        ?>
 class="icon_d_type_radio" /> 
                                                        </li>
                                                        <li class="likebtn-is-block likebtn-is-frst">
                                                            <?php 
        _e('Image', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            <br/>
                                                            <?php 
        $likebtn_icon_url = get_option('likebtn_settings_icon_d_url_' . $entity_name);
        ?>
                                                            <a title="<?php 
        _e('Select Icon', LIKEBTN_I18N_DOMAIN);
        ?>
" class="<?php 
        if (!$likebtn_icon_url) {
            ?>
button button-large <?php 
        }
        ?>
likebtn-i-pick" data-likebtn-wp-title="<?php 
        _e('Like Icon', LIKEBTN_I18N_DOMAIN);
        ?>
">
                                                                    <span class="likebtn-is-cap<?php 
        if ($likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><?php 
        _e('Select', LIKEBTN_I18N_DOMAIN);
        ?>
</span>
                                                                    <img class="attachment-medium<?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
" src="<?php 
        echo $likebtn_icon_url;
        ?>
 " />
                                                            </a>
                                                            <div class="likebtn-is-remove <?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><a onclick="likebtnIconRemove(this);return false;" href="#"><?php 
        _e('Remove', LIKEBTN_I18N_DOMAIN);
        ?>
</a></div>
                                                            <input type="hidden" name="likebtn_settings_icon_d_url_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_d_url" value="<?php 
        echo $likebtn_icon_url;
        ?>
" class="likebtn-is-inp <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 /> 
                                                        </li>
                                                        <li class="likebtn-is-block">
                                                            <?php 
        _e('Image after voting', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            <br/>
                                                            <?php 
        $likebtn_icon_url = get_option('likebtn_settings_icon_d_url_v_' . $entity_name);
        ?>
                                                            <a title="<?php 
        _e('Select Icon', LIKEBTN_I18N_DOMAIN);
        ?>
" class="<?php 
        if (!$likebtn_icon_url) {
            ?>
button button-large <?php 
        }
        ?>
likebtn-i-pick" data-likebtn-wp-title="<?php 
        _e('Image after voting', LIKEBTN_I18N_DOMAIN);
        ?>
">
                                                                    <span class="likebtn-is-cap<?php 
        if ($likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><?php 
        _e('Select', LIKEBTN_I18N_DOMAIN);
        ?>
</span>
                                                                    <img class="attachment-medium<?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
" src="<?php 
        echo $likebtn_icon_url;
        ?>
 " />
                                                            </a>
                                                            <div class="likebtn-is-remove <?php 
        if (!$likebtn_icon_url) {
            ?>
 hidden<?php 
        }
        ?>
"><a onclick="likebtnIconRemove(this);return false;" href="#"><?php 
        _e('Remove', LIKEBTN_I18N_DOMAIN);
        ?>
</a></div>
                                                            <input type="hidden" name="likebtn_settings_icon_d_url_v_<?php 
        echo $entity_name;
        ?>
" id="settings_icon_d_url_v" value="<?php 
        echo $likebtn_icon_url;
        ?>
" class="likebtn-is-inp <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled<?php 
        }
        ?>
" <?php 
        if (LIKEBTN_ICON_TYPE_URL != get_option('likebtn_icon_d_type_' . $entity_name)) {
            ?>
disabled="disabled"<?php 
        }
        ?>
/> 
                                                        </li>
                                                    </ul>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden param_icon">
                                                <th scope="row"><label><?php 
        _e('Icon size', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="number" name="likebtn_settings_icon_size_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_icon_size_' . $entity_name) ? get_option('likebtn_settings_icon_size_' . $entity_name) : $likebtn_settings['icon_size']['default'];
        ?>
" class="likebtn_input likebtn_i_sm" min="5" max="500" maxlength="3"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden param_icon_l">
                                                <th scope="row"><label><?php 
        _e('Like icon color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_icon_l_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_icon_l_c_' . $entity_name) ? get_option('likebtn_settings_icon_l_c_' . $entity_name) : $likebtn_settings['icon_l_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden param_icon_l">
                                                <th scope="row"><label><?php 
        _e('Color after voting', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_icon_l_c_v_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_icon_l_c_v_' . $entity_name) ? get_option('likebtn_settings_icon_l_c_v_' . $entity_name) : $likebtn_settings['icon_l_c_v']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden param_icon_d">
                                                <th scope="row"><label><?php 
        _e('Dislike icon color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_icon_d_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_icon_d_c_' . $entity_name) ? get_option('likebtn_settings_icon_d_c_' . $entity_name) : $likebtn_settings['icon_d_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden param_icon_d">
                                                <th scope="row"><label><?php 
        _e('Color after voting', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_icon_d_c_v_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_icon_d_c_v_' . $entity_name) ? get_option('likebtn_settings_icon_d_c_v_' . $entity_name) : $likebtn_settings['icon_d_c_v']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Label color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_label_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_label_c_' . $entity_name) ? get_option('likebtn_settings_label_c_' . $entity_name) : $likebtn_settings['label_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Color after voting', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_label_c_v_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_label_c_v_' . $entity_name) ? get_option('likebtn_settings_label_c_v_' . $entity_name) : $likebtn_settings['label_c_v']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Likes counter color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_counter_l_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_counter_l_c_' . $entity_name) ? get_option('likebtn_settings_counter_l_c_' . $entity_name) : $likebtn_settings['counter_l_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Dislikes counter color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_counter_d_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_counter_d_c_' . $entity_name) ? get_option('likebtn_settings_counter_d_c_' . $entity_name) : $likebtn_settings['counter_d_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Background color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_bg_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_bg_c_' . $entity_name) ? get_option('likebtn_settings_bg_c_' . $entity_name) : $likebtn_settings['bg_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Border color', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_brdr_c_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_brdr_c_' . $entity_name) ? get_option('likebtn_settings_brdr_c_' . $entity_name) : $likebtn_settings['brdr_c']['default'];
        ?>
" data-alpha="true" class="likebtn_input likebtn_i_sm likebtn_cp"/>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Font family', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <select name="likebtn_settings_f_family_<?php 
        echo $entity_name;
        ?>
" class="likebtn_i_sm">
                                                        <?php 
        foreach ($likebtn_fonts as $font) {
            ?>
                                                            <option value="<?php 
            echo $font;
            ?>
" <?php 
            selected($font, get_option('likebtn_settings_f_family_' . $entity_name));
            ?>
 style="font-family: '<?php 
            echo $font;
            ?>
'"><?php 
            echo $font;
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Label font style', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <select name="likebtn_settings_label_fs_<?php 
        echo $entity_name;
        ?>
" class="likebtn_i_sm">
                                                        <?php 
        foreach ($likebtn_fstyles as $fstyle => $fstyle_opts) {
            ?>
                                                            <option value="<?php 
            echo $fstyle;
            ?>
" <?php 
            selected($fstyle, get_option('likebtn_settings_label_fs_' . $entity_name));
            ?>
 style="<?php 
            echo $fstyle_opts['css'];
            ?>
"><?php 
            echo $fstyle_opts['name'];
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr valign="top" class="likebtn_custom hidden">
                                                <th scope="row"><label><?php 
        _e('Counter font style', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <select name="likebtn_settings_counter_fs_<?php 
        echo $entity_name;
        ?>
" class="likebtn_i_sm">
                                                        <?php 
        foreach ($likebtn_fstyles as $fstyle => $fstyle_opts) {
            ?>
                                                            <option value="<?php 
            echo $fstyle;
            ?>
" <?php 
            selected($fstyle, get_option('likebtn_settings_counter_fs_' . $entity_name));
            ?>
 style="<?php 
            echo $fstyle_opts['css'];
            ?>
"><?php 
            echo $fstyle_opts['name'];
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Language', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <select name="likebtn_settings_lang_<?php 
        echo $entity_name;
        ?>
" id="settings_lang" class="likebtn_i_sm">
                                                        <?php 
        foreach ($languages as $lang_code => $lang_info) {
            ?>
                                                            <option value="<?php 
            echo $lang_code;
            ?>
" <?php 
            selected($lang_code, get_option('likebtn_settings_lang_' . $entity_name));
            ?>
 title="<?php 
            echo $lang_info['en_name'];
            ?>
">[<?php 
            echo $lang_code;
            ?>
] <?php 
            echo $lang_info['name'];
            ?>
</option>
                                                        <?php 
        }
        ?>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Show buttons', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="checkbox" name="likebtn_settings_like_enabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_like_enabled_' . $entity_name));
        ?>
 />
                                                    <i><?php 
        _e('Like', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                    &nbsp;&nbsp;
                                                    <input type="checkbox" name="likebtn_settings_dislike_enabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_dislike_enabled_' . $entity_name));
        ?>
 />
                                                    <i><?php 
        _e('Dislike', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Show labels', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="checkbox" name="likebtn_settings_show_like_label_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_show_like_label_' . $entity_name));
        ?>
 />
                                                    <i><?php 
        _e('Like', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                    &nbsp;&nbsp;
                                                    <input type="checkbox" name="likebtn_settings_show_dislike_label_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_show_dislike_label_' . $entity_name));
        ?>
 />
                                                    <i><?php 
        _e('Dislike', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                 <th scope="row"><label><?php 
        _e('Show icons', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                 <td>
                                                     <input type="checkbox" name="likebtn_settings_icon_like_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_icon_like_show_' . $entity_name));
        ?>
 />
                                                     <i><?php 
        _e('Like', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                     &nbsp;&nbsp;
                                                     <input type="checkbox" name="likebtn_settings_icon_dislike_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_icon_dislike_show_' . $entity_name));
        ?>
 />
                                                     <i><?php 
        _e('Dislike', LIKEBTN_I18N_DOMAIN);
        ?>
</i>
                                                 </td>
                                             </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Counter type', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <select name="likebtn_settings_counter_type_<?php 
        echo $entity_name;
        ?>
" class="image_dropdown" id="settings_counter_type">
                                                        <option value="number" <?php 
        selected('number', get_option('likebtn_settings_counter_type_' . $entity_name));
        ?>
 ><?php 
        _e('Number', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                        <option value="percent" <?php 
        selected('percent', get_option('likebtn_settings_counter_type_' . $entity_name));
        ?>
 ><?php 
        _e('Percent', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                        <option value="subtract_dislikes" <?php 
        selected('subtract_dislikes', get_option('likebtn_settings_counter_type_' . $entity_name));
        ?>
 ><?php 
        _e('Subtract dislikes', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                        <option value="single_number" <?php 
        selected('single_number', get_option('likebtn_settings_counter_type_' . $entity_name));
        ?>
 ><?php 
        _e('Single number outside', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Show tooltips', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="checkbox" name="likebtn_settings_tooltip_enabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_tooltip_enabled_' . $entity_name));
        ?>
 />
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Like button text', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_i18n_like_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_like_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Like', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                </td>
                                            </tr>
                                            <tr valign="top">
                                                <th scope="row"><label><?php 
        _e('Dislike button text', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                <td>
                                                    <input type="text" name="likebtn_settings_i18n_dislike_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_dislike_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Dislike', LIKEBTN_I18N_DOMAIN);
        ?>
" />
                                                </td>
                                            </tr>
                                            <tr valign="top" class="plan_dependent plan_vip">
                                                <th scope="row"><label><?php 
        _e('Remove branding', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="VIP / ULTRA"></i></label>
                                                    <i class="likebtn_help" title="<?php 
        _e('No LikeBtn.com branding link', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                </th>
                                                <td>
                                                    <input type="checkbox" name="likebtn_settings_white_label_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_white_label_' . $entity_name));
        ?>
 />
                                                </td>
                                            </tr>
                                            <?php 
        if ($entity_name !== LIKEBTN_ENTITY_COMMENT) {
            ?>
                                                <tr valign="top">
                                                    <th scope="row"><label><?php 
            _e('Google Rich Snippets', LIKEBTN_I18N_DOMAIN);
            ?>
</label>
                                                    </th>
                                                    <td>
                                                        <input type="checkbox" name="likebtn_settings_rich_snippet_<?php 
            echo $entity_name;
            ?>
" value="1" <?php 
            checked('1', get_option('likebtn_settings_rich_snippet_' . $entity_name));
            ?>
 <?php 
            if ($entity_name == LIKEBTN_ENTITY_PRODUCT || $entity_name == LIKEBTN_ENTITY_PRODUCT_LIST) {
                ?>
disabled="disabled"<?php 
            }
            ?>
/>
                                                        <?php 
            if ($entity_name == LIKEBTN_ENTITY_PRODUCT || $entity_name == LIKEBTN_ENTITY_PRODUCT_LIST) {
                ?>
                                                            <small style="color:gray"><?php 
                echo __('WooCommerce is adding Rich Snippets to the products pages by default.', LIKEBTN_I18N_DOMAIN);
                ?>
</small>
                                                        <?php 
            } else {
                ?>
                                                            <small><a href="<?php 
                echo __('https://likebtn.com/en/faq#rich_snippets', LIKEBTN_I18N_DOMAIN);
                ?>
" target="_blank"><?php 
                echo __('What are Google Rich Snippets and how do they boost traffic?', LIKEBTN_I18N_DOMAIN);
                ?>
</a> / <a href="https://www.google.com/search?q=%D0%A1%D1%82%D0%B0%D0%BB%D0%B8%D0%BD%D1%81%D0%BA%D0%B0%D1%8F+%D1%8D%D0%BA%D0%BE%D0%BD%D0%BE%D0%BC%D0%B8%D0%BA%D0%B0+%D1%8D%D1%82%D0%BE+%D0%BD%D0%B5+%D1%8D%D0%BA%D0%BE%D0%BD%D0%BE%D0%BC%D0%B8%D0%BA%D0%B0+%D0%A1%D0%A1%D0%A1%D0%A0+%D0%94%D0%95%D0%A0%D0%96%D0%90%D0%92%D0%90+%D0%A1%D0%95%D0%93%D0%9E%D0%94%D0%9D%D0%AF" target="_blank"><?php 
                echo __('Live demo', LIKEBTN_I18N_DOMAIN);
                ?>
</a></small>
                                                        <?php 
            }
            ?>
                                                    </td>
                                                </tr>
                                            <?php 
        }
        ?>
                                            <?php 
        if (empty($likebtn_entities_config['likebtn_alignment'][$entity_name]['hide'])) {
            ?>
                                                <tr valign="top">
                                                    <th scope="row"><label><?php 
            _e('Horizontal alignment', LIKEBTN_I18N_DOMAIN);
            ?>
</label></th>
                                                    <td>
                                                        <input type="radio" name="likebtn_alignment_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_ALIGNMENT_LEFT;
            ?>
" <?php 
            if (LIKEBTN_ALIGNMENT_LEFT == get_option('likebtn_alignment_' . $entity_name) || !get_option('likebtn_alignment_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Left');
            ?>
                                                        &nbsp;&nbsp;&nbsp;
                                                        <input type="radio" name="likebtn_alignment_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_ALIGNMENT_CENTER;
            ?>
" <?php 
            if (LIKEBTN_ALIGNMENT_CENTER == get_option('likebtn_alignment_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Center');
            ?>
                                                        &nbsp;&nbsp;&nbsp;
                                                        <input type="radio" name="likebtn_alignment_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_ALIGNMENT_RIGHT;
            ?>
" <?php 
            if (LIKEBTN_ALIGNMENT_RIGHT == get_option('likebtn_alignment_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Right');
            ?>

                                                    </td>
                                                </tr>
                                            <?php 
        }
        ?>
                                            <?php 
        if (empty($likebtn_entities_config['likebtn_position'][$entity_name]['hide'])) {
            ?>
                                                <tr valign="top">
                                                    <th scope="row"><label><?php 
            _e('Vertical alignment', LIKEBTN_I18N_DOMAIN);
            ?>
</label></th>
                                                    <td>
                                                        <input type="radio" name="likebtn_position_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_POSITION_TOP;
            ?>
" <?php 
            if (LIKEBTN_POSITION_TOP == get_option('likebtn_position_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Top of Content', LIKEBTN_I18N_DOMAIN);
            ?>
&nbsp;&nbsp;&nbsp;
                                                        <input type="radio" name="likebtn_position_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_POSITION_BOTTOM;
            ?>
" <?php 
            if (LIKEBTN_POSITION_BOTTOM == get_option('likebtn_position_' . $entity_name) || !get_option('likebtn_position_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Bottom of Content', LIKEBTN_I18N_DOMAIN);
            ?>
&nbsp;&nbsp;&nbsp;
                                                        <input type="radio" name="likebtn_position_<?php 
            echo $entity_name;
            ?>
" value="<?php 
            echo LIKEBTN_POSITION_BOTH;
            ?>
" <?php 
            if (LIKEBTN_POSITION_BOTH == get_option('likebtn_position_' . $entity_name)) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e('Top and Bottom', LIKEBTN_I18N_DOMAIN);
            ?>

                                                    </td>
                                                </tr>
                                            <?php 
        }
        ?>
                                        </table>

                                        <?php 
        /*<div class="postbox">
        
                                                    <h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Extended Settings', LIKEBTN_I18N_DOMAIN); ?></h3>
                                                    <div class="inside">
                                                        <br/>*/
        ?>

                                                <?php 
        /*<p class="description">&nbsp;&nbsp;<?php _e('You can find detailed settings description on <a href="http://likebtn.com/en/#settings" target="_blank">LikeBtn.com</a>', LIKEBTN_I18N_DOMAIN); ?></p><br/>*/
        ?>

                                        <br/>

                                        <h3 class="nav-tab-wrapper" style="padding: 0" id="likebtn_extset_tabs">
                                            <a class="nav-tab likebtn_tab_general nav-tab-active" href="javascript:likebtnGotoTab('general', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('General', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_popup" href="javascript:likebtnGotoTab('popup', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Popup', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_voting" href="javascript:likebtnGotoTab('voting', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Voting', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_counter" href="javascript:likebtnGotoTab('counter', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Counter', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_loading" href="javascript:likebtnGotoTab('sharing', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Sharing', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <?php 
        /*
        <a class="nav-tab likebtn_tab_loading" href="javascript:likebtnGotoTab('loading', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php _e('Loading', LIKEBTN_I18N_DOMAIN); ?></a>
        */
        ?>

                                            <a class="nav-tab likebtn_tab_tooltips" href="javascript:likebtnGotoTab('tooltips', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Tooltips', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_misc" href="javascript:likebtnGotoTab('misc', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Misc', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_texts" href="javascript:likebtnGotoTab('texts', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);"><?php 
        _e('Texts', LIKEBTN_I18N_DOMAIN);
        ?>
</a>

                                            <a class="nav-tab likebtn_tab_buddypress" href="javascript:likebtnGotoTab('buddypress', '.likebtn_tab_extset', '#likebtn_extset_tab_', '#likebtn_extset_tabs');void(0);">BuddyPress</a>
                                        </h3>

                                        <div class="postbox likebtn_tab_extset" id="likebtn_extset_tab_general">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('General', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table" >
                                                    <?php 
        /*if (!in_array($entity_name, $likebtn_no_excerpts)): ?>
                                                                <tr valign="top">
                                                                    <th scope="row"><label><?php _e('View mode', LIKEBTN_I18N_DOMAIN); ?></label></th>
                                                                    <td>
                                                                        <input type="radio" name="likebtn_post_view_mode_<?php echo $entity_name; ?>" value="<?php echo LIKEBTN_POST_VIEW_MODE_FULL; ?>" <?php checked(LIKEBTN_POST_VIEW_MODE_FULL, get_option('likebtn_post_view_mode_' . $entity_name)) ?> /> <?php _e('Full', LIKEBTN_I18N_DOMAIN); ?>&nbsp;&nbsp;&nbsp;
                                                                        <input type="radio" name="likebtn_post_view_mode_<?php echo $entity_name; ?>" value="<?php echo LIKEBTN_POST_VIEW_MODE_EXCERPT; ?>" <?php checked(LIKEBTN_POST_VIEW_MODE_EXCERPT, get_option('likebtn_post_view_mode_' . $entity_name)) ?> /> <?php _e('Excerpt', LIKEBTN_I18N_DOMAIN); ?>&nbsp;&nbsp;&nbsp;
                                                                        <input type="radio" name="likebtn_post_view_mode_<?php echo $entity_name; ?>" value="<?php echo LIKEBTN_POST_VIEW_MODE_BOTH; ?>" <?php checked(LIKEBTN_POST_VIEW_MODE_BOTH, get_option('likebtn_post_view_mode_' . $entity_name)) ?> /> <?php _e('Both', LIKEBTN_I18N_DOMAIN); ?>
        
                                                                        <i class="likebtn_help" title="<?php _e('Choose post display modes for which you want to show the Like Button', LIKEBTN_I18N_DOMAIN); ?>"></i>
                                                                    </td>
                                                                </tr>
                                                            <?php endif*/
        ?>

                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Format', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Select post formats for which you want to show the Like Button', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_post_format_<?php 
        echo $entity_name;
        ?>
[]" value="all" <?php 
        if (in_array('all', get_option('likebtn_post_format_' . $entity_name))) {
            ?>
checked="checked"<?php 
        }
        ?>
 onClick="postFormatAllChange(this, '<?php 
        echo $entity_name;
        ?>
')" /> <?php 
        _e('All', LIKEBTN_I18N_DOMAIN);
        ?>
&nbsp;&nbsp;&nbsp;
                                                            <span id="post_format_container_<?php 
        echo $entity_name;
        ?>
" <?php 
        if (in_array('all', get_option('likebtn_post_format_' . $entity_name))) {
            ?>
style="display:none"<?php 
        }
        ?>
>
                                                                <?php 
        foreach ($post_formats as $post_format) {
            ?>
                                                                    <input type="checkbox" name="likebtn_post_format_<?php 
            echo $entity_name;
            ?>
[]" value="<?php 
            echo $post_format;
            ?>
" <?php 
            if (in_array($post_format, get_option('likebtn_post_format_' . $entity_name))) {
                ?>
checked="checked"<?php 
            }
            ?>
 /> <?php 
            _e(__(ucfirst($post_format), LIKEBTN_I18N_DOMAIN));
            ?>
&nbsp;&nbsp;&nbsp;
                                                                <?php 
        }
        ?>
                                                            </span>
                                                        </td>
                                                    </tr>

                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Exclude on selected sections', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Choose sections where you DO NOT want to show the Like Button', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_exclude_sections_<?php 
        echo $entity_name;
        ?>
[]" value="home" <?php 
        if (in_array('home', $excluded_sections)) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Home');
        ?>
&nbsp;&nbsp;&nbsp;
                                                            <input type="checkbox" name="likebtn_exclude_sections_<?php 
        echo $entity_name;
        ?>
[]" value="archive" <?php 
        if (in_array('archive', $excluded_sections)) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Archive', LIKEBTN_I18N_DOMAIN);
        ?>
&nbsp;&nbsp;&nbsp;
                                                            <input type="checkbox" name="likebtn_exclude_sections_<?php 
        echo $entity_name;
        ?>
[]" value="search" <?php 
        if (in_array('search', $excluded_sections)) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Search', LIKEBTN_I18N_DOMAIN);
        ?>
&nbsp;&nbsp;&nbsp;
                                                            <input type="checkbox" name="likebtn_exclude_sections_<?php 
        echo $entity_name;
        ?>
[]" value="category" <?php 
        if (in_array('category', $excluded_sections)) {
            ?>
checked="checked"<?php 
        }
        ?>
 /> <?php 
        _e('Category', LIKEBTN_I18N_DOMAIN);
        ?>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Exclude in selected categories', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Select categories where you DO NOT want to show the Like Button', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <select name='likebtn_exclude_categories_<?php 
        echo $entity_name;
        ?>
[]' multiple="multiple" id="likebtn_exclude_categories" class="likebtn_input">
                                                                <?php 
        $categories = _likebtn_get_categories();
        foreach ($categories as $category) {
            $selected = in_array($category->cat_ID, $excluded_categories) ? 'selected="selected"' : '';
            $option = '<option value="' . $category->cat_ID . '" ' . $selected . '>';
            $option .= $category->cat_name;
            $option .= ' (' . $category->category_count . ')';
            $option .= '</option>';
            echo $option;
        }
        ?>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <?php 
        if ($entity_name == LIKEBTN_ENTITY_BBP_POST) {
            ?>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
            _e('Allow in selected forum', LIKEBTN_I18N_DOMAIN);
            ?>
</label>
                                                        </th>
                                                        <td>
                                                            <select name='likebtn_allow_forums_<?php 
            echo $entity_name;
            ?>
[]' multiple="multiple" id="likebtn_allow_forums" class="likebtn_input">
                                                                <?php 
            $forums = _likebtn_get_forums();
            foreach ($forums as $forum) {
                $selected = in_array($forum->ID, $allow_forums) ? 'selected="selected"' : '';
                $option = '<option value="' . $forum->ID . '" ' . $selected . '>';
                $option .= $forum->post_title;
                $option .= '</option>';
                echo $option;
            }
            ?>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                    <?php 
        }
        ?>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Allow post/page IDs', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Suppose you have a post which belongs to more than one category and you have excluded one of those categories. So the Like Button will not be available for that post. Enter comma separated post ids where you want to show the Like Button irrespective of that post category being excluded.', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="text" name="likebtn_allow_ids_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        _e(get_option('likebtn_allow_ids_' . $entity_name));
        ?>
" class="likebtn_input" />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Exclude post/page IDs', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Comma separated post/page IDs where you DO NOT want to show the Like Button', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="text" name="likebtn_exclude_ids_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        _e(get_option('likebtn_exclude_ids_' . $entity_name));
        ?>
" class="likebtn_input" />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('User authorization check', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_ALL, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show to all', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <br/>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_USER_LOGGED_IN_YES;
        ?>
" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_YES, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show to <strong>logged in</strong> users only', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <br/>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_USER_LOGGED_IN_NO;
        ?>
" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_NO, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show to <strong>non-logged in</strong> users only', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <br/>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_USER_LOGGED_IN_ALERT;
        ?>
" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_ALERT, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show a <strong>message</strong> asking to login instead of the button to non-logged in users', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <br/>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_USER_LOGGED_IN_ALERT_BTN;
        ?>
" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_ALERT_BTN, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show a <strong>message</strong> asking to login <strong>and the button</strong> to non-logged in users', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <br/>
                                                            <label>
                                                                <input type="radio" name="likebtn_user_logged_in_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_USER_LOGGED_IN_MODAL;
        ?>
" class="user_logged_in_radio" <?php 
        checked(LIKEBTN_USER_LOGGED_IN_MODAL, get_option('likebtn_user_logged_in_' . $entity_name));
        ?>
 /><?php 
        _e('Show a <strong>modal window</strong> with the message asking to login when non-logged in user votes', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <p class="notice update-nag param_user_logged_in_notice"><?php 
        echo strtr(__('Make sure not to disable anonymous access to %admin_ajax%, otherwise votes from anonymous visitors will not be accepted.', LIKEBTN_I18N_DOMAIN), array('%admin_ajax%' => '<a href="' . admin_url('admin-ajax.php') . '" target="_blank">/wp-admin/admin-ajax.php</a>'));
        ?>
</p>

                                                            <p class="description param_user_logged_in_alert hidden">
                                                                <br/>
                                                                <?php 
        _e('Message', LIKEBTN_I18N_DOMAIN);
        ?>
:
                                                                <textarea name="likebtn_user_logged_in_alert_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input" rows="2"><?php 
        echo htmlspecialchars($user_logged_in_alert);
        ?>
</textarea>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <th scope="row"><label><?php 
        _e('Like box', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('List of users who liked an item', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_<?php 
        echo $entity_name;
        ?>
" value="" class="like_box_radio" <?php 
        checked('', get_option('likebtn_like_box_' . $entity_name));
        ?>
 /><?php 
        _e('Disabled', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            &nbsp;&nbsp;&nbsp; 
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_LIKE_BOX_AFTER;
        ?>
" class="like_box_radio" <?php 
        checked(LIKEBTN_LIKE_BOX_AFTER, get_option('likebtn_like_box_' . $entity_name));
        ?>
 /><?php 
        _e('After the button', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            &nbsp;&nbsp;&nbsp; 
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_LIKE_BOX_BEFORE;
        ?>
" class="like_box_radio" <?php 
        checked(LIKEBTN_LIKE_BOX_BEFORE, get_option('likebtn_like_box_' . $entity_name));
        ?>
 /><?php 
        _e('Before the button', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            <div class="param_like_box hidden" style="position:absolute"><small><a target="_blank" href="https://likebtn.com/en/wordpress-like-button-plugin#like_box_template"><?php 
        _e('How to alter like box template?', LIKEBTN_I18N_DOMAIN);
        ?>
</a></small></div>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="param_like_box hidden">
                                                        <th scope="row"><label><?php 
        _e('Like box size', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e('Number of users to display in the like box', LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="number" name="likebtn_like_box_size_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_like_box_size_' . $entity_name) ? get_option('likebtn_like_box_size_' . $entity_name) : $likebtn_buttons_options['likebtn_like_box_size'];
        ?>
" class="likebtn_input likebtn_i_sm" min="1" maxlength="3"/> (<?php 
        _e('users', LIKEBTN_I18N_DOMAIN);
        ?>
)
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="param_like_box hidden">
                                                        <th scope="row"><label><?php 
        _e('Like box users', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_VOTE_LIKE;
        ?>
" <?php 
        if (get_option('likebtn_like_box_type_' . $entity_name) == LIKEBTN_VOTE_LIKE || get_option('likebtn_like_box_type_' . $entity_name) == '') {
            ?>
checked="checked"<?php 
        }
        ?>
 /><?php 
        _e('Likers', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            &nbsp;&nbsp;&nbsp; 
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_VOTE_DISLIKE;
        ?>
" <?php 
        checked(LIKEBTN_VOTE_DISLIKE, get_option('likebtn_like_box_type_' . $entity_name));
        ?>
 /><?php 
        _e('Dislikers', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                            &nbsp;&nbsp;&nbsp; 
                                                            <label>
                                                                <input type="radio" name="likebtn_like_box_type_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo LIKEBTN_VOTE_BOTH;
        ?>
" <?php 
        checked(LIKEBTN_VOTE_BOTH, get_option('likebtn_like_box_type_' . $entity_name));
        ?>
 /><?php 
        _e('Likers & dislikers', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </label>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="param_like_box hidden">
                                                        <th scope="row"><label><?php 
        _e('Like box text', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <input type="text" name="likebtn_like_box_text_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_like_box_text_' . $entity_name);
        ?>
" class="likebtn_input" />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('HTML to put before', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <?php 
        /*<i class="likebtn_help" title="<?php _e('HTML code to insert before the Like Button', LIKEBTN_I18N_DOMAIN); ?>">&nbsp;</i>*/
        ?>
                                                        </th>
                                                        <td>
                                                            <textarea name="likebtn_html_before_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input" rows="2"><?php 
        echo get_option('likebtn_html_before_' . $entity_name);
        ?>
</textarea>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('HTML to put after', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <?php 
        /*<i class="likebtn_help" title="<?php _e('HTML code to insert after the Like Button', LIKEBTN_I18N_DOMAIN); ?>">&nbsp;</i>*/
        ?>
                                                        </th>
                                                        <td>
                                                            <textarea name="likebtn_html_after_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input" rows="2"><?php 
        echo get_option('likebtn_html_after_' . $entity_name);
        ?>
</textarea>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Display on a new line', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Add a 'clear:both' style to the like button container", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_newline_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_newline_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Wrap button in a div', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("If disabled alignment and new line options have no affect", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_wrap_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_wrap_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>

                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_popup">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Popup', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top" class="plan_dependent plan_vip">
                                                        <th scope="row"><label><?php 
        _e('Disable popup', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="VIP / ULTRA"></i></label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_popup_disabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_popup_disabled_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Show popup on disliking', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_popup_dislike_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_popup_dislike_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Show popup on button load', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_popup_on_load_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_popup_on_load_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup position', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <div class="image_toggle">
                                                                <input type="radio" name="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_top" value="top" <?php 
        checked('top', get_option('likebtn_settings_popup_position_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_top"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_position/top.png" alt="<?php 
        _e('top', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('top', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>

                                                                <input type="radio" name="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_right" value="right" <?php 
        checked('right', get_option('likebtn_settings_popup_position_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_right"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_position/right.png" alt="<?php 
        _e('right', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('right', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>

                                                                <input type="radio" name="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_bottom" value="bottom" <?php 
        checked('bottom', get_option('likebtn_settings_popup_position_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_bottom"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_position/bottom.png" alt="<?php 
        _e('bottom', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('bottom', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>

                                                                <input type="radio" name="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_left" value="left" <?php 
        checked('left', get_option('likebtn_settings_popup_position_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_position_<?php 
        echo $entity_name;
        ?>
_left"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_position/left.png" alt="<?php 
        _e('left', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('left', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup style', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <div class="image_toggle">
                                                                <input type="radio" name="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
_light" value="light" <?php 
        checked('light', get_option('likebtn_settings_popup_style_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
_light"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_style/light.png" alt="<?php 
        _e('light', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('light', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>                                                                        
                                                                <input type="radio" name="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
_dark" value="dark" <?php 
        checked('dark', get_option('likebtn_settings_popup_style_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_popup_style_<?php 
        echo $entity_name;
        ?>
_dark"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_style/dark.png" alt="<?php 
        _e('dark', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('dark', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup width', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="number" name="likebtn_settings_popup_width_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_popup_width_' . $entity_name);
        ?>
" size="8"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Hide popup when clicking outside', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_popup_hide_on_outside_click_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_popup_hide_on_outside_click_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="plan_dependent plan_vip">
                                                        <th scope="row"><label><?php 
        _e('Donate buttons', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="VIP / ULTRA"></i></label></th>
                                                        <td>
                                                            <div id="donate_wrapper">
                                                                <div id="donate_pveview" class="likebtn_input"></div>

                                                                <a href="javascript:likebtnDG('popup_donate_input', false, {width: '80%'}, {preview_container: '#donate_pveview'});void(0);" id="popup_donate_trigger"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/popup_donate.png" alt="<?php 
        _e('Configure donate buttons', LIKEBTN_I18N_DOMAIN);
        ?>
"></a>
                                                            </div>

                                                            <input type="hidden" name="likebtn_settings_popup_donate_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo htmlspecialchars(get_option('likebtn_settings_popup_donate_' . $entity_name));
        ?>
" id="popup_donate_input" class="likebtn_input"/>

                                                            <p class="description">
                                                                <?php 
        _e('Collect donations using', LIKEBTN_I18N_DOMAIN);
        ?>
 <a href="https://www.paypal.com" target="_blank">PayPal</a>, <a href="https://bitcoin.org" target="_blank">Bitcoin</a>, <a href="https://wallet.google.com" target="_blank">Google Wallet</a>, <a href="https://money.yandex.ru" target="_blank">Yandex.Money</a>, <a href="http://www.webmoney.ru" target="_blank">Webmoney</a>, <a href="https://qiwi.ru" target="_blank">Qiwi</a>, <a href="http://smscoin.com" target="_blank">SmsCoin</a>, <a href="https://zaypay.com" target="_blank"><?php 
        _e('Zaypay Mobile Payments', LIKEBTN_I18N_DOMAIN);
        ?>
</a>.
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="plan_dependent plan_pro">
                                                        <th scope="row"><label><?php 
        _e('Custom HTML', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="PRO / VIP / ULTRA"></i></label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Custom HTML to insert into the popup", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <textarea name="likebtn_settings_popup_html_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input" rows="2"><?php 
        echo get_option('likebtn_settings_popup_html_' . $entity_name);
        ?>
</textarea>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup content order', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <select id="settings_popup_content_order" multiple="multiple" class="likebtn_input">
                                                                <option value="popup_donate" ><?php 
        _e('Donate buttons', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="popup_share" ><?php 
        _e('Share buttons', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="popup_html" ><?php 
        _e('Custom HTML', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                            </select>

                                                            <input type="hidden" id="settings_popup_content_order_input" name="likebtn_settings_popup_content_order_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_popup_content_order_' . $entity_name);
        ?>
" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>

                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_voting">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Voting', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Allow voting', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_voting_enabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_voting_enabled_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Allow to cancel a vote', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_voting_cancelable_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_voting_cancelable_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Allow to like and dislike at the same time', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_voting_both_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_voting_both_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Voting frequency', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <select name="likebtn_settings_voting_frequency_<?php 
        echo $entity_name;
        ?>
">
                                                                <option value=""><?php 
        _e('Once', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="1" <?php 
        selected('1', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Unlimited', LIKEBTN_I18N_DOMAIN);
        ?>
 *</option>
                                                                <option value="60" <?php 
        selected('60', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Every minute', LIKEBTN_I18N_DOMAIN);
        ?>
 *</option>
                                                                <option value="3600" <?php 
        selected('3600', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Hourly', LIKEBTN_I18N_DOMAIN);
        ?>
 *</option>
                                                                <option value="86400" <?php 
        selected('86400', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Daily', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="604800" <?php 
        selected('604800', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Weekly', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="2592000" <?php 
        selected('2592000', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Monthly', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="31536000" <?php 
        selected('31536000', get_option('likebtn_settings_voting_frequency_' . $entity_name));
        ?>
 ><?php 
        _e('Annually', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                            </select>
                                                            <p class="description">
                                                                * <?php 
        echo strtr(__('Make sure that its value is larger than <a href="%url_interval%">IP address vote interval</a> of your website (default IP address vote interval is 24 hours).', LIKEBTN_I18N_DOMAIN), array('%url_interval%' => "javascript:likebtnPopup('" . __('http://likebtn.com/en/', LIKEBTN_I18N_DOMAIN) . "customer.php/websites');void(0);"));
        ?>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Display a read-only button to the post author', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_voting_author_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_voting_author_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Voting period', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        <i class="likebtn_help" title="<?php 
        _e("After the specified period of time the button will be displayed in a read-only mode", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <select name="likebtn_voting_period_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input voting_period" id="likebtn_voting_period">
                                                                <option value=""><?php 
        _e('Voting is always active', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="<?php 
        echo LIKEBTN_VOTING_PERIOD_DATE;
        ?>
" <?php 
        selected(LIKEBTN_VOTING_PERIOD_DATE, get_option('likebtn_voting_period_' . $entity_name));
        ?>
 ><?php 
        _e('Voting is active till specific date', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                                <option value="<?php 
        echo LIKEBTN_VOTING_PERIOD_CREATED;
        ?>
" <?php 
        selected(LIKEBTN_VOTING_PERIOD_CREATED, get_option('likebtn_voting_period_' . $entity_name));
        ?>
 ><?php 
        _e('Voting is active for a period of time since item publication', LIKEBTN_I18N_DOMAIN);
        ?>
</option>
                                                            </select>
                                                            <div class="param_voting_period param_vp_date hidden">
                                                                <br/>
                                                                <?php 
        _e('Date', LIKEBTN_I18N_DOMAIN);
        ?>
: <input type="text" name="likebtn_voting_date_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_voting_date_' . $entity_name);
        ?>
" id="likebtn_voting_date" size="16" />
                                                                <p class="description">
                                                                    <?php 
        _e('Keep in mind that you have to specify your server date and time.', LIKEBTN_I18N_DOMAIN);
        ?>
<br/><?php 
        _e('Current server date and time:', LIKEBTN_I18N_DOMAIN);
        ?>
 <?php 
        echo date("Y/m/d H:i");
        ?>
                                                                </p>
                                                            </div>
                                                            <div class="param_voting_period param_vp_created hidden">
                                                                <br/>
                                                                <div id="likebtn_voting_created_cntr"></div>
                                                                <input type="number" name="likebtn_voting_created_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_voting_created_' . $entity_name);
        ?>
" id="likebtn_voting_created" class="hidden" />
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>

                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_counter">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Counter', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table">
                                                 <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Show votes counter', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_counter_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_counter_show_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Votes counter is clickable', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_counter_clickable_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_counter_clickable_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Counter padding', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_counter_padding_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_counter_padding_' . $entity_name);
        ?>
" class="likebtn_input" />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Show zero value in counter', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_counter_zero_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_counter_zero_show_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>

                                        <?php 
        /*<div class="postbox">
                                                    <h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Sharing', LIKEBTN_I18N_DOMAIN); ?></h3>
                                                    <div class="inside hidden">
                                                        <table class="form-table">
        
                                                        </table>
                                                    </div>
                                                </div>*/
        ?>

                                        <?php 
        /*
        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_loading">
            <?php /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Loading', LIKEBTN_I18N_DOMAIN); ?></h3> ?>
            <div class="inside">
                <table class="form-table">
                    
                </table>
            </div>
        </div>
        */
        ?>
                                       
                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_sharing">
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top" class="plan_dependent plan_plus">
                                                        <th scope="row"><label><?php 
        _e('Show share buttons', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="PLUS / PRO / VIP / ULTRA"></i></label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_share_enabled_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_share_enabled_' . $entity_name));
        ?>
 />
                                                            <?php 
        /*<span class="description"><?php _e('Use popup_disabled option to enable/disable popup.', LIKEBTN_I18N_DOMAIN); ?></span>*/
        ?>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="plan_dependent plan_pro">
                                                        <th scope="row">
                                                            <label><?php 
        _e('AddThis share buttons', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="PLUS / PRO / VIP / ULTRA"></i></label>
                                                        </th>
                                                        <td>
                                                            <select id="settings_addthis_service_codes" class="likebtn_at16 likebtn_input" multiple="multiple" >
                                                                <?php 
        foreach ($likebtn_addthis_service_codes as $addthis_service_code) {
            ?>
                                                                    <option value="<?php 
            echo $addthis_service_code;
            ?>
"><?php 
            echo $addthis_service_code;
            ?>
</option>
                                                                <?php 
        }
        ?>
                                                            </select>

                                                            <input type="hidden" name="likebtn_settings_addthis_service_codes_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo $value_addthis_service_codes;
        ?>
" class="likebtn_input" id="settings_addthis_service_codes_input"/>

                                                            <p class="description"><?php 
        _e('<a href="http://www.addthis.com" target="_blank">AddThis</a> is the content sharing and social insights platform helping users to share your content and drive viral traffic.', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Share buttons size', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <div class="image_toggle">
                                                                <input type="radio" name="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_small" value="small" <?php 
        checked('small', get_option('likebtn_settings_share_size_' . $entity_name));
        ?>
 >
                                                                <label for="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_small"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/share_size/small.png" alt="<?php 
        _e('small', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('small', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>

                                                                <input type="radio" name="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_medium" value="medium" <?php 
        checked('medium', get_option('likebtn_settings_share_size_' . $entity_name));
        checked('', get_option('likebtn_settings_share_size_' . $entity_name));
        ?>
 >
                                                                <label for="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_medium"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/share_size/medium.png" alt="<?php 
        _e('medium', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('medium', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>

                                                                <input type="radio" name="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
" id="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_large" value="large" <?php 
        checked('large', get_option('likebtn_settings_share_size_' . $entity_name));
        ?>
>
                                                                <label for="likebtn_settings_share_size_<?php 
        echo $entity_name;
        ?>
_large"><img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/share_size/large.png" alt="<?php 
        _e('large', LIKEBTN_I18N_DOMAIN);
        ?>
" title="<?php 
        _e('large', LIKEBTN_I18N_DOMAIN);
        ?>
" /></label>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top" class="plan_dependent plan_pro">
                                                        <th scope="row"><label><?php 
        _e('AddThis <a href="https://www.addthis.com/settings/publisher" target="_blank">Profile ID</a>', LIKEBTN_I18N_DOMAIN);
        ?>
 <i class="premium_feature" title="PLUS / PRO / VIP / ULTRA"></i></label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Enter your AddThis Profile ID to collect sharing statistics and view it on AddThis analytics page", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_addthis_pubid_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_addthis_pubid_' . $entity_name);
        ?>
" class=" likebtn_input likebtn_placeholder" placeholder="ra-511b51aa3d843ec4" />
                                                        </td>
                                                    </tr>
                                                    <?php 
        if (empty($likebtn_entities_config['likebtn_og'][$entity_name]['hide'])) {
            ?>
                                                        <tr valign="top">
                                                            <th scope="row"><label><?php 
            _e('Add Open Graph meta tags', LIKEBTN_I18N_DOMAIN);
            ?>
</label></th>
                                                            <td>
                                                                <input type="checkbox" name="likebtn_og_<?php 
            echo $entity_name;
            ?>
" value="1" <?php 
            checked('1', get_option('likebtn_og_' . $entity_name_clean));
            ?>
 />
                                                                <p class="description"><?php 
            _e('When sharing an item on Facebook it picks up the data (title, thumbnail image, description) from <a href="http://www.addthis.com/blog/2014/07/03/optimize-your-content-recommendations-with-open-graph-tags-2/#.Vn-z8Pl95nJ" target="_blank">Open Graph</a> meta tags. If these tags are not present the social network attempts to fetch information from the page itself. In order to figure out what Facebook sees use <a href="https://developers.facebook.com/tools/debug/" target="_blank">Facebook’s URL Debugger</a>', LIKEBTN_I18N_DOMAIN);
            ?>
                                                                    <?php 
            /*<br/><br/>
              <?php _e('Open Graph meta tags can be added to the single post/page only. There is no way to add specific meta tag for each post in the list.', LIKEBTN_I18N_DOMAIN); ?>*/
            ?>
                                                                     
                                                                </p>
                                                            </td>
                                                        </tr>
                                                    <?php 
        }
        ?>
                                                </table>
                                            </div>
                                        </div>

                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_tooltips">
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Always show Like button tooltip', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_tooltip_like_show_always_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_tooltip_like_show_always_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Always show Dislike button tooltip', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_tooltip_dislike_show_always_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_tooltip_dislike_show_always_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>

                                        <?php 
        /*<div class="postbox">
              <h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Domains', LIKEBTN_I18N_DOMAIN); ?></h3>
              <div class="inside hidden">
                  <table class="form-table">
                      <tr valign="top">
                          <th scope="row"><label><?php _e('Use domain of the parent window', LIKEBTN_I18N_DOMAIN); ?></label></th>
                          <td>
                              <input type="checkbox" name="likebtn_settings_domain_from_parent_<?php echo $entity_name; ?>" value="1" <?php checked('1', get_option('likebtn_settings_domain_from_parent_' . $entity_name)); ?> />
                              <span class="description">domain_from_parent</span>
                          </td>
                      </tr>
                  </table>
              </div>
          </div>*/
        ?>

                                        <div class="postbox likebtn_tab_extset hidden"  id="likebtn_extset_tab_misc">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Events', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top">
                                                        <th colspan="2" scope="row"><h3 class="likebtn_subtitle"><?php 
        _e('Loading', LIKEBTN_I18N_DOMAIN);
        ?>
</h3></th>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Lazy load', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("If button is outside a viewport it is loaded when user scrolls to it", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_lazy_load_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_lazy_load_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Show loader', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Show loader while loading a button", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_settings_loader_show_<?php 
        echo $entity_name;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_settings_loader_show_' . $entity_name));
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Loader image', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("URL of the image to use as loader image (leave empty to display default image)", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_loader_image_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_loader_image_' . $entity_name);
        ?>
" class="likebtn_input" />
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th colspan="2" scope="row"><h3 class="likebtn_subtitle"><?php 
        _e('Events', LIKEBTN_I18N_DOMAIN);
        ?>
</h3></th>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row">
                                                            <label>
                                                                <?php 
        _e('JavaScript callback function', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td class="description">
                                                            <input type="text" name="likebtn_settings_event_handler_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        _e(get_option('likebtn_settings_event_handler_' . $entity_name));
        ?>
" class="likebtn_input" />
                                                            <p class="description">
                                                                <?php 
        _e('The provided function receives the event object as its single argument. The event object has the following properties:', LIKEBTN_I18N_DOMAIN);
        ?>
<br/>
                                                                <code>type</code> – <?php 
        _e('indicates which event was dispatched:', LIKEBTN_I18N_DOMAIN);
        ?>
<br/>
                                                                ● "likebtn.loaded"<br/>
                                                                ● "likebtn.like"<br/>
                                                                ● "likebtn.unlike"<br/>
                                                                ● "likebtn.dislike"<br/>
                                                                ● "likebtn.undislike"<br/>
                                                                <code>settings</code> – <?php 
        _e('button settings', LIKEBTN_I18N_DOMAIN);
        ?>
<br/>
                                                                <code>wrapper</code> – <?php 
        _e('button DOM-element', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <?php 
        /*<tr valign="top">
              <th scope="row"><label><?php _e('Show info messages', LIKEBTN_I18N_DOMAIN); ?></label>
                  <i class="likebtn_help" title="<?php _e("Show information message instead of the button when it is restricted by tariff plan", LIKEBTN_I18N_DOMAIN); ?>">&nbsp;</i>
              </th>
              <td>
                  <input type="checkbox" name="likebtn_settings_info_message_<?php echo $entity_name; ?>" value="1" <?php checked('1', get_option('likebtn_settings_info_message_' . $entity_name)); ?> />
              </td>
          </tr>*/
        ?>
                                                </table>
                                            </div>
                                        </div>

                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_texts">
                                            <?php 
        /*<h3 style="cursor:pointer" onclick="toggleCollapsable(this)" class="likebtn_collapse_trigger"><small>►</small> <?php _e('Texts', LIKEBTN_I18N_DOMAIN); ?></h3>*/
        ?>
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Like button text after liking', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_after_like_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_after_like_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Like', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Dislike button text after disliking', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_after_dislike_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_after_dislike_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Dislike', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Like button tooltip', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_like_tooltip_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_like_tooltip_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('I like this', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Dislike button tooltip', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_dislike_tooltip_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_dislike_tooltip_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('I dislike this', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Like button tooltip after liking', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_unlike_tooltip_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_unlike_tooltip_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Unlike', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Dislike button tooltip after disliking', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_undislike_tooltip_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_undislike_tooltip_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Undislike', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Text before share buttons', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_share_text_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_share_text_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Would you like to share?', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup close button text', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_popup_close_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_popup_close_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Close', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Popup text when sharing disabled', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_popup_text_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_popup_text_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Glad you liked it!', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row"><label><?php 
        _e('Text before donate buttons', LIKEBTN_I18N_DOMAIN);
        ?>
</label></th>
                                                        <td>
                                                            <input type="text" name="likebtn_settings_i18n_popup_donate_<?php 
        echo $entity_name;
        ?>
" value="<?php 
        echo get_option('likebtn_settings_i18n_popup_donate_' . $entity_name);
        ?>
" class="likebtn_input likebtn_placeholder" placeholder="<?php 
        _e('Show gratitude in the form of a donation', LIKEBTN_I18N_DOMAIN);
        ?>
"/>
                                                        </td>
                                                    </tr>
                                                    </tr>
                                                    <tr valign="top">
                                                        <th scope="row" colspan="2">
                                                            <a href="javascript:likebtnPopup('<?php 
        _e('http://likebtn.com/en/translate-like-button-widget', LIKEBTN_I18N_DOMAIN);
        ?>
');void(0);"><?php 
        _e('Send us Translation', LIKEBTN_I18N_DOMAIN);
        ?>
</a>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                        <div class="postbox likebtn_tab_extset hidden" id="likebtn_extset_tab_buddypress">
                                            <div class="inside">
                                                <table class="form-table">
                                                    <tr>
                                                        <th scope="row"><label><?php 
        _e('Display notifications on likes & dislikes for users', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Display a notification for the author when other authenticated user likes or dislikes author's content", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_bp_notify_<?php 
        echo $entity_name_clean;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_bp_notify_' . $entity_name_clean));
        ?>
 <?php 
        if (!_likebtn_is_bp_active()) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <th scope="row"><label><?php 
        _e('Record vote action in activity stream', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_bp_activity_<?php 
        echo $entity_name_clean;
        ?>
" value="1" class="bp_activity" <?php 
        checked('1', get_option('likebtn_bp_activity_' . $entity_name_clean));
        ?>
 <?php 
        if (!_likebtn_is_bp_active()) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 />
                                                            <br/><p class="description">
                                                                ● <?php 
        _e('If you want to record vote actions for forums in BuddyPress groups, enable this option for (bbPress) Forum Posts', LIKEBTN_I18N_DOMAIN);
        ?>
<br/>
                                                                ● <?php 
        _e('Votes in private groups are NOT displayed in the public activity stream', LIKEBTN_I18N_DOMAIN);
        ?>
                                                            </p>
                                                        </td>
                                                    </tr>
                                                    <tr class="param_bp_hide_sitewide">
                                                        <th scope="row"><label><?php 
        _e('Hide vote actions from sitewide activity', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                            <i class="likebtn_help" title="<?php 
        _e("Activity will be private and only visible for the logged in user when viewing his profile activities", LIKEBTN_I18N_DOMAIN);
        ?>
">&nbsp;</i>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_bp_hide_sitewide_<?php 
        echo $entity_name_clean;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_bp_hide_sitewide_' . $entity_name_clean));
        ?>
 <?php 
        if (!_likebtn_is_bp_active()) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 />
                                                        </td>
                                                    </tr>
                                                    <tr class="param_bp_image">
                                                        <th scope="row"><label><?php 
        _e('Include item snippet in activity stream', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                        </th>
                                                        <td>
                                                            <input type="checkbox" name="likebtn_bp_image_<?php 
        echo $entity_name_clean;
        ?>
" value="1" <?php 
        checked('1', get_option('likebtn_bp_image_' . $entity_name_clean));
        ?>
 <?php 
        if (!_likebtn_is_bp_active()) {
            ?>
disabled="disabled"<?php 
        }
        ?>
 />
                                                            <br/><br/>
                                                            <?php 
        _e('Snippet template', LIKEBTN_I18N_DOMAIN);
        ?>
:
                                                            <br/>
                                                            <textarea name="likebtn_bp_snippet_tpl_<?php 
        echo $entity_name;
        ?>
" class="likebtn_input" rows="7"><?php 
        if (get_option('likebtn_bp_snippet_tpl_' . $entity_name)) {
            echo htmlspecialchars(get_option('likebtn_bp_snippet_tpl_' . $entity_name));
        } else {
            echo htmlspecialchars(LIKEBTN_BP_SNIPPET_TPL);
        }
        ?>
</textarea>
                                                            <br/><br/>
                                                            <img src="<?php 
        echo _likebtn_get_public_url();
        ?>
img/buddypress_activity.png" class="likebtn_input" />
                                                            <br/><br/>
                                                            <p class="description">
                                                                <small><?php 
        _e('Keep in mind that BuddyPress has a list of allowed HTML-tags and attributes for activity snippets. If you need extra tags in snippet, add the following code to your theme\'s functions.php:', LIKEBTN_I18N_DOMAIN);
        ?>
 </small>
                                                                <textarea class="likebtn_input disabled" rows="4" readonly="readonly">function custom_bp_activity_allowed_tags( $allowedtags ) {
    // New tags and attributes
    if (empty($allowedtags['td'])) {
        $allowedtags['td'] = array();
    }
    if (empty($allowedtags['td']['style'])) {
        $allowedtags['td']['style'] = array();
    }
    return $allowedtags;
}
add_filter('bp_activity_allowed_tags', 'custom_bp_activity_allowed_tags');</textarea>
                                                            </p>
                                                            <?php 
        /*
                                                                    <?php /*<br/>
                                                                    <small class="description"><a target="_blank" href="https://likebtn.com/en/wordpress-like-button-plugin#bb_activity_snippet_template"><?php _e('How to alter snippet template?', LIKEBTN_I18N_DOMAIN); ?></a></small>*/
        ?>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </div>
                                            <?php 
        /*
                                                    </div>
                                                </div>*/
        ?>
                                        <div class="likebtn_reset_wrapper">
                                            <span class="likebtn_sc_trgr"><a href="javascript:likebtnToggleShortcode('likebtn_sc_wr')"><?php 
        _e('Get shortcode', LIKEBTN_I18N_DOMAIN);
        ?>
</a> <small>▼</small></span>
                                            <input class="button-secondary" type="button" name="Reset" value="<?php 
        _e('Reset', LIKEBTN_I18N_DOMAIN);
        ?>
" onclick="return resetSettings('<?php 
        echo $entity_name;
        ?>
', reset_settings)" />
                                        </div>
                                        <div id="likebtn_sc_wr" class="postbox">
                                            <br/>
                                            <textarea class="likebtn_input likebtn_disabled" rows="5" id="likebtn_sc" readonly="readonly"></textarea>
                                            <table class="form-table">
                                                <tr>
                                                    <th scope="row">
                                                        <label><?php 
        _e('Button identifier', LIKEBTN_I18N_DOMAIN);
        ?>
</label>
                                                    </th>
                                                    <td>
                                                        <input type="radio" name="likebtn_identifier_type" value="post_id" checked="checked"/> <?php 
        _e('Post ID', LIKEBTN_I18N_DOMAIN);
        ?>
                                                        &nbsp;&nbsp;&nbsp;
                                                        <input type="radio" name="likebtn_identifier_type" value="custom" /> <?php 
        _e('Custom', LIKEBTN_I18N_DOMAIN);
        ?>
&nbsp;
                                                        <input type="text" id="likebtn_sc_identifier" value="item_1" class="likebtn_sc_identifier_custom hidden"/>
                                                    </td>
                                                </tr>
                                                <tr class="likebtn_sc_identifier_custom hidden">
                                                    <th scope="row" class="no-padding-top">
                                                        &nbsp;
                                                    </th>
                                                    <td class="no-padding-top">
                                                        <p class="likebtn_error">
                                                            <?php 
        _e('Identifier must be unique for all the buttons inserted using shortcode, otherwise buttons will reflect the same number of likes.', LIKEBTN_I18N_DOMAIN);
        ?>
                                                        </p>
                                                        <p class="likebtn_error">
                                                            <?php 
        _e('If custom identifier is used you will see button identifier in statistics and most liked content widget instead of post title. You also will be unable to sort posts by likes.', LIKEBTN_I18N_DOMAIN);
        ?>
                                                        </p>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            <?php 
    }
    ?>

            <input class="button-primary" type="submit" name="Save" value="<?php 
    _e('Save Changes', LIKEBTN_I18N_DOMAIN);
    ?>
" <?php 
    /*if (get_option('likebtn_show_' . $entity_name) == '1'): ?>style="display: none"<?php endif*/
    ?>
 /><br/><br/>
        </form>

    </div>
    <?php 
    _likebtn_admin_footer();
}
Exemplo n.º 11
0
function _likebtn_set_default_settings($parameter)
{
    global $likebtn_settings;
    $likebtn_entities = _likebtn_get_entities();
    foreach ($likebtn_entities as $entity_name => $entity_title) {
        update_option('likebtn_settings_' . $parameter . '_' . $entity_name, $likebtn_settings[$parameter]['default']);
    }
}
Exemplo n.º 12
0
        /**
         * Add Settings
         */
        public function preferences()
        {
            $prefs = $this->prefs;
            $likebtn_entities = _likebtn_get_entities(true, false, false);
            ?>
<h3 class="nav-tab-wrapper" style="padding: 0" id="likebtn_mycred_tab_labels">
    <?php 
            foreach ($likebtn_entities as $tab_entity_name => $tab_entity_title) {
                ?>
        <a class="nav-tab likebtn_mycred_tab_lbl_<?php 
                echo $tab_entity_name;
                ?>
 <?php 
                echo 'post' == $tab_entity_name ? 'nav-tab-active' : '';
                ?>
" href="javascript:likebtnGotoTab('<?php 
                echo $tab_entity_name;
                ?>
', '.likebtn_mycred_tab', '#likebtn_mycred_tab_', '#likebtn_mycred_tab_labels', 'likebtn_mycred_tab_lbl_');void(0);"><?php 
                _e($tab_entity_title, LIKEBTN_I18N_DOMAIN);
                ?>
</a>
    <?php 
            }
            ?>
</h3>

<?php 
            foreach ($likebtn_entities as $entity_name => $entity_title) {
                ?>
<div id="likebtn_mycred_tab_<?php 
                echo $entity_name;
                ?>
" class="likebtn_mycred_tab postbox <?php 
                if ($entity_name !== 'post') {
                    ?>
hidden<?php 
                }
                ?>
" >
	<div class="inside">
		<label class="subheader"><?php 
                echo _e('Points for Liking Content', LIKEBTN_I18N_DOMAIN);
                ?>
</label>
		<?php 
                $instance = 'like_' . $entity_name;
                $this->settings_block($prefs, $instance);
                ?>
		<label class="subheader"><?php 
                _e('Points for Getting a Content Like', LIKEBTN_I18N_DOMAIN);
                ?>
</label>
		<?php 
                $instance = 'get_like_' . $entity_name;
                $this->settings_block($prefs, $instance);
                ?>
		<label class="subheader"><?php 
                echo _e('Points for Disliking Content', LIKEBTN_I18N_DOMAIN);
                ?>
</label>
		<?php 
                $instance = 'dislike_' . $entity_name;
                $this->settings_block($prefs, $instance);
                ?>
		<label class="subheader"><?php 
                _e('Points for Getting a Content Dislike', LIKEBTN_I18N_DOMAIN);
                ?>
</label>
		<?php 
                $instance = 'get_dislike_' . $entity_name;
                $this->settings_block($prefs, $instance);
                ?>
	</div>
</div>
<?php 
            }
        }