@@ -206,9 +206,6 @@ |
||
206 | 206 | * Get the number of shares |
207 | 207 | * |
208 | 208 | * @param string $url The URL to get the shares for |
209 | - * @param string $token Unique string to identify the page |
|
210 | - * @return array |
|
211 | - * @access private |
|
212 | 209 | */ |
213 | 210 | private function get_share_count($url) |
214 | 211 | { |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | protected $phpbb_root_path; |
36 | 36 | |
37 | 37 | /** |
38 | - * Constructor |
|
39 | - * |
|
40 | - * @param \phpbb\config\config $config Config Object |
|
41 | - * @param \phpbb\template\template $template Template object |
|
42 | - * @param \phpbb\user $user User object |
|
43 | - * @param \phpbb\request\request $request Request object |
|
44 | - * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
|
45 | - * @param string $phpbb_root_path phpbb_root_path |
|
46 | - * @access public |
|
47 | - */ |
|
38 | + * Constructor |
|
39 | + * |
|
40 | + * @param \phpbb\config\config $config Config Object |
|
41 | + * @param \phpbb\template\template $template Template object |
|
42 | + * @param \phpbb\user $user User object |
|
43 | + * @param \phpbb\request\request $request Request object |
|
44 | + * @param \phpbb\cache\driver\driver_interface $cache Cache driver interface |
|
45 | + * @param string $phpbb_root_path phpbb_root_path |
|
46 | + * @access public |
|
47 | + */ |
|
48 | 48 | public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\cache\driver\driver_interface $cache, $phpbb_root_path) |
49 | 49 | { |
50 | 50 | $this->config = $config; |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * Assign functions defined in this class to event listeners in the core |
|
61 | - * |
|
62 | - * @return array |
|
63 | - * @static |
|
64 | - * @access public |
|
65 | - */ |
|
60 | + * Assign functions defined in this class to event listeners in the core |
|
61 | + * |
|
62 | + * @return array |
|
63 | + * @static |
|
64 | + * @access public |
|
65 | + */ |
|
66 | 66 | static public function getSubscribedEvents() |
67 | 67 | { |
68 | 68 | return array( |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | - * Display the first post as Open Graph description |
|
77 | - * |
|
78 | - * @param object $event The event object |
|
79 | - * @return null |
|
80 | - * @access public |
|
81 | - */ |
|
76 | + * Display the first post as Open Graph description |
|
77 | + * |
|
78 | + * @param object $event The event object |
|
79 | + * @return null |
|
80 | + * @access public |
|
81 | + */ |
|
82 | 82 | public function display_og_description($event) |
83 | 83 | { |
84 | 84 | if (empty($this->description)) |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
96 | - * Display Social Media Buttons at the index page |
|
97 | - * |
|
98 | - * @param object $event The event object |
|
99 | - * @return null |
|
100 | - * @access public |
|
101 | - */ |
|
96 | + * Display Social Media Buttons at the index page |
|
97 | + * |
|
98 | + * @param object $event The event object |
|
99 | + * @return null |
|
100 | + * @access public |
|
101 | + */ |
|
102 | 102 | public function display_on_index($event) |
103 | 103 | { |
104 | 104 | $url = generate_board_url(); |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
138 | - * Display Social Media Buttons at topics page |
|
139 | - * |
|
140 | - * @param object $event The event object |
|
141 | - * @return null |
|
142 | - * @access public |
|
143 | - */ |
|
138 | + * Display Social Media Buttons at topics page |
|
139 | + * |
|
140 | + * @param object $event The event object |
|
141 | + * @return null |
|
142 | + * @access public |
|
143 | + */ |
|
144 | 144 | public function display_on_viewtopic($event) |
145 | 145 | { |
146 | 146 | $enabled_forums = isset($this->config['socialbuttons_enable_forums']) ? explode(',', $this->config['socialbuttons_enable_forums']) : array(); |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
206 | - * Get the number of shares |
|
207 | - * |
|
208 | - * @param string $url The URL to get the shares for |
|
209 | - * @param string $token Unique string to identify the page |
|
210 | - * @return array |
|
211 | - * @access private |
|
212 | - */ |
|
206 | + * Get the number of shares |
|
207 | + * |
|
208 | + * @param string $url The URL to get the shares for |
|
209 | + * @param string $token Unique string to identify the page |
|
210 | + * @return array |
|
211 | + * @access private |
|
212 | + */ |
|
213 | 213 | private function get_share_count($url) |
214 | 214 | { |
215 | 215 | $cache_time = isset($this->config['socialbuttons_cachetime']) ? $this->config['socialbuttons_cachetime'] : 0; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $desctiption = strip_tags($event['post_row']['MESSAGE']); |
87 | 87 | //Facebook only displays the first 300 characters of a description, so we can cut the post text after 300 characters |
88 | - $this->description = (strlen($desctiption) > 300) ? preg_replace("/[^ ]*$/", '', substr($desctiption, 0, 300)) . '...' : $desctiption; |
|
88 | + $this->description = (strlen($desctiption) > 300) ? preg_replace("/[^ ]*$/", '', substr($desctiption, 0, 300)) . '...' : $desctiption; |
|
89 | 89 | $this->template->assign_vars(array( |
90 | 90 | 'OG_DESCRIPTION' => $this->description, |
91 | 91 | )); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | { |
272 | 272 | $handle = curl_multi_info_read($mh); |
273 | 273 | $content[$platform] = curl_multi_getcontent($ch); |
274 | - curl_multi_remove_handle($mh, $handle['handle'] ); |
|
274 | + curl_multi_remove_handle($mh, $handle['handle']); |
|
275 | 275 | } |
276 | 276 | curl_multi_close($mh); |
277 | 277 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | $shares['google'] = isset($matches[1]) ? $matches[1] : 0; |
294 | 294 | |
295 | 295 | preg_match('#<span class="pluginCountTextDisconnected">([0-9]+)</span>#s', $content['facebook'], $matches); |
296 | - $shares['facebook'] = isset($matches[1]) ? $matches[1] : 0 ; |
|
296 | + $shares['facebook'] = isset($matches[1]) ? $matches[1] : 0; |
|
297 | 297 | |
298 | 298 | $pageinfo = json_decode($content['twitter'], true); |
299 | 299 | $shares['twitter'] = isset($pageinfo['count']) ? $pageinfo['count'] : 0; |
@@ -160,8 +160,7 @@ discard block |
||
160 | 160 | $host = $this->request->server('HTTP_HOST'); |
161 | 161 | $https = $this->request->server('HTTPS'); |
162 | 162 | $url = ($https ? 'https://' : 'http://') . $host . '/' . $page; |
163 | - } |
|
164 | - else |
|
163 | + } else |
|
165 | 164 | { |
166 | 165 | $url = generate_board_url() . '/viewtopic.php?f=' . $event['topic_data']['forum_id'] . '&t=' . $event['topic_data']['topic_id']; |
167 | 166 | } |
@@ -304,8 +303,7 @@ discard block |
||
304 | 303 | // Write data to cache |
305 | 304 | $this->cache->put($cache_file, $shares, $cachetime); |
306 | 305 | return $shares; |
307 | - } |
|
308 | - else |
|
306 | + } else |
|
309 | 307 | { |
310 | 308 | // return data from cache |
311 | 309 | return $shares; |
@@ -34,5 +34,5 @@ |
||
34 | 34 | // ’ » “ ” … |
35 | 35 | // |
36 | 36 | $lang = array_merge($lang, array( |
37 | - 'ACP_SOCIALBUTTONS_TITLE' => 'دکمه های رسانه های اجتماعی', |
|
37 | + 'ACP_SOCIALBUTTONS_TITLE' => 'دکمه های رسانه های اجتماعی', |
|
38 | 38 | )); |