_atInstalled)) { foreach($plugins as $plugin) { if (substr($plugin['Name'], 0, 7) === 'AddThis') array_push($this->_atInstalled, $plugin['Name']); } } $keys = array_keys($this->_atPlugins); $uninstalled = array_diff( $keys, $this->_atInstalled); if (empty($uninstalled)) return false; // Get rid of our keys, we just want the names which are the keys elsewhere $uninstalled = array_values($uninstalled); $string = __('Want to increase your site traffic? AddThis also has '); $count = count($uninstalled); if ($count == 1){ $string .= __('a plugin for ', 'addthis'); $string .= __( sprintf('' .$this->_atPlugins[$uninstalled[0]][1] .'', $this->_atPlugins[$uninstalled[0]][0]), 'addthis'); } else { $string . __('plugins for '); for ($i = 0; $i < $count; $i++) { $string .= __( sprintf('' .$this->_atPlugins[$uninstalled[$i]][1] .'', $this->_atPlugins[$uninstalled[$i]][0]), 'addthis'); if ($i < ($count - 2)) $string .= ', '; else if ($i == ($count -2)) $string .= ' and '; else if ($i == ($count -1)) $string .= ' plugins available.'; } } return '
' .$string . '
'; } } function addAfterScript($newData){ $this->jsAfterAdd .= $newData; } function addAfterToJs(){ if (! empty($this->jsAfterAdd)); $this->jsToAdd .= ''; } function output_script(){ if ($this->_js_added != true) { $this->wrapJs(); $this->addWidgetToJs(); $this->addAfterToJs(); echo $this->jsToAdd; echo ''; $this->_js_added = true; } } function output_script_filter($content){ if ($this->_js_added != true && ! is_admin() && ! is_feed() ) { $this->wrapJs(); $this->addWidgetToJs(); $this->addAfterToJs(); $content = $content . $this->jsToAdd; $this->_js_added = true; } return $content; } }