<?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>Kune.fr &#187; Tutoriels</title>
	<atom:link href="http://kune.fr/blog/category/tutoriels/feed/" rel="self" type="application/rss+xml" />
	<link>http://kune.fr</link>
	<description>Bougeons le web</description>
	<lastBuildDate>Fri, 18 Sep 2009 17:11:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Un diagramme en barre, en pure CSS</title>
		<link>http://kune.fr/blog/tutoriels/barr-diagramme-pure-css/</link>
		<comments>http://kune.fr/blog/tutoriels/barr-diagramme-pure-css/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:16:11 +0000</pubDate>
		<dc:creator>Mat_</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[diagramme]]></category>
		<category><![CDATA[graphique]]></category>

		<guid isPermaLink="false">http://kune.fr/?p=139</guid>
		<description><![CDATA[Pour mon stage chez Ultranoir (j&#8217;en reparlerais plus tard), j&#8217;ai eu l&#8217;occasion de réaliser un diagramme en barre, simple. J&#8217;ai voulu qu&#8217;il soit complètement en CSS (j&#8217;ai quand même rajouté de l&#8217;animation en javascript par la suite, mais pour cet article, je me contenterai de vous présenter le diagramme sans animation). Pour commencer, voilà la [...]]]></description>
			<content:encoded><![CDATA[<p>Pour mon stage chez Ultranoir (j&#8217;en reparlerais plus tard), j&#8217;ai eu l&#8217;occasion de réaliser un diagramme en barre, simple. J&#8217;ai voulu qu&#8217;il soit complètement en CSS (j&#8217;ai quand même rajouté de l&#8217;animation en javascript par la suite, mais pour cet article, je me contenterai de vous présenter le diagramme sans animation).</p>
<p>Pour commencer, voilà la structure html du diagramme:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;graph&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>Vous l&#8217;aurez compris, notre diagramme est composé de 4 barres! Passons maintenant à la première partie du CSS:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.bar</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.g1</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#029FD6</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.g2</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#E2017B</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.g3</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#A4C409</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.g4</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#939393</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Maintenant, notre div .gX étant en position absolute, il suffit de lui donner la bonne taille et le bon attribut TOP dans votre feuille de style, et le tout est joué!<br />
Si vous souhaitez votre un exemple qui fonctionne, voilà la page complète:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:300px;width:400px&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;graph&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:300px&quot;</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;</span>
		        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;g1&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:300px;width:100px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;g2&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:180px;width:100px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;g3&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:75px;width:100px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bar&quot;</span>&gt;</span>
			<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;g4&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;height:45px;width:100px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
		<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>NB: Bizarrement, le plugin qui affiche le code HTML ne semble pas afficher l&#8217;attribut top dans le style des gX&#8230; Il suffit de le rajouter comme ceci: <em> style=&nbsp;&raquo;height: 180px; top: 120px; width: 100px;&nbsp;&raquo;</em> ou la valeur de top est la hauteur totale moins la hauteur de la barre souhaitée.</p>
<p>N&#8217;oubliez pas d&#8217;enregistrer la feuille de style dans le fichier styles.css</p>
<p>Le résultat devrait ressemble à ça:</p>
<p><img src="http://kune.fr/files/2009/05/graph.png" alt="graph" width="500" height="330" class="alignleft size-full wp-image-145" /></p>
<p>Pour ne plus avoir à calculer le TOP et la hauteur de chaques barres, une petite fonction PHP ne fera pas de mal. Je ne la donnerai pas ici, ce n&#8217;est pas le but de l&#8217;article, mais si vous rencontrez un problème, n&#8217;hésitez pas à laisser un commentaire !</p>
]]></content:encoded>
			<wfw:commentRss>http://kune.fr/blog/tutoriels/barr-diagramme-pure-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Créer un index de tag pour WordPress</title>
		<link>http://kune.fr/blog/wordpress/creer-un-index-de-tag-pour-wordpress/</link>
		<comments>http://kune.fr/blog/wordpress/creer-un-index-de-tag-pour-wordpress/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 18:02:28 +0000</pubDate>
		<dc:creator>Mat_</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[tag]]></category>

		<guid isPermaLink="false">http://kune.fr/?p=86</guid>
		<description><![CDATA[En lisant un tweet de Fran6, l&#8217;auteur du site Fran6art.com et du livre Le campus: WordPress, qui se demandait comment réaliser une sorte d&#8217;index de tag sur wordpress, je me suis amuser à programmer ça et voilà comment j&#8217;ai procédé: Je créé un template de page tout simple, avec comme nom IndexTag. Je vous laisse [...]]]></description>
			<content:encoded><![CDATA[<p>En lisant un tweet de Fran6, l&#8217;auteur du site <a title="Fran6art.com" href="http://www.fran6art.com/">Fran6art.com</a> et du livre Le campus: WordPress, qui se demandait comment réaliser une sorte d&#8217;index de tag sur wordpress, je me suis amuser à programmer ça et voilà comment j&#8217;ai procédé:</p>
<ol>
<li>Je créé un template de page tout simple, avec comme nom IndexTag. Je vous laisse le loisir de découvrir comment faire sur le codex de wordpress.org, mais pour faire simple, il suffit souvent de prendre si on l&#8217;a, la page page.php dans le dossier de son template wordpress, supprimer la boucle qui affiche l&#8217;article et les tags du style &lt;?php the_permalink(); ?&gt; en les remplaçant par ce qu&#8217;il faut (si vous avez besoin d&#8217;aide la dessus, n&#8217;hésitez pas à laisser un commentaire ).</li>
<li>Dans le corps de la page, j&#8217;ajoute cette partie de code (les explications arrivent ensuite):
<p style="text-align: left">&lt;?php $tag = wp_tag_cloud(&#8216;format=array&amp;smallest=8&amp;largest=8&#8242; );</p>
<p style="text-align: left">        $start = &laquo;&nbsp;0&#8243;;</p>
<p><span> </span></p>
<p style="text-align: left">        foreach($tag as $untag){</p>
<p style="text-align: left">                echo &laquo;&nbsp;\n&nbsp;&raquo;;</p>
<p style="text-align: left">                ereg(&laquo;&nbsp;&gt;([A-Za-z0-9\.|-|_éàèêç ]*)&lt;/a&gt;&nbsp;&raquo;,$untag, $letag);</p>
<p style="text-align: left">                $letag[1] = ucfirst($letag[1]);</p>
<p><span> </span></p>
<p style="text-align: left">                if($start == &laquo;&nbsp;0&#8243;){</p>
<p style="text-align: left">                       $start = $letag[1][0];</p>
<p style="text-align: left">                       echo $start;</p>
<p style="text-align: left">                       echo &laquo;&nbsp;&lt;ul&gt;&nbsp;&raquo;;</p>
<p style="text-align: left">                }</p>
<p style="text-align: left">                if($letag[1][0] == $start)</p>
<p style="text-align: left">                       echo &laquo;&nbsp;&lt;li&gt;$untag&lt;/li&gt;&nbsp;&raquo;;</p>
<p style="text-align: left">                else{</p>
<p style="text-align: left">                       echo &laquo;&nbsp;&lt;/ul&gt;&nbsp;&raquo;;</p>
<p style="text-align: left">                       $start = $letag[1][0];</p>
<p style="text-align: left">                       echo $start;</p>
<p style="text-align: left">                       echo &laquo;&nbsp;&lt;ul&gt;&nbsp;&raquo;;</p>
<p style="text-align: left">                       echo &laquo;&nbsp;&lt;li&gt;$untag&lt;/li&gt;&nbsp;&raquo;;</p>
<p style="text-align: left">               }</p>
<p style="text-align: left">        }</p>
<p style="text-align: left">?&gt;</p>
</li>
<li>Il ne reste plus qu&#8217;à créer une page avec pour modèle de page IndexTag.</li>
</ol>
<p>Pour les explications du codes, c&#8217;est plutot simple:</p>
<ol>
<li>wp_tag_cloud avec l&#8217;option format=array récupere dans un tableau de variable tous les tags du site</li>
<li>Dans ma boucle: 
<ol>
<li>ereg(&laquo;&nbsp;&gt;([A-Za-z0-9\.|-|_éàèêç ]*)&lt;/a&gt;&nbsp;&raquo;,$untag, $letag);  est une fonction qui recupere le texte qui se trouve dans le lien du tag</li>
<li>$letag[1] = ucfirst($letag[1]);    met en majuscule la premiere lettre du tag</li>
<li>La suite vérifie simplement si le tag commence par la bonne lettre, si c&#8217;est le cas, on le garde dans la liste, sinon on construit une nouvelle liste.</li>
</ol>
</li>
</ol>
<p>Et voilà! Libre à vous de modifier ce code comme il vous plait, en ajoutant par exemple une balise de titre sur autour de  <em>echo $start; </em>comme par exemple <em>echo &laquo;&nbsp;&lt;h3&gt;$start&lt;/h3&gt;&nbsp;&raquo;;</em></p>
<p>En espérant vous avoir aidé dans votre apprentissage !! N&#8217;hésitez pas à poser vos questions en commentaire.</p>
]]></content:encoded>
			<wfw:commentRss>http://kune.fr/blog/wordpress/creer-un-index-de-tag-pour-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
