/**
  * 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 widget($args, $instance = array())
 {
     global $wpdb;
     global $likebtn_nonpost_entities;
     global $likebtn_bbp_post_types;
     $has_posts = false;
     $post_types_count = 0;
     if (is_array($args)) {
         extract($args);
     }
     $instance = LikeBtnLikeButtonMostLikedWidget::prepareInstance($instance);
     if (is_array($instance)) {
         extract($instance);
     }
     if (empty($instance['entity_name'])) {
         $instance['entity_name'] = array(LIKEBTN_ENTITY_POST);
     }
     if (empty($instance['exclude_categories'])) {
         $instance['exclude_categories'] = array();
     }
     // Author
     $author_in = '';
     if (!empty($instance['author'])) {
         $author_in = "'" . implode("','", explode(",", preg_replace("/[^0-9,]/", '', $instance['author']))) . "'";
     }
     // Add bbPress
     $nonpost_entities = $likebtn_nonpost_entities;
     $nonpost_entities[] = LIKEBTN_ENTITY_BBP_POST;
     foreach ($instance['entity_name'] as $entity_index => $entity_name) {
         $instance['entity_name'][$entity_index] = str_replace("'", '', trim($entity_name));
         if (!in_array($entity_name, $nonpost_entities)) {
             $has_posts = true;
         }
     }
     $query_limit = '';
     if (isset($instance['number']) && (int) $instance['number'] > 0) {
         $query_limit = "LIMIT " . (int) $instance['number'];
     }
     // getting the most liked content
     $query = '';
     // Posts
     if ($has_posts) {
         $query_post_types = "'" . implode("','", $instance['entity_name']) . "'";
         $query_exclude_categories = '';
         if (count($instance['exclude_categories'])) {
             $query_exclude_categories = "'" . implode("','", $instance['exclude_categories']) . "'";
         }
         $query_attachment = '';
         if (in_array(LIKEBTN_ENTITY_ATTACHMENT, $instance['entity_name'])) {
             $query_attachment = " OR (p.post_type = 'attachment') ";
         }
         $query .= "\n                 SELECT\n                    DISTINCT p.ID as 'post_id',\n                    p.post_title,\n                    p.post_date,\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    p.post_type,\n                    p.post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}postmeta pm_likes\n                 LEFT JOIN {$wpdb->prefix}posts p\n                     ON (p.ID = pm_likes.post_id)\n                 LEFT JOIN {$wpdb->prefix}postmeta pm_dislikes\n                     ON (pm_dislikes.post_id = pm_likes.post_id AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}postmeta pm_likes_minus_dislikes\n                     ON (pm_likes_minus_dislikes.post_id = pm_likes.post_id AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "') \n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "'\n                    AND ((p.post_status = 'publish'\n                    AND p.post_type in ({$query_post_types})) {$query_attachment}) ";
         if ($query_exclude_categories) {
             //              ".($query_exclude_categories ? "
             // LEFT JOIN {$wpdb->term_relationships} t_rel ON (t_rel.object_id = p.ID)
             // LEFT JOIN {$wpdb->term_taxonomy} t_tax ON (t_tax.term_taxonomy_id = t_rel.term_taxonomy_id)" : '')."
             $query .= " AND NOT EXISTS (\n                    SELECT t_tax.term_id\n                    FROM {$wpdb->term_relationships} t_rel\n                    LEFT JOIN {$wpdb->term_taxonomy} t_tax ON (t_tax.term_taxonomy_id = t_rel.term_taxonomy_id)\n                    WHERE t_rel.object_id = p.ID AND t_tax.term_id IN ({$query_exclude_categories})\n                ) ";
         }
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND p.post_date >= '" . $this->timeRangeToDateTime($instance['time_range']) . "' ";
         }
         if ($author_in) {
             $query .= " AND p.post_author IN (" . $author_in . ") ";
         }
         $post_types_count++;
     }
     // Comments
     if (in_array(LIKEBTN_ENTITY_COMMENT, $instance['entity_name'])) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query .= "\n                 SELECT\n                    p.comment_ID as 'post_id',\n                    p.comment_content as post_title,\n                    p.comment_date as 'post_date',\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    '" . LIKEBTN_ENTITY_COMMENT . "' as post_type,\n                    '' as post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}commentmeta pm_likes\n                 LEFT JOIN {$wpdb->prefix}comments p\n                    ON (p.comment_ID = pm_likes.comment_id)\n                 LEFT JOIN {$wpdb->prefix}commentmeta pm_dislikes\n                    ON (pm_dislikes.comment_id = pm_likes.comment_id AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}commentmeta pm_likes_minus_dislikes\n                     ON (pm_likes_minus_dislikes.comment_id = pm_likes.comment_id AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "')\n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "' \n                    AND p.comment_approved = 1 ";
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND comment_date >= '" . $this->timeRangeToDateTime($instance['time_range']) . "'";
         }
         if ($author_in) {
             $query .= " AND p.comment_author IN (" . $author_in . ") ";
         }
         $post_types_count++;
     }
     // Custom items
     if (in_array(LIKEBTN_ENTITY_CUSTOM_ITEM, $instance['entity_name'])) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query_post_types = "'" . implode("','", $instance['entity_name']) . "'";
         $query .= "\n                 SELECT\n                    p.ID as 'post_id',\n                    p.identifier as 'post_title',\n                    '' as 'post_date',\n                    p.likes,\n                    p.dislikes,\n                    p.likes_minus_dislikes,\n                    '" . LIKEBTN_ENTITY_CUSTOM_ITEM . "' as 'post_type',\n                    '' as 'post_mime_type',\n                    url\n                 FROM {$wpdb->prefix}" . LIKEBTN_TABLE_ITEM . " p\n                 WHERE\n                    1 = 1 ";
         $post_types_count++;
     }
     // BuddyPress Member
     if (_likebtn_is_bp_active() && in_array(LIKEBTN_ENTITY_BP_MEMBER, $instance['entity_name'])) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query .= "\n                 SELECT\n                    p.ID as 'post_id',\n                    p.display_name as post_title,\n                    p.user_registered as 'post_date',\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    '" . LIKEBTN_ENTITY_BP_MEMBER . "' as post_type,\n                    '' as post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}bp_xprofile_meta pm_likes\n                 LEFT JOIN {$wpdb->prefix}users p\n                    ON (p.ID = pm_likes.object_id AND pm_likes.object_type = '" . LIKEBTN_BP_XPROFILE_OBJECT_TYPE . "')\n                 LEFT JOIN {$wpdb->prefix}bp_xprofile_meta pm_dislikes\n                    ON (pm_dislikes.object_id = pm_likes.object_id AND pm_dislikes.object_type = '" . LIKEBTN_BP_XPROFILE_OBJECT_TYPE . "' AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}bp_xprofile_meta pm_likes_minus_dislikes\n                    ON (pm_likes_minus_dislikes.object_id = pm_likes.object_id AND pm_likes_minus_dislikes.object_type = '" . LIKEBTN_BP_XPROFILE_OBJECT_TYPE . "' AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "')\n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "' \n                    AND p.user_status = 0 ";
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND p.user_registered >= '" . $this->timeRangeToDateTime($instance['time_range']) . "'";
         }
         $post_types_count++;
     }
     // BuddyPress Activities
     if (_likebtn_is_bp_active() && (in_array(LIKEBTN_ENTITY_BP_ACTIVITY_POST, $instance['entity_name']) || in_array(LIKEBTN_ENTITY_BP_ACTIVITY_UPDATE, $instance['entity_name']) || in_array(LIKEBTN_ENTITY_BP_ACTIVITY_COMMENT, $instance['entity_name']) || in_array(LIKEBTN_ENTITY_BP_ACTIVITY_TOPIC, $instance['entity_name']))) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query .= "\n                SELECT \n                    p.id as 'post_id',\n                    CONCAT( IF(p.action != '', p.action, IF(p.content !='', p.content, IF(p.primary_link != '', p.primary_link, p.type))), IF(p.content != '' && p.type != 'bbp_topic_create' && p.type != 'new_blog_post', CONCAT(': ', p.content), '') ) as 'post_title',\n                    p.date_recorded as 'post_date',\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    IF (p.type = 'bbp_topic_create',\n                        '" . LIKEBTN_ENTITY_BP_ACTIVITY_TOPIC . "',\n                        IF (p.type = 'new_blog_post',\n                            '" . LIKEBTN_ENTITY_BP_ACTIVITY_POST . "',\n                            '" . LIKEBTN_ENTITY_BP_ACTIVITY_UPDATE . "'\n                        )\n                    ) as post_type,\n                    '' as post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}bp_activity_meta pm_likes\n                 LEFT JOIN {$wpdb->prefix}bp_activity p\n                     ON (p.id = pm_likes.activity_id)\n                 LEFT JOIN {$wpdb->prefix}bp_activity_meta pm_dislikes\n                     ON (pm_dislikes.activity_id = pm_likes.activity_id AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}bp_activity_meta pm_likes_minus_dislikes\n                     ON (pm_likes_minus_dislikes.activity_id = pm_likes.activity_id AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "')\n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "' \n                    AND p.hide_sitewide = 0\n                    AND p.is_spam = 0 ";
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND p.user_registered >= '" . $this->timeRangeToDateTime($instance['time_range']) . "'";
         }
         if ($author_in) {
             $query .= " AND p.user_id IN (" . $author_in . ") ";
         }
         $post_types_count++;
     }
     // bbPress Post
     if (_likebtn_is_bbp_active() && in_array(LIKEBTN_ENTITY_BBP_POST, $instance['entity_name'])) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query .= "\n                 SELECT\n                    p.ID as 'post_id',\n                    IF (p.post_title != '', p.post_title, p.post_content) as post_title,\n                    p.post_date,\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    p.post_type,\n                    p.post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}postmeta pm_likes\n                 LEFT JOIN {$wpdb->prefix}posts p\n                     ON (p.ID = pm_likes.post_id)\n                 LEFT JOIN {$wpdb->prefix}postmeta pm_dislikes\n                     ON (pm_dislikes.post_id = pm_likes.post_id AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}postmeta pm_likes_minus_dislikes\n                     ON (pm_likes_minus_dislikes.post_id = pm_likes.post_id AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "')\n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "'\n                    AND p.post_type in ('" . implode("', '", $likebtn_bbp_post_types) . "') \n                    AND p.post_status = 'publish' ";
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND post_date >= '" . $this->timeRangeToDateTime($instance['time_range']) . "'";
         }
         if ($author_in) {
             $query .= " AND p.post_author IN (" . $author_in . ") ";
         }
         $post_types_count++;
     }
     // bbPress User
     if (_likebtn_is_bbp_active() && in_array(LIKEBTN_ENTITY_BBP_USER, $instance['entity_name'])) {
         if ($post_types_count > 0) {
             $query .= " UNION ";
         }
         $query .= "\n                 SELECT\n                    p.ID as 'post_id',\n                    p.display_name as post_title,\n                    p.user_registered as 'post_date',\n                    CONVERT(pm_likes.meta_value, UNSIGNED INTEGER) as 'likes',\n                    CONVERT(pm_dislikes.meta_value, UNSIGNED INTEGER) as 'dislikes',\n                    CONVERT(pm_likes_minus_dislikes.meta_value, SIGNED INTEGER) as 'likes_minus_dislikes',\n                    '" . LIKEBTN_ENTITY_BBP_USER . "' as post_type,\n                    '' as post_mime_type,\n                    '' as url\n                 FROM {$wpdb->prefix}usermeta pm_likes\n                 LEFT JOIN {$wpdb->prefix}users p\n                    ON (p.ID = pm_likes.user_id)\n                 LEFT JOIN {$wpdb->prefix}usermeta pm_dislikes\n                    ON (pm_dislikes.user_id = pm_likes.user_id AND pm_dislikes.meta_key = '" . LIKEBTN_META_KEY_DISLIKES . "')\n                 LEFT JOIN {$wpdb->prefix}usermeta pm_likes_minus_dislikes\n                    ON (pm_likes_minus_dislikes.user_id = pm_likes.user_id AND pm_likes_minus_dislikes.meta_key = '" . LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES . "')\n                 WHERE\n                    pm_likes.meta_key = '" . LIKEBTN_META_KEY_LIKES . "' \n                    AND p.user_status = 0 ";
         if (!empty($instance['time_range']) && $instance['time_range'] != 'all') {
             $query .= " AND p.user_registered >= '" . $this->timeRangeToDateTime($instance['time_range']) . "'";
         }
         $post_types_count++;
     }
     if ($post_types_count > 1) {
         $query = "SELECT * FROM (" . $query . ") main_query";
     }
     $query .= "\n            ORDER BY ";
     switch ($instance['order']) {
         default:
         case 'likes':
             $query .= "likes";
             break;
         case 'dislikes':
             $query .= "dislikes";
             break;
         case 'likes_minus_dislikes':
             $query .= "likes_minus_dislikes";
             break;
     }
     $query .= " DESC";
     $query .= " {$query_limit}";
     // echo "<pre>";
     // print_r($query);
     // exit();
     $posts = $wpdb->get_results($query);
     $post_loop = array();
     if (count($posts) > 0) {
         foreach ($posts as $i => $db_post) {
             $post = array('id' => $db_post->post_id, 'type' => $db_post->post_type, 'post_mime_type' => $db_post->post_mime_type, 'title' => '', 'link' => '', 'likes' => '', 'dislikes' => '', 'date' => '', 'excerpt' => '', 'author_id' => '', 'author_name' => '');
             if (empty($instance['title_length'])) {
                 $instance['title_length'] = LIKEBTN_WIDGET_TITLE_LENGTH;
             }
             // Title
             $post['title'] = _likebtn_prepare_title($db_post->post_type, $db_post->post_title, $instance['title_length']);
             // Link
             $post['link'] = _likebtn_get_entity_url($db_post->post_type, $db_post->post_id, $db_post->url);
             $post['likes'] = $db_post->likes;
             $post['dislikes'] = $db_post->dislikes;
             if ($show_date) {
                 $post['date'] = strtotime($db_post->post_date);
             }
             if ($show_author) {
                 $author_id = _likebtn_get_author_id($db_post->post_type, $db_post->post_id);
                 if ($author_id) {
                     $post['author_id'] = $author_id;
                     $post['author_name'] = _likebtn_get_entity_title(LIKEBTN_ENTITY_USER, $author_id);
                 }
             }
             if ($show_excerpt) {
                 $post['excerpt'] = _likebtn_get_entity_excerpt($db_post->post_type, $db_post->post_id);
             }
             // For bbPress replies
             if (!$post['title']) {
                 $post['title'] = _likebtn_shorten_title($post['excerpt'], $instance['title_length']);
             }
             $post_loop[$i] = $post;
         }
     }
     // Get and include the template we're going to use
     ob_start();
     include $this->getTemplateHierarchy(self::TEMPLATE);
     $result = ob_get_contents();
     ob_get_clean();
     return $result;
 }
function _likebtn_delete_bp_member_votes($entity_id)
{
    global $wpdb;
    if (!_likebtn_is_bp_active()) {
        return false;
    }
    $bp_xprofile = $wpdb->get_row("\n        SELECT id\n        FROM " . $wpdb->prefix . "bp_xprofile_data\n        WHERE user_id = {$entity_id}\n    ");
    if (!empty($bp_xprofile)) {
        bp_xprofile_delete_meta($entity_id, LIKEBTN_BP_XPROFILE_OBJECT_TYPE, LIKEBTN_META_KEY_LIKES);
        bp_xprofile_delete_meta($entity_id, LIKEBTN_BP_XPROFILE_OBJECT_TYPE, LIKEBTN_META_KEY_DISLIKES);
        bp_xprofile_delete_meta($entity_id, LIKEBTN_BP_XPROFILE_OBJECT_TYPE, LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES);
        return true;
    }
    return false;
}
Beispiel #4
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;
}
Beispiel #5
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();
}