<?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>Qu&#039;une petite étincelle brille au fond de vos yeux ! &#187; Astuces</title>
	<atom:link href="http://www.vdigital.org/sharing/category/astuces/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vdigital.org/sharing</link>
	<description>Savoirs et partages</description>
	<lastBuildDate>Sun, 01 Aug 2010 09:47:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>S&#8217;affranchir des templates-extensions</title>
		<link>http://www.vdigital.org/sharing/2010/08/saffranchir-des-templates-extensions/</link>
		<comments>http://www.vdigital.org/sharing/2010/08/saffranchir-des-templates-extensions/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 08:35:56 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Piwigo]]></category>
		<category><![CDATA[Templates]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=1030</guid>
		<description><![CDATA[Piwigo par le biais de son prédécesseur PhpWebGallery avait intégré un principe assez mal compris, celui des templates-extensions (T-E.). Le principe était alors simplement décrit et devait encore être codé, ce que j&#8217;ai réalisé dans Piwigo 2.0. Les T-E. de Piwigo étaient sensés permettre vos adaptations tout en autorisant les évolutions des templates standards. Donc [...]]]></description>
			<content:encoded><![CDATA[<p>Piwigo par le biais de son prédécesseur PhpWebGallery avait intégré un principe assez mal compris, celui des templates-extensions (T-E.).<br />
Le principe était alors simplement décrit et devait encore être codé, ce que j&#8217;ai réalisé dans Piwigo 2.0.</p>
<blockquote><p>Les T-E. de Piwigo étaient sensés permettre vos adaptations tout en autorisant les évolutions des templates standards. Donc de permettre d&#8217;identifier rapidement les différences. Afin que les évolutions puissent être également appliquées à vos adaptations.<br />
Les T-E. sont ni plus ni moins que des templates qui sous certaines conditions remplacent les templates standards.</p></blockquote>
<p>Pour identifier rapidement les différences, il aurait été nécessaire de proposer un outil de comparaison entre chaque T-E. et son template d&#8217;origine. Ceci afin que les évolutions soient rapidement prises en compte.<span id="more-1030"></span><br />
De l&#8217;absence de comparateur et pour la raison évoquée ci-après, nous assisterons à la fin programmée des T-E.<br />
La logigue de thème parent a tendance à se généraliser dans bon nombre d&#8217;applications et surtout elle a pris le pas sur l&#8217;orientation template de Piwigo.<br />
Il s&#8217;en suit des incohérences entre les templates fournis par les thèmes, incohérences devenant bloquantes parfois pour certains plugins.<br />
Prenons un exemple récent :  RV Maps and Earth (un fabuleux plugin de rvelices) ne fonctionne pas actuellement avec le thème Luciano.<br />
Même si cela sera sans doute vite corrigé, ce type d&#8217;incohérences conduit :<br />
- soit à multiplier les plugins afin de répondre aux problématiques créées par un thème (et parfois tous les thèmes enfants) et pour s&#8217;en convaincre il suffit de chercher un plugin de WordPress;<br />
- soit à faire évoluer le thème et vous faire perdre vos adaptations.</p>
<p>Si les thèmes parents/enfants se généralisent, il semble évident que les T-E. n&#8217;auront plus lieu d&#8217;être. Cependant, ceux-ci permettaient de présenter vos pages sur la base de conditions totalement originales comme une catégorie spéciale ou un lien permanent (permalink).<br />
C&#8217;est là qu&#8217;intervient la <a href="http://www.vdigital.org/sharing/2010/07/la-mise-en-oeuvre-de-getparam/" title="La mise en œuvre de getParam()">fonction getParam()</a>.<br />
Exemples:<br />
- getParam(&#8216;most_recent&#8217;) permettra de sélectionner un template particulier aux images récentes peut-être,<br />
- getParam(&#8216;category/Paris&#8217;) permettra d&#8217;ajouter un script particulier,<br />
etc.</p>
<p>Comment coder un tel template (<a href="http://www.vdigital.org/sharing/2010/07/concevoir-des-templates-evolutifs/" title="Concevoir des templates évolutifs" target="_blank">évolutif</a>) dans son thème ?<br />
Dans mon_theme/template/ par exemple pour créer un header.tpl évolutif&#8230;</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'recent_pics'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'recent.tpl'</span> assign<span style="color: #339933;">=</span>RECENT_BANNER<span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../default/template/header.tpl&quot;</span> PAGE_BANNER<span style="color: #339933;">=</span><span style="color: #000088;">$RECENT_BANNER</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#123;</span><span style="color: #339933;">*</span> le path doit être relatif depuis themes<span style="color: #339933;">/</span>mon_theme<span style="color: #339933;">/</span>template<span style="color: #339933;">/</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../default/template/header.tpl&quot;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category/Paris'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span>known_script id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;jquery&quot;</span> src<span style="color: #339933;">=</span><span style="color: #000088;">$ROOT_URL</span><span style="color: #339933;">|@</span>cat<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;themes/default/js/jquery.packed.js&quot;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span>known_script id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;topbar&quot;</span> src<span style="color: #339933;">=</span><span style="color: #000088;">$ROOT_URL</span><span style="color: #339933;">|@</span>cat<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;local/js/topbar.js&quot;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span></div></div>
<p>Explications du code ci-dessus:<br />
- si l&#8217;url contient recent_pics, on génèrera une bannière spécifique.<br />
- si l&#8217;url contient un lien permanent de catégorie vers « Paris » un script sera ajouté à la page&#8230; avant le &lt;/head> (Page de miniatures et page picture).</p>
<p>Cette astuce permet de traiter la grande majorité des cas de figure traités par les T-E actuels de Piwigo.</p>
<blockquote><p>
En attendant, la fin programmée des T-E. les points restants en leur faveur sont:<br />
1 &#8211; La sécurité (les curieux ne pourront pas découvrir l&#8217;emplacement de votre T-E. et, du fait, son contenu avant inclusion dans la page).<br />
2 &#8211; La modification globale (Ajout d&#8217;éléments communs à toutes les pages et quel que soit le thème).<br />
3 &#8211; La réduction du besoin de plugin (pour tous ceux qui ne maîtrisent pas assez le php), la modification globale (sans critère) permet de s&#8217;éviter d&#8217;avoir à coder un plugin personnel (lequel serait plus complexe à maintenir).</p></blockquote>
<p>Pour la grande majorité des débutants, espérons que les T-E. (templates-extensions) aient la vie dure, même si leur utilisation semble complexe au début.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=1030';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/08/saffranchir-des-templates-extensions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Concevoir des templates évolutifs</title>
		<link>http://www.vdigital.org/sharing/2010/07/concevoir-des-templates-evolutifs/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/concevoir-des-templates-evolutifs/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 07:34:53 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Piwigo]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=1006</guid>
		<description><![CDATA[Piwigo utilise un système de templates pour générer des pages web. Un template est un morceau de code HTML dans lequel seuls quelques éléments d&#8217;information seront modifiés d&#8217;une utilisation à l&#8217;autre. Un template simplifie la plupart des adaptations. Par contre, ce système pourrait vous priver d&#8217;une partie des évolutions de Piwigo. Si vous adaptez une [...]]]></description>
			<content:encoded><![CDATA[<p>Piwigo utilise un système de templates pour générer des pages web. Un template est un morceau de code HTML dans lequel seuls quelques éléments d&#8217;information seront modifiés d&#8217;une utilisation à l&#8217;autre. Un template simplifie la plupart des adaptations.<br />
Par contre, ce système pourrait vous priver d&#8217;une partie des évolutions de Piwigo. Si vous adaptez une partie d&#8217;une page web, et si celle-ci a besoin d&#8217;être complétée ou transformée par l&#8217;équipe de conception, alors votre adaptation pourrait masquer les nouveautés. </p>
<p>En comparaison, une application comme WordPress sans template vous privera des évolutions de thème, ou les évolutions effaceront toutes vos adaptations. En général les applications, qui n&#8217;utilisent pas de templates, auront beaucoup de thèmes mais ceux-ci resteront sans évolution.</p>
<p>Assurément, il n&#8217;y aurait pas de solution idéale.<br />
Nous allons voir pour Piwigo comment coder un template évolutif dans un thème personnel.<span id="more-1006"></span><br />
Ci-dessous vous trouverez un exemple d&#8217;un header.tpl évolutif&#8230;</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'hello.inc.tpl'</span> assign<span style="color: #339933;">=</span>BANNER<span style="color: #009900;">&#125;</span> <br />
&nbsp; <span style="color: #009900;">&#123;</span>assign <span style="color: #000000; font-weight: bold;">var</span><span style="color: #339933;">=</span>HOME_BANNER value<span style="color: #339933;">=</span><span style="color: #000088;">$PAGE_BANNER</span><span style="color: #339933;">|</span>cat<span style="color: #339933;">:</span><span style="color: #000088;">$BANNER</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'topbar.inc.tpl'</span> assign<span style="color: #339933;">=</span>TOPBAR<span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;../../default/template/header.tpl&quot;</span> theSwiftHeader<span style="color: #339933;">=</span><span style="color: #000088;">$TOPBAR</span> PAGE_BANNER<span style="color: #339933;">=</span><span style="color: #000088;">$HOME_BANNER</span><span style="color: #009900;">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#123;</span><span style="color: #339933;">*</span> le path doit être relatif depuis themes<span style="color: #339933;">/</span>xxxx<span style="color: #339933;">/</span>template<span style="color: #339933;">/</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span>html_head<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>style type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$ROOT_URL}</span>themes/{<span style="color: #006699; font-weight: bold;">$themeconf</span>.id}/css/extension.css&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot;&gt;<br />
&nbsp; {/html_head}</span></div></div>
<p><strong><br />
Explications du code ci-dessus :</strong></p>
<p>  {include file=&#8217;hello.inc.tpl&#8217; assign=BANNER}<br />
Le code html contenu dans votre thème ./template/hello.inc.tpl sera affecté à la variable BANNER (Un logo par exemple).</p>
<p>  {assign var=HOME_BANNER value=$PAGE_BANNER|cat:$BANNER}<br />
La variable HOME_BANNER va recevoir la concaténation (cat) de la bannière standard ($PAGE_BANNER) avec celle produite par hello.inc.tpl</p>
<p>  {include file=&#8217;topbar.inc.tpl&#8217; assign=TOPBAR}<br />
Là encore, du code html contenu dans votre thème ./template/topbar.inc.tpl sera affecté à la variable TOPBAR (Des liens du site vers votre forum, votre blog, etc).</p>
<p>{include file=&nbsp;&raquo;../../default/template/header.tpl&nbsp;&raquo; theSwiftHeader=$TOPBAR PAGE_BANNER=$HOME_BANNER} </p>
<blockquote><p>C&#8217;est là l&#8217;essentiel, au lieu de copier le header standard, le thème va l&#8217;inclure et ainsi profiter de ses évolutions.<br />
Mais également la variable theSwiftHeader va prendre la valeur de TOPBAR (nos liens)<br />
et la variable PAGE_BANNER prendra la valeur de HOME_BANNER (notre bannière avec son logo).<br />
En incluant le header standard, le thème continuera à bénéficier des évolutions du header standard, tout en pouvant être différent.
</p></blockquote>
<p>C&#8217;est assez simple, mais surtout cela fonctionne bien.</p>
<p>Une seule réserve: lors de l&#8217;include du template d&#8217;origine faites attention à décrire le chemin relatif à partir de themes/xxxx/template/</p>
<p>  {html_head}<br />
    &lt;style type=&nbsp;&raquo;text/css&nbsp;&raquo; src=&nbsp;&raquo;{$ROOT_URL}themes/{$themeconf.id}/css/extension.css&nbsp;&raquo;}&nbsp;&raquo;><br />
  {/html_head}<br />
Ajout d&#8217;un style complémentaire ou plus avant la balise &lt;/head> (Cf. <a href="http://www.vdigital.org/sharing/2010/07/javascript-interprete-inutilement/" title="Javascript interprété inutilement" target="_blank">Javascript interprété inutilement</a>)</p>
<blockquote><p>Remarque: Cette astuce n&#8217;est qu&#8217;une application des fonctionnalités de Smarty (le moteur de templates utilisé par Piwigo)</p></blockquote>
<p>.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=1006';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/concevoir-des-templates-evolutifs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>La mise en œuvre de getParam()</title>
		<link>http://www.vdigital.org/sharing/2010/07/la-mise-en-oeuvre-de-getparam/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/la-mise-en-oeuvre-de-getparam/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 20:57:44 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Fonctions]]></category>
		<category><![CDATA[getParam]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Piwigo]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=993</guid>
		<description><![CDATA[Dans le cadre de Piwigo, la fonction getParam() expliquée dans cet autre billet va nous permettre de présenter des images en fonction de différents paramètres. Avant tout, nous allons étudier où introduire cette fonction dans Piwigo. Cette fonction pourrait avoir sa place à plusieurs endroits, essentiellement dans : - un plugin, et plus précisément plugins/PersonalPlugin/main.inc.php [...]]]></description>
			<content:encoded><![CDATA[<p>Dans le cadre de Piwigo, la fonction getParam() expliquée dans cet <a href="http://www.vdigital.org/sharing/2010/07/bons-arguments/" title="Avec de bons arguments">autre billet</a> va nous permettre de présenter des images en fonction de différents paramètres.</p>
<p>Avant tout, nous allons étudier où introduire cette fonction dans Piwigo. Cette fonction pourrait avoir sa place à plusieurs endroits, essentiellement dans :<br />
- un plugin, et plus précisément plugins/PersonalPlugin/main.inc.php (également éditable en ligne par LocalFiles Editor), ou<br />
- un thème, et plus précisément dans un themeconf.inc.php (mais ceux-ci ne sont pas éditables en ligne à ce jour).</p>
<p>Avec de bons arguments, je considère que sa place est dans le themeconf.inc.php, car l&#8217;appel de cette fonction concerne l&#8217;affichage final.<br />
Si nous placions cette fonction dans un plugin, il ne faudrait jamais perdre de vue que le plugin devrait rester actif.<br />
En le plaçant dans la configuration du thème, nous n&#8217;aurons qu&#8217;à créer des templates sur lesquels nous souhaitons agir différement.</p>
<p>Exemples dans un thème personnel.<span id="more-993"></span></p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
Theme Name: Mon thème<br />
*/</span><br />
<span style="color: #000088;">$themeconf</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; <span style="color: #0000ff;">'theme'</span> &nbsp;<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mon_theme'</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #0000ff;">'parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'default'</span><span style="color: #339933;">,</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span>PHPWG_ROOT_PATH <span style="color: #339933;">.</span><span style="color: #0000ff;">'themes/mon_theme/include/functions.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>dès lors dans themes/mon_theme/include/functions.inc.php</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'getParam'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">function</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$def</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><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_ADMIN'</span><span style="color: #009900;">&#41;</span> and IN_ADMIN<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$def</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_string"><span style="color: #990000;">is_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#41;</span> and <a href="http://www.php.net/stripos"><span style="color: #990000;">stripos</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$k</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/[^0-9a-z\-_\.]+/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$k</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;">// Remove anything but 0-9,a-z,-_</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// permalink, category_url_style in 'id-name', picture_url_style in id-file</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$def</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Ensuite il suffira de copier et de modifier les templates standards que l&#8217;on souhaite modifier venant de themes/default/template/ dans themes/mon_theme/template/<br />
par exemple: <strong>thumbnails.tpl</strong> afin d&#8217;y remplacer</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail</span><span style="color: #339933;">.</span>NB_COMMENTS<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>span <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{if 0==<span style="color: #006699; font-weight: bold;">$thumbnail</span>.NB_COMMENTS}zero {/if}nb-comments&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>br<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #000088;">$pwg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">l10n_dec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%d comment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%d comments'</span><span style="color: #339933;">,</span><span style="color: #000088;">$thumbnail</span><span style="color: #339933;">.</span>NB_COMMENTS<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span></div></div>
<p>par</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#41;</span> and <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail</span><span style="color: #339933;">.</span>NB_COMMENTS<span style="color: #009900;">&#41;</span> and <span style="color: #000088;">$thumbnail</span><span style="color: #339933;">.</span>NB_COMMENTS <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;</span>span <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;nb-comments&quot;</span><span style="color: #339933;">&gt;&lt;</span>br<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #000088;">$pwg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">l10n_dec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%d comment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%d comments'</span><span style="color: #339933;">,</span><span style="color: #000088;">$thumbnail</span><span style="color: #339933;">.</span>NB_COMMENTS<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #339933;">&lt;/</span>span<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span></div></div>
<p>Ainsi le nombre de commentaires ne sera plus indiqué que sur les pages de catégories. Ce nombre ne figurera donc pas dans les résultats de recherches, les pages de miniatures découvertes par les tags, ou les pages des catégories spéciales.</p>
<p>Autre exemple, <strong>picture.tpl</strong> afin d&#8217;y remplacer</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>hr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;separation&quot;</span><span style="color: #339933;">&gt;</span><br />
<br />
<span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$COMMENT_COUNT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comments&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #000088;">$COMMENT_COUNT</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$pwg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">l10n_dec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%d comment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%d comments'</span><span style="color: #339933;">,</span><span style="color: #000088;">$COMMENT_COUNT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$navbar</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'navigation_bar.tpl'</span><span style="color: #339933;">|@</span>get_extent<span style="color: #339933;">:</span><span style="color: #0000ff;">'navbar'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'comment_list.tpl'</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_add</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>form &nbsp;method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span> action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$comment_add</span>.F_ACTION}&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;filter&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;addComment&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>fieldset<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>legend<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Add a comment'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>legend<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #000088;">$comment_add</span><span style="color: #339933;">.</span>SHOW_AUTHOR<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Author'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;author&quot;</span><span style="color: #339933;">&gt;&lt;/</span>label<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Comment'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;contentid&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;80&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$comment_add</span><span style="color: #339933;">.</span>CONTENT<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>textarea<span style="color: #339933;">&gt;&lt;/</span>label<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;hidden&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;key&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$comment_add</span>.KEY}&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>input <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{'Submit'|@translate}&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>fieldset<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#123;</span><span style="color: #339933;">*</span>comments<span style="color: #339933;">*</span><span style="color: #009900;">&#125;</span></div></div>
<p>par</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#41;</span> and <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$COMMENT_COUNT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#123;</span><span style="color: #339933;">*</span> comments only within a category<span style="color: #339933;">*</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">&lt;</span>hr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;separation&quot;</span><span style="color: #339933;">&gt;</span><br />
<br />
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;comments&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #000088;">$COMMENT_COUNT</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$pwg</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">l10n_dec</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'%d comment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'%d comments'</span><span style="color: #339933;">,</span><span style="color: #000088;">$COMMENT_COUNT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$navbar</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'navigation_bar.tpl'</span><span style="color: #339933;">|@</span>get_extent<span style="color: #339933;">:</span><span style="color: #0000ff;">'navbar'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comments</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">include</span> <a href="http://www.php.net/file"><span style="color: #990000;">file</span></a><span style="color: #339933;">=</span><span style="color: #0000ff;">'comment_list.tpl'</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_add</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>form &nbsp;method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span> action<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$comment_add</span>.F_ACTION}&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;filter&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;addComment&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;</span>fieldset<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>legend<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Add a comment'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>legend<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">if</span> <span style="color: #000088;">$comment_add</span><span style="color: #339933;">.</span>SHOW_AUTHOR<span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Author'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;author&quot;</span><span style="color: #339933;">&gt;&lt;/</span>label<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>label<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'Comment'</span><span style="color: #339933;">|@</span>translate<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;</span>textarea name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;contentid&quot;</span> rows<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> cols<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;80&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$comment_add</span><span style="color: #339933;">.</span>CONTENT<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>textarea<span style="color: #339933;">&gt;&lt;/</span>label<span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;hidden&quot;</span> name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;key&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{<span style="color: #006699; font-weight: bold;">$comment_add</span>.KEY}&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; &nbsp; <span style="color: #339933;">&lt;</span>input <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{'Submit'|@translate}&quot;</span><span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>fieldset<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span><br />
<span style="color: #009900;">&#123;</span><span style="color: #339933;">/</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#123;</span><span style="color: #339933;">*</span>category<span style="color: #339933;">*</span><span style="color: #009900;">&#125;</span></div></div>
<p>Et cette fois, il ne s&#8217;agira pas du nombre mais des commentaires eux-mêmes qui ne seront pas affichés sur la page picture dès lors que l&#8217;image n&#8217;est pas présentée au travers de sa catégorie.</p>
<p>Ces 2 exemples simples de l&#8217;utilisation de getParam() ne sont que des préludes à d&#8217;autres usages également très intéressants que nous découvrirons prochainement.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=993';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/la-mise-en-oeuvre-de-getparam/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Avec de bons arguments</title>
		<link>http://www.vdigital.org/sharing/2010/07/bons-arguments/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/bons-arguments/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:29:27 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Fonctions]]></category>
		<category><![CDATA[getParam]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Piwigo]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=972</guid>
		<description><![CDATA[Pour une utilisation dans Piwigo, mais cela pourrait également convenir à d&#8217;autres logiciels, je vous propose de découvrir une petite fonction PHP toute simple. if &#40; !function_exists&#40; 'getParam' &#41;&#41; &#123; &#160; function getParam&#40;$name, $def = false&#41; &#123; &#160; &#160; if &#40;defined&#40;'IN_ADMIN'&#41; and IN_ADMIN&#41; return $def; &#160; &#160; foreach &#40; $_REQUEST as $k =&#62; $v &#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Pour une utilisation dans Piwigo, mais cela pourrait également convenir à d&#8217;autres logiciels, je vous propose de découvrir une petite fonction PHP toute simple.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'getParam'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">function</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$def</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><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_ADMIN'</span><span style="color: #009900;">&#41;</span> and IN_ADMIN<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000088;">$def</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_REQUEST</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <a href="http://www.php.net/is_string"><span style="color: #990000;">is_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$k</span><span style="color: #009900;">&#41;</span> and <a href="http://www.php.net/stripos"><span style="color: #990000;">stripos</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$k</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/[^0-9a-z\-_\.]+/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$k</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;">// Remove anything but 0-9,a-z,-_ </span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// permalink, category_url_style in 'id-name', picture_url_style in id-file</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$def</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Avant de l&#8217;utiliser, je me propose une explication minimaliste.<br />
Cette fonction PHP fait appel à un preg_replace et une expression rationnelle.<br />
L&#8217;objectif est de conserver uniquement les caractères comme le point, la virgule, les 2 tirets (- et _), les lettres (minuscules ou majuscules, mais pas les lettres accentuées) et les chiffres.<br />
Par exemple, supposons que nous ayons ceci :</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'avant'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Quel 1er_paramètre ? Un argument'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> getParam<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'avant'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>alors nous devrions avoir en retour :</p>
<blockquote><p>Quel 1er_paramtre &nbsp; Un argument</p></blockquote>
<p>L&#8217;intérêt sera de sécuriser votre site lors de l&#8217;appel à cette fonction.</p>
<p>Découvrir la <a href="http://www.vdigital.org/sharing/2010/07/la-mise-en-oeuvre-de-getparam/" title="La mise en œuvre de getParam()">mise en œuvre</a> de cette fonction.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=972';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/bons-arguments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Allo ? T&#8217;es où ?</title>
		<link>http://www.vdigital.org/sharing/2010/07/allo-tes-ou/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/allo-tes-ou/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 19:40:44 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Adresse]]></category>
		<category><![CDATA[Géolocalisation]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=878</guid>
		<description><![CDATA[Aujourd&#8217;hui, si je devais réécrire le plugin Whois Online de Piwigo, j&#8217;utiliserai l&#8217;api d&#8217;infodb.com. De fait, il deviendrait totalement inutile d&#8217;avoir la conversation habituelle des propriétaires de téléphones mobiles. Avertissement au lecteur : Les indications suivantes sont obtenues dynamiquement et ne sont pas enregistrées sur ce site mais pourraient être enregistrées par d&#8217;autres. (Elles seront [...]]]></description>
			<content:encoded><![CDATA[<p>Aujourd&#8217;hui, si je devais réécrire le plugin Whois Online de Piwigo, j&#8217;utiliserai l&#8217;api d&#8217;infodb.com.<br />
De fait, il deviendrait totalement inutile d&#8217;avoir la conversation habituelle des propriétaires de téléphones mobiles.</p>
<p><strong>Avertissement au lecteur : </strong><br />
<em>Les indications suivantes sont obtenues dynamiquement et ne sont pas enregistrées sur ce site mais pourraient être enregistrées par d&#8217;autres.<br />
</em>(Elles seront certainement différentes pour chacun de vous).<br />
<span id="more-878"></span><br />
Votre accès :</p>
<blockquote><p>Ville de connexion de votre FAI : <br/>Votre région : <br/>United States<br/>Latitude : 38<br/>Longitude : -97<br/>Timezone : <br/>Soit GMT : 0<br/><a target="_blank" href="http://maps.google.fr/maps?hl=fr&#038;z=13&#038;ie=UTF8&#038;ll=38,-97" alt="Google Maps">Google Maps</a>
<div class="img-shadow" style="height:370px; width:445px;">
<div style="background-color:#FFF; border:1px solid #222C36; height:350px; padding:6px; width:425px;"><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.fr/maps?hl=fr&amp;ie=UTF8&amp;ll=38,-97&amp;spn=0.039522,0.072956&amp;z=13&amp;output=embed"></iframe></div>
</div>
<div style="height:30px; margin-top:390px; text-align:center; width:445px;"><small><a href="http://maps.google.fr/maps?hl=fr&amp;ie=UTF8&amp;ll=38,-97&amp;spn=0.039522,0.072956&amp;z=13&amp;source=embed" style="color:#0000FF;text-align:left">Agrandir le plan</a></small></div>
</blockquote>
<p>Quelques précisions devraient être utiles pour votre compréhension.<br />
A partir de votre adresse IP, en utilisant les services gratuits de <a href="http://www.ipinfodb.com/" target="_blank" title="Sans doute le numéro 1 de la géolocalisation en version libre">ipinfodb.com</a>, en php on codera (version simplifiée) :</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/getenv"><span style="color: #990000;">getenv</span></a><span style="color: #009900;">&#40;</span>HTTP_X_FORWARDED_FOR<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ip_address</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/getenv"><span style="color: #990000;">getenv</span></a><span style="color: #009900;">&#40;</span>HTTP_X_FORWARDED_FOR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000088;">$ip_address</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/getenv"><span style="color: #990000;">getenv</span></a><span style="color: #009900;">&#40;</span>REMOTE_ADDR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$xml_src</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://ipinfodb.com/ip_query.php?timezone=true&amp;ip='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ip_address</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml_src</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Ville de connexion de votre FAI : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">City</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'Votre région : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RegionName</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">CountryName</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'Latitude : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Latitude</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'Longitude : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Longitude</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'Timezone : '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">TimezoneName</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'Soit GMT : '</span> <span style="color: #339933;">.</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Gmtoffset</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Isdst</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> &nbsp;<span style="color: #0000ff;">'en heure d\'été.&lt;br/&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a target=&quot;_blank&quot; href=&quot;http://maps.google.fr/maps?hl=fr&amp;z=13&amp;ie=UTF8&amp;ll='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Latitude</span> &nbsp;<span style="color: #339933;">.</span> <span style="color: #0000ff;">','</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Longitude</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;Google Maps&quot;&gt;Google Maps&lt;/a&gt;'</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>file_get_contents peut être restreint par votre hébergeur auquel cas il existe peut-être des solutions de remplacement (à base de fsockopen ou de curl) mais ce n&#8217;est pas le propos.</p>
<p>Il est recommandé d&#8217;être en php 5 au minimum (SimpleXML requiert PHP 5).<br />
Cette extension, SimpleXML, est disponible via l&#8217;option de configuration de php &#8211;enable-libxml  (ceci dit libxml est activée par défaut).<br />
SimpleXMLElement va « parser » (transformer) le résultat de ipinfodb.com/ip_query.php en un objet php.<br />
Il suffira ensuite d&#8217;utiliser chacun des éléments obtenus (propriétés de l&#8217;objet php).</p>
<p>Exemple de résultat de ip_query.php :</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Response<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Ip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>XX.XX.XXX.XXX<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Ip<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>OK<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CountryCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FR<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CountryCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CountryName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>France<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CountryName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;RegionCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>A9<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/RegionCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;RegionName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Languedoc-Roussillon<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/RegionName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;City<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Graissessac<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/City<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ZipPostalCode</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Latitude<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>43.6667<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Latitude<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Longitude<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3.0833<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Longitude<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;TimezoneName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Europe/Paris<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/TimezoneName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Gmtoffset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>7200<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Gmtoffset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Isdst<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Isdst<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Response<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Gmtoffset représente le décalage en seconde par rapport à l&#8217;heure du méridien de Greenwhich (GMT Greenwhich Mean Time).<br />
Isdst à 1 indique que la zone est en heure d&#8217;été.<br />
Certains champs peuvent être non renseignés et dans ce cas vous n&#8217;aurez pas d&#8217;erreur mais un élément vide, exemple fréquent en France, le Code postal  (&lt;ZipPostalCode/>).</p>
<p>A tous les développeurs : à vos claviers, c&#8217;est à vous d&#8217;imaginer comment vous allez pouvoir mettre en œuvre ce service.<br />
N&#8217;abusez pas de ce service, vous pourriez être temporisé, voire banni.</p>
<p>Attention, vous devez toujours savoir respecter la vie privée de vos visiteurs, donc ne conservez pas ces données au delà du nécessaire.</p>
<p>Chers visiteurs de passage n&#8217;oubliez pas que ce qu&#8217;internet permet est vraiment peu de chose comparé aux renseignements qui pourraient être collectés par les opérateurs téléphoniques.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=878';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/allo-tes-ou/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Géolocalisation : émaillez vos voyages&#8230;</title>
		<link>http://www.vdigital.org/sharing/2010/07/geolocalisation-emaillez-vos-voyages/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/geolocalisation-emaillez-vos-voyages/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:13:15 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[téléchargement]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=850</guid>
		<description><![CDATA[En complément du plugin Whois Online de Piwigo, lequel contient une collection incomplète de drapeaux avec un effet émaillé, vous trouverez ici une collection un peu plus complète avec 229 drapeaux en format 24&#215;16 présentant le même effet métal émaillé. Les drapeaux correspondent à des pays et pas forcément à des langues, exemples : Les [...]]]></description>
			<content:encoded><![CDATA[<p>En complément du plugin Whois Online de Piwigo, lequel contient une collection incomplète de drapeaux avec un effet émaillé, vous trouverez ici une collection un peu plus complète avec 229 drapeaux en format 24&#215;16 présentant le même effet métal émaillé.<br />
Les drapeaux correspondent à des pays et pas forcément à des langues, exemples :<br />
Les drapeaux breton, catalan, corse, occitan et bien d&#8217;autres sont absents de la collection.<br />
Si un pays est manquant (ou plusieurs) merci de le(s) signaler.</p>
<p>Quelques uns des 229 drapeaux:<br />
<img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/BW.jpg" alt="BW.jpg" title="BW" width="24" height="16" class="alignleft size-full wp-image-858" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/CK.jpg" alt="CK.jpg" title="CK" width="24" height="16" class="alignleft size-full wp-image-859" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/DM.jpg" alt="DM.jpg" title="DM" width="24" height="16" class="alignleft size-full wp-image-860" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/DO.jpg" alt="DO.jpg" title="DO" width="24" height="16" class="alignleft size-full wp-image-861" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/KI.jpg" alt="KI.jpg" title="KI" width="24" height="16" class="alignleft size-full wp-image-862" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/KP.jpg" alt="KP.jpg" title="KP" width="24" height="16" class="alignleft size-full wp-image-863" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/LA.jpg" alt="LA.jpg" title="LA" width="24" height="16" class="alignleft size-full wp-image-864" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/MC.jpg" alt="MC.jpg" title="MC" width="24" height="16" class="alignleft size-full wp-image-865" /><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/MK.jpg" alt="MK.jpg" title="MK" width="24" height="16" class="alignleft size-full wp-image-866" /><br/></p>
<p>Si vous avez une utilisation originale comme dans le cadre d&#8217;une géolocalisation, n&#8217;hésitez pas à proposer votre un lien.</p>
<p>Bon usage à tous, et à votre retour de voyage n&#8217;oubliez pas d&#8217;émailler vos récits d&#8217;un grand nombre de détails afin de renforcer vos souvenirs.<br />
<a href="http://www.vdigital.org/download.php?f=enamel_flags.zip"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/telechargement_fr.jpg" alt="Télécharger la collection des drapeaux 24x16 émaillés" title="telechargement_fr" width="320" height="90" class="aligncenter size-full wp-image-852" /></a></p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=850';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/geolocalisation-emaillez-vos-voyages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript interprété inutilement</title>
		<link>http://www.vdigital.org/sharing/2010/07/javascript-interprete-inutilement/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/javascript-interprete-inutilement/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 19:56:32 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=804</guid>
		<description><![CDATA[Dans le généré d&#8217;une page web, il est assez fréquent de relever la présence d&#8217;une multitude de scripts. Quelque soit le logiciel utilisé, vous pourrez observer le même phénomène. Je vous propose d&#8217;étudier plus attentivement les causes et conséquences de ceci, et de voir comment éviter ces dernières. Exemple une page web de Piwigo (que [...]]]></description>
			<content:encoded><![CDATA[<p>Dans le généré d&#8217;une page web, il est assez fréquent de relever la présence d&#8217;une multitude de scripts.<br />
Quelque soit le logiciel utilisé, vous pourrez observer le même phénomène.<br />
Je vous propose d&#8217;étudier plus attentivement les causes et conséquences de ceci, et de voir comment éviter ces dernières.<br />
<span id="more-804"></span><br />
Exemple une page web de Piwigo (que je connais encore fort bien):</p>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./plugins/HDShadowbox/shadowbox.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span><br />
Shadowbox.init();<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;plugins/paMOOramics/js/mootools.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;plugins/paMOOramics/js/pamoorama0.3.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">charset</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;utf-8&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;plugins/grum_plugins_classes-2/ajax.js&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span> function roll_over_piclens(img_name, img_src){document[img_name].src = img_src;}<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./plugins/pwgCumulus/js/swfobject.js&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></div>
<p>Dans le cas présent, il s&#8217;agit d&#8217;un problème de plugins et nullement de Piwigo lui-même.</p>
<p>Le premier script, <a href="http://fr.piwigo.org/ext/extension_view.php?eid=354" title="HD Shadowbox" target="_blank">HDShadowbox</a>, est présent dans toutes les pages picture.php, même si la page ne propose aucune image en haute définition, c&#8217;est pourtant sa seule raison d&#8217;agir.<br />
<a href="http://fr.piwigo.org/ext/extension_view.php?eid=213" title="" target="_blank">paMOOramics</a> est un contre exemple, il est présent uniquement dans les pages où il est réellement utile.<br />
Le script grum_plugins_classes-2 (avec Piwigo 2.0) n&#8217;est pas utilisé dans les pages picture.php, son <a href="http://fr.piwigo.org/ext/extension_view.php?eid=199" title="" target="_blank">successeur </a>pour Piwigo 2.1 ne génère plus ce script prouvant bien qu&#8217;il est possible de remédier au problème.<br />
Je vous fais grâce de <a href="http://fr.piwigo.org/ext/extension_view.php?eid=234" title="Cooliris/Piclens" target="_blank">piclens</a> ou de <a href="http://fr.piwigo.org/ext/extension_view.php?eid=263" title="Cumulus Tags Cloud" target="_blank">pwgCumulus</a> qui n&#8217;ont en général rien à faire en page picture.php. Sachez qu&#8217;ils ne sont pas des exceptions et les plugins du même acabit sont nombreux.</p>
<p>Pourtant Piwigo présente l&#8217;incommensurable avantage de disposer de {known_script id=&#8230;} et de {html_head}.<br />
Ces balises sont spécifiques à Piwigo, et Smarty devrait bien s&#8217;en inspirer. Elles simplifient radicalement la vie de tous les développeurs de plugins.<br />
Il leur suffit d&#8217;incorporer directement ces balises avec les paramètres qui vont bien dans le template.<br />
Dès lors si le template est mis en œuvre les scripts seront remontés dans le &laquo;&nbsp;head&nbsp;&raquo; de la page.</p>
<p>{html_head} &#8230; {/html_head} remonte le contenu avant la balise /head (également utile pour les styles).<br />
{known_script id=&#8230;} évince les doubles inclusions d&#8217;un même script (exemple: un même framework par plusieurs plugins) et bien entendu remonte le script avant le /head.</p>
<p>Par exemple, pour pwgCumulus, actuellement nous avons dans <a href="http://piwigo.org/dev/browser/extensions/pwgCumulus/include/pwgCumulusContent.class.php#L34" title="Browser" target="_blank">pwgCumulusContent.class.php</a>, ceci :</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'template'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">func_known_script</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'swfobject'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'src'</span> <span style="color: #339933;">=&gt;</span> PWG_CUMULUS_PLUGIN_JS<span style="color: #339933;">.</span> <span style="color: #0000ff;">'/swfobject.js'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'template'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">smarty</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>alors que dans le <a href="http://piwigo.org/dev/browser/extensions/pwgCumulus/template/tags.tpl" title="Browser" target="_blank">tags.tpl</a>, il suffirait de coder:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#123;</span>known_script id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;swfobject&quot;</span> src<span style="color: #339933;">=</span><span style="color: #000088;">$ROOT_URL</span><span style="color: #339933;">|</span>cat<span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;plugins/pwgCumulus/js/swfobject.js&quot;</span><span style="color: #009900;">&#125;</span></div></div>
<p>Si le template est sollicité alors le module swfobject.js sera présent dans la page, dans tous les autres cas il n&#8217;apparaitra pas.<br />
C&#8217;est super simple, c&#8217;est même plus lisible que les balises natives de Smarty.<br />
Ainsi le script swfobject.js n&#8217;encombrera pas les navigateurs de vos visiteurs au moins pour la page en cours.</p>
<p>En principe, par leur présence dans une page web, les javascripts sont chargés par le navigateur, et analysés au niveau syntaxique.<br />
Le fait d&#8217;éviter la présence d&#8217;un javascript inutile, multiplié par le nombre de visites (et donc de requêtes http), améliorera la disponibilité de votre bande passante et la vitesse d&#8217;affichage de vos pages.</p>
<p>La solution pour Piwigo doit pouvoir s&#8217;appliquer à tous les CMS, et autres systèmes basés sur l&#8217;usage de plugins et de frameworks.</p>
<p>WordPress: L&#8217;application propose une fonction assez proche de celle de Piwigo (fonction wp_enqueue_script), c&#8217;est seulement un peu plus compliqué. Cette fonction gère la dépendance au script parent et à la version. Pourtant la solution de Piwigo présente de nombreux aspects intéressants et avantages:<br />
- Le premier plugin qui définit un script en fixe la version, il suffit aux auteurs de plugins de jouer sur les priorités des hooks (handlers, triggers), c&#8217;est plus simple.<br />
- L&#8217;usage d&#8217;un moteur de template permet de remonter simplement les scripts en &laquo;&nbsp;head&nbsp;&raquo; lesquels n&#8217;ont vraiment rien à faire dans le &laquo;&nbsp;body&nbsp;&raquo; de la page.<br />
- Les pages sont allégées des scripts inutiles, elles sont plus simples à relire, et plus faciles à déboguer pour ceux qui font du support.<br />
- Vous obtenez une réduction du nombre de requête HTTP.<br />
- Vous avez moins de scripts à analyser par les navigateurs et moins de risques de conflits entre les scripts.</p>
<p>Bonne interprétation.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=804';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/javascript-interprete-inutilement/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nouvel accueil</title>
		<link>http://www.vdigital.org/sharing/2010/07/nouvel-accueil/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/nouvel-accueil/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 22:48:41 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=798</guid>
		<description><![CDATA[Inspiré par Seb, Jean et d&#8217;autres, j&#8217;ai également mis en place une nouvelle page d&#8217;accueil. J&#8217;en détaillerai la logique et en ferai un module téléchargeable dans quelques semaines. Mais avant tout, vos remarques seront essentielles pour produire un tel script complet. A vos claviers, merci. Après les commentaires de tosca: likebot_bgcolor = ''; likebot_url = [...]]]></description>
			<content:encoded><![CDATA[<p>Inspiré par Seb, Jean et d&#8217;autres, j&#8217;ai également mis en place une nouvelle page d&#8217;<a href="http://www.vdigital.org/home/index.php">accueil</a>.<br />
J&#8217;en détaillerai la logique et en ferai un module téléchargeable dans quelques semaines.<br />
Mais avant tout, vos remarques seront essentielles pour produire un tel script complet.<br />
A vos claviers, merci.</p>
<div id="attachment_802" class="wp-caption aligncenter" style="width: 330px"><a class="img-shadow" href="http://www.vdigital.org/home/"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/home.png" alt="Nouvel accueil version slideshow.KenBurns" title="Page d&#039;accueil" width="320" height="94" class="size-full wp-image-802" /></a>
<p class="wp-caption-text">Nouvelle page d&#8217;accueil, une version slideshow.KenBurns</p>
</div>
<p><span id="more-798"></span><br />
Après les commentaires de tosca:</p>
<div id="attachment_843" class="wp-caption aligncenter" style="width: 460px"><a class="img-shadow"  href="http://www.vdigital.org/home/"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/sharing11.png" alt="Version révisée avec plus de et moins de... ;°))" title="Page d&#039;accueil" width="450" height="136" class="size-full wp-image-843" /></a>
<p class="wp-caption-text">Nouvelle page d&#8217;accueil, après révision</p>
</div>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=798';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/nouvel-accueil/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Piwigo.com</title>
		<link>http://www.vdigital.org/sharing/2010/07/piwigo-com/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/piwigo-com/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:46:16 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=471</guid>
		<description><![CDATA[Le logiciel Piwigo vous permet d&#8217;avoir une galerie de photos d&#8217;une qualité exceptionnelle de par ses fonctionnalités. Il vous faudra quand même maîtriser l&#8217;ensemble de ses composantes. Une fois ce niveau acquis, ce n&#8217;est que du bonheur. Il faut cependant reconnaître que tout le monde n&#8217;a pas les compétences, ou le temps d&#8217;atteindre ce niveau [...]]]></description>
			<content:encoded><![CDATA[<p>Le logiciel Piwigo vous permet d&#8217;avoir une galerie de photos d&#8217;une qualité exceptionnelle de par ses fonctionnalités.<br />
Il vous faudra quand même maîtriser l&#8217;ensemble de ses composantes.<br />
Une fois ce niveau acquis, ce n&#8217;est que du bonheur. Il faut cependant reconnaître que tout le monde n&#8217;a pas les compétences, ou le temps d&#8217;atteindre ce niveau de connaissance du produit. C&#8217;est là qu&#8217;intervient <a href="http://fr.piwigo.com" target="_blank" title="Une galerie photo à votre image">Piwigo.com</a>.</p>
<p>Si vous souhaitez mettre vos photos en ligne rapidement, simplement, et sans peine, alors <a href="http://fr.piwigo.com" target="_blank" title="Une galerie photo à votre image">Piwigo.com</a> répondra à vos attentes.</p>
<div id="attachment_747" class="wp-caption aligncenter" style="width: 358px"><a href="http://fr.piwigo.com" target="_blank" title="Une galerie photo à votre image"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/Sharing.png" alt="Pied de page côté Administration" title="Pied de page côté Administration" width="348" height="19" class="size-full wp-image-747" /></a>
<p class="wp-caption-text">Pied de page côté Administration</p>
</div>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=471';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/piwigo-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>L&#8217;âge du capitaine</title>
		<link>http://www.vdigital.org/sharing/2010/07/lage-du-capitaine/</link>
		<comments>http://www.vdigital.org/sharing/2010/07/lage-du-capitaine/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 20:36:06 +0000</pubDate>
		<dc:creator>VDigital</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Personnalisation]]></category>
		<category><![CDATA[Piwigo]]></category>

		<guid isPermaLink="false">http://www.vdigital.org/sharing/?p=698</guid>
		<description><![CDATA[Au nombre des énigmes, celles basées sur le calcul de l&#8217;âge m&#8217;ont toujours fait sourire. Le Xème jour du Yème mois de l’année 1900 + Z, un bateau ayant U hélices, V cheminées et W hommes d’équipage est lancé. Sachant que le produit UVWXYZ augmenté de la racine cubique de l’âge du capitaine (qui est [...]]]></description>
			<content:encoded><![CDATA[<p>Au nombre des énigmes, celles basées sur le calcul de l&#8217;âge m&#8217;ont toujours fait sourire.</p>
<blockquote><p>Le Xème jour du Yème mois de l’année 1900 + Z, un bateau ayant U hélices, V cheminées et W hommes d’équipage est lancé.</p>
<p>Sachant que le produit UVWXYZ augmenté de la racine cubique de l’âge du capitaine (qui est grand-père) est égal à 4002331, trouver l’âge du capitaine ainsi que toutes les caractéristiques du bateau.
</p></blockquote>
<p>Ce n&#8217;est pas le lieu d&#8217;y apporter une réponse (Bien qu&#8217;avec l&#8217;aide de 2 précisions vous pouvez la trouver sur l&#8217;excellent <a href="http://www.siteduzero.com/forum-83-33920-p9-pause-cerveau.html#r266010">site du zéro</a>, un site très formateur. Comme quoi se détendre, s&#8217;amuser sur un forum, ne gâche rien).</p>
<p>Non, le capitaine (webmaster) dès qu&#8217;il entame la personnalisation de sa galerie Piwigo, inévitablement imagine les questions suivantes:</p>
<blockquote><p>    Ô Combien de miniatures, combien de lignes<br />
    devrais-je présenter dans la largeur ou la hauteur de chaque page?</p></blockquote>
<p>Encore une énigme basée sur une opération élémentaire, mais celle-ci ne m&#8217;a jamais faire particulièrement sourire.</p>
<p>Mais dites-moi, avons-nous tous le même écran ? <span id="more-698"></span><br />
Même si parfois nous pouvons en trouver deux identiques, rien ne prouve qu&#8217;ils soient réglés avec les mêmes résolutions, non ?<br />
Devons-nous être limités en largeur quand on regarde votre site avec une résolution 1920 x 1080 sur un écran 27&#8243; ou sur un écran TV de salon ?<br />
Pensez-vous que votre site s&#8217;affichera comme vous l&#8217;imaginez sur un iPhone (résolution 640 x 960) ou sur un iPad (résolution 1024 x 768) avec leurs pages web formatées par l&#8217;iOS ?</p>
<p>Piwigo propose 2 paramètres:
<ul>
<li>Le nombre de miniatures par ligne, et</li>
<li>Le nombre de lignes par page</li>
</ul>
<p>Les préférences permettent en théorie de faire votre choix :<br />
<a href="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/Capitaine.png" rel="lightbox[698]" title="Configuration &gt; Options"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/Capitaine-300x97.png" alt="Configuration de Piwigo [Paramètres invité]" title="Configuration &gt; Options" width="300" height="97" class="aligncenter size-medium wp-image-702" /></a></p>
<p>Pourtant en résolution standard, nous obtenons :<br />
<a href="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/grab.png" rel="lightbox[698]" title="Résolution standard "><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/grab-300x105.png" alt="" title="Résolution standard " width="300" height="105" class="aligncenter size-medium wp-image-703" /></a></p>
<p>ou dans une résolution particulièrement élevée, l&#8217;affichage nous avons un rendu différent mais toujours adapté :<br />
<a href="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/screenshot.png" rel="lightbox[698]" title="Résolution élevée"><img src="http://www.vdigital.org/sharing/wp-content/uploads/2010/07/screenshot-150x150.png" alt="" title="Résolution élevée" width="150" height="150" class="aligncenter size-thumbnail wp-image-704" /></a></p>
<p>En fait, Piwigo présente au travers de tous les thèmes un nombre de miniatures par page. Opération élémentaire :<br />
Nombre de miniatures par ligne * Nombre de lignes par page = Nombre de miniatures par page</p>
<p>Seulement vous n&#8217;aurez pas le nombre de miniatures par ligne que vous espériez et ceci avec bon nombre des thèmes proposés.<br />
Restent les thèmes de largeur fixe (par exemple: MontBlanc XL) seulement la dimension des miniatures peut très bien limiter le nombre de miniatures par ligne, et vous aurez beau demander peut-être 10 miniatures par lignes, en général vous n&#8217;obtiendrez pas l&#8217;âge du capitaine.</p>
<blockquote><p>Pourquoi alors nous proposer d&#8217;indiquer le nombre de miniatures par ligne dans la configuration ?
</p></blockquote>
<p>Demain peut-être qu&#8217;un thème en tiendra compte. </p>
<blockquote><p>Mais dans ce cas n&#8217;est-ce pas à ce thème de le gérer lui-même le paramètre ?
</p></blockquote>
<p>Nous sommes bien d&#8217;accord, vous avez compris l&#8217;objet de mon billet.<br />
Mais surtout, vous ne vous poserez plus la question du nombre de miniatures par ligne.</p>
<p>PS: Ce sujet n&#8217;a rien avoir avec l&#8217;histoire de l&#8217;ami Victor:</p>
<blockquote><p>    Ô combien de marins, combien de capitaines<br />
    Qui sont partis joyeux pour des courses lointaines</p></blockquote>
<p>PS2: Un billet dédié à la mémoire de Christine, partie hier, bien trop tôt. Mes pensées accompagnent son mari, et leurs deux fils qui devront mener leur barque sans elle maintenant.</p>
<!-- PHP 5.x --><div style="float:right; margin-left:10px;">	
			<a class="LikeBotButton" />
				<script type="text/javascript">
					likebot_bgcolor = '';
					likebot_url = 'http://www.vdigital.org/sharing/?p=698';
					likebot_type = 'horizontal_thumbs';
				</script>
				<script src="http://i.likebot.com/button.js" type="text/javascript"></script>
			</a>
			
			</div>]]></content:encoded>
			<wfw:commentRss>http://www.vdigital.org/sharing/2010/07/lage-du-capitaine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
