PluginProbe
Social Share Buttons / 1.18
Social Share Buttons v1.18
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
share-button / classes / network / simple.php

simple.php in Social Share Buttons 1.18, at classes/network/simple.php

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