<?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>xiligroup dev &#187; Expert&#8217;s corner</title>
	<atom:link href="http://dev.xiligroup.com/?feed=rss2&#038;cat=480&#038;lang=en_us" rel="self" type="application/rss+xml" />
	<link>http://dev.xiligroup.com</link>
	<description>a multilingual site for web developments</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:21:10 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>xili-language and the time</title>
		<link>http://dev.xiligroup.com/?p=1482</link>
		<comments>http://dev.xiligroup.com/?p=1482#comments</comments>
		<pubDate>Tue, 16 Feb 2010 09:24:45 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-language]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[multilingual theme]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1482</guid>
		<description><![CDATA[Setting time, on the fly, in current language of the current post is not very easy in Wordpress. After some research in core's source and in php functions, several pathways are available here]]></description>
			<content:encoded><![CDATA[<p><em>Setting time, on the fly, in current language of the current post is not very easy in WordPress. After some research in core&#8217;s source and in php functions, several pathways are available here</em> :</p>
<p>Without changing or adding specific <strong>template tags</strong>, <strong>the_time()</strong>, <strong>the_modified_time()</strong> and other functions are hookable by xili-language.</p>
<p>The &laquo;&nbsp;hooking&nbsp;&raquo; functions are placed inside the xilidev-libraries (<a href="http://dev.xiligroup.com/?p=1111">see this post</a>).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> xiliml_comment_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_time</span><span style="color: #339933;">,</span><span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* params no used because php format */</span>
  <span style="color: #666666; font-style: italic;">/* the first param is to be as msgid in .po example: %B %d, %Y - %H:%M or %B %d, %Y at %H:%M   */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y'</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_comment_time <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #666666; font-style: italic;">/* impossible to use get_comment_date as it is itself filtered*/</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_comment_date'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliml_comment_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> xiliml_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thetime</span><span style="color: #339933;">,</span><span style="color: #000088;">$theformat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* param no used because php format */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y - %H:%M'</span><span style="color: #339933;">,</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_time'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliml_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> xiliml_modified_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thetime</span><span style="color: #339933;">,</span><span style="color: #000088;">$theformat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* param no used because php format */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y - %H:%M'</span><span style="color: #339933;">,</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_the_modified_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_modified_time'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliml_modified_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Basically WordPress uses php date() format  &#8211; <a href="http://fr2.php.net/manual/en/function.date.php">http://fr2.php.net/manual/en/function.date.php</a> &#8211; and and internal static translation tools.</p>
<p>In the hooking function and in date format translation, the format depending of setlocale is used. See &#8211; <a href="http://fr2.php.net/manual/en/function.strftime.php">http://fr2.php.net/manual/en/function.strftime.php</a> &#8211; </p>
<p>With this way and if the server is well configured, the live translation of date / time works well.</p>
<p>For the .po file, the msgid format is &#8216;<strong>%B %d, %Y &#8211; %H:%M</strong>&#8216; and his translation in french can be &#8216;<strong>%d %B %Y &#8211; %Hh%M</strong>&#8216;</p>
<h4>FAQ</h4>
<p>* <strong>Why are these hooks inside the xilidev library and not inside the plugin itself ?</strong></p>
<p>Because the webmaster can modify it and the modifications will be not erased when the plugin is updated. (Don&#8217;t forget to check (and activate) this library in admin plugin&#8217;s UI)<br />
<div id="attachment_1486" class="wp-caption aligncenter" style="width: 308px"><a href="http://dev.xiligroup.com/wp-content/uploads/2010/02/gold_functions.png" rel="lightbox[post-1482]" ><img src="http://dev.xiligroup.com/wp-content/uploads/2010/02/gold_functions.png" alt="xilidev or gold functions" title="xilidev or gold functions" width="298" height="271" class="size-full wp-image-1486" /></a><p class="wp-caption-text">xilidev or gold functions</p></div><br />
* <strong>Why the parameters of <em>the_time()</em> are not used ?</strong></p>
<p>Because they need big translation and lot of lines. So it was better to bypass it and insert more flexible properties.</p>
<p>* <strong>In <em>the_time()</em> how to suppress the time ?</strong></p>
<p>Just modify the string &#8216;%B %d, %Y &#8211; %H:%M&#8217;  in &#8216;%B %d, %Y&#8217; .</p>
<p>* <strong>What do the function <em>the_xili_local_time()</em> ?</strong></p>
<p>This function inside the plugin translates a generic numeric date according current language of the post or the theme&#8217;s live language.</p>
<p>* <strong>On my website, I use different patterns inside <em>the_time()</em> depending category or single or&#8230; What do you recommend ?</strong><br />
Inside the filter function, add php &#8216;<em>switch case</em>&#8216; lines analyzing the $theformat passed (php format) and deliver &#8211; according these &#8211; the first param of <em>the_xili_local_time()</em> a setlocale format with <strong>%</strong>. It is indeed easy to choose a result with or without hour:min. After you have defined the list of format, don&#8217;t forget to translate them in .po (and .mo) of each language.</p>
<p>&nbsp;<br />&nbsp;<br /><fieldset class="series" ><legend>This posts belong to the series: xili-language for experts</legend><ol><li><a href='http://dev.xiligroup.com/?p=726' title="xili-language plugin : release 1.6.0 (compatible WP 3.0)">xili-language plugin : release 1.6.0 (compatible WP 3.0)</a></li><li><a href='http://dev.xiligroup.com/?p=1068' title="Q&A about xili-language plugin, release 1.1">Q&A about xili-language plugin, release 1.1</a></li><li><a href='http://dev.xiligroup.com/?p=1045' title="xili-language : hooks, filters, class and so on...">xili-language : hooks, filters, class and so on...</a></li><li><a href='http://dev.xiligroup.com/?p=1055' title="From a theme with localization to a multilingual theme with xili-language : technical and general notes.">From a theme with localization to a multilingual theme with xili-language : technical and general notes.</a></li><li><a href='http://dev.xiligroup.com/?p=1111' title="xili-language - 1.4.1 - new libraries">xili-language - 1.4.1 - new libraries</a></li><li><a href='http://dev.xiligroup.com/?p=1432' title="Xili-language toolbox in one table">Xili-language toolbox in one table</a></li><li>xili-language and the time</li><li><a href='http://dev.xiligroup.com/?p=1497' title="xili-language : Affichage des dates et heures">xili-language : Affichage des dates et heures</a></li></ol></fieldset>&nbsp;<br />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1482</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xili-language &#8211; 1.4.1 &#8211; new libraries</title>
		<link>http://dev.xiligroup.com/?p=1111</link>
		<comments>http://dev.xiligroup.com/?p=1111#comments</comments>
		<pubDate>Mon, 15 Feb 2010 10:03:31 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-language]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[multilingual theme]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1111</guid>
		<description><![CDATA[This release <strong>1.1.8</strong> adds new features dedicated to multilingual theme's creators and webmasters. Some new php functions, a folder to include functions shared by themes (not necessary to put functions in functions.php of the current theme); example with a shortcode to insert link inside content toward another post in a language. Since this release, xili-language is also tested with future wordpress 2.9-rare. ]]></description>
			<content:encoded><![CDATA[<p><em>This release <strong>xili-language 1.2.1</strong> adds new features dedicated to multilingual theme&#8217;s creators and webmasters. Some new php functions, a folder to include functions shared by themes (not necessary to put functions in functions.php of the current theme); example with a shortcode to insert link inside content toward another post in a language. Since this release, xili-language is also compliant with wordpress 2.9.</em> </p>
<p><div id="attachment_1120" class="wp-caption alignright" style="width: 299px"><img src="http://dev.xiligroup.com/wp-content/uploads/2009/10/gold_functions.png" alt="Gold functions" title="Gold functions" width="289" height="251" class="size-full wp-image-1120" /><p class="wp-caption-text">Gold functions</p></div></p>
<h4>Gold functions</h4>
<p>In sidebox &laquo;&nbsp;Settings&nbsp;&raquo;, a new check button appears if a folder named <strong>xilidev-libraries</strong> and containing a <strong>functions.php</strong> file was present inside your <strong>wp/content/plugins/</strong> folder.<br />
If this button is checked, all the functions inside this file was added when plugin is activated. Why it is interesting ? When adding here special filters or actions for hookable template tags of xili-language, you don&#8217;t need to copy and paste your functions of one theme to another theme.</p>
<h4>New functions in core of xili-language</h4>
<p>Two new functions was added for developers (since February &#8211; 3 new for time display) :<br />
<code>xiliml_get_lang_object_of_post($post_ID)</code> Return an object containing properties of the language set to the post passed as param (false if the post don&#8217;t exist or undefined language) See code for more infos.<br />
<code>xiliml_get_language($lang_nameorslug="")</code> Return an object containing properties of the language passed as slug (ex fr_fr) or name (ex fr_FR). False if the language doesn&#8217;t exist. <code>$result->description</code> gives the full name of the language set by you in xili-language settings.</p>
<p>To illustrate these new features, please find an example of functions.php here containing only two functions to create a shortcode named <strong>linkpost</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009933; font-style: italic;">/**
 * shortcode to insert link to post in other languages inside the content 
 * example : [linkpost lang=&quot;fr_FR&quot;]link to french similar post[/linkpost] (if title=&quot;some text&quot; : title of link is set by replacing title 'A similar post in...')
 *
 *
 *@since 1.2
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> xiliml_build_linked_posts_shortcode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$atts</span><span style="color: #339933;">,</span><span style="color: #000088;">$content</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$arr_result</span> <span style="color: #339933;">=</span> shortcode_atts<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'lang'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$atts</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">extract</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr_result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$language</span> <span style="color: #339933;">=</span> xiliml_get_language<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* test if lang is available */</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$language</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$otherpost</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'lang-'</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$otherpost</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$obj_lang</span> <span style="color: #339933;">=</span> xiliml_get_lang_object_of_post<span style="color: #009900;">&#40;</span><span style="color: #000088;">$otherpost</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #000088;">$obj_lang</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$obj_lang</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'A similar post in'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">.</span><span style="color: #000088;">$description</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error with target post #'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$otherpost</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #000088;">$otherpost</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$content</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">/* this link above can be enriched by image or flag */</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;a href=&quot;#&quot; title=&quot;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error: other post not present !!!'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xili-language'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$content</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'linkpost'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'xiliml_build_linked_posts_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Please find <a href='http://dev.xiligroup.com/wp-content/uploads/2009/10/xilidev-libraries.zip'>here a .zip</a> containing the folder &laquo;&nbsp;xilidev-libraries&nbsp;&raquo; to upload in wp-content/plugins/ directory and this example functions [enriched since Feb 28th, 2010].<br />
&nbsp;<br />&nbsp;<br /><fieldset class="series" ><legend>This posts belong to the series: xili-language for experts</legend><ol><li><a href='http://dev.xiligroup.com/?p=726' title="xili-language plugin : release 1.6.0 (compatible WP 3.0)">xili-language plugin : release 1.6.0 (compatible WP 3.0)</a></li><li><a href='http://dev.xiligroup.com/?p=1068' title="Q&A about xili-language plugin, release 1.1">Q&A about xili-language plugin, release 1.1</a></li><li><a href='http://dev.xiligroup.com/?p=1045' title="xili-language : hooks, filters, class and so on...">xili-language : hooks, filters, class and so on...</a></li><li><a href='http://dev.xiligroup.com/?p=1055' title="From a theme with localization to a multilingual theme with xili-language : technical and general notes.">From a theme with localization to a multilingual theme with xili-language : technical and general notes.</a></li><li>xili-language - 1.4.1 - new libraries</li><li><a href='http://dev.xiligroup.com/?p=1432' title="Xili-language toolbox in one table">Xili-language toolbox in one table</a></li><li><a href='http://dev.xiligroup.com/?p=1482' title="xili-language and the time">xili-language and the time</a></li><li><a href='http://dev.xiligroup.com/?p=1497' title="xili-language : Affichage des dates et heures">xili-language : Affichage des dates et heures</a></li></ol></fieldset>&nbsp;<br />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1111</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Xili-language toolbox in one table</title>
		<link>http://dev.xiligroup.com/?p=1432</link>
		<comments>http://dev.xiligroup.com/?p=1432#comments</comments>
		<pubDate>Fri, 12 Feb 2010 11:00:18 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[Full width]]></category>
		<category><![CDATA[xili-language]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[multilingual theme]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1432</guid>
		<description><![CDATA[In this table, all the main template tags, functions and hooks are grouped.]]></description>
			<content:encoded><![CDATA[<p>In this table, all the main template tags, functions and hooks are grouped. <em>(under finishing and pending review step).</em> This post will be frequently updated.</p>
<p><small>This table is a summary of the &laquo;&nbsp;technical&nbsp;&raquo; features of xili-language plugin and is dedicaced to webmaster and theme&#8217;s designer.</small></p>
<div id="toolbox" class="fullwidth" >
<table cellspacing="0" cellpadding="0">
<tbody>
<tr >
<td colspan="5" valign="top">
<p><b>Toolbox: xili-language plugin for a multilingual website in one table</b></p>
</td>
</tr>
<tr>
<td valign="top" class="ttd1">
<p>Name</p>
</td>
<td valign="top" class="ttd2">
<p>Definition</p>
</td>
<td valign="top" class="td3">
<p>Comment</p>
</td>
<td valign="top" class="ttd4" >
<p>Example</p>
</td>
<td valign="top" class="ttd5">
<p>Concern</p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>WIDGETS</b></p>
</td>
<td colspan="2" valign="top">
<p><i>to enrich widget enable themes</i></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>Theme</p>
</td>
</tr>
<tr>
<td valign="top">
<p>Languages list</p>
</td>
<td valign="top">
<p>Display the list of available languages</p>
</td>
<td valign="top">
<p>Multiple widgets possible. If your theme contains functions that offer widget personalization, the item type must be filled. (<a href="?p=1045">see this post</a>)</p>
</td>
<td valign="top">
        <a href="wp-content/uploads/2010/02/language_list.png" rel="lightbox[post-1432]" ><img src="wp-content/uploads/2010/02/language_list-206x300.png" alt="" title="language_list" width="206" height="300" class="alignnone size-medium wp-image-1465" /></a>
      </td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p>Recent comments</p>
</td>
<td valign="top">
<p>Display the list of recent comments in current displayed language. </p>
</td>
<td valign="top">
This widget was created because the default one cannot be translatable or offer sub-selection in one language.</p>
<p>multiple widgets possible</p>
</td>
<td valign="top">
        <a href="wp-content/uploads/2010/02/recent_comments.png" rel="lightbox[post-1432]" ><img src="wp-content/uploads/2010/02/recent_comments-292x300.png" alt="" title="Recent comments widget" width="292" height="300" class="alignnone size-medium wp-image-1468" /></a>
      </td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p>Recent posts</p>
</td>
<td valign="top">
<p>Display list of recent posts in a choosen language</p>
</td>
<td valign="top">
<p>since v 1.4.0 for WP >2.8</p>
<p>This new widget solves conflicts or issues occuring when WP default widget is present (contains an <em>obscur</em> `wp_reset_query`). Also a choice of language of this list of recent posts is possible &#8211; not necessary the same of the current page. And you can install multiple widgets. <strong>Replace WP Recent Widget by this one named</strong> &#8211; <strong>List of recent posts</strong><em> -</p>
<p>multiple widgets possible with different languages (fixed or dynamic)</p>
</td>
<td valign="top">
       ----<a href="http://dev.xiligroup.com/wp-content/uploads/2010/02/screenshot-12.png" rel="lightbox[post-1432]" ><img src="http://dev.xiligroup.com/wp-content/uploads/2010/02/screenshot-12-207x300.png" alt="xili-language widgets: the new &quot;multiple&quot; widget to display list of recent posts in a choosen language." title="xili-language widgets: the new &quot;multiple&quot; widget to display list of recent posts in a choosen language." width="207" height="300" class="size-medium wp-image-1537" /></a>
      </td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>TEMPLATE TAGS</b></p>
</td>
<td colspan="2" valign="top">
<p><i>usable by theme’s designer and webmaster</i></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>Theme</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_the_other_posts <br /><em>default parameters:</em> <br />
($post_ID,$before = &laquo;&nbsp;This post in&nbsp;&raquo;, $separator = &laquo;&nbsp;, &laquo;&nbsp;, $type = &laquo;&nbsp;display&nbsp;&raquo;)</p>
</td>
<td valign="top">
<p>in loop display the link of other posts defined as in other languages</p>
</td>
<td valign="top">
<p>can be used in theme template in single.php under the title</p>
<p> * example: if(class_exists(&#8216;xili_language&#8217;)) xiliml_the_other_posts($post-&gt;ID)</p>
<p><em>(in the example, the default template tag was hooked to display flag &#8211; see hooks rows below)</em></p>
</td>
<td valign="top">
       <a href="wp-content/uploads/2010/02/other-posts.png" rel="lightbox[post-1432]" ><img src="wp-content/uploads/2010/02/other-posts-300x62.png" alt="" title="other-posts" width="300" height="62" class="alignright size-medium wp-image-1461" /></a>
      </td>
<td valign="top">
<p>post &#8211; page &#8211; loop</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xili_post_language <br /><em>default parameters:</em> <br />($before = &#8216;&lt;span class=&nbsp;&raquo;xili-lang&nbsp;&raquo;&gt;(&#8216;, $after =&#8217;)&lt;/span&gt;&#8217;)</p>
</td>
<td valign="top">
<p>in loop display the language of the post</p>
</td>
<td valign="top">
<p>Useful inside a multilingual category loop.</p>
</td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;postsubtitleinfo&quot;&gt;
	&lt;small&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
			the_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/*__('F jS, Y','xilidev')*/</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&amp;nbsp;-&amp;nbsp;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> xili_post_language<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/small&gt;&lt;/div&gt;</pre></div></div>

</td>
<td valign="top">
<p>loop, category, search</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xili_language_list <br /><em>default parameters:</em> <br />($before = &#8216;&lt;li&gt;&#8217;, $after =&#8217;&lt;/li&gt;&#8217;, $theoption=&nbsp;&raquo;)</p>
</td>
<td valign="top">
<p>outside loop (sidebar) display the languages of the site (used also by widget)</p>
</td>
<td valign="top">
<p>When the theme don&#8217;t enable widget. Use this template tag to display the list in sidebar or (header and footer)</p>
</td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Languages'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xilidev'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
	&lt;ul class=&quot;langs&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language_list'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			xili_language_list<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'siderss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;/ul&gt;</pre></div></div>

</td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_the_category <br /><em>default parameters:</em> <br />($post_ID, $separator = &#8216;, &#8216; ,$echo = true)</p>
</td>
<td valign="top">
<p>replace the_category() tag of WP Core</p>
</td>
<td valign="top">
<p>The current template tag the_category is not hookable by plugin. So here the categories list of a post inside loop will be translated according the language of the current post.</p>
</td>
<td valign="top">
<p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;p class=&quot;postmetadata&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Tags: '</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;br /&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posted in'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">;</span> 
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					xiliml_the_category<span style="color: #009900;">&#40;</span>get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
					the_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span> | <span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Edit'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' | '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>  <span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_popup_link<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No Comments &amp;#187;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1 Comment &amp;#187;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'% Comments &amp;#187;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliips'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;</pre></div></div>

</p>
</td>
<td valign="top">
<p>post &#8211; page &#8211; loop</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_langinsearchform <br /><em>default parameters:</em> <br />($before=&nbsp;&raquo;,$after=&nbsp;&raquo;)</p>
</td>
<td valign="top">
<p>Template Tag insertable in search form for sub-selection of a language</p>
</td>
<td valign="top">
<p>As in example, this function add a way to limit the search to a target language.</p>
</td>
<td valign="top">
<p><img src="wp-content/uploads/2010/02/search.png" alt="" title="search" width="208" height="95" class="alignnone size-full wp-image-1463" /></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Search'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xilidev'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
              &lt;form id=&quot;searchform&quot; method=&quot;get&quot; action=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
&nbsp;
                &lt;input type=&quot;text&quot; name=&quot;s&quot; id=&quot;s&quot; size=&quot;15&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_search_query<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
&nbsp;
                &lt;input type=&quot;submit&quot; value=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'go'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xilidev'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;&lt;br/&gt;
                <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xiliml_langinsearchform'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> xiliml_langinsearchform <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;span class=&quot;radiosearch&quot; &gt;'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
              &lt;/form&gt;</pre></div></div>

</td>
<td valign="top">
<p>search &#8211; sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>FUNCTIONS</b></p>
</td>
<td colspan="2" valign="top">
<p><i>usable by developer with knowledges in php (see php source)</i></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>CMS</p>
</td>
</tr>
<tr>
<td valign="top">
<p>the_curlang()</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>theme</p>
</td>
</tr>
<tr>
<td valign="top">
<p>the_cur_langs_group_id()</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p>the_xili_local_time <br /><em>default parameters:</em> <br />($format=&#8217;%B %d, %Y&#8217;,$time = null)</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>time</p>
</td>
</tr>
<tr>
<td valign="top">
<p>get_cur_language ($post_ID)</p>
</td>
<td valign="top">
<p>Return the language of current post in loop</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>see below</p>
</td>
<td valign="top">
<p>loop</p>
</td>
</tr>
<tr>
<td valign="top">
<p>get_cur_post_lang_dir ($post_ID)</p>
</td>
<td valign="top">
<p>Return the lang and dir of language of current post in loop.</p>
</td>
<td valign="top">
<p> The example on right uses this tag and the above one.</p>
</td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> while (have_posts()) : the_post(); 
			$langdir = ((function_exists('get_cur_post_lang_dir')) ? get_cur_post_lang_dir($post-&gt;ID) : array()); ?&gt;
      		&lt;div class=&quot;story <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$langdir</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'direction'</span><span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'borders_'</span><span style="color: #339933;">.</span>get_cur_language<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/*style*/</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div>

</td>
<td valign="top">
<p>loop</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_get_lang_object_of_post ($post_ID)</p>
</td>
<td valign="top">
<p>Return language object of a post.</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>loop</p>
</td>
</tr>
<tr>
<td valign="top">
<p>choice_of_browsing_language()</p>
</td>
<td valign="top">
<p>Return the language of current browser.</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>visitor’s browser</p>
</td>
</tr>
<tr>
<td valign="top">
<p>choice_of_browsing_lang_dir()</p>
</td>
<td valign="top">
<p>Return the lang and dir of current browser.</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>visitor’s browser lang and direction</p>
</td>
</tr>
<tr>
<td valign="top">
<p>add_again_filter ($filtername,$filterfunction)</p>
</td>
<td valign="top">
<p>Activate hooks of plugin in class.</p>
</td>
<td valign="top">
<p>Reserved for high level developers &#8211; see code of function below</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_get_category_link ($catid = 0)</p>
</td>
<td valign="top">
<p>Replace get_category_link to bypass hook from xili_language</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_recent_comments</p>
</td>
<td valign="top">
<p>Recent comments &#8211; used by xili widget &#8211; usable if you need to create your own template tag</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>comments</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_get_language ($lang_nameorslug=&nbsp;&raquo;")</p>
</td>
<td valign="top">
<p>Return full object of a language</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p>ex_pages_by_lang ($pages, $r)</p>
</td>
<td valign="top">
<p>sub selection of pages for wp_list_pages()</p>
</td>
<td valign="top">
<p>example to use as hook </p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td valign="top">
<p>function xiliml_force_loop_lang ($lang_query_tag)</p>
</td>
<td valign="top">
<p>functions to change loop&#8217;s query tag of language</p>
</td>
<td valign="top">
<p>useful for sidebar widgets and latest posts widget &#8211; since 1.3.0</p>
<p><em>Even if the main loop is in one language, in the sidebar, it is possible to &laquo;&nbsp;force&nbsp;&raquo; the language in another one for the widgets.</em></p>
</td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
xiliml_force_loop_lang<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;fr_fr&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sidebar top'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;ul&gt;
 &lt;li&gt;?&lt;/li&gt;
&lt;/ul&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> xiliml_restore_loop_lang<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			<span style="color: #000000; font-weight: bold;">&lt;?php</span> 
					xiliml_force_loop_lang<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;en_us&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sidebar topus'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;ul&gt;
 				&lt;li&gt;?&lt;/li&gt;
			&lt;/ul&gt;
			<span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> xiliml_restore_loop_lang<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Another example :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
 <span style="color: #666666; font-style: italic;">//echo the_curlang();</span>
 <span style="color: #666666; font-style: italic;">/* in this case, the widgets are forced as current lang of the theme - useful in home when query tag 'lang' is not defined -*/</span>
 xiliml_force_loop_lang<span style="color: #009900;">&#40;</span>the_curlang<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sidebar top'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;ul&gt;
  &lt;li&gt;?&lt;/li&gt;
 &lt;/ul&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?php</span>  <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> xiliml_restore_loop_lang<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

</td>
<td valign="top">
<p>sidebar, widget</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_restore_loop_lang ()</p>
</td>
<td valign="top">
<p>functions to restore loop&#8217;s query tag of language</p>
</td>
<td valign="top">
<p>see above</p>
</td>
<td valign="top">
        <div id="attachment_1480" class="wp-caption alignleft" style="width: 230px"><a href="http://dev.xiligroup.com/wp-content/uploads/2010/02/latestpostss.png" rel="lightbox[post-1432]" ><img src="http://dev.xiligroup.com/wp-content/uploads/2010/02/latestpostss.png" alt="Snapshot of example above" title="Snapshot of example above" width="220" height="340" class="size-full wp-image-1480" /></a><p class="wp-caption-text">Snapshot of example above</p></div>
      </td>
<td valign="top">
<p>sidebar, widget</p>
</td>
</tr>
<tr>
<td valign="top">
<p>xiliml_add_lang_to_parsed_query ()</p>
</td>
<td valign="top">
<p>function for filter &#8216;parse_query&#8217; to authorize lang query tag in custom WP_Query()</p>
</td>
<td valign="top">
<p>since 1.4.0</p>
<p>useful for function or plugin that put posts inside post&#8230;</p>
</td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #666666; font-style: italic;">/* example: */</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parse_query'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliml_add_lang_to_parsed_query'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thequery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'parse_query'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'xiliml_add_lang_to_parsed_query'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
<p>loop, custom queries</p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>SHORTCODE</b></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p>linked post</p>
</td>
<td valign="top">
<p>example of shortcode using plugin functions</p>
</td>
<td valign="top">
<p>this code can be inserted in dedicaced functions detectable inside this folder: wp-content/plugins/xilidev-libraries &#8211; <a href="?p=1111">see this post</a> &#8211; </p>
</td>
<td valign="top">
<p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span>em<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#91;</span>linkpost lang<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fr_FR&quot;</span><span style="color: #009900;">&#93;</span>Cette page en français<span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>linkpost<span style="color: #009900;">&#93;</span><span style="color: #339933;">&lt;/</span>em<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span></pre></div></div>

</p>
</td>
<td valign="top">
<p>post content</p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>HOOKS</b></p>
</td>
<td colspan="2" valign="top">
<p><i>Main functions and template tags of xili-language are modifiable by hooks to have better and adapted CMS behaviour.</i></p>
<p><i>It is useful for developer with deep knowledges in php and wp (see end of php source)</i></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>CMS</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xiliml_the_category</strong></p>
<p>add_action (&#8216;xiliml_the_category&#8217;,'your_xiliml_the_category&#8217;,10,3)</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>template tag</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xiliml_the_other_posts</strong></p>
<p>add_action(&#8216;xiliml_the_other_posts&#8217;,'your_xiliml_the_other_posts&#8217;,10,3)</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>template tag</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xili_post_language</strong></p>
<p>add_action(&#8216;xili_post_language&#8217;,'your_xili_post_language&#8217;,10,2)</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>template tag</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xili_language_list</strong></p>
<p>add_action(&#8216;xili_language_list&#8217;,'your_xili_language_list&#8217;,10,3)</p>
</td>
<td valign="top">
<p>In this <a href="http://dev.xiligroup.com/?p=989">example described formerly</a>, the list of languages is enriched by flags:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> my_xili_language_list<span style="color: #009900;">&#40;</span><span style="color: #000088;">$before</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$after</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$theoption</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$theoption</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'top'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">/* usable in type item in new multiple widget */</span>
		<span style="color: #000088;">$listlanguages</span> <span style="color: #339933;">=</span> get_terms_of_groups_lite <span style="color: #009900;">&#40;</span>the_cur_langs_group_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>TAXOLANGSGROUP<span style="color: #339933;">,</span>TAXONAME<span style="color: #339933;">,</span><span style="color: #0000ff;">'ASC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$a</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$currenturl</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/?'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$listlanguages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$language</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//QUETAG</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'ar_ar'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'ar_ma'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$a</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$before</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;a href='&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$currenturl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;hlang&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' title='&quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Latest posts selected'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'in '</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;img src='&quot;</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/images/flags/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.png' alt='' /&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$a</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">/* the current list in sidebar with category sub selection*/</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>  
			<span style="color: #000088;">$catcur</span> <span style="color: #339933;">=</span> xiliml_get_category_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$currenturl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$catcur</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;amp;'</span><span style="color: #339933;">;</span> 
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		 	<span style="color: #000088;">$currenturl</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'siteurl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/?'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$listlanguages</span> <span style="color: #339933;">=</span> get_terms_of_groups_lite <span style="color: #009900;">&#40;</span>the_cur_langs_group_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>TAXOLANGSGROUP<span style="color: #339933;">,</span>TAXONAME<span style="color: #339933;">,</span><span style="color: #0000ff;">'ASC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$listlanguages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$language</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'ar_ar'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'ar_ma'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$before</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>the_curlang<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
						<span style="color: #000088;">$beforee</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;li class=&quot;current-cat&quot; &gt;'</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #000088;">$beforee</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'&lt;li&gt;'</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
				 <span style="color: #000088;">$a</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$beforee</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;a href='&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$currenturl</span><span style="color: #339933;">.</span>QUETAG<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' title='&quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts selected'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'in '</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;img src='&quot;</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/images/flags/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.png' alt='' /&gt; &quot;</span><span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'in '</span><span style="color: #339933;">.</span><span style="color: #000088;">$language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$currenturl</span> <span style="color: #339933;">=</span> xiliml_get_category_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$a</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$before</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;a href='&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$currenturl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' title='&quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts of current category in all languages'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' &gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;img src='&quot;</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/images/flags/www.png' alt='' /&gt; &quot;</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'in all languages'</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/a&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$a</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language_list'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_xili_language_list'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
<p>template tag</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xiliml_langinsearchform</strong></p>
<p>add_action(&#8216;xiliml_langinsearchform&#8217;,'your_xiliml_langinsearchform&#8217;,10,2)</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>sidebar</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xiliml_cat_language</strong></p>
<p>add_filter(&#8216;xiliml_cat_language&#8217;,'my_rules_for_cat_language&#8217;,2,3);</p>
</td>
<td valign="top">
<p>Exemple to show translated and original item</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> my_rules_for_cat_language <span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$category</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$curlang</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #666666; font-style: italic;">/*to detect admin UI*/</span>
	      	<span style="color: #000088;">$new_cat_name</span> <span style="color: #339933;">=</span>  __<span style="color: #009900;">&#40;</span><span style="color: #000088;">$category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span>THEME_TEXTDOMAIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	      	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_cat_name</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
	      		<span style="color: #000088;">$new_cat_name</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; (&quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$content</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;) &quot;</span><span style="color: #339933;">;</span>
	      	<span style="color: #b1b100;">endif</span>
	    <span style="color: #b1b100;">else</span> <span style="color: #339933;">:</span>
	    	<span style="color: #000088;">$new_cat_name</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
	    <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> 
	    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$new_cat_name</span><span style="color: #339933;">;</span>
	 <span style="color: #009900;">&#125;</span> 
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xiliml_cat_language'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_rules_for_cat_language'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
<p>sidebar</p>
<p>wp list categories</p>
<p>content</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>head_insert_language_metas</strong></p>
<p>add_filter(&#8216;head_insert_language_metas&#8217;,'my_head_insert_language_metas&#8217;,1,2);</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>header xhtml</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>head_language_attributes</strong></p>
<p>add_filter(&#8216;head_language_attributes&#8217;,'my_ head_language_attributes&#8217;,1,1);</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p>header xhtml</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p><strong>xiliml_cur_lang_head</strong></p>
<p>add_filter(&#8216;xiliml_cur_lang_head&#8217;,'my_xiliml_cur_lang_head&#8217;,1);</p>
</td>
<td valign="top">
<p>default rules &#8211; set curlang in head according rules</p>
</td>
<td valign="top">
<p>multilingual behaviour (front, cat, search,&#8230;)</p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>More technical hooks and filters inside xili-language</p>
<p><i>(Read the plugin php source for more infos)</i></p>
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>choice_of_browsing_language</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_link_translate_desc</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_single_cat_title_translate</p>
</td>
<td valign="top">
<p>used by filter for wp_title() tags &#8211; since 1.4.1</p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_getarchives_where</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_getarchives_join</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_modify_querytag</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_taglink_append_lang</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top">
<p>xiliml_link_append_lang</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>OTHER FILTERS</b></p>
</td>
<td colspan="2" valign="top">
<p>Some template tags inside WP core are not fully multilingual and need filters.</p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
        <functions file
      </td>
</tr>
<tr>
<td colspan="2" valign="top">
<p>the_time</p>
<p>add_filter(&#8216;the_time&#8217;,'my_date&#8217;,10,2);</p>
</td>
<td valign="top">
        Date management and translation are very complicated. Here by using a xili-language function, it is possible to modify the basic behaviour of the current template tag <strong>the_time</strong>.
      </td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> my_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thetime</span><span style="color: #339933;">,</span><span style="color: #000088;">$theformat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* param no used because php format */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y - %H:%M'</span><span style="color: #339933;">,</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_the_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_time'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
        Post, Page
      </td>
</tr>
<tr>
<td colspan="2" valign="top">
<p>the_modified_time</p>
<p>add_filter(&#8216;the_modified_time&#8217;,'my_modified_date&#8217;,10,2);</p>
</td>
<td valign="top">
         Date management and translation are very complicated. Here by using a xili-language function, it is possible to modify the basic behaviour of the current template tag <strong>the_modified_time</strong>.
      </td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> my_modified_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thetime</span><span style="color: #339933;">,</span><span style="color: #000088;">$theformat</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* param no used because php format */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y - %H:%M'</span><span style="color: #339933;">,</span><span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_the_modified_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_modified_time'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_modified_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
        Post, Page
      </td>
</tr>
<tr>
<td colspan="2" valign="top">
<p>get_comment_date</p>
<p>add_filter(&#8216;get_comment_date&#8217;,'my_comment_date&#8217;,10,2);</p>
</td>
<td valign="top">
      This is the date of each comments in the comments loop.
      </td>
<td valign="top">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> my_comment_date<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_time</span><span style="color: #339933;">,</span><span style="color: #000088;">$d</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">/* params no used because php format */</span>
  <span style="color: #666666; font-style: italic;">/* the first param is to be as msgid in .po example: %B %d, %Y - %H:%M or %B %d, %Y at %H:%M   */</span>	
  <span style="color: #b1b100;">return</span> the_xili_local_time<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%B %d, %Y'</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span>get_comment_time <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m/d/Y H:i'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #666666; font-style: italic;">/* impossible to use get_comment_date as it is itself filtered*/</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_comment_date'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_comment_date'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</td>
<td valign="top">
        Comments
      </td>
</tr>
<tr>
<td colspan="3" valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
<td valign="top">
<p></p>
</td>
</tr>
<tr>
<td valign="top" class="ttd1">
<p>© dev.xiligroup.com</p>
</td>
<td valign="top" class="ttd2">
<p>2010</p>
</td>
<td valign="top" class="ttd3">
<p></p>
</td>
<td valign="top" class="ttd4">
<p></p>
</td>
<td valign="top" class="ttd5">
<p></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;<br />&nbsp;<br />
Please use the <a href="http://forum.dev.xiligroup.com/">forum</a> for questions or comments.<br />
&nbsp;<br />&nbsp;<br />
&nbsp;<br />&nbsp;<br /><fieldset class="series" ><legend>This posts belong to the series: xili-language for experts</legend><ol><li><a href='http://dev.xiligroup.com/?p=726' title="xili-language plugin : release 1.6.0 (compatible WP 3.0)">xili-language plugin : release 1.6.0 (compatible WP 3.0)</a></li><li><a href='http://dev.xiligroup.com/?p=1068' title="Q&A about xili-language plugin, release 1.1">Q&A about xili-language plugin, release 1.1</a></li><li><a href='http://dev.xiligroup.com/?p=1045' title="xili-language : hooks, filters, class and so on...">xili-language : hooks, filters, class and so on...</a></li><li><a href='http://dev.xiligroup.com/?p=1055' title="From a theme with localization to a multilingual theme with xili-language : technical and general notes.">From a theme with localization to a multilingual theme with xili-language : technical and general notes.</a></li><li><a href='http://dev.xiligroup.com/?p=1111' title="xili-language - 1.4.1 - new libraries">xili-language - 1.4.1 - new libraries</a></li><li>Xili-language toolbox in one table</li><li><a href='http://dev.xiligroup.com/?p=1482' title="xili-language and the time">xili-language and the time</a></li><li><a href='http://dev.xiligroup.com/?p=1497' title="xili-language : Affichage des dates et heures">xili-language : Affichage des dates et heures</a></li></ol></fieldset>&nbsp;<br />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1432</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Class: modify or extend ?</title>
		<link>http://dev.xiligroup.com/?p=1357</link>
		<comments>http://dev.xiligroup.com/?p=1357#comments</comments>
		<pubDate>Sun, 29 Nov 2009 08:18:04 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-plugins]]></category>
		<category><![CDATA[class extend]]></category>
		<category><![CDATA[floom]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1357</guid>
		<description><![CDATA[After the creation of xili-floom-slideshow: Here, through the example of the original Floom javascript (displaying a pretty slideshow), we will present and discuss the ways to improve features and events of this script containing a core class. This well documented class is based on powerful Mootools framework (>1.2.2). The first report : Floom is a [...]]]></description>
			<content:encoded><![CDATA[After the creation of <a href="http://dev.xiligroup.com/?p=1241">xili-floom-slideshow</a>:
<em>Here, through the example of the original <a href="http://blog.olicio.us/2009/07/25/floom/">Floom javascript</a> (displaying a pretty slideshow), we will present and discuss the ways to improve features and events of this script containing a core class.</em>

This well documented class is based on powerful Mootools framework (>1.2.2).

<h5>The first report :</h5>
Floom is a standalone (insulated) javascript class ( and don&#8217;t offer enough dialogs with environment &#8211; only two events &#8211; <em>end of preload images, or when slides change</em> &#8211; and impossible to stop it).
The script contains two errors (start and end index of series of images).

<h5>What is wished?</h5>
Some events fired by Floom : onFirst, onLast,  &#8230;
Some events detected and received by Floom : when container is clicked (to stop and start it) and when mouse enter in caption (the image legend).
<h5>Step by step</h5>
At the beginning, for tests, the script was modified  but remembering the OOP and Class architecture of Mootools, we try to create an extension of the original class. 
The first way is dangerous because it is very uneasy to maintain the script if the original will be updated by the author. The second is easiest because the work is only on the new class extending the first.
Research on net was not very easy because the multiple ways of scripting depend from the old and recent versions of Mootools and javascript. The Mootools  documentation proved most effective, even with these small examples because examples on most blogs are often out-of-date.
&nbsp;<br />
The new class is named here <strong>xiliFloom</strong>.
&nbsp;<br />


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> xiliFloom <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000000; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">Extends</span><span style="color: #339933;">:</span> Floom<span style="color: #339933;">,</span>
    options<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        stopandgo<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
        originwrap <span style="color: #339933;">:</span> <span style="color: #000088;">$empty</span><span style="color: #339933;">,</span>
        onFirst<span style="color: #339933;">:</span>     <span style="color: #000088;">$empty</span><span style="color: #339933;">,</span>
        onLast<span style="color: #339933;">:</span>     <span style="color: #000088;">$empty</span><span style="color: #339933;">,</span>
        onClickWrapper<span style="color: #339933;">:</span>     <span style="color: #000088;">$empty</span><span style="color: #339933;">,</span>
        onInvader<span style="color: #339933;">:</span>     <span style="color: #000088;">$empty</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>



First property : <strong>Extends</strong> the Class that xiliFloom will extend.
&nbsp;<br />
<strong>options :</strong> here only new options are added (parameters and event names that the new class will fire &#8211; onFirst, onLast&#8230;)
&nbsp;<br />&nbsp;<br />


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">initialize <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>wrapper<span style="color: #339933;">,</span> slides<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        this<span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span>wrapper<span style="color: #339933;">,</span> slides<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>originwrap <span style="color: #339933;">=</span> wrapper<span style="color: #339933;">;</span> 
        $<span style="color: #009900;">&#40;</span>wrapper<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>addEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'click'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>stopandgo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">-</span> this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>stopandgo<span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>stopandgo <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>this<span style="color: #339933;">.</span>restart<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>           
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>stopandgo <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$clear</span><span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>periodicalblinds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
            this<span style="color: #339933;">.</span>fireEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'onClickWrapper'</span><span style="color: #339933;">,</span> this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>stopandgo<span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">.</span>bind<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>



<strong>initialize :</strong> the first entry of the function of this property is important here : this.parent() will call initialize of the parent class Floom. And after adds other value, function or event. Here an event &#8216;click&#8217; is added to the main wrapper containing all images.
&nbsp;<br />&nbsp;<br />
Some other properties of the parent class are overriden (partially or completed).


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">createCaptions<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        this<span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        this<span style="color: #339933;">.</span>captions<span style="color: #339933;">.</span>addEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mouseenter'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            this<span style="color: #339933;">.</span>mouseinvader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">.</span>bind<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    step<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        this<span style="color: #339933;">.</span>parent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide <span style="color: #339933;">==</span> this<span style="color: #339933;">.</span>slides<span style="color: #339933;">.</span>length<span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>this<span style="color: #339933;">.</span>fireEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'onLast'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span>slides<span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide <span style="color: #339933;">===</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>this<span style="color: #339933;">.</span>fireEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'onFirst'</span><span style="color: #339933;">,</span> this<span style="color: #339933;">.</span>slides<span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>



<strong>createCaptions</strong> (create the legend block) : after the parent call, here only one event is added &#8211; when a mouse enter in the block containing captions of the slideshow.
&nbsp;<br />
<strong>step :</strong> (manage the changing of images inside the slideshow)  after the parent call, if the conditions are met, events are fired:
onFirst &#8211; if the first image is displayed (current image object is passed as parameter).
onLast &#8211;  if the last image is displayed (current image object is passed as parameter and his index).
&nbsp;<br />&nbsp;<br />
&nbsp;<br />&nbsp;<br />


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">restart<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        wrapper <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>originwrap<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>originwrap<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
        this<span style="color: #339933;">.</span>createStructure<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> 
    goto<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>e <span style="color: #339933;">&lt;</span> this<span style="color: #339933;">.</span>slides<span style="color: #339933;">.</span>length<span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        	this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide <span style="color: #339933;">=</span> e<span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        	this<span style="color: #339933;">.</span>step<span style="color: #339933;">.</span>delay<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>animation<span style="color: #339933;">,</span> this<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    	<span style="color: #009900;">&#125;</span>       
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
    mouseinvader <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
        this<span style="color: #339933;">.</span>fireEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'onInvader'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span>slides<span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



New properties are here added for the future needs of xili-floom-slideshow plugin wordpress plugin (also usable elsewhere):
&nbsp;<br />
<strong>restart: </strong>is a property containing a function used when a click event occurs on slideshow. In the parent class there is no equivalent property.
&nbsp;<br />
<strong>goto: </strong>is a property containing a function called by a external action to jump to a specified image. The parameter is the index beginning at 1. Our target is to create a thumbnail image gallery. When the user will click on one the slideshow will jump to this full image. In <a href="http://dev.xiligroup.com/?p=1319">this post</a>, the tabs are now linked to corresponding images.
&nbsp;<br />
&#8230; and all the properties that can be possible to design&#8230;.
&nbsp;<br />&nbsp;<br />
<h5>Before to conclude</h5>
To be honest, only three modications were done inside the original script. (commented by //XF)
Two concern the errors on image indexing. (start and end of the loop of images array) &#8211; described in comments of the original post.&nbsp;<br />
One is more interesting &#8211; animateBlinds which is recursive. &nbsp;<br />


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">onPreload<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        this<span style="color: #339933;">.</span>periodicalblinds <span style="color: #339933;">=</span> this<span style="color: #339933;">.</span>animateBlinds<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>periodical<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">.</span>options<span style="color: #339933;">.</span>interval<span style="color: #339933;">,</span> this<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//XF</span>
&nbsp;
        this<span style="color: #339933;">.</span>fireEvent<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'onPreload'</span><span style="color: #339933;">,</span> this<span style="color: #339933;">.</span>slides<span style="color: #009900;">&#91;</span>this<span style="color: #339933;">.</span><span style="color: #990000;">current</span><span style="color: #339933;">.</span>slide<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>



Inside Preload, this function was fired with periodical Method but not affected to a var. this.periodicalblinds is added and will be useful in the new class to stop the periodic execution through the click event  -and function $clear(this.periodicalblinds) -
Because this function animateBlinds is recursive, it is impossible to override his content. It doesn&#8217;t matter here.
&nbsp;<br />&nbsp;<br />
<h5>domready</h5>
In the Event domready, the constructor is now used and not the previous Element.implement name &#8211; floom  &#8211; as before.
With this writting approach, in the php/js scripting, it will be easier to construct (for test or gold services) parent class (Floom) or new class (xiliFloom).


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">// Floom or xiliFloom
				theFloom = new <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$xili_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'goldparam'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>Floom('<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$floom_divs</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>',slides, {
				prefix: '<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$xili_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prefix'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* only global settings */</span><span style="color: #000000; font-weight: bold;">?&gt;</span>',
				amount: <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$amount</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>,</pre></div></div>



&nbsp;<br />&nbsp;<br />
<em>Hope this &#8216;step by step&#8217; has helped you for better understanding&#8230;</em>
&nbsp;<br />
<h5>WordPress Expert Corner </h5>
In your theme functions.php, because the new class (that you can adapt to your theme) is in another file upload inside the current theme. A hook filter must be used like below (example).


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> xilifloom_theme_header <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">/* option if mootools is elsewhere */</span>	
			wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mootools-core'</span><span style="color: #339933;">,</span>FLOOMURL<span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/mootools-core.js'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1.2.4'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mootools-more'</span><span style="color: #339933;">,</span>FLOOMURL<span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/mootools-more.js'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mootools-core'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1.2.4.2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'floom'</span><span style="color: #339933;">,</span>FLOOMURL<span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/floom-1.0.js'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mootools-core'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mootools-more'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xilifloom'</span><span style="color: #339933;">,</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/xilifloom-1.0xf.js'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'floom'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1.0xf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// and other js.... for events....		</span>
	<span style="color: #009900;">&#125;</span>
	add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'xilifloom_theme_header'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>



When updating the plugin, the specific scripts were not be overwritten.&nbsp;<br />
Soon, a new version of xili-floom-slideshow plugin !
&nbsp;<br />&nbsp;<br />





]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1357</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xili-floom-slideshow : fireEvent when picture changes ! (updated)</title>
		<link>http://dev.xiligroup.com/?p=1319</link>
		<comments>http://dev.xiligroup.com/?p=1319#comments</comments>
		<pubDate>Sun, 22 Nov 2009 22:41:07 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-plugins]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[floom]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1319</guid>
		<description><![CDATA[Floom slideshow fire event when image changes...]]></description>
			<content:encoded><![CDATA[<div id="blinds-cont"><div id="blinds"></div></div>
<div id="wrapper"><div id="heading"> 
			<ul id="buttons">
				<li class="firstbbt" onClick="theFloom.goto(1);">First Picture</li>
				<li class="secondbbt" onClick="theFloom.goto(2);">Second Picture</li>
<li class="thirdbbt" onClick="theFloom.goto(3);">Third Picture</li>
			</ul>
			 </div><div id="panes"><div id="content"><div class="pane xililanglook" style="display:block;" id="tab-1">A detail of the <strong>first image</strong> :
&nbsp;<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/DET_1.jpg" alt="Village on automn" title="Village on automn" width="320" height="240" class="alignleft size-full wp-image-1332" /><em>Ut praessectet ipisci ea faci blamconse feugue ver se ea aliquip ustin et ulput landreet, sequatum dolobore min volore exeriusto doloreet am alisismolore modipit lore dio euissim at vel euguero od magnit, quismod modolore faccumsandio commodio dit utem volor iriureet eum dipisci cidui blaore doluptat.</em> Ut veliquatum irit prat.
</div><div class="pane xililanglook" style="display:block;" id="tab-2">
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/DET_2-300x225.png" alt="Sky and tree" title="Sky and tree" width="300" height="225" class="alignright size-medium wp-image-1331" />A zoom of the <strong>second image</strong> : &nbsp;<br /><em>Lore del iuscin ut alit wisi tet volutat veniamet lummy nis adionsecte faccum incillummy nostrud tat, veliquat praesent nonullam diatumsan heniscipsum nullandre ming essismod er accum doloreet venis dipit dolor ad modolortion henisismodit praessi blan esseniat.</em>
</div><div class="pane xililanglook" style="display:block;" id="tab-3">A zoom of the <strong>third image</strong> :&nbsp;<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/DET_3.png" alt="Color" title="Color" width="320" height="240" class="alignleft size-full wp-image-1329" /><em>Lorperos esto odo dion hent augue facin velesectet, quat wissi esto od magniss quipit il in velit iliquis aut ip eugiat. Ut ipit loreet, susto commy nibh ent velenis nis am veliquat vel ullutat ing et iure facil in ex eui euguero eugueros exercil deliquam <strong>venibh eum vel in et</strong>, quis nim in henis do erosto conulluptat nonsequi blamet vel ut utetum quamet, sum velesequip et, susto consequ ssenit veliquam zzriustrud min hent lor inci exeriliquat ip euipsum vent lummy <strong>nibh eum</strong> quate ea facipit diamet ea commy nullaore ea adiam dit duis ad dipis esed euguer sumsandiamet deliquat aliquatuer se dolore eugiat.</em>



</div></div></div></div>
<hr />
Here, the cycle of images drives the sliding tabs below. Both scripts are made with Mootools framework. As demo, it is very simple to see what happen&#8230;
As you can observe, the event is fired when the image has finished to change&#8230; And also if you click in a tab of the tabbed post &#8211; it is possible with a new class <strong>extending</strong> the Floom class (see <a href="http://dev.xiligroup.com/?p=1357">modify or extend?</a>). 
&nbsp;<br />&nbsp;<br />
<h5>How to ?</h5>
 1) add JS functions in your header:


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;!--</span> 
	<span style="color: #000000; font-weight: bold;">function</span> nextslidingtab<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$chk</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'idoftargetobject'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			yourfunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">function</span> preloadfired<span style="color: #009900;">&#40;</span>slide<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$chk</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'idoftargetobject'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			initfunction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>



Set inside xili-floom-slideshow the value for target functions :

<span id="attachment_1343" class="wp-caption alignnone" style="width: 500px"><img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/xfs-js-settings.png" alt="xili-floom js function settings" title="xili-floom js function settings" width="490" height="269" class="size-full wp-image-1343" /><span class="wp-caption-text">xili-floom js function settings</span></span>
Be very careful to check the content of target functions to be sure that js target objects are available&#8230;
&nbsp;<br />
<fieldset class="series" ><legend>Other posts about xili-floom-slideshow</legend><ol><li><a href='http://dev.xiligroup.com/?p=1241' title="xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)">xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)</a></li><li><a href='http://dev.xiligroup.com/?p=1269' title="xili-floom-slideshow : the mystery of css revealed !">xili-floom-slideshow : the mystery of css revealed !</a></li><li><a href='http://dev.xiligroup.com/?p=1301' title="xili-floom-slideshow plugin : one example of a picture frame">xili-floom-slideshow plugin : one example of a picture frame</a></li><li>xili-floom-slideshow : fireEvent when picture changes ! (updated)</li></ol></fieldset>
&nbsp;<br />]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1319</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xili-floom-slideshow : the mystery of css revealed !</title>
		<link>http://dev.xiligroup.com/?p=1269</link>
		<comments>http://dev.xiligroup.com/?p=1269#comments</comments>
		<pubDate>Sat, 21 Nov 2009 19:01:38 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-plugins]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[floom]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1269</guid>
		<description><![CDATA[To optimize floom slideshow, some css features are necessary ! Example of a vertical series of images...]]></description>
			<content:encoded><![CDATA[<div style="overflow:hidden">
<div id="blinds-contv2"><div id="blinds"></div></div></p>
<div style="margin-left:350px">
<h5>introduction</h5>
<p>On the left, there is a floom slideshow embedded inside the content of this post. Some characteristics: images are &laquo;&nbsp;portrait&nbsp;&raquo; (320 x 427 pixels). The title is followed by a description. The frame is black with a small shadow.<br />
As described in documentation, all the images (©MSC 2009) are attachments of this post (but are not inserted in the current content).<br />
Only a shortcode is inserted at the top of the post&#8217;s content before this text.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>xilifloom frame_id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;blinds-contv2&quot;</span><span style="color: #009900;">&#93;</span></pre></div></div>

<p>Because here the properties are different, the parameter &#8216;frame_id&#8217; is set to &laquo;&nbsp;blinds-contv2&#8243; (this id is present in the floom.css present inside the current theme.<br />
As you can see the post contains also images after this paragraph. So, to avoid insertion of them inside slideshow, the custom field &laquo;&nbsp;<em>floom_subname</em>&nbsp;&raquo; is set to &laquo;&nbsp;<em>img</em>&nbsp;&raquo; because name of files of series contains img but not the other for explanations. The order of images in wp gallery is also used to sort the series.
</div>
</div>
<h5>A short description of the frame (div containing frame and images)</h5>
<p><div id="attachment_1276" class="wp-caption alignnone" style="width: 310px"><a href="http://dev.xiligroup.com/wp-content/uploads/2009/11/DIV_how_2.png" rel="lightbox[post-1269]" ><img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/DIV_how_2-300x152.png" alt="the divs of the demo" title="the divs of the demo" width="300" height="152" class="size-medium wp-image-1276" /></a><p class="wp-caption-text">the divs of the demo - blue borders</p></div><br />
In this snapshot (as in plugin&#8217;s <a href="http://dev.xiligroup.com/?p=1241">post</a>), some div html tags are visible. Outside, the div with id named &laquo;&nbsp;blinds-cont&nbsp;&raquo;. Just around the image, the div named &laquo;&nbsp;blinds&nbsp;&raquo;.<br />
The corresponding extract of css is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#blinds-cont { -webkit-box-shadow: 0 0 20px #000; background: url(bg.png) 0 0 no-repeat; margin: 20px auto; padding: 12px 0 0 0; font-family: 'Georgia', 'Arial Narrow', 'Arial', sans-serif; height: 254px; -moz-box-shadow: 0 0 20px #000; width: 620px; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds { margin: 0 auto; background: url(spinner.gif) 50% no-repeat; height: 204px; width: 596px; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds .floom_slice { z-index: 10; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds .floom_caption { text-shadow: 0 1px 0 #fff; font-size: 1.0em; color: #333; font-style: italic; position: relative; text-align: center; width: 100%; top: 15px; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds .floom_progressbar { font-size: 1px; background: #131718; border-bottom: solid 1px #fff; height: 3px; position: relative; z-index: 1000; width: 0; top: 2px; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds .floom_container { overflow: hidden; border-bottom: solid 1px #fff; border-top: solid 1px #666; }
</span><span style="color: #666666; font-style: italic;">#blinds-cont #blinds .floom_vertical { float: left; }</span></pre></div></div>

<p>In this horizontal demo case, the frame contains a shadowed border (visible in Safari or Mozilla) and a background frame image with a large bottom part for title of image.</p>
<h5>Which are the characteristics here?</h5>
<p>The ID (#) &laquo;&nbsp;blinds-contv2&#8243; is set (and used in shortcode). the image (#blinds) div has height and width equal to size of series of images. The container (frame) is a little bigger to create a border especially on bottom for description.<br />
Here before to create a new one, the frame don&#8217;t use image as background. It is only black.<br />
The resulting second part of the floom.css is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#blinds-contv2 { -webkit-box-shadow: 0 0 10px #000; background: #000; margin: 20px 30x 20px; padding: 10px 0 0 0; font-family: 'Georgia', 'Arial Narrow', 'Arial', sans-serif; height: 550px; -moz-box-shadow: 0 0 20px #000; width: 324px; float:left;}
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds { margin: 0 auto; background: url(spinner.gif) 50% no-repeat; height: 427px; width: 320px; }
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds .floom_slice { z-index: 10; }
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds .floom_caption { font-size: 1.0em; color: #ddd; font-style: italic; position: relative; text-align: center; width: 100%; top: 15px; }
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds .floom_progressbar { font-size: 1px; background: #131718; border-bottom: solid 1px #fff; height: 3px; position: relative; z-index: 1000; width: 0; top: 2px; }
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds .floom_container { overflow: hidden; border-bottom: solid 1px #999; border-top: solid 1px #666; }
</span><span style="color: #666666; font-style: italic;">#blinds-contv2 #blinds .floom_vertical { float: left; }</span></pre></div></div>

<h5>Title and description</h5>
<p><div id="attachment_1279" class="wp-caption alignnone" style="width: 358px"><img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/CustomField.png" alt="Custom Fields" title="Custom Fields" width="348" height="170" class="size-full wp-image-1279" /><p class="wp-caption-text">Custom Fields</p></div><br />
As you know, each image uploaded to WordPress can be described with a title, a caption (alt) and a description. By default, embedding by plugin use title of attachment. To use both, custom field named &#8216;<em>floom_title_desc</em>&#8216; is set to 3. (1= title, 2=description).</p>
<h5>To conclude temporarily&#8230;</h5>
<p>Hope this short text will invite you to better understanding of this marvelous tool and &#8216;embedder&#8217; xili-floom-slideshow plugin. But you need to create your own design adapted to your theme.<br />
&nbsp;<br /> <br />
M. from dev.xiligroup<br />
&nbsp;<br />&nbsp;<br />
<fieldset class="series" ><legend>This article belongs to the series below</legend><ol><li><a href='http://dev.xiligroup.com/?p=1241' title="xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)">xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)</a></li><li>xili-floom-slideshow : the mystery of css revealed !</li><li><a href='http://dev.xiligroup.com/?p=1301' title="xili-floom-slideshow plugin : one example of a picture frame">xili-floom-slideshow plugin : one example of a picture frame</a></li><li><a href='http://dev.xiligroup.com/?p=1319' title="xili-floom-slideshow : fireEvent when picture changes ! (updated)">xili-floom-slideshow : fireEvent when picture changes ! (updated)</a></li></ol></fieldset><br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1269</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)</title>
		<link>http://dev.xiligroup.com/?p=1241</link>
		<comments>http://dev.xiligroup.com/?p=1241#comments</comments>
		<pubDate>Thu, 19 Nov 2009 17:48:00 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-plugins]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[floom]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1241</guid>
		<description><![CDATA[Floom slideshow designed by Oskar Krawczyk is wonderful and amazing. For integration inside wordpress, it can be awesome ! xili-floom-slideshow tries to install it automatically but also allows personalizations (parameters, child class,...)
]]></description>
			<content:encoded><![CDATA[<div id="blinds-cont"><div id="blinds"></div></div>
<strong>xili-floom-slideshow integrates the Floom slideshow in wordpress theme.</strong>
<div id="cha-posttabs">
<h4>Description</h4><div><p>Floom slideshow designed by <a href="http://nouincolor.com/">Oskar Krawczyk</a> under MIT license is wonderful and amazing. For integration inside wordpress, it can be awesome ! xili-floom-slideshow tries to install it automatically but also allows personalizations.</p>
<h5>How it works ?</h5>
<p><strong>xili-floom-slideshow</strong>  inserts the javascript and css file inside the header of the theme. The images attached (but not inserted) to a post (or a page) are listed for the slideshow. And after adding a</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>xilifloom<span style="color: #009900;">&#93;</span></pre></div></div>

<p> shortcode inside the content of the post, the slideshow of the images of the gallery are automatically displayed.<br />
With the dashboard Settings page, it is possible to change some properties of the slideshow without changing the original javascript: <em>by example, number of vertical &#8216;venitian&#8217; blinds, speed, progress bar, visible captions, and <a href="http://blog.olicio.us/2009/07/25/floom/">more</a>.</em><br />
Some properties can be attached to one post by using custom fields.</p>
<h5>prerequisite</h5>
<ul>
<li>* Minimun knowledges in WordPress architecture (and css).</li>
<li>* If others plugins use mootools, some modifications must be done through a added function named

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">xilifloom_theme_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>inside functions.php. </li>
<li>* Images for a slideshow must be selected with great precaution. (Same size adapted to the frame)</li>
</ul>
</div>
<h4>New !</h4><div><h5>new 0.9.3</h5>
<p>Gold parameters added : ready to integrate a new child class of Floom [<a href="http://dev.xiligroup.com/?p=1357">see this post</a>]. Open to better events exchanged with theme UI. More modularity and possibility of setting. (*Gold options are reserved for theme designer and webmaster with sufficient knowledge in php, js,&#8230;*)<br />
CAUTION: after upgrading, if `floom_subname` is used in custom fields of some posts, to retrieve the images series, the wildcard must be wrapped with one or two chars &#8216;%&#8217; as in **LIKE** of sql query.</p>
<h5>0.9.2</h5>
<ul>
<li>* add for pictures order by menu_order. If order is set in gallery linked to a post, displayed series is ordered by these numbers ascendant. <em><a href="http://dev.xiligroup.com/?p=1241#tab-4">see screenshot</a></em></li>
<li>* more parameters.</li>
<li>* add hooks and filters : to allow better selection of floom values and choice of series of images (not necessary attached to a post) according the theme or cms architecture, two filters was added : `<code>xili_floom_get_values</code>` and `<code>xili_floom_get_images</code>` insertable in functions inside `functions.php` of the current theme. Very useful to personalize header according place inside the site architecture. [<a href="http://dev.xiligroup.com/?cat=480&#038;lang=en_us">example</a>]</li>
</ul>
<h5>0.9.1 (beta)</h5>
<p>- A lot of new properties and features will be soon commented.<br />
- xilitheme-select plugin compatibility (for iPhone).<br />
- A new demo is <a href="http://dev.xiligroup.com/?p=1269">explained here</a>.<br />
- A <a href="http://dev.xiligroup.com/?p=1301">example</a> of css and pictures frame (bg image).</p>
<h5>0.9.0 (beta)</h5>
<p>First public release shipped Nov, 19th</p>
</div>
<h4>Installation</h4><div><h5>Installation</h5>
<p>1. Upload the folder containing `<code>xili-floom-slideshow.php</code>` and other sub-folders and files to the `/<code>wp-content/plugins/</code>` directory.<br />
2. Activate the plugin.<br />
3. If you want to personalize the look and size of the frame of the slideshow, don&#8217;t modify the default css and files present inside plugin&#8217;s folder. Create a floom folder (and a css sub-folder) inside your current theme. Inside this, copy the floom.css, spiner.gif and frame bg image that you can adapt. xili-floom-slideshow plugin will detect automatically this folder.</p>
<h5>Personalizations</h5>
<p>What ? if other plugins use mootools js framework</p>
<p>Just add a function named `xilifloom_theme_header` in functions.php of the current theme and the needed enqueues … and the action `wp_print_scripts` adapted with the other plugins…</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> xilifloom_theme_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'floom'</span><span style="color: #339933;">,</span>FLOOMURL<span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/floom-1.0.js'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mootools-core'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mootools-more'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'1.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xilifloom_default_settings'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
			add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_print_scripts'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'xilifloom_theme_header'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<h5>Settings for only one post</h5>
<p>Some **Custom fields** are possible: `<code>floom_divs</code>` to set id of the div containing images ; `<code>floom_captions</code>` (true or false) to display or not the caption (title) of the images ; `floom_progressbar`  (true or false) to show (or not) the progress bar. `floom_title_desc` is set by default to 1 and display the title of the attached images. (2 : only the description and 3 : both title and description).</p>
<p>* `<code>floom_parentID</code>` to choose attachment from another post (and not the current post where slideshow in inserted)<br />
* `<code>floom_subname</code>` to sub-select a series of pictures attached by set a mask (use % as LIKE in SQL %img or %pict%&#8230;) [<a href="http://dev.xiligroup.com/?p=1269">See post</a>].<br />
* `<code>floom_container</code>` to inform name of container (default : blinds-cont).<br />
* `<code>floom_display</code>` to decide if the container is displayed when no image (block or none) &#8211; default : block.</p>
<p>The following custom fields (prefix floom_) work like javascript parameters. Use them with caution..</p>
<p>* `<code>floom_amount</code>` (number of blinds)<br />
* `<code>floom_interval</code>` (interval between change)<br />
* `<code>floom_axis</code>` (by default : vertical)</p>
<p>It is also possible to fireEvent (onSlideChange and onPreload) by choosing name of fired functions (javascript added by functions in current theme).</p>
<p>**Gold parameters**<br />
If active in plugin settings, a wide range of features are open for special js effects on first or last slide and on other events of the child class&#8230; [<a href="http://dev.xiligroup.com/?p=1357">see this post</a>]</p>
<p>= xilitheme-select plugin compatibility (for iPhone) =<br />
As in this website [<a href="http://dev.xiligroup.com/">dev.xiligroup.com</a>], it is now possible to specify a floom.css in each theme (the for desktop, the for mobile as iPhone or iPod).</p>
<p>Don&#8217;t forget to verify that version of mootools (core and more) are >1.2.2.</p>
<p>More infos soon&#8230;</p>
</div>
<h4>F.A.Q</h4><div><h5>Is is possible to insert slideshow outside the content of post on CMS ?</h5>
<p>Yes, xili-floom-slideshow only need to find the id of the div where images are displayed (default name <strong>blinds</strong>).</p>
<h5>Is xili-floom-slideshow plugin compatible with other plugins based on Mootools ?</h5>
<p>Yes, but be aware to add a special function in you functions.php. See example [here] (soon).</p>
<h5>Support Forum or contact form ?</h5>
<p>Effectively, prefer <a href="http://forum.dev.xiligroup.com/">forum</a> to obtain some support.</p>
</div>
<h4>Screenshots</h4><div><p><img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/screenshot-11.png" alt="Settings page" /><br />
1. Settings page.<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/screenshot-21.png" alt="Folder" /><br />
2. Folder example in current theme.<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/screenshot-31.png" alt="screenshot-3" title="screenshot-3" width="166" height="166" class="alignnone size-full wp-image-1380" /><br />
3. Blinds during transition between two images (snapshot from Oskar example).<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/screenshot-4.jpg" alt="screenshot-4" title="screenshot-4" width="480" height="320" class="alignnone size-full wp-image-1381" /><br />
4. Example in iPhone Safari.<br />
<img src="http://dev.xiligroup.com/wp-content/uploads/2009/11/screenshot-5-300x167.jpg" alt="screenshot-5" title="screenshot-5" width="300" height="167" class="alignnone size-medium wp-image-1382" /><br />
5. Ordered list of images (only these in slideshow are affected).</p>
</div>
<h4>Other notes</h4><div><h5>What about fireEvents by Floom ?</h5>
<p>If a js function called by Floom is named `dothisthing(s)` just add in xili-floom-setting the name `dothisthing` as value of one of the two available fireEvents as `onSlideChange`. (the param passed by floom is the current image object). <a href="http://dev.xiligroup.com/?p=1319">See this amazing post !</a><br />
&nbsp;<br />&nbsp;<br />
<em>It is more a beta version; soon more docs about powerful features&#8230;</em><br />
© 2009-12-05 MS dev.xiligroup.com</p>
</div>
<h4>Download</h4><div><p>the readme file ( see <a href="http://wordpress.org/extend/plugins/xili-floom-slideshow/">here</a> )<br />
<strong>WordPress Repository  (beta) : </strong> <a href='http://wordpress.org/extend/plugins/xili-floom-slideshow/download/'>xili-floom-slideshow</a></p>
</div>
</div>
&nbsp;<br />&nbsp;<br /><fieldset class="series" ><legend>This article belongs to the series below</legend><ol><li>xili-floom-slideshow : a plugin to install famous floom (0.9.3 beta)</li><li><a href='http://dev.xiligroup.com/?p=1269' title="xili-floom-slideshow : the mystery of css revealed !">xili-floom-slideshow : the mystery of css revealed !</a></li><li><a href='http://dev.xiligroup.com/?p=1301' title="xili-floom-slideshow plugin : one example of a picture frame">xili-floom-slideshow plugin : one example of a picture frame</a></li><li><a href='http://dev.xiligroup.com/?p=1319' title="xili-floom-slideshow : fireEvent when picture changes ! (updated)">xili-floom-slideshow : fireEvent when picture changes ! (updated)</a></li></ol></fieldset>&nbsp;<br />&nbsp;<br />

]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1241</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress: An assumed choice for future</title>
		<link>http://dev.xiligroup.com/?p=1235</link>
		<comments>http://dev.xiligroup.com/?p=1235#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:45:09 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[tracs]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1235</guid>
		<description><![CDATA[Darn You WordPress!! is a very recent post about wishes for wordpress.

Before to answer about the question about coherence or generic design of template tags (with optional echoing).
This recent post is an opportunity to write a short post about our choice of Wordpress tools used since more than 4 years.]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblogtoolscollection.com/archives/2009/11/08/darn-you-wordpress/">Darn You WordPress!!</a> is a very recent post about wishes for wordpress and his core.</p>
<p>Before to answer about the question about coherence or generic design of template tags (with optional echoing).<br />
This recent post is an opportunity to write a short post about our choice of WordPress tools used since more than 4 years as blog or cms.</p>
<h4>Some arguments :</h4>
<p>Open-source, large community, traceability of the developments, Reactivity of the groups, the possibility of concentrating on the fields of website or data models (CMS) &#8211; I do not have particular affinity for the fields of the security or mechanics like ajax</p>
<p>an architecture which makes it possible to build light code for visitor&#8217;s webside without interface:<br />
<em>Personally I prefer to write a simple number in css to change a color or a width or copy and paste a template tags in a theme file than to open a wysiwyg heavy desktop application to generate a 30 lines HTML file.</em></p>
<p>a good data-model totally open for cms architecture (<em>Instead creating new tables, for some plugins, we use the powerful taxonomies architecture</em>).</p>
<h4>A philosophy</h4>
<p><strong>On the visitor&#8217;s webside, </strong><br />
a broad (infinite) range of possible personalizations: from simple blog to cms corporate or groups website.</p>
<p><strong>On the admin (author&#8217;s or editor&#8217;s) side</strong></p>
<p>Two modes to edit contents (via html or a wysiwg like editor)</p>
<p><strong>On designer&#8217;s side &#8211; plugin, hook,&#8230;</strong></p>
<p>Possible dangers and drifts :</p>
<p><strong>Admin UI : </strong><br />
<em>Client side vs Server side</em><br />
Client/server versus HTML enriched by Ajax and JS (Excepted iPhone version or unfinished Mars Edit) I am interrogative about the evolution of dashboard and admin UI. Instead to create a powerful client application using the power of the client computer, with a slowdown of flowrate, WP try to recreate an good interface but with the side effects of html and a server shared by lot of users&#8230;</p>
<p><strong>Revision, Trash&#8230;</strong>  Good, but if settings are not good, database will contains more drafts than public posts.</p>
<p><strong>Flow rate 3G vs Optical or Cable  &#8211; mobile or high speed</strong>:  On visitor&#8217;s side, the target is again as 10 years ago, the shortest files as possible</p>
<p><strong>Image processing announced in 2.9 &#8211; why not ?</strong> but what are consequences on servers. Hope that this features will be optional (I think it is better to prepare images before to sent them&#8230;)</p>
<p><strong>Contrasts et contradictions:</strong><br />
If we analyse deeply the previous paragraphs, it is visible that it is not easy to choose the good way for further developments or fixing issues&#8230;</p>
<p><strong>Targets:</strong><br />
End users without knowledge in php, html or css are not identical to general or &laquo;&nbsp;WP specific&nbsp;&raquo; programmers. The choices must leave open the two ways without closing the other.</p>
<p><strong>Upgrading:</strong><br />
Even if I can test the nightly built on a local server, on production server, I wait always the first sub version (i.e 2.8.1)</p>
<h5>About the code and the source :</h5>
<p><strong>What could we expect?</strong></p>
<p>We know that we are a little slave of the history of the product (obsolete functions) but sometime, for a new branch, a new rewritten template tag or a renewed function is better.<br />
Evaluating consequences of a modification is not easy particularly for the innumerable themes or plugins.<br />
But we find again here the advantages of open source&#8230; where each developer participates for the whole communauty.</p>
<p><strong>coherence, robustness, shortest sources,&#8230;</strong> Theses properties are well known but must be periodically remembered.</p>
<p><strong>writing conventions:</strong> unique ID for dev &#8211; avoiding conflicts &#8211; naming with unique prefix &#8211; are some wished properties or recommandations.</p>
<p><strong>param like string or args in array: </strong>passing params in a concatenate string or with an array is very powerful and offers future evolutions or personalization. Instead a template tag (like <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages</a>), the_tags today don&#8217;t allow it&#8230;</p>
<p>Example of the template tag &#8211; <strong><a href="http://codex.wordpress.org/Template_Tags/the_tags">the_tags()</a></strong> &#8211; with only display list of tags attached to a post in the loop. (three params)</p>
<p>During analyzing this template tag, you discover a deep stacking like a Russian headstock.<br />
And to create the same function but sub-selecting some tags (ie of a language as in <a href="http://dev.xiligroup.com/xili-tidy-tags/">xili-tidy-tags</a> plugin) the function is not &#8216;as is&#8217; usable. Consequently the extension must contain a new function and the theme&#8217;s designer must include this new template tag. </p>
<p><em>Note: a ticket on trac will be soon published with examples. Just need time to prepare and write it.</em></p>
<p>Michel<br />
dev.xiligroup.com</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1235</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bbPress plugin: New Post Notification [updated 0.9.2]</title>
		<link>http://dev.xiligroup.com/?p=1136</link>
		<comments>http://dev.xiligroup.com/?p=1136#comments</comments>
		<pubDate>Mon, 26 Oct 2009 20:56:14 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[Studies]]></category>
		<category><![CDATA[bbpress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1136</guid>
		<description><![CDATA[Simple plugin to send short notification to a choosen email address when a new post is created. Useful for simple forum with only one moderator.]]></description>
			<content:encoded><![CDATA[<blockquote><p><strong>Download</strong> the lastest version&nbsp;<br /> in bbpress repository <a href='http://bbpress.org/plugins/topic/xili-new-post-notification/download/'>xili-bb-np-notification</a> &nbsp;<br />or here as file if bbPress server not yet updated :</p>
<p><a href="http://plugins-svn.bbpress.org/xili-new-post-notification/tags/0.9.2/">http://plugins-svn.bbpress.org/xili-new-post-notification/tags/0.9.2/</a></p></blockquote>
<p><div class="readme-parser"><h2> xili New Post Notification 0.9.2 </h2>
Contributors: dev.xiligroup.com<br/>
Donate link: <a href="http://dev.xiligroup.com">dev.xiligroup.com</a><br/>
Tags: notification, bbpress, email<br/>
Requires at least: 1.0.1<br/>
Tested up to: 1.0.2<br/>
Stable tag: 0.9.2<br/>
<br/>
A very light plugin to send a short notification to a choosen email address when a new post is created.<br/>
<br/>
<h3> Description </h3>
<div id="readme-description" class="readme-div">

<br/>
Simple plugin to send short notification to a choosen email address when a new post is created. Useful for simple forum with only one moderator.<br/>
<br/>
</div>
<h3> Installation </h3>
<div id="readme-installation" class="readme-div">

<ul><li>Add the `xili-bb-npn.php` file (or his folder) to bbPress' `my-plugins/` directory and activate.</li><li>Go to Settings sidebar menu and New Post Notification submenu. Fill the to: address and save settings...</li></ul>
</div>
<h3> Frequently Asked Questions </h3>
<div id="readme-faq" class="readme-div">

<br/>
<h4> What about future ? </h4>
<br/>
[WordCamp Paris May 8th] BBPress seems resurrect. I will start again devs and answer soon to users and contributors questions…<br/>
<br/>
<br/>
<h4> Why this plugin ? </h4>
<ul><li>to solve a lack of feature when installing [dev.xiligroup support forum](<a href="http://forum.dev.xiligroup.com/).">forum.dev.xiligroup.com/).</a></li><li>to solve the lack of plugins tested and compatible with latest release of BBpress 1.0.<li>Thanks to these previous plugins authors.</li><li>to discover how to create BBpress plugin (with knowledges of WP plugins as developed in dev.xiligroup.com)...</li></ul></li></ol><h3> License </h3>
<ul><li>CC-GNU-GPL <a href="http://creativecommons.org/licenses/GPL/2.0/">creativecommons.org/licenses/GPL/2.0/</a></li></ul>
<h3> Donate </h3>
<ul><li><a href="http://dev.xiligroup.com/">dev.xiligroup.com/</a></li></ul>
</div>
<h3> Changelog </h3>
<div id="readme-changelog" class="readme-div">

<br/>
<h4> Version 0.9.2 (2010-05_09) </h4><ul><li>Add option to insert content of post in notification email</li></ul><h4> Version 0.9.1 (2009-10-29) </h4><ul><li>first public release</li></ul>
<h3> To Do </h3>
<ul><li>improve choices of to: address...</li><li>save options in array</li></ul>
© 2009-10 - MS - dev.xiligroup.com<br/>
<br/>
</div><div style="text-align:right;"><small>created by <a href="http://www.tomsdimension.de/wp-plugins/readme-parser">Readme Parser</a></small></div></div></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From a theme with localization to a multilingual theme with xili-language : technical and general notes.</title>
		<link>http://dev.xiligroup.com/?p=1055</link>
		<comments>http://dev.xiligroup.com/?p=1055#comments</comments>
		<pubDate>Wed, 22 Jul 2009 13:49:55 +0000</pubDate>
		<dc:creator>xiligroup dev</dc:creator>
				<category><![CDATA[Expert's corner]]></category>
		<category><![CDATA[xili-language]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[webmaster]]></category>

		<guid isPermaLink="false">http://dev.xiligroup.com/?p=1055</guid>
		<description><![CDATA[When studying FAQ of xili-language about some themes with localization (lots of theme's creator forget to add in tags - localization or international, translation-ready,...), we discover that lot of improvements can be done during creation/design steps to easy transform them in a real multilingual theme.]]></description>
			<content:encoded><![CDATA[<p><em>This post follow the tests about multilingual themes <a href="http://dev.xiligroup.com/?p=427">published in May</a>.</em></p>
<p>When studying FAQ of xili-language about some themes with localization (lots of theme&#8217;s creator forget to add in tags &#8211; localization or international, translation-ready,&#8230;), we discover that lot of improvements can be done during creation/design steps to easy transform them in a real multilingual theme.</p>
<p>With examples like with themes &#8211; INOVE or ARCLITE, FUSION or ATAHUALPA, we will illustrate here some features that must be considered.</p>
<h4>As introduction :</h4>
<p><strong>localization and multilingual : </strong></p>
<p>a theme is localizable if the language of the theme can be set by the webmaster according the language of the admin dashboard (in config.php). The .mo file of the language must be present inside the theme&#8217;s folder.</p>
<p>A multilingual theme change LIVE his texts when, depending some rules, the language of the post or the visitor&#8217;s browser change.<br />
With few modifications, a well made localizable theme can be multilingual with help of xili-language plugin.</p>
<h4>Chapter One</h4>
<p>What we observe with the themes choosen as example :</p>
<p><strong>ARCLITE, FUSION</strong> by <a href="http://www.digitalnature.ro">digitalnature.ro</a></p>
<p>After our previous post, thanks to the author who includes the few lines of code inside the source&#8230; If xili-language is active, all the theme becomes live- multilingual.<br />
End of august, we hope to provide more improvements to place languages selector (widget) with better design (as permitted by hooks inside xili-language plugins).</p>
<p><strong>INOVE</strong> by <a href="http://www.neoease.com">www.neoease.com</a></p>
<p>The languages are in a sub-folder named &laquo;&nbsp;languages&nbsp;&raquo;. </p>
<p>Only one line in functions.php must be modified :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/** l10n */</span>
<span style="color: #000000; font-weight: bold;">function</span> theme_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
load_theme_textdomain<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'inove'</span><span style="color: #339933;">,</span> get_template_directory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/languages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>to :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>421
422
423
424
425
426
427
428
429
430
431
432
433
434
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/** l10n */</span>
<span style="color: #000000; font-weight: bold;">function</span> theme_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">/*
	* xili-language PLEASE DO NOT DELETE
	* @since 090422
	*/</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_TEXTDOMAIN'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'inove'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_LANGS_FOLDER'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/languages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	   load_theme_textdomain<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'inove'</span><span style="color: #339933;">,</span> get_template_directory<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/languages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>But inside the theme, by instance in sidebar.php some texts remain coded as &laquo;&nbsp;hard&nbsp;&raquo; and don&#8217;t incorporate multilingual function __() or _e()&#8230; below &laquo;&nbsp;Categories&nbsp;&raquo; on line 121.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>115
116
117
118
119
120
121
122
123
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">&lt;!-- sidebar east START --&gt;
	&lt;div id=&quot;eastsidebar&quot; class=&quot;sidebar&quot;&gt;
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'east_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
		&lt;!-- categories --&gt;
		&lt;div class=&quot;widget widget_categories&quot;&gt;
			&lt;h3&gt;Categories&lt;/h3&gt;
			&lt;ul&gt;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_cats<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sort_column=name&amp;optioncount=0&amp;depth=1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p><strong>ATAHUALPA</strong> by <a href="http://wordpress.bytesforall.com/">BytesForAll</a></p>
<p>Here there is only the .pot file, you must create both .po and .mo files for expected languages. You must use PoEdit to complete the file by instance for french (fr_FR.po) or german (de_DE.po) and compile them in .mo (fr_FR.mo, de_DE.mo,&#8230;). The theme&#8217;s author leave these files inside folder and not in a sub-folder.<br />
the present line of code inside functions.php :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Load translation file </span>
load_theme_textdomain<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'atahualpa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>the lines modified :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Load translation file </span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xili_language'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_TEXTDOMAIN'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'atahualpa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_LANGS_FOLDER'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			load_theme_textdomain<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'atahualpa'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h4>Chapter Two</h4>
<p><strong>Dynamic elements and live translations</strong> : Categories, tags, widget&#8217;s titles must be also dynamic translatable. You can check all these english terms and add it with poEdit but it is far easiest to use xili-dictionary to complete the .po (and .mo) files. <a href="http://dev.xiligroup.com/?cat=394&#038;lang=en_us">See the posts</a> inside this website and also read the review of Jacob <a href="http://wordpress.org/support/topic/275934">here</a>.</p>
<h4>as a preliminary conclusion</h4>
<p><strong>the core and the hooks</strong><br />
Provided as a core to offer live selections of languages according rules (post or browser), xili-language plugin remains a way to implement rich and customized solutions for CMS or blogs &#8211; the hooks are here for that. xili-tidy-tags and xili-dictionary reinforce the toolbox.</p>
<p><strong>webmaster or end-users</strong></p>
<p>The first target of the plugin are webmasters with knowledges in WP (php and html). The future will be for end-users&#8230; with the help of theme&#8217;s designers.</p>
<p><strong>next steps</strong><br />
After WP 2.8.2 release that introduces some powerful librairies, it will be possible soon to provide plug and play kit for non-developer people. </p>
<p>Michel July 22th<br />
&nbsp;<br />&nbsp;<br /><fieldset class="series" ><legend>xili-language: posts for experts</legend><ol><li><a href='http://dev.xiligroup.com/?p=726' title="xili-language plugin : release 1.6.0 (compatible WP 3.0)">xili-language plugin : release 1.6.0 (compatible WP 3.0)</a></li><li><a href='http://dev.xiligroup.com/?p=1068' title="Q&A about xili-language plugin, release 1.1">Q&A about xili-language plugin, release 1.1</a></li><li><a href='http://dev.xiligroup.com/?p=1045' title="xili-language : hooks, filters, class and so on...">xili-language : hooks, filters, class and so on...</a></li><li>From a theme with localization to a multilingual theme with xili-language : technical and general notes.</li><li><a href='http://dev.xiligroup.com/?p=1111' title="xili-language - 1.4.1 - new libraries">xili-language - 1.4.1 - new libraries</a></li><li><a href='http://dev.xiligroup.com/?p=1432' title="Xili-language toolbox in one table">Xili-language toolbox in one table</a></li><li><a href='http://dev.xiligroup.com/?p=1482' title="xili-language and the time">xili-language and the time</a></li><li><a href='http://dev.xiligroup.com/?p=1497' title="xili-language : Affichage des dates et heures">xili-language : Affichage des dates et heures</a></li></ol></fieldset>&nbsp;<br />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.xiligroup.com/?feed=rss2&amp;p=1055</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
