PluginProbe
Social Share Buttons / 1.30
Social Share Buttons v1.30
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/network/simple.php +269 -95 0.91.30 View file →
@@ -1,156 +1,330 @@
1 -<?php
2 -namespace MBSocial;
1 +<?php
2 +namespace MBSocial;
3 3 defined('ABSPATH') or die('No direct access permitted');
4 4
5 -/*
6 -class blogLovingNetwork extends mbNetwork
5 +class diggNetwork extends mbNetwork
7 6 {
8 - protected $network = 'blogloving';
9 - protected $icon = 'fa-bold';
10 -
11 -
12 - public function __construct()
7 + protected $network = 'digg';
8 + protected $icon = 'fa-digg';
9 + protected $priority = 'readmore';
10 + protected $color = '#000';
11 +
12 + public function __construct()
13 13 {
14 -
15 - $this->popup = false;
16 - }
17 -} */
14 + parent::__construct();
15 + $this->label = __('Share', 'mbsocial');
16 + $this->share_url = 'http://digg.com/submit?url={url}&title={title}';
17 + $this->popup_dimensions = array(600,600);
18 18
19 -class diggNetwork extends mbNetwork
20 -{
21 - protected $network = 'digg';
22 - protected $icon = 'fa-digg';
23 - protected $priority = 'readmore';
24 -
25 - public function __construct()
26 - {
27 - $this->label = __('Share', 'mbsocial');
28 - $this->share_url = 'http://digg.com/submit?url={url}&title={title}';
29 - $this->popup_dimensions = array(600,600);
30 -
31 19 }
32 20 }
33 21
34 22 class emailNetwork extends mbNetwork
35 23 {
36 - protected $network = 'email';
37 - protected $icon = 'fa-envelope';
38 -
39 - public function __construct()
24 + protected $network = 'email';
25 + protected $icon = 'fa-envelope';
26 + protected $icon_type = 'fas';
27 + protected $color = '#5e5e5e';
28 + protected $forcesamewindow = true;
29 + protected $is_popup = false;
30 +
31 + public function __construct()
40 32 {
33 + $this->label = __('Email', 'mbsocial');
34 + if (Install::isPro() )
35 + $this->share_url = 'mailto:?subject={email_subject}&body={email_content}';
36 + else {
37 + $this->share_url = 'mailto:?subject={title}&body={url}';
38 + }
41 39
42 - $this->label = __('Email', 'mbsocial');
43 - $this->share_url = 'mailto:?subject={title}&body={url}';
44 - $this->popup = false;
45 - $this->countable = false;
40 + parent::__construct();
41 +
46 42 }
47 43 }
48 44
49 45 class facebookNetwork extends mbNetwork
50 46 {
51 - protected $network = 'facebook';
52 - protected $icon = 'fa-facebook';
53 -
54 - public function __construct()
47 + protected $network = 'facebook';
48 +
49 + protected $icon = 'fa-facebook-f';
50 + protected $color = '#3b5998';
51 +
52 + public function __construct()
55 53 {
56 - $this->label = __('Share', 'mbsocial');
57 - $this->share_url = 'https://www.facebook.com/sharer.php?u={url}';
54 + $this->label = __('Share', 'mbsocial');
55 + $this->share_url = 'https://www.facebook.com/sharer.php?u={url}';
56 + $this->profile_url = 'https://www.facebook.com/{profile}';
58 57 $this->countable = true;
59 - $this->count_api = 'https://graph.facebook.com/{url}';
60 - $this->return_var = 'share|share_count';
61 -
58 + $this->count_api = 'https://graph.facebook.com/{url}';
59 + $this->return_var = 'share|share_count';
60 + $this->popup_dimensions = array(550,320);
61 +
62 + parent::__construct();
62 63 }
64 +
63 65 }
64 66
67 +class linkedinNetwork extends mbNetwork
68 +{
69 + protected $network = 'linkedin';
70 + protected $icon = 'fa-linkedin-in';
71 + protected $color = '#007bb6';
72 + protected $priority = 'unselected';
65 73
66 74
67 -class linkedinNetwork extends mbNetwork
68 -{
69 - protected $network = 'linkedin';
70 - protected $icon = 'fa-linkedin';
71 -
72 - public function __construct()
75 + public function __construct()
73 76 {
74 77 $this->label = __('Share','mbsocial');
75 - $this->share_url = 'https://www.linkedin.com/shareArticle?mini=true&url={url}';
76 - $this->count_api = 'https://www.linkedin.com/countserv/count/share?url={url}&format=json';
77 - $this->countable = true;
78 - $this->return_var = 'count';
79 - $this->popup_dimensions = array(700,500);
78 + $this->share_url = 'https://www.linkedin.com/shareArticle?mini=true&url={url}';
79 + $this->alternate_url = 'https://www.linkedin.com/company/{profile}';
80 + $this->alternate_label = __('Company Profile');
81 + $this->profile_url = 'https://www.linkedin.com/in/{profile}';
82 + // Linkedin counts where killed
83 + //$this->count_api = 'https://www.linkedin.com/countserv/count/share?url={url}&format=json';
84 + //$this->countable = true;
85 + //$this->return_var = 'count';
86 +
87 + $this->popup_dimensions = array(700,500);
88 +
89 + parent::__construct();
90 +
80 91 }
81 92
82 93 }
83 -
84 94
85 -class printNetwork extends mbNetwork
95 +
96 +class printNetwork extends mbNetwork
86 97 {
87 - protected $network = 'print';
88 - protected $icon = 'fa-print';
98 + protected $network = 'print';
99 + protected $icon = 'fa-print';
100 + protected $icon_type = 'fas';
101 + protected $color = '#5e5e5e';
102 + protected $forcesamewindow = true;
103 + protected $is_popup = false;
89 104
90 - public function __construct()
105 + public function __construct()
91 106 {
92 107 $this->label = __('Print', 'mbsocial');
93 - $this->share_url = 'javascript:window.print()';
94 - $this->countable = false;
95 - $this->popup = false;
108 + $this->share_url = 'javascript:window.print()';
109 +
110 + parent::__construct();
111 +
96 112 }
97 113 }
98 114
99 115
100 -class stumbleuponNetwork extends mbNetwork
116 +class stumbleuponNetwork extends mbNetwork
101 117 {
102 - protected $network = 'stumbleupon';
103 - protected $priority = 'readmore';
104 - protected $icon = 'fa-stumbleupon';
118 + protected $network = 'stumbleupon';
119 + protected $priority = 'readmore';
120 + protected $icon = 'fa-stumbleupon';
121 + protected $color = '#eb4924';
105 122
106 - public function __construct()
123 + public function __construct()
107 124 {
108 125 $this->label = __('Share','mbsocial');
109 - $this->share_url = 'https://www.stumbleupon.com/submit?url={url}&title={title}';
110 - $this->count_api = 'https://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}';
126 + $this->share_url = 'https://www.stumbleupon.com/submit?url={url}&title={title}';
127 + $this->count_api = 'https://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}';
111 128 $this->countable = true;
112 - $this->return_var = 'result|views';
113 -
114 -
115 - }
129 + $this->return_var = 'result|views';
130 +
131 + parent::__construct();
132 + }
116 133 }
117 134
118 -class redditNetwork extends mbNetwork
135 +class redditNetwork extends mbNetwork
119 136 {
120 - protected $network = 'reddit';
121 - protected $priority = 'readmore';
122 - protected $icon = 'fa-reddit';
123 -
124 -
125 - public function __construct()
137 + protected $network = 'reddit';
138 + protected $priority = 'unselected';
139 + protected $icon = 'fa-reddit';
140 + protected $color = '#ff4500';
141 +
142 +
143 + public function __construct()
126 144 {
127 145 $this->label = __('Share', 'mbsocial');
128 - $this->share_url = 'https://reddit.com/submit?url={url}&title={title}';
129 - $this->count_api = 'https://buttons.reddit.com/button_info.json?url={url}';
146 + $this->share_url = 'https://reddit.com/submit?url={url}&title={title}';
147 + $this->count_api = 'https://buttons.reddit.com/button_info.json?url={url}';
130 148 $this->countable = true;
131 - $this->return_var = 'data|children|0|data|score';
132 - $this->popup_dimensions = array(800,500);
133 -
134 -
149 + $this->profile_url = 'https://www.reddit.com/user/{profile}';
150 + $this->return_var = 'data|children|0|data|score';
151 + $this->popup_dimensions = array(800,500);
152 +
153 + parent::__construct();
154 +
135 155 }
136 156
137 157 }
138 158
139 159
140 -class whatappNetwork extends mbNetwork
160 +class whatappNetwork extends mbNetwork
141 161 {
142 - protected $network = 'whatsapp';
143 - protected $priority = 'readmore';
144 - protected $icon = 'fa-whatsapp';
145 -
162 + protected $network = 'whatsapp';
163 + protected $priority = 'readmore';
164 + protected $icon = 'fa-whatsapp';
165 + protected $color = '#4dc247';
166 +
146 167 protected $displayDesktop = false;
147 -
148 - public function __construct()
168 +
169 + public function __construct()
149 170 {
150 171 $this->label = __('Send', 'mbsocial');
151 - $this->share_url = 'whatsapp://send?text={url} {title}';
152 - $this->countable = false;
153 -
172 + $this->share_url = 'whatsapp://send?text={url} {title}';
173 +
174 + parent::__construct();
175 +
154 176 }
177 +
178 +}
179 +
180 +class instagramNetwork extends mbNetwork
181 +{
182 + protected $network = 'instagram';
183 + protected $priority = 'unselected';
184 + protected $icon = 'fa-instagram';
185 + protected $color = '#517fa4';
186 +
187 + public function __construct()
188 + {
189 +
190 + $this->label = __('Follow', 'mbsocial');
191 + $this->profile_url = 'https://instagram.com/{profile}';
192 +
193 + parent::__construct();
194 +
195 + }
196 +
197 +}
198 +
199 +
200 +class youtubeNetwork extends mbNetwork
201 +{
202 + protected $network = 'youtube';
203 + protected $priority = 'readmore';
204 + protected $icon = 'fa-youtube';
205 + protected $color = '#bb0000';
206 + protected $is_popup = false;
207 +
208 + public function __construct()
209 + {
210 + $this->label = __('View', 'mbsocial');
211 + $this->profile_url = 'https://youtube.com/{profile}';
212 +
213 + parent::__construct();
214 + }
215 +}
216 +
217 +class snapchatNetwork extends mbNetwork
218 +{
219 + protected $network = 'snapchat';
220 + protected $priority = 'readmore';
221 + protected $icon = 'fa-snapchat';
222 + // protected $color = '#fffc00';
223 + protected $color = '#000';
224 + protected $displayDesktop = false;
225 +
226 + public function __construct()
227 + {
228 + $this->label = __('Follow', 'mbsocial');
229 + $this->profile_url = 'https://snapchat.com/{profile}';
230 +
231 + parent::__construct();
232 +
233 + }
234 +
235 +}
236 +
237 +class rssNetwork extends mbNetwork
238 +{
239 + protected $network = 'rss';
240 + protected $priority = 'readmore';
241 + protected $icon = 'fa-rss';
242 + protected $icon_type = 'fas';
243 + protected $color = '#F99000';
244 +
245 + protected $share_profile = false;
246 + protected $is_popup = false;
247 + // protected $profile_placeholder = '';
248 +
249 + public function __construct()
250 + {
251 + $this->nice_name = __('RSS', 'mbsocial');
252 + $this->profile_placeholder = __('Feed URL', 'mbsocial');
253 + $this->label = __('Follow', 'mbsocial');
254 + $this->profile_url = '{profile}';
255 + parent::__construct();
256 +
257 + }
258 +/*
259 + public function get_url()
260 + {
261 + $url = parent::get_url();
262 +
263 + if (strlen(trim($url)) == 0)
264 + {
265 + return bloginfo('rss_url');
266 + }
267 + } */
268 +
269 +}
270 +
271 +class vimeoNetwork extends mbNetwork
272 +{
273 + protected $network = 'vimeo';
274 + protected $priority = 'readmore';
275 + protected $icon = 'fa-vimeo-v';
276 + protected $color = '#1ab7ea';
277 +
278 + public function __construct()
279 + {
280 + $this->label = __('View', 'mbsocial');
281 + $this->profile_url = 'https://vimeo.com/{profile}';
282 +
283 + parent::__construct();
284 +
285 + }
286 +}
287 +
288 +class tiktokNetwork extends mbNetwork
289 +{
290 +
291 + protected $network = 'tiktok';
292 + protected $priority = 'readmore';
293 + protected $icon = 'fa-tiktok';
294 + protected $icon_type = 'fab';
295 + protected $color = '#010101';
296 +
297 + public function __construct()
298 + {
299 + $this->nice_name = __('TikTok', 'mbsocial');
300 + $this->label = __('Follow', 'mbsocial');
301 + $this->profile_url = 'https://tiktok.com/{profile}';
302 +
303 + parent::__construct();
304 +
305 + }
306 +}
307 +
308 +
309 +class phoneNetwork extends mbNetwork
310 +{
311 + protected $network = 'phone';
312 + protected $priority = 'readmore';
313 + protected $icon = 'fa-phone';
314 + protected $icon_type = 'fas';
315 + protected $color = '#00932c';
316 + protected $is_popup = false;
317 +
318 + public function __construct()
319 + {
320 + $this->nice_name = __('Phone Number', 'mbsocial');
321 + $this->label = __('Call', 'mbsocial');
322 + $this->profile_url = 'tel:{profile}';
323 + $this->profile_placeholder = __('Phone Number', 'mbsocial');
324 + $this->displayDesktop = false;
325 +
326 + parent::__construct();
327 + }
328 +
155 329
156 330 }