<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:cc="http://backend.userland.com/creativeCommonsRssModule"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    
	<channel>
		<title>Gastero Prod - Tags - astuce</title>
		<link>http://www.gasteroprod.com/tags/astuce.html</link>
		<description></description>
		<image>
			<url>http://www.gasteroprod.com/design/images/button_gasteroprod.png</url>
			<width>80</width>
			<height>15</height>
			<title>Gastero Prod</title>
			<link>http://www.gasteroprod.com/</link>
		</image>
		<language>fr</language>
		<generator>SPIP 2.0.0 dev</generator>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<ttl>60</ttl>
		<cc:license>http://creativecommons.org/licenses/by-nc-sa/1.0/</cc:license>
		
		<item>
			<title>Amusons nous avec des boucles SPIP et les petits nouveaux #GET, #SET et #ARRAY</title>
			<link>http://www.gasteroprod.com/blog/blog/amusons-nous-avec-des-boucles-spip-et-les-petits-nouveaux-get-set-et-array.html</link>
			<description><![CDATA[
        <div id="contentbox">
        	<div class="chapo" style="font-weight: bolder;"><p>Je suis tombé il y a quelque temps sur une problématique que je n&#8217;avais jamais rencontrée au cours de mes nombreuses expériences avec SPIP, et il s&#8217;avère qu&#8217;une solution très élégante est possible en n&#8217;utilisant que la syntaxe de SPIP, là où il aurait fallu il n&#8217;y a pas si longtemps que cela utiliser du code PHP dans le squelette. Suivez le guide...</p></div>
        	<div><p>Imaginez que vous ayez dans votre site de nombreux sites référencés, avec la syndication activée, et des mots clefs thématiques associés à ces sites. Cela peut vous rappeler Sedna, sauf que les mots clefs peuvent être multiples pour un site alors que Sedna utilise des rubriques, forcément uniques pour chaque site.</p>

<p>Imaginez maintenant que vous souhaitiez afficher dans une page les dernières nouveautés de tous les sites ayant un mot clef donné.</p>

<p>La solution simple &mdash; qui fonctionne depuis longtemps avec SPIP &mdash; est de lister les sites qui ont le mot clef, et de lister pour chacun les derniers articles syndiqués. Le problème de cette solution, c&#8217;est que vous devez vérifier chaque site pour savoir s&#8217;il y a du nouveau. Le problème est encore plus grave si vous souhaitez utiliser une pagination, puisqu&#8217;elle sera nécessairement sur les sites plutôt que sur les articles syndiqués.</p>

<p>Ma problématique du jour était donc de lister tous les articles syndiqués dans leur ordre chronologique, donc sans devoir passer par les sites au préalable, et voici la solution&nbsp;:</p>

<div class="coloration_code"><div class="spip_spip code"><span style="font-weight: bold; color: black;">&lt;BOUCLE_mot_courant</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span>MOTS<span class="br0">&#41;</span></span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>titre=mot_clef<span class="br0">&#125;</span></span>&gt;<br />
&nbsp; <span style="color: #ff0000;">#SET</span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>sites,<span style="color: #ff0000;">#ARRAY</span><span class="br0">&#125;</span></span><br />
&nbsp; <span style="font-weight: bold; color: black;">&lt;B_sites</span>&gt;<br />
&nbsp; <span style="font-weight: bold; color: black;">&lt;BOUCLE_sites</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span>SITES<span class="br0">&#41;</span></span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>id_mot<span class="br0">&#125;</span></span>&gt;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#SET</span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>sites,<span class="br0">&#91;</span><span class="br0">&#40;</span><span style="color: #ff0000;">#GET</span><span class="br0">&#123;</span>sites<span class="br0">&#125;</span></span>|push<span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span><span style="color: #ff0000;">#ID_SYNDIC</span><span class="br0">&#125;</span></span><span class="br0">&#41;</span></span><span class="br0">&#93;</span><span class="br0">&#125;</span><span class="br0">&#41;</span><span class="br0">&#93;</span><br />
&nbsp; <span style="font-weight: bold; color: black;">&lt;/BOUCLE_sites</span>&gt;<br />
&nbsp; &nbsp; <span style="font-weight: bold; color: black;">&lt;B_derniers_liens</span>&gt;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">#ANCRE_PAGINATION</span><br />
&nbsp; &nbsp; &nbsp; &lt;dt&gt;&lt;span&gt;Actualité du Web&lt;/span&gt;&lt;/dt&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;dd id=&quot;actu-web&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#PAGINATION</span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>accessible<span class="br0">&#125;</span></span><span class="br0">&#41;</span></span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;dl&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-weight: bold; color: black;">&lt;BOUCLE_derniers_liens</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span>SYNDIC_ARTICLES<span class="br0">&#41;</span></span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>id_syndic IN <span style="color: #ff0000;">#GET</span>**<span class="br0">&#123;</span>sites<span class="br0">&#125;</span></span><span class="br0">&#125;</span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>pagination <span style="">5</span><span class="br0">&#125;</span></span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>par date<span class="br0">&#125;</span></span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>inverse<span class="br0">&#125;</span></span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dt&gt;<span style="color: #ff0000;">#TITRE</span>&lt;/dt&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd class=&quot;origine&quot;&gt;Sur &lt;a href=&quot;<span style="color: #ff0000;">#URL_ARTICLE</span>&quot;&gt;<span style="color: #ff0000;">#NOM_SITE</span>&lt;/a&gt;&lt;/dd&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;dd class=&quot;date&quot;&gt;<span class="br0">&#91;</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#DATE</span>|affdate<span class="br0">&#41;</span></span><span class="br0">&#93;</span>&lt;/dd&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>&lt;dd class=&quot;auteur&quot;&gt;&lt;cite&gt;<span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#LESAUTEURS</span><span class="br0">&#41;</span></span>&lt;/cite&gt;&lt;/dd&gt;<span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>&lt;dd&gt;<span style="font-weight: bold; color: black;">&lt;blockquote</span>&gt;&lt;p&gt;<span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#DESCRIPTIF</span><span class="br0">&#41;</span></span>&lt;/p&gt;<span style="font-weight: bold; color: black;">&lt;/blockquote</span>&gt;&lt;/dd&gt;<span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-weight: bold; color: black;">&lt;/BOUCLE_derniers_liens</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/dl&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span><span style="font-weight: bold; color: black;"><span class="br0">&#40;</span><span style="color: #ff0000;">#PAGINATION</span><span style="color: #66cc66; font-weight: bold;"><span class="br0">&#123;</span>accessible<span class="br0">&#125;</span></span><span class="br0">&#41;</span></span><span class="br0">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &lt;/dd&gt;<br />
&nbsp; &nbsp; <span style="font-weight: bold; color: black;">&lt;/B_derniers_liens</span>&gt;<br />
&nbsp; <span style="font-weight: bold; color: black;">&lt;/B_sites</span>&gt;<br />
&nbsp; <span style="font-weight: bold; color: black;">&lt;//B_sites</span>&gt;<br />
<span style="font-weight: bold; color: black;">&lt;/BOUCLE_mot_courant</span>&gt;</div><div class='code_download'
		style='text-align: right;'>
		<a href='http://www.gasteroprod.com/local/cache-code/e81d84aa9a491342c8ef6183b72c5591.txt'
		style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>T&eacute;l&eacute;charger</a></div></div>
<p>Ce code fonctionne avec SPIP 1.9.2c&nbsp;[<a href="http://www.gasteroprod.com/#nb1" name="nh1" id="nh1" class="spip_note" rel="footnote" title='[1] A condition d&#39;ajouter le filtre &#171; push &#187;, dont voici le code : function (...)' >1</a>], mais ne devrait plus être nécessaire avec SPIP 1.9.3, la boucle <code class='spip_code' dir='ltr'>SYNDIC_ARTICLES</code> acceptant maintenant le paramètre <code class='spip_code' dir='ltr'>{id_mot_syndic}</code>&nbsp;[<a href="http://www.gasteroprod.com/#nb2" name="nh2" id="nh2" class="spip_note" rel="footnote" title='[2] Voir le commit SVN 11019.' >2</a>]&nbsp;!</p></div>
        	
        	<div class="info" style="border: 1px solid #333;"><p>[<a href="http://www.gasteroprod.com/#nh1" name="nb1" class="spip_note" title="Notes 1" rev="footnote">1</a>] A condition d&#8217;ajouter le filtre &#171;&nbsp;push&nbsp;&#187;, dont voici le code&nbsp;:</p>
<div class="coloration_code"><div class="spip_php code"><span style="color: #000000; font-weight: bold;">function</span> push<span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span> <span style="color: #339933;">==</span> <span style="">''</span> OR <span style="color: #339933;">!</span><a href="http://www.php.net/array_push"><span style="color: #990000;">array_push</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="">''</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$array</span>;<br />
<span style="color: #009900;">&#125;</span></div><div class='code_download'
		style='text-align: right;'>
		<a href='http://www.gasteroprod.com/local/cache-code/2ea158b71f9390f380271ff6cb740766.txt'
		style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>T&eacute;l&eacute;charger</a></div></div>
<p>[<a href="http://www.gasteroprod.com/#nh2" name="nb2" class="spip_note" title="Notes 2" rev="footnote">2</a>] Voir <a href="http://trac.rezo.net/trac/spip/changeset/11019" class="spip_out">le commit SVN 11019</a>.</p></div>
        </div>
        ]]></description>
			<pubDate>Tue, 22 Jan 2008 20:23:00 +0100</pubDate>
			
				<category>SPIP</category>
			
				<category>astuce</category>
			
			<guid isPermaLink="true">blog/blog/amusons-nous-avec-des-boucles-spip-et-les-petits-nouveaux-get-set-et-array.html</guid>
			<dc:creator>Nicolas Hoizey</dc:creator>
  		<dc:format>text/html</dc:format>
			<dc:language>fr</dc:language>
			<comments>http://www.gasteroprod.com/blog/blog/amusons-nous-avec-des-boucles-spip-et-les-petits-nouveaux-get-set-et-array.html#commentaires</comments>
			<wfw:commentRss>http://www.gasteroprod.com/rss/commentaires/amusons-nous-avec-des-boucles-spip-et-les-petits-nouveaux-get-set-et-array-628.rss</wfw:commentRss>
		</item>
		
		<item>
			<title>Afficher les favicon dans la barre personnelle de Firefox sous Mac OS</title>
			<link>http://www.gasteroprod.com/blog/blog/afficher-les-favicon-dans-la-barre-personnelle-de-firefox-sous-mac-os.html</link>
			<description><![CDATA[
        <div id="contentbox">
        	<div class="chapo" style="font-weight: bolder;"><p>Dans sa version Mac OS, <a href="http://www.mozilla-europe.org/fr/products/firefox/" class="spip_out">Mozilla Firefox</a> est configuré pour ne pas afficher l&#8217;icône personnalisée d&#8217;un site à côté d&#8217;un favori placé dans la barre personnelle.</p></div>
        	<div><p>Ce choix est incompréhensible, l&#8217;apport ergonomique de ces <i>favicon</i>&nbsp;[<a href="http://www.gasteroprod.com/#nb1-1" name="nh1-1" id="nh1-1" class="spip_note" rel="footnote" title='[1] Leur nom technique, le fichier s&#39;appelant par d&#233;faut favicon.ico' >1</a>] étant considérable pour identifier visuellement rapidement un favori.</p>

<p><span class='spip_document_463 spip_documents spip_documents_center' >
<img src='http://www.gasteroprod.com/IMG/png/firefox-favicon-barre-personnelle.png' width="303" height="151" alt="Des favicon dans la barre personnelle de Firefox, m&#234;me sous Mac" title="Des favicon dans la barre personnelle de Firefox, m&#234;me sous Mac" /></span></p>

<p>Heureusement, une solution technique mais relativement simple existe. La technologie XUL employée par Mozilla fait qu&#8217;il suffit d&#8217;<a href="http://www.geckozone.org/forum/viewtopic.php?t=28965" class="spip_out">éditer une feuille de styles CSS personnalisée pour changer la présentation de l&#8217;interface</a>. Car l&#8217;icône est en fait bien présente, elle est juste masquée.</p>

<p>Voici donc le bout de code à ajouter à votre feuille de style personnalisée <code class='spip_code' dir='ltr'>userChrome.css</code>&nbsp;[<a href="http://www.gasteroprod.com/#nb1-2" name="nh1-2" id="nh1-2" class="spip_note" rel="footnote" title='[2] A cr&#233;er s&#39;il n&#39;existe pas d&#233;j&#224;' >2</a>]&nbsp;:</p>

<div class="coloration_code"><div class="spip_css code"><span style="color: #6666ff;">.bookmark-item</span> <span style="color: #00AA00;">&gt;</span> <span style="color: #6666ff;">.toolbarbutton-icon</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> !important;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">padding</span> <span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">2px</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span> !important;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">18px</span> !important;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">16px</span> !important;<br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span> !important;<br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.bookmark-item</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&gt;</span> <span style="color: #6666ff;">.toolbarbutton-icon</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;chrome://browser/skin/bookmark-hover-mid.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> !important;<br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.bookmark-item</span><span style="color: #3333ff;">:hover</span><span style="color: #3333ff;">:active </span><span style="color: #00AA00;">&gt;</span> <span style="color: #6666ff;">.toolbarbutton-icon</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">&quot;chrome://browser/skin/bookmark-open-mid.png&quot;</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> !important;<br />
<span style="color: #00AA00;">&#125;</span> </div><div class='code_download'
		style='text-align: right;'>
		<a href='http://www.gasteroprod.com/local/cache-code/fc0733d2db09a12f6f6251cee14345aa.txt'
		style='font-family: verdana, arial, sans; font-weight: bold; font-style: normal;'>T&eacute;l&eacute;charger</a></div></div>
<p>J&#8217;ai testé avec succès cette technique tant sur <a href="http://www.mozilla.com/en-US/firefox/all.html" class="spip_out">Firefox 2</a> que sur la toute dernière <a href="http://www.mozilla.com/en-US/firefox/all-beta.html" class="spip_out">Firefox 3 beta 2</a>.</p></div>
        	
        	<div class="info" style="border: 1px solid #333;"><p>[<a href="http://www.gasteroprod.com/#nh1-1" name="nb1-1" class="spip_note" title="Notes 1-1" rev="footnote">1</a>] Leur nom technique, le fichier s&#8217;appelant par défaut <code class='spip_code' dir='ltr'>favicon.ico</code></p>

<p>[<a href="http://www.gasteroprod.com/#nh1-2" name="nb1-2" class="spip_note" title="Notes 1-2" rev="footnote">2</a>] A créer s&#8217;il n&#8217;existe pas déjà</p></div>
        </div>
        ]]></description>
			<pubDate>Tue, 22 Jan 2008 09:04:47 +0100</pubDate>
			
				<category>Firefox</category>
			
				<category>Mac</category>
			
				<category>astuce</category>
			
			<guid isPermaLink="true">blog/blog/afficher-les-favicon-dans-la-barre-personnelle-de-firefox-sous-mac-os.html</guid>
			<dc:creator>Nicolas Hoizey</dc:creator>
  		<dc:format>text/html</dc:format>
			<dc:language>fr</dc:language>
			<comments>http://www.gasteroprod.com/blog/blog/afficher-les-favicon-dans-la-barre-personnelle-de-firefox-sous-mac-os.html#commentaires</comments>
			<wfw:commentRss>http://www.gasteroprod.com/rss/commentaires/afficher-les-favicon-dans-la-barre-personnelle-de-firefox-sous-mac-os-635.rss</wfw:commentRss>
		</item>
		
	</channel>
    
</rss>