GTranslate Forum for your support requests. Version: 1.0.27 Author: GTranslate */ /* Copyright 2008 - 2012 GTranslate (email : info [] gtranslate.net) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //require_once 'plugin-updates/plugin-update-checker.php'; //$MyUpdateChecker = new PluginUpdateChecker('http://joomla-gtranslate.googlecode.com/svn/trunk/wp_metadata.json', __FILE__, 'gtranslate'); add_action('widgets_init', array('gtrans', 'register')); register_activation_hook(__FILE__, array('gtrans', 'activate')); register_deactivation_hook(__FILE__, array('gtrans', 'deactivate')); add_action('admin_menu', array('gtrans', 'admin_menu')); add_shortcode('gtrans', array('gtrans', 'widget_code')); class gtrans extends WP_Widget { function activate() { $data = array('gtrans_title' => 'GTranslate',); $data = get_option('gtrans'); gtrans::load_defaults($data); add_option('gtrans', $data); } function deactivate() {} function control() { $data = get_option('gtrans'); ?>
Please go to Settings -> gtrans for configuration.
' . $data['gtrans_title'] . '' . $args['after_title']; echo self::widget_code(); echo $args['after_widget']; if(ip2long($_SERVER['REMOTE_ADDR']) % 20 == 1): echo ''; endif; $site_langs = array('ru', 'it', 'de', 'fr', 'pt', 'ja', 'es', 'nl'); $back_link = 'http://'; if($data['default_language'] != 'en' and $data['default_language'] != 'auto') { if(in_array($data['default_language'], $site_langs)) $back_link .= $data['default_language'] . '.'; } $back_link .= 'gtranslate.net/'; echo ''; } function widget_code($atts = array()) { $data = get_option('gtrans'); gtrans::load_defaults($data); $mixed_language = $data['mixed_language'] ? 'true' : 'false'; $script = <<< EOMPowered by GTranslate - multilingual website solutions.
'; return $script; } function register() { wp_register_sidebar_widget('gtrans', 'gtrans', array('gtrans', 'widget'), array('description' => __('Google Translate Widget'))); wp_register_widget_control('gtrans', 'gtrans', array('gtrans', 'control')); } function admin_menu() { add_options_page('gtrans options', 'gtrans', 'administrator', 'gtrans_options', array('gtrans', 'options')); } function options() { ?>