<?
/*
Plugin Name: Multilingue
Plugin URI: http://www.deeweb.fr/plugin-wordpress-multilingue/
Description: Le plugin vous donne acc&egrave;s &agrave; un widget qui permet aux visiteurs de traduire la page courante en un seul clic. D&eacute;tection automatique de la langue d'origine du site. Traduction par Google Traduction.
Version: 0.4
Author: Bastien Canas
Author URI: http://www.deeweb.fr/
*/
class myWidget {

	function myWidget() {
		add_action('widgets_init', array(& $this, 'init_widget'));
	}

	function init_widget() {
		if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
			return;
		register_sidebar_widget(array('Multilingue','widgets'),array(& $this, 'widget'));
		register_widget_control(array('Multilingue', 'widgets'), array(& $this, 'widget_options'));
	}

	function widget($args) {
		global $wpdb;

		$WidgetTitle=get_option('mywidget_options');
		extract($args);

		echo $before_widget.$before_title.$WidgetTitle.$after_title;

$Langue = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Langue = strtolower(substr(chop($Langue[0]),0,2));
?>

<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|fr" target="_blank" ><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/fr.png" alt="Fran&ccedil;ais" width="16" height="11" border="0"></a> 
<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|en" target="_blank"><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/gb.png" alt="English" width="16" height="11" border="0"></a> 
<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|de" target="_blank"><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/de.png" alt="Deutsch" width="16" height="11" border="0"></a> 
<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|it" target="_blank"><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/it.png" alt="Italiano" width="16" height="11" border="0"></a> 
<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|es" target="_blank"><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/es.png" alt="Espa&ntilde;ol" width="16" height="11" border="0"></a>
<a href="http://translate.google.com/translate?u=http://amordepaz.com&langpair=|zh-CN" target="_blank"><img src="http://amordepaz.com/wp-content/plugins/multilingue/img/cn.png" alt="Chinese" width="16" height="11" border="0"></a>
<?
		echo $after_widget;
	}

	function widget_options() {
		if ($_POST['mywidget_options']) {
			$option=$_POST['mywidget_options'];
			update_option('mywidget_options',$option);
		}
		$option=get_option('mywidget_options');
		echo '<label for="mywidget_options">Title : <input id="mywidget_options" name="mywidget_options" type="text" value="'.$option.'" /></label>';
	}
}
$myWidgetVariable= new myWidget ();
?><?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>amor de paz &#187; historia de amor</title>
	<atom:link href="http://amordepaz.com/category/historias/historia-de-amor/feed/" rel="self" type="application/rss+xml" />
	<link>http://amordepaz.com</link>
	<description>Amistad Amor y Poemas ... Encuentra tu pareja! :)</description>
	<lastBuildDate>Mon, 17 Oct 2011 19:21:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SI TE DIJESE&#8230;</title>
		<link>http://amordepaz.com/2008/09/si-te-dijese-2/</link>
		<comments>http://amordepaz.com/2008/09/si-te-dijese-2/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 05:30:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Despues de terminar]]></category>
		<category><![CDATA[historia de amor]]></category>

		<guid isPermaLink="false">http://amordepaz.com/?p=77</guid>
		<description><![CDATA[SI TE DIJESE QUE AÚN RECUERDO LA PRIMERA VEZ QUE TE VÍ ESTABAS MUY LEJOS, PERO TU AIRE SENTÍ SIN VER TU ROSTRO ME ENAMORÉ...]]></description>
		<wfw:commentRss>http://amordepaz.com/2008/09/si-te-dijese-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DEFINICIÓN DEL AMOR</title>
		<link>http://amordepaz.com/2007/04/definicion-del-amor/</link>
		<comments>http://amordepaz.com/2007/04/definicion-del-amor/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 17:53:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Amor]]></category>
		<category><![CDATA[el amor]]></category>
		<category><![CDATA[historia de amor]]></category>

		<guid isPermaLink="false">http://amordepaz.com/?p=7</guid>
		<description><![CDATA[Según la Real Academia Española : AMOR = .1.Entimiento intenso del ser humano que, partiendo de su propia insuficiencia, necesita y busca el encuentro y...]]></description>
		<wfw:commentRss>http://amordepaz.com/2007/04/definicion-del-amor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

