<?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>dat &#187; cms</title>
	<atom:link href="http://dat.perdomani.net/category/cms/feed/" rel="self" type="application/rss+xml" />
	<link>http://dat.perdomani.net</link>
	<description>infastidito</description>
	<lastBuildDate>Tue, 27 Jul 2010 15:33:08 +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>Piccole cose che migliorano la vita</title>
		<link>http://dat.perdomani.net/2007/04/10/piccole-cose-che-migliorano-la-vita/</link>
		<comments>http://dat.perdomani.net/2007/04/10/piccole-cose-che-migliorano-la-vita/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 00:20:15 +0000</pubDate>
		<dc:creator>dat</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[post serio]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://dat.perdomani.net/2007/04/10/piccole-cose-che-migliorano-la-vita/</guid>
		<description><![CDATA[Ho un modem 56k, no, non in fondo ad un armadio o a prendere polvere in cantina, è qui vicino a me, con le sue lucette natalizie. Chiaramente, ringraziando Telecom, non posso avere l&#8217;adsl, e mi sorbisco un&#8217;altalenante web doppino da 56 cappa. Tutto questo incipit per dire soltanto che mi infastidisco a mille quando [...]]]></description>
			<content:encoded><![CDATA[<p>Ho un modem <strong>56k</strong>, no, non in fondo ad un armadio o a prendere polvere in cantina, è qui vicino a me, con le sue lucette natalizie. Chiaramente, ringraziando Telecom, <a href="http://www.antidigitaldivide.org/">non posso avere l&#8217;adsl</a>, e mi sorbisco un&#8217;altalenante web doppino da 56 cappa.</p>
<p>Tutto questo incipit per dire soltanto che mi infastidisco a mille quando devo aprire un sito <a href="http://www.gazzetta.it">pesaaaaaante</a> o un blog <a href="http://www.macchianera.net/">infinitooooooooooo</a> con mille post in home?? Ovviamente no, e a breve scoprirai perchè.</p>
<p>Siccome quando bestemmio sui siti degli altri voglio <strike>avere le spalle coperte</strike> dare il buon esempio mi sono messo a smanettare con wordpress in cerca di soluzione. Ed ecco il mio personale auto-brainstorming con topic &#8220;<strong>come avere un blog leggero ma efficente?</strong>&#8220;:</p>
<ol>
<li>diminuire il numero di post</li>
<li>tenere il num di post  ma usare &lt;!&#8211; more &#8211;&gt; aggressivo</li>
<li>farmi un caffè</li>
<li>modificare il template</li>
</ol>
<p>dopo la prima brain-fase è necessario raffinare le idee in maniera critica:</p>
<ol>
<li>diminuire i post a chessò, 4 o 5, sarebbe un  <em>seouicide </em>(e comunque non mi piace);<em><br />
</em></li>
<li>il <em>more</em> way è orrendo e ad ogni modo aprire tre o quattro pagine pesa parecchio;</li>
<li>ottima idea che però esula un attimo dal contesto;</li>
<li>a quanto pare mi sa che devo aprire un ssh+pico sul server &#8230;</li>
</ol>
<p>allora rotta verso il punto 4, capitano. Volendo quindi modificare il template mi faccio un giro sul sito di <a href="http://codex.wordpress.org/Main_Page">wordpress</a> e scopro tante cose interessanti come ad esempio i <strong>loop doppi</strong> o la <strong>funzione query_post</strong>. Gli ingredienti ci sono, adesso bisogna diventare operativi.</p>
<p>Prima di tutto porto a <strong>5 i post visualizzati in home page</strong> usando le opzioni dal pannello di wordpress.</p>
<p>Poi aggiungo un <strong>secondo loop</strong> all&#8217;interno del file index.php del tema che uso. Più o meno una cosa del genere:</p>
<p>&lt;?php if (is_home() &amp;&amp; !is_paged() ) { ?&gt;<br />
&lt;?php query_posts(&#8216;showposts=15&amp;offset=5&#8242;); ?&gt;<br />
&lt;h4&gt;Post vecchi ma non per questo meno interessanti&lt;/h4&gt;<br />
&lt;?php if (have_posts()) : ?&gt;<br />
&lt;?php while (have_posts()) : the_post(); ?&gt;<br />
&lt;?php the_date(); ?&gt;<br />
&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;&lt;?php the_title(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;<br />
&lt;?php the_category(&#8216;, &#8216;) ?&gt;<br />
&lt;?php endwhile; ?&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;?php } ?&gt;</p>
<p>Così facendo vengono visualizzati completamente i primi 5 post e a seguire i titoli dei 15 post successivi.</p>
<p>La cosa poteva anche <strong>finire qui</strong> se non fosse stato per quella vocina interna che mi diceva: &#8220;<em>coglione guarda quanti termini ti perdi dalla home page lasciando solo i titoli dei post, e google questo te lo farà pagare</em>&#8220;. Come dare torto alla vocina??</p>
<p>Passiamo quindi alla <strong>seconda fase</strong>: cercare un plugin che mi ritorni i <strong>termini più importanti del post</strong>. Io non l&#8217;ho trovato, se esiste già segnalatemelo. Per adesso me ne sono scritto uno mio, senza troppe pretese, partendo dall&#8217;ottimo <a href="http://rmarsh.com/plugins/similar-posts/">Similar Posts</a> che avevo già in casa.</p>
<p>Più o meno ho copiato/modificato un paio di funzioni per far sputare fuori i termini più frequenti di un post. Il risultato l&#8217;ho messo in questa <a href="http://dat.perdomani.net/post-term-list-plugin/">pagina dedicata</a>, nella speranza che qualcuno che sappia programmare veramente lo sistemi e lo renda decente. Se e come funziona lo vedete in <a href="http://dat.perdomani.net/">home page</a> (giù giù, vai fino in fondo). Ad ogni modo, una volta installato basta aggiungere  questo</p>
<p>&lt;?php<br />
if (function_exists(post_term_list)) {<br />
echo &#8220;In questo post, con gran confusione: &lt;br /&gt;&#8221;;<br />
post_term_list($post-&gt;ID);<br />
} ?&gt;<br />
all&#8217;interno del secondo loop. A dire il vero dovrei raffinare almeno la stop word list ma alle due e un quarto di notte è ora di spegnere &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://dat.perdomani.net/2007/04/10/piccole-cose-che-migliorano-la-vita/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Drupal, hide install text files using rewrite rules</title>
		<link>http://dat.perdomani.net/2007/01/30/drupal-hide-install-text-files-using-rewrite-rules/</link>
		<comments>http://dat.perdomani.net/2007/01/30/drupal-hide-install-text-files-using-rewrite-rules/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 14:32:32 +0000</pubDate>
		<dc:creator>dat</dc:creator>
				<category><![CDATA[cms]]></category>
		<category><![CDATA[informatica]]></category>
		<category><![CDATA[inglese]]></category>
		<category><![CDATA[serio]]></category>

		<guid isPermaLink="false">http://dat.perdomani.net/2007/01/30/drupal-hide-install-text-files-using-rewrite-rules/</guid>
		<description><![CDATA[I see lots of web sites that are using drupal cms, and most of them are not hiding the text files that the installation process leave in the root directory. This is not a problem in general, but if you use an old version of drupal maybe is better not to show the world the [...]]]></description>
			<content:encoded><![CDATA[<p>I see lots of web sites that are using <a href="http://drupal.org/" title="External site" target="_blank">drupal cms</a>, and most of them are not hiding the text files that the installation process leave in the root directory. This is not a problem in general, but if you use an old version of drupal maybe is better not to show the world the version you are using. Take a look at <a href="http://drupal.org/CHANGELOG.txt" target="_blank" title="External site">drupal.org changelog file</a> (yes this site is supposed to be up of date;).</p>
<p>So I use this basic solution, note that I update drupal using cvs method so I hide also the CVS directories. Put this code in your <code>.htaccess</code> file after <code>RewriteEngine on</code> inside the <code>IfModule mod_rewrite.c</code> section:</p>
<p><code>RewriteRule    ^(.*)CHANGELOG\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)INSTALL\.mysql\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)INSTALL\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)MAINTAINERS\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)CVS$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)CVS/$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)INSTALL\.pgsql\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)LICENSE\.txt$  http://www.perdomani.net [R,L]<br />
RewriteRule    ^(.*)UPGRADE\.txt$  http://www.perdomani.net [R,L]</code></p>
<p>Modify to fix your needs and save the .htaccess file.</p>
<p>F.A.Q.</p>
<p>1 &#8211; Why you use tons of rules for every file and not something like ^(.*)\.txt$ ?</p>
<p>Mhh, I really don&#8217;t remember, maybe I have some text file I want to be accessible in the site.</p>
<p>2 &#8211; Why not just removing that text files?</p>
<p>I think that CVS import them on every update, so you have to remove the files many times.</p>
]]></content:encoded>
			<wfw:commentRss>http://dat.perdomani.net/2007/01/30/drupal-hide-install-text-files-using-rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
