Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Ismail El Korchi

    (@ismailelkorchi)

    hello Jamesosix, I just fix the problem go and grab the new version !

    if you have any other question related to the social widget feel free to ask me at ismail.elkorchi[at]gmail.com

    cheers.

    Not fixed, I’ve just installed it and the whole widget is in French! ??

    Plugin Author Ismail El Korchi

    (@ismailelkorchi)

    I’ll fix this in the next release.

    OK thankyou

    Here I converted it to english. To use this code go to Admin → Plugins → Editor → Social Widget → social-widget/social-widget.php and then replace the code with this code. Hopefully the developer will make a nice update that allows switching the language desired.

    <?php
    /*
    Plugin Name: Social Widget
    Description: A beautiful widget that allow you to add a stylish Facebook like box, twitter follow button and a google +1 button to your sidebar.
    Author: Ismail el korchi
    Version: 1.5
    Author URI:
    */
    
    /*  Copyright 2012  Ismail El Korchi
    
        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 3 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, see <https://www.gnu.org/licenses/>.
    */
    
    class SocialWidget extends WP_Widget
    {
    	function __construct()
    	{
    		$params = array(
    			'description' => 'A beautiful widget that allow you to add a stylish Facebook like box, twitter follow button and a google +1 button to your sidebar.',
    			'name' => 'Social Widget'
    		);
    		parent::__construct('SocialWidget','',$params);
    	}
    		function update( $new_instance, $old_instance )
    		{
    			$new_instance = (array) $new_instance;
    			$instance = array( 'follower_count' => 0, 'show_username' => 0, 'show_poweredby_link' => 0);
    			foreach ( $instance as $field => $val ) {
    				if ( isset($new_instance[$field]) )
    					$instance[$field] = 1;
    		}
    		$instance['recommend'] = $new_instance['recommend'];
    		$instance['page_id'] = $new_instance['page_id'];
    		$instance['username'] = $new_instance['username'];
    
    		return $instance;
    	}
    
    		public function form($instance)
    	{
    		// DEFAULT VALUES
    		$instance = wp_parse_args( (array) $instance, array('page_id' => '','username' => '', 'recommend' => "Recommend", 'follower_count' => false, 'show_username' => true, 'show_poweredby_link' => false ) );
    
    		?>
    		<center><strong>Social Profiles</strong></center>
    
    		<p>
    			<label for="<?php echo $this->get_field_id('page_id');?>">Facebook Page ID : </label>
    			<input type="text" class="widefat"
    			id="<?php echo $this->get_field_id('page_id');?>"
    			name="<?php echo $this->get_field_name('page_id');?>"
    			value="<?php echo esc_attr( $instance['page_id']); ?>" />
    		</p>
    		<p>
    			<label for="<?php echo $this->get_field_id('username');?>">Twitter Username : </label>
    			<input type="text" class="widefat"
    			id="<?php echo $this->get_field_id('username');?>"
    			name="<?php echo $this->get_field_name('username');?>"
    			value="<?php echo esc_attr( $instance['username']); ?>" />
    		</p>
    		<center><strong>Settings</strong></center>
    		<p>
    			<label for="<?php echo $this->get_field_id('recommend');?>">Google recommend text :</label>
    			<input type="text" class="widefat"
    			id="<?php echo $this->get_field_id('recommend');?>"
    			name="<?php echo $this->get_field_name('recommend');?>"
    			value="<?php echo esc_attr( $instance['recommend']); ?>" />
    		</p>
    		<p>
    			<input class="checkbox" type="checkbox"
    			<?php checked($instance['follower_count'], true) ?>
    			id="<?php echo $this->get_field_id('follower_count');?>"
    			name="<?php echo $this->get_field_name('follower_count');?>"/>
    			<label for="<?php echo $this->get_field_id('follower_count');?>">Show the Follower count</label> 
    
    			<input class="checkbox" type="checkbox"
    			<?php checked($instance['show_username'], true) ?>
    			id="<?php echo $this->get_field_id('show_username');?>"
    			name="<?php echo $this->get_field_name('show_username');?>"/>
    			<label for="<?php echo $this->get_field_id('show_username');?>">Show the Twitter username</label>
    		</p>
    		<p>
    			<input class="checkbox" type="checkbox"
    			<?php checked($instance['show_poweredby_link'], true) ?>
    			id="<?php echo $this->get_field_id('show_poweredby_link');?>"
    			name="<?php echo $this->get_field_name('show_poweredby_link');?>"/>
    			<label for="<?php echo $this->get_field_id('show_poweredby_link');?>">Support this free plug-in with a small powered by link at your page footer. Thank you!</label>
    		</p>
    		<?php
    	}
    
    	public function widget($args,$instance)
    	{
    		extract($args);
    		$showUN = isset($instance['show_username']) ? $instance['show_username'] : false;
    		$showFC = isset($instance['follower_count']) ? $instance['follower_count'] : false;
    		$showFL = isset($instance['show_poweredby_link']) ? $instance['show_poweredby_link'] : true;
    		if ($showUN)
    		{
    			$showUN = 'true';
    		}
    		else
    		{
    			$showUN = 'false';
    		}
    		if ($showFC)
    		{
    			$showFC = 'true';
    		}
    		else
    		{
    			$showFC = 'false';
    		}
    		echo $before_widget;
    			printf('<div id="sidesocial">
    						<div class="sidefb">
    
    							<fb:fan profile_id="' . $instance['page_id'] . '" stream="0" connections="8" logobar="0" width="250"
    							height="200" css="' . get_bloginfo('wpurl') . '/wp-content/plugins/social-widget/style.css?ver=8" rel="stylesheet" type="text/css"></fb:fan>
    						</div>
    						<div class="sideg">
    							<div class="g-plusone" data-size="medium" data-href="'.get_bloginfo('wpurl').'"></div>
    							<span>'.$instance['recommend'].'</span>
    						</div>
    						<div class="sidetw">
    						<a href="https://twitter.com/' . $instance['username'] . '">Follow @' . $instance['username'] . '</a>
    						</div>
    					</div>');
    		echo $after_widget;
    		if($showFL)
    		{
    			add_action('wp_footer','footer_link');
    		}
    	}
    }
    
    function footer_link()
    {
    	print('<p style="text-align:center;font-size:x-small;color:#808080;">Social Widget provided by <a href="https://www.conseils-relationnel.com">Conseils relationnel</a>.</p>');
    }
    
    add_action('wp_head','addstyle');
    function addstyle()
    {
    	echo '<link type="text/css" rel="stylesheet" href="' . get_bloginfo('wpurl') . '/wp-content/plugins/social-widget/style.css"/>' ;
    }
    
    add_action('wp_footer','addscripts');
    function addscripts()
    {
    	?>
    	<div id="fb-root">
    	<script type="text/javascript">
    		window.fbAsyncInit = function() {
      			FB.init({ status: true, cookie: true, xfbml: true});
    		};
    		(function() {
    			var e = document.createElement('script');
    			e.type = 'text/javascript';
    			e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    			e.async = true;
    			document.getElementById('fb-root').appendChild(e);
    		}());
    		(function() {
    			var e = document.createElement('script');
    			e.type = 'text/javascript';
    			e.src = 'https://platform.twitter.com/widgets.js';
    			e.async = true;
    			document.getElementById('fb-root').appendChild(e);
    		}());
    		(function() {
    			var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        		po.src = 'https://apis.google.com/js/plusone.js';
       			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      		})();
     	</script>
    </div>
    <?php
    }
    
    add_action('widgets_init','register_socialwidget');
    function register_socialwidget()
    {
    	register_widget('SocialWidget');
    }
    ?>

    Plugin Author Ismail El Korchi

    (@ismailelkorchi)

    Hello guys,

    the problem is fixed with the new update.

    Cheers,
    ismail.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Social Widget] Google 1 text in french by default?’ is closed to new replies.