PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.0
Wp Social Login and Register Social Counter v2.2.0
3.2.1 trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / template / counter / counter-html.php
wp-social / template / counter Last commit date
counter-html.php 3 years ago
counter-html.php
133 lines
1 <?php
2
3 defined('ABSPATH') || exit;
4
5 $enabled_providers = \WP_Social\App\Settings::get_enabled_provider_conf_counter();
6
7 $show_core_provider = \WP_Social\App\Providers::get_core_providers_count();
8 $show_core_provider = array_keys($show_core_provider);
9
10 if(!empty($enabled_providers)) : ?>
11
12 <div class="xs_social_counter_widget <?php echo esc_attr($className); ?>">
13 <ul class="xs_counter_url <?php echo esc_attr($widget_style); ?>">
14
15 <?php
16
17 $factory = new \WP_Social\Lib\Provider\Counter_Factory();
18 $cache_time = \WP_Social\App\Settings::get_counter_cache_time();
19
20 foreach($show_core_provider as $key) {
21
22 if(!empty($enabled_providers[$key]['enable'])) {
23
24 // check if provider list is provided from widget
25 if(!in_array($key, $provider)) {
26 continue;
27 }
28
29 $p_obj = $factory->make($key);
30 //$follower_count = $p_obj->get_cached_count($cache_time);
31
32 $label = isset($counter_provider[$key]['label']) ? $counter_provider[$key]['label'] : '';
33 $def = isset($counter_provider[$key]['data']['value']) ? $counter_provider[$key]['data']['value'] : 0;
34 $text = isset($counter_provider[$key]['data']['text']) ? $counter_provider[$key]['data']['text'] : '';
35
36 /**
37 * We will give priority to the actual number, if actual number is zero then we will show the default value.
38 */
39 $counter = !empty($counter_data[$key]) ? $counter_data[$key] : $def;
40 #$counter = ($def) > 0 ? $def : $counter;
41
42 $id = isset($counter_provider[$key]['id']) ? $counter_provider[$key]['id'] : '';
43 $type = isset($counter_provider[$key]['type']) ? $counter_provider[$key]['type'] : '';
44 $getUrl = isset($core_provider[$key]['data']['url']) ? $core_provider[$key]['data']['url'] : '#';
45
46 if($key == 'youtube') {
47 $url = sprintf($getUrl, strtolower($type), $id);
48
49 } elseif($key == 'linkedin') {
50
51 if($type == 'Profile') {
52 $url = sprintf($getUrl, 'in', $id);
53
54 } else {
55 $url = sprintf($getUrl, 'company', $id);
56 }
57 } elseif($key == 'dribbble') {
58
59 $url = get_option('home_url_dribbble_count', 'https://dribbble.com/');
60
61 } else {
62 $url = sprintf($getUrl, $id);
63 }
64
65 ?>
66 <li class="xs-counter-li <?php echo esc_attr($key); ?>" data-key="<?php echo esc_attr($key); ?>">
67 <a href="<?php echo esc_url($url); ?>" target="_blank">
68 <div class="xs-social-icon">
69 <span class="met-social met-social-<?php echo esc_attr($key); ?>"></span>
70 </div>
71
72 <?php
73
74 if(!empty($styleArr[$cntStyleKey]['content'])) {
75
76 if(!empty($styleArr[$cntStyleKey]['content']['number'])) {
77
78 ?>
79 <div class="xs-social-follower">
80 <?php echo esc_html(xs_format_num($counter)); ?>
81 </div>
82
83 <?php
84 }
85
86 if(!empty($styleArr[$cntStyleKey]['content']['label'])) {
87
88 ?>
89 <div class="xs-social-follower-text">
90 <?php echo esc_html($text); ?>
91 </div>
92 <?php
93 }
94
95 } else {
96
97 ?>
98 <div class="xs-social-follower">
99 <?php echo esc_html(xs_format_num($counter)); ?>
100 </div>
101
102 <div class="xs-social-follower-text">
103 <?php echo esc_html($text); ?>
104 </div>
105
106 <?php
107 }
108 ?>
109
110 <div class="wslu-hover-content">
111 <div class="xs-social-followers">
112 <?php echo esc_html(xs_format_num($counter)); ?>
113 </div>
114 <div class="xs-social-follower-text">
115 <?php echo esc_html($text); ?>
116 </div>
117 </div>
118
119 </a>
120 </li>
121 <?php
122 }
123 }
124
125 ?>
126
127 </ul>
128 </div>
129
130 <?php
131
132 endif;
133