<?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>Marco Buttarini &#187; programmazione</title>
	<atom:link href="http://marbu.org/marbu/argomento/blog/programmazione/feed/" rel="self" type="application/rss+xml" />
	<link>http://marbu.org/marbu</link>
	<description>Portfolio e Blog di Marco Buttarini</description>
	<lastBuildDate>Tue, 29 Nov 2011 22:07:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Come eliminare da WordPress i tag meno utilizzati</title>
		<link>http://marbu.org/marbu/eliminare-da-wordpress-i-tag-meno-utilizzati/</link>
		<comments>http://marbu.org/marbu/eliminare-da-wordpress-i-tag-meno-utilizzati/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 10:32:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress trick & tips]]></category>
		<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/marbu/?p=278</guid>
		<description><![CDATA[Per eliminare i tag meno utilizzati da wordpress potete fare direttamente delle query al db, senza bisogno di installare un plugin che servirebbe per una operazione one-shot. Per farlo avete bisogno: di un accesso al db tramite interfaccia (es: phpmyadmin) oppure di un accesso al server e al db tramite ssh. In questo caso dopo [...]]]></description>
			<content:encoded><![CDATA[<p>Per eliminare i tag meno utilizzati da wordpress potete fare direttamente delle query al db, senza bisogno di installare un plugin che servirebbe per una operazione one-shot.</p>
<p>Per farlo avete bisogno:</p>
<ul>
<li>di un accesso al db tramite interfaccia (es: phpmyadmin)</li>
<li>oppure di un accesso al server e al db tramite ssh. In questo caso dopo aver fatto login (mysql -u username -p password), e aver selezionato il db in uso (use nomedb) potete eseguire la seguenti query:</li>
</ul>
<p><span id="more-278"></span>Per rimuovere i tag vuoti:</p>
<pre class="brush: php; title: ;">
DELETE t.*, tx.*
FROM wp_terms t, wp_term_taxonomy tx
WHERE t.term_id = tx.term_id
AND tx.taxonomy = &quot;post_tag&quot;
AND tx.count = &quot;0&quot;;
</pre>
<p>Mentre per rimuovere i tag che hanno, ad esempio, meno di 2 articoli:</p>
<pre class="brush: php; title: ;">
DELETE t.*, tx.*
FROM wp_terms t, wp_term_taxonomy tx
WHERE t.term_id = tx.term_id
AND tx.taxonomy = &quot;post_tag&quot;
AND tx.count &lt; &quot;2&quot;;
</pre>
<p>Se utilizzate sistemi di auto-posting (es: feedwordpress)  è facile che vi troviate con migliaia di tag con un solo articoli, che appesantiscono di molto la fruizione e il carico del db.</p>
<p>Il miglioramento di prestazioni in alcuni casi limite (tanti post e tanti tag) è evidente</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/eliminare-da-wordpress-i-tag-meno-utilizzati/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attivare il debug in WordPress</title>
		<link>http://marbu.org/marbu/attivare-il-debug-in-wordpress/</link>
		<comments>http://marbu.org/marbu/attivare-il-debug-in-wordpress/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 10:09:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress trick & tips]]></category>
		<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/marbu/?p=270</guid>
		<description><![CDATA[Può essere molto utile in alcuni casi l&#8217;attivazione della modalità di debug in WordPress, per mostrare tutti quei warning e quelle notice che normalmente non vediamo a video.(solitamente apache è configurato per mostrare solo gli &#8220;error&#8221;) Per farlo basta 1) aggiungere queste righe di codice al file functions.php del tema: if ( isset($_GET['debug']) &#38;amp;&#38;amp; $_GET['debug'] [...]]]></description>
			<content:encoded><![CDATA[<p>Può essere molto utile in alcuni casi l&#8217;attivazione della modalità di debug in WordPress, per mostrare tutti quei warning e quelle notice che normalmente non vediamo a video.(solitamente apache è configurato per mostrare solo gli &#8220;error&#8221;)</p>
<p><span id="more-270"></span>Per farlo basta</p>
<p>1) aggiungere queste righe di codice al file functions.php del tema:</p>
<pre class="brush: php; title: ;">
if ( isset($_GET['debug']) &amp;amp;&amp;amp; $_GET['debug'] == 'debug'){
define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
@ini_set('display_errors',1);
}
</pre>
<p>2) chiamare la pagina del sito in cui visualizzare le print di debug, aggiungendo alla url il parametro debug in questa maniera: ?debug=debug</p>
<p>Scoprirete molte cose interessanti, tra cui l&#8217;utilizzo da parte degli stessi file del core di WordPress, di funzioni che WordPress ha definito deprecate&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/attivare-il-debug-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bordi arrotondati via css</title>
		<link>http://marbu.org/marbu/bordi-arrotondati-via-css/</link>
		<comments>http://marbu.org/marbu/bordi-arrotondati-via-css/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 10:41:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/marbu/?p=207</guid>
		<description><![CDATA[Il dramma per ogni grafico alle prese con i bordi arrotondati è la compatibilità con i diversi browser. Diciamolo chiaramente: se dovete &#8220;stondeggiare&#8221; ed essere sicuri che il risultato sia uniforme sui diversi browser usate da subito un approccio con le immagini. Inutile sbattere la testa con i tondeggiamenti, per poi rendersi conto di dover [...]]]></description>
			<content:encoded><![CDATA[<p>Il dramma per ogni grafico alle prese con i <strong>bordi arrotondati</strong> è la <strong>compatibilità</strong> con i diversi browser.<br />
Diciamolo  chiaramente: se dovete &#8220;<strong>stondeggiare</strong>&#8221; ed essere sicuri che il risultato sia uniforme sui diversi browser usate da subito un approccio con le immagini.<br />
Inutile sbattere la testa con i tondeggiamenti, per poi rendersi conto di dover gestire delle eccezioni con pesanti javascript o immagini solo per <strong>ie7</strong>.<br />
Se invece non vi interessa essere conformi a tutti i browser, e dovete usare il tondeggiamento su piccole porzioni del sito, la via css è semplice e simpatica.<br />
Ma, ripeto, <strong>scordatevi di Internet Explorer</strong>, ancora per qualche annetto almeno.</p>
<p>Questo un sito ad-hoc per reperire le istruzioni css da utilizzare in questo caso:<br />
<a href="http://border-radius.com/" target="_blank"> http://border-radius.com/</a></p>
<p>Bell&#8217;idea, dominio azzeccato, grafica carina per un servizio semplice e utile.</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/bordi-arrotondati-via-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Widget per WordPress 2.8</title>
		<link>http://marbu.org/marbu/twitter-widget-per-wordpress-28/</link>
		<comments>http://marbu.org/marbu/twitter-widget-per-wordpress-28/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 10:24:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Plugin]]></category>
		<category><![CDATA[Wordpress trick & tips]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://marbu.org/weblog/2009/07/03/twitter-widget-per-wordpress-28/</guid>
		<description><![CDATA[Ho sviluppato il plugin partendo da quello realizzato da Sarah Isaacson e usando l&#8217;esempio di widgettizzazione di Justin Tadlock. Avevo bisogno di un widget di twitter che fosse moltiplicabile, e che mostrasse l&#8217;immagine. Lo potete scaricare qui: WG Twitter Widget ENGLISH VERSION I developed, starting from the existing widget of Sarah Isaacson, and using the [...]]]></description>
			<content:encoded><![CDATA[<p>Ho sviluppato il plugin partendo da quello realizzato da <a href="http://www.velvet.id.au/twitter-wordpress-sidebar-widget/">Sarah Isaacson</a> e usando l&#8217;esempio di widgettizzazione di <a href="http://justintadlock.com/">Justin Tadlock</a>.</p>
<p>Avevo bisogno di un widget di twitter che fosse moltiplicabile, e che mostrasse l&#8217;immagine.<span id="more-54"></span></p>
<p>Lo potete scaricare qui:</p>
<p><a href="http://marbu.org/weblog/files/2009/07/wg-twitter.zip" title="WG Twitter Widget">WG Twitter Widget</a></p>
<p>ENGLISH VERSION</p>
<p>I developed, starting from the existing widget of <a href="http://www.velvet.id.au/twitter-wordpress-sidebar-widget/">Sarah Isaacson</a>, and using the example widget of <a href="http://justintadlock.com/">Justin Tadlock</a> a new twitter widget for wp 2.8.</p>
<p>I needed of a multiple widget for different twitter account. And i needed of the image to be showed in my widget, so that&#8217;s it, you can download it from here:</p>
<p><a href="http://marbu.org/weblog/files/2009/07/wg-twitter.zip" title="WG Twitter Widget">WG Twitter Widget</a></p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/twitter-widget-per-wordpress-28/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>wordpress plugin login redirect</title>
		<link>http://marbu.org/marbu/wordpress-plugin-login-redirect/</link>
		<comments>http://marbu.org/marbu/wordpress-plugin-login-redirect/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 19:06:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress trick & tips]]></category>
		<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/weblog/2008/12/20/wordpress-plugin-login-redirect/</guid>
		<description><![CDATA[Per realizzare un redirect automatico in homepage doo aver fatto il login esistono vari plugin. Dalla versione 2.6.2 è stato aggiunto un apposito filtro, login_redirect,  sfruttato dal peters-login-redirect, ma testato su wpmu non funziona. Il modo più sicuro e cross-version credo rimanga quello di controllare la url di provenienza, e di mettere una funzione in [...]]]></description>
			<content:encoded><![CDATA[<p>Per realizzare un redirect automatico in homepage doo aver fatto il login esistono vari plugin.</p>
<p>Dalla versione 2.6.2 è stato aggiunto un apposito filtro, login_redirect,  sfruttato dal <a href="http://wordpress.org/extend/plugins/peters-login-redirect/">peters-login-redirect</a>, ma testato su wpmu non funziona.<span id="more-53"></span></p>
<p>Il modo più sicuro e cross-version credo rimanga quello di controllare la url di provenienza, e di mettere una funzione in corrispondenza di  admin_head:</p>
<pre class="brush: php; title: ;">

/**********************/

function redirect_to_front_page() {
global $wpdb;
$mystring = $_SERVER['HTTP_REFERER'];
$findme   = 'wp-login.php';
$pos = strpos($mystring, $findme);
if (!($pos === false)) {
$redirect_to=get_bloginfo('url');
wp_redirect($redirect_to);
}
}

add_action(&quot;admin_head&quot;, &quot;redirect_to_front_page&quot;);

/**********************/
</pre>
<p>per scaricare il plugin cliccare qui:</p>
<p><a title="marbu plugin redirect" href="http://marbu.org/weblog/files/2008/12/marbu_login_redirectphp.zip">marbu plugin redirect</a></p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/wordpress-plugin-login-redirect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>autenticazione in sessione con php e mysql</title>
		<link>http://marbu.org/marbu/autenticazione-in-sessione-con-php-e-mysql/</link>
		<comments>http://marbu.org/marbu/autenticazione-in-sessione-con-php-e-mysql/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 10:28:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/weblog/2007/12/01/autenticazione-in-sessione-con-php-e-mysql/</guid>
		<description><![CDATA[Quando devo gestire il login in un&#8217;area di amministrazione utilizzo mettere i dati in sessione, e, ad ogni pagina, controllo la coerenza dei dati in sessione con quelli del database. Questo mi permette di mettere sotto protezione diverse pagine semplicemente utilizzando la chiamata alla funzione di controllo, che, se fallisce, redireziona verso la pagina di [...]]]></description>
			<content:encoded><![CDATA[<p>Quando devo gestire il login in un&#8217;area di amministrazione utilizzo mettere i dati in sessione, e, ad ogni pagina, controllo la coerenza dei dati in sessione con quelli del database.<span id="more-51"></span></p>
<p>Questo mi permette di mettere sotto protezione diverse pagine semplicemente utilizzando la chiamata alla funzione di controllo, che, se fallisce, redireziona verso la pagina di login.</p>
<p>Qualcuno mi ha contestato questo metodo, perchè lascio troppo lavoro al server, ma per l&#8217;utilizzo che ne faccio (poche decine di utenti al massimo) è un problema che non si pone.</p>
<p>La vera pecca del codice che sto per scrivere è che utilizza la password in chiaro sul db (non codificato in base64 per esempio)</p>
<p>Allora,  innanzitutto la pagina di login, che creo nuova e la chiamo, appunto, login.php:</p>
<p>/******************************/</p>
<address> &lt;form action=&#8221;index.php&#8221; method=&#8221;post&#8221; name=&#8221;login&#8221; id=&#8221;login&#8221;&gt;</address>
<address> &lt;p align=&#8221;center&#8221;&gt;Username&lt;br&gt;</address>
<address> &lt;input name=&#8221;username&#8221; type=&#8221;text&#8221; id=&#8221;username&#8221;&gt;</address>
<address> &lt;/p&gt;</address>
<address> &lt;p align=&#8221;center&#8221;&gt;Password&lt;br&gt;</address>
<address> &lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; id=&#8221;password&#8221;&gt;</address>
<address> &lt;/p&gt;</address>
<address> &lt;p align=&#8221;center&#8221;&gt;</address>
<address> &lt;input name=&#8221;Entra&#8221; type=&#8221;submit&#8221; id=&#8221;Entra&#8221; value=&#8221;Entra&#8221;&gt;</address>
<address> &lt;/p&gt;</address>
<address> &lt;/form&gt;</address>
<p>/******************************/</p>
<p>Poi creo e riempio la tabella utenti sul db mysql:</p>
<p>Il campo &#8220;permessi&#8221; ouò essere usato per gestire diversi livelli di autenticazione (editore, amministratore&#8230;)</p>
<p>/******************************/</p>
<address> CREATE TABLE `utenti` (</address>
<address> `id_utente` int(10) NOT NULL auto_increment,</address>
<address> `nome` varchar(255) NOT NULL default &#8221;,</address>
<address> `cognome` varchar(255) NOT NULL default &#8221;,</address>
<address> `username` varchar(255) NOT NULL default &#8221;,</address>
<address> `password` varchar(255) NOT NULL default &#8221;,</address>
<address> `permessi` int(10) NOT NULL default &#8217;0&#8242;,</address>
<address> `mail` varchar(100) NOT NULL,</address>
<address> `contatti` text NOT NULL,</address>
<address> `attivo` int(2) NOT NULL,</address>
<address> PRIMARY KEY  (`id_utente`)</address>
<address> ) TYPE=MyISAM  PACK_KEYS=0 AUTO_INCREMENT=1;</address>
<address>INSERT INTO `utenti` (`id_utente`, `nome`, `cognome`, `username`, `password`, `permessi`, `mail`,  `attivo`) VALUES<br />
(1, &#8216;nomeadmin&#8217;, &#8216;passwordadmin&#8217;, &#8216;admin&#8217;, &#8216;admin&#8217;, 2, &#8216;webgrafia@gmail.com&#8217;,  1);</address>
<p>/********************************/</p>
<p>Poi creo il file auth.php che includo prima di ogni cosa (almeno prima di stampare alcunchè a video):</p>
<p>/********************************/</p>
<address>&lt;?</address>
<address> session_start();</address>
<address> // per uscire dalla sessione</address>
<address> if($_GET['azione']==&#8221;esci&#8221;){</address>
<address> session_unset();</address>
<address> session_destroy();</address>
<address> }</address>
<address> // controllo permessi</address>
<address> if(!isset($_SESSION['permessi'])){</address>
<address> if(isset($_POST['username'])){</address>
<address> $query = &#8220;SELECT * FROM `utenti` WHERE username=&#8217;&#8221;.$_POST['username'].&#8221;&#8216; AND password = &#8216;&#8221;.$_POST['password'].&#8221;&#8216;&#8221;;</address>
<address> $result=mysql_query($query);</address>
<address> if($row=mysql_fetch_array($result)){</address>
<address> if($row['attivo']){</address>
<address> $_SESSION['permessi']=$row['permessi'];</address>
<address> $_SESSION['id_utente']=$row['id_utente'];</address>
<address> $_SESSION['nome']=$row['nome'];</address>
<address> $_SESSION['cognome']=$row['cognome'];</address>
<address> }else{</address>
<address> echo &#8221; Utente non attivo &#8220;;</address>
<address> include(&#8216;login.php&#8217;);</address>
<address> exit;</address>
<address> }</address>
<address> }else{</address>
<address> echo &#8221; Username e password errati&#8221;;</address>
<address> include(&#8216;login.php&#8217;);</address>
<address> exit;</address>
<address> }</address>
<address> }else{</address>
<address> echo &#8221; Autenticati prima di accedere alla pagina&#8221;;</address>
<address> include(&#8216;login.php&#8217;);</address>
<address> exit;</address>
<address> }</address>
<address> }</address>
<address> ?&gt;</address>
<p> /******************************/<br />
E poi&#8230; basta, ogni tentativo di accesso non autorizzato viene rigettato sulla pagina di login</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/autenticazione-in-sessione-con-php-e-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>select regioni-provincie con javascript, php e mysql</title>
		<link>http://marbu.org/marbu/select-regioni-provincie-con-javascript-php-e-mysql/</link>
		<comments>http://marbu.org/marbu/select-regioni-provincie-con-javascript-php-e-mysql/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 09:57:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/weblog/2007/12/01/select-regioni-provincie-con-javascript-php-e-mysql/</guid>
		<description><![CDATA[Avevo bisogno di un sistema che alla selezione di una regione aggiornasse il menu a tendina della provincia. Cercando in rete ho trovato un pò di cose che ho messo insieme. Innanzitutto un dump di mysql con le tabelle con le regioni e le provincie italiane, e con le opportune relazioni: scarica qui il dump [...]]]></description>
			<content:encoded><![CDATA[<p>Avevo bisogno di un sistema che alla selezione di una regione aggiornasse il menu a tendina della provincia. Cercando in rete ho trovato un pò di cose che ho messo insieme.<span id="more-50"></span></p>
<p>Innanzitutto un dump di <strong>mysql</strong> con le <strong>tabelle con le regioni e le provincie</strong> italiane, e con le opportune relazioni:</p>
<p><span style="text-decoration: line-through;">scarica qui il <strong>dump mysql</strong></span><strong> file perso durante un trasferimento&#8230;<br />
</strong></p>
<p>poi bisogna creare le 2 select</p>
<p>quella della regione prende i dati da mysql e chiama la funzione javascript che  valorizzerà la provincia:</p>
<pre class="brush: php; title: ;">
&lt;select name=&quot;id_regione&quot; onChange=&quot;Riempi(this.options.selectedIndex)&quot;&gt;
&lt;?php
$query = &quot;SELECT * FROM regioni WHERE 1 ORDER BY nomeregione&quot;;
$result=mysql_query($query);
echo '&lt;option value=&quot;&quot;&gt; &lt;/option&gt;';
while($row=mysql_fetch_array($result)){
echo '&lt;option value=&quot;'.$row['id_regione'].'&quot;&gt;'.$row['nomeregione'].'&lt;/option&gt;';
}
?&gt;
&lt;/select&gt;
</pre>
<p>La select della provincia invece la lascio vuota perchè sarà riempita dal javascript:</p>
<pre class="brush: php; title: ;">
&lt;select name=&quot;id_provincia&quot;&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;option&gt;          &lt;/option&gt;
&lt;/select&gt;
</pre>
<p>Ho inserito nell&#8217;esempio 7 campi option vuoti per risolvere un problema di Netscape, (non riesce a creare nuovi fields nelle select, almeno così dicono in rete, io non ho provato). Per tutti gli altri browser è sufficiente creare la select vuota.</p>
<p>A questo punto manca il <strong>javascript,</strong> che va costruito interrogando il db nuovamente per creare gli array utilizzati per valorizzare la select della provincia:</p>
<pre class="brush: php; title: ;">
&lt;SCRIPT&gt;
&lt;!--
var prov=new Array();
var sigle=new Array();
&lt;?php
$query = &quot;SELECT * FROM regioni WHERE 1 ORDER BY nomeregione&quot;;
$result=mysql_query($query);
$counter=1;
while($row=mysql_fetch_array($result)){
$query2 = &quot;SELECT * FROM province WHERE id_regione  = &quot;.$row['id_regione'].&quot; ORDER BY nomeprovincia&quot;;
$result2=mysql_query($query2);
$counter2=0;
$str_prov=&quot;&quot;;
$str_sigla=&quot;&quot;;
while($row2=mysql_fetch_array($result2)){
if($counter2&gt;0){  $str_prov.=&quot;,&quot;; $str_sigla.=&quot;,&quot;; }
$str_prov.='&quot;'.$row2['nomeprovincia'].'&quot;';
$str_sigla.='&quot;'.$row2['id_provincia'].'&quot;';
$counter2++;
}
echo   &quot;prov[&quot;.$counter.&quot;]=new Array(&quot;.$str_prov.&quot;) \n&quot;;
echo   &quot;sigle[&quot;.$counter.&quot;]=new Array(&quot;.$str_sigla.&quot;) \n&quot;;
$counter++;
}
?&gt; function Riempi(source)
{
with (document.ins.id_provincia)
{
while (options.length &gt; 0)
options[0]=null;
for (i=0;i&lt;prov[source][/source].length;i++)
options[i]=new Option(prov[source][/source][i],sigle[source][/source][i])
options.selectedIndex=0;
}
}
//--&gt;
&lt;/SCRIPT&gt;
</pre>
<p>E questo è tutto!</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/select-regioni-provincie-con-javascript-php-e-mysql/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WordPress &#8211; Anche chat</title>
		<link>http://marbu.org/marbu/wordpress-chat/</link>
		<comments>http://marbu.org/marbu/wordpress-chat/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 17:43:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress trick & tips]]></category>
		<category><![CDATA[programmazione]]></category>

		<guid isPermaLink="false">http://marbu.org/weblog/2007/09/17/wordpress-chat/</guid>
		<description><![CDATA[WordPress è uno strumento fantastico per tutti gli sviluppatori che hanno fin&#8217;ora girovagato nei 1000 cms della rete alla ricerca del migliore. Devo dire che per un pò ho tentennato con Joomla, ma alla fine, vista la leggerezza del codice e gli ultimi aggiornamenti che lo rendono sempre più vicino ad un reale cms ho [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress è uno strumento fantastico per tutti gli sviluppatori che hanno fin&#8217;ora girovagato nei 1000 cms della rete alla ricerca del migliore.<span id="more-49"></span></p>
<p>Devo dire che per un pò ho tentennato con Joomla, ma alla fine, vista la leggerezza del codice e gli ultimi aggiornamenti che lo rendono sempre più vicino ad un reale cms ho definitivamente scelto <a title="Wordpress" href="http://wordpress.org/">WordPress</a> come Content Management System.</p>
<p>Per utilizzare al meglio le sue funzionalità widget ho fatto delle piccole modifiche al plugin <a title="xdtalk" href="http://www.xdweb.net/wordpress/xdtalk/">xdtalk</a> (una delle poche chat per wp trovata in rete) che riporto qui di seguito per tutti coloro che ne avessero bisogno:</p>
<p>In fondo al file xdtalk.php inserite queste righe:</p>
<pre class="brush: php; title: ;">
/*******************/

function xdtalk_widget_init() {
if ( !function_exists('register_sidebar_widget') )
return;

function widget_xdtalk($args) {
extract($args);
?&gt;
&lt;?php echo $before_widget; ?&gt;
&lt;?php
$options = (array) get_option('xdtalk_widget');
echo $before_title;
echo $options['title'];
echo  $after_title;
xdtalk_echo_sidebar_setup();
echo $after_widget;
?&gt;
&lt;?php
}

function xdtalk_widget_control() {
$options = get_option('xdtalk_widget');
if ( !is_array($options) )
$options = array('title'=&gt;'Chat');
if ( $_POST['xdtalk_widget-submit'] ) {
$options['title'] = strip_tags(stripslashes($_POST['xdtalk_widget-title']));
update_option('xdtalk_widget', $options);
}
$title = htmlspecialchars($options['title'], ENT_QUOTES);
?&gt;
&lt;p&gt;&lt;label for=&quot;xdtalk_widget-title&quot;&gt;Title: &lt;/label&gt;&lt;input name=&quot;xdtalk_widget-title&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $title; ?&gt;&quot; /&gt;&lt;/p&gt;
&lt;input type=&quot;hidden&quot; id=&quot;xdtalk_widget-submit&quot; name=&quot;xdtalk_widget-submit&quot; value=&quot;1&quot; /&gt;
&lt;?php
}

register_sidebar_widget('xdtalk widget', 'widget_xdtalk');
register_widget_control('xdtalk widget', 'xdtalk_widget_control', 300, 100);

}
add_action('plugins_loaded', 'xdtalk_widget_init');

/********************/
</pre>
<p>et voilà, adesso in Aspetto -&gt; Widget trovate il widget che potete spostare a vostro piacimento</p>
<p>Se volete scaricare l&#8217;intero plugin xdtalk lo trovate <a title="xdtalk chat e widget" href="http://marbu.org/wp-content/uploads/xdtalk_widget.tgz">qui</a>, ma attenti, non aggiornerò la versione, che è alla 1,02 !</p>
]]></content:encoded>
			<wfw:commentRss>http://marbu.org/marbu/wordpress-chat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

