PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.0.8
Wp Social Login and Register Social Counter v3.0.8
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 2 years ago
counter-html.php
145 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
23 if(!empty($enabled_providers[$key]['enable'])) {
24
25 // check if provider list is provided from widget
26 if(!in_array($key, $provider)) {
27 continue;
28 }
29
30 $p_obj = $factory->make($key);
31 //$follower_count = $p_obj->get_cached_count($cache_time);
32
33 $label = isset($counter_provider[$key]['label']) ? $counter_provider[$key]['label'] : '';
34 $def = isset($counter_provider[$key]['data']['value']) ? $counter_provider[$key]['data']['value'] : 0;
35 $text = isset($counter_provider[$key]['data']['text']) ? $counter_provider[$key]['data']['text'] : '';
36
37 /**
38 * We will give priority to the actual number, if actual number is zero then we will show the default value.
39 */
40 $counter = !empty($counter_data[$key]) ? $counter_data[$key] : $def;
41 #$counter = ($def) > 0 ? $def : $counter;
42
43 $id = isset($counter_provider[$key]['id']) ? $counter_provider[$key]['id'] : '';
44 $user_name = isset($counter_provider[$key]['user_name']) ? $counter_provider[$key]['user_name'] : '';
45 $pinterest_user_name = isset($counter_provider[$key]['username']) ? $counter_provider[$key]['username'] : '';
46 $type = isset($counter_provider[$key]['type']) ? $counter_provider[$key]['type'] : '';
47 $getUrl = isset($core_provider[$key]['data']['url']) ? $core_provider[$key]['data']['url'] : '#';
48
49 if($key == 'youtube') {
50 $url = sprintf($getUrl, strtolower($type), $id);
51
52 } elseif($key == 'linkedin') {
53
54 if($type == 'Profile') {
55 $url = sprintf($getUrl, 'in', $id);
56
57 } else {
58 $url = sprintf($getUrl, 'company', $id);
59 }
60 } elseif($key == 'dribbble') {
61
62 $url = get_option('home_url_dribbble_count', 'https://dribbble.com/');
63
64 } elseif($key == 'instagram') {
65
66 $url = sprintf($getUrl, $user_name);
67
68 } elseif($key == 'pinterest') {
69
70 $url = sprintf($getUrl, $pinterest_user_name);
71
72
73 } else {
74 $url = sprintf($getUrl, $id);
75 }
76
77 ?>
78 <li class="xs-counter-li <?php echo esc_attr($key); ?>" data-key="<?php echo esc_attr($key); ?>">
79 <a href="<?php echo esc_url($url); ?>" target="_blank">
80 <div class="xs-social-icon">
81 <span class="met-social met-social-<?php echo esc_attr($key); ?>"></span>
82 </div>
83
84 <?php
85
86 if(!empty($styleArr[$cntStyleKey]['content'])) {
87
88 if(!empty($styleArr[$cntStyleKey]['content']['number'])) {
89
90 ?>
91 <div class="xs-social-follower">
92 <?php echo esc_html(xs_format_num($counter)); ?>
93 </div>
94
95 <?php
96 }
97
98 if(!empty($styleArr[$cntStyleKey]['content']['label'])) {
99
100 ?>
101 <div class="xs-social-follower-text">
102 <?php echo esc_html($text); ?>
103 </div>
104 <?php
105 }
106
107 } else {
108
109 ?>
110 <div class="xs-social-follower">
111 <?php echo esc_html(xs_format_num($counter)); ?>
112 </div>
113
114 <div class="xs-social-follower-text">
115 <?php echo esc_html($text); ?>
116 </div>
117
118 <?php
119 }
120 ?>
121
122 <div class="wslu-hover-content">
123 <div class="xs-social-followers">
124 <?php echo esc_html(xs_format_num($counter)); ?>
125 </div>
126 <div class="xs-social-follower-text">
127 <?php echo esc_html($text); ?>
128 </div>
129 </div>
130
131 </a>
132 </li>
133 <?php
134 }
135 }
136
137 ?>
138
139 </ul>
140 </div>
141
142 <?php
143
144 endif;
145