<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" version="2.0">

<channel>
	<title>Nutsmuggling</title>
	
	<link>http://davidebenini.it</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 04 Mar 2010 18:59:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Nutsmuggling" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nutsmuggling" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Events Manager 2.1</title>
		<link>http://davidebenini.it/2010/03/04/events-manager-2-1/</link>
		<comments>http://davidebenini.it/2010/03/04/events-manager-2-1/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:54:59 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Events Manager]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[haircut]]></category>
		<category><![CDATA[manager]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=548</guid>
		<description><![CDATA[Hello folks,
just a short note to announce the release of Events Manager 2.1.
It&#8217;s probably not as stable as the lack of a or b would suggest, but it is definitely much stabler than the previous version. Also, I got tired of letters.
Here&#8217;s the changelog:

Properly added Marcus Sykes as a contributor  
Added a full calendar [...]]]></description>
			<content:encoded><![CDATA[<p>Hello folks,<br />
just a short note to announce the release of <a href="http://davidebenini.it/wordpress-plugins/events-manager/">Events Manager 2.1</a>.<br />
It&#8217;s probably not as stable as the lack of <code>a</code> or <code>b</code> would suggest, but it is definitely much stabler than the previous version. Also, I got tired of letters.</p>
<p>Here&#8217;s the changelog:</p>
<ul>
<li>Properly added Marcus Sykes as a contributor  </li>
<li>Added a full calendar  </li>
<li>Added an #_EDITEVENT placeholder  </li>
<li>Added Brazialian Portuguese localization and some translatable strings</li>
<li>Added a today scope for events lists</li>
<li>Increased to 3 te default lists limit</li>
<li>Categories are now displayed in the events table                        </li>
<li>Now weeks starts according to WP settings       </li>
<li>Moved the hide page option up for better access  </li>
<li>Attributes column was not created when the plugin was upgraded, fixed</li>
<li>Added comment field to the RSVP form and #_COMMENT placeholder in RSVP email templates </li>
<li>Added customizable title to small calendar      </li>
<li>Removed php short tags                        </li>
<li>Changed RVSP &#8216;no seats available message&#8217; for better English</li>
<li>Bugfix: there was a time bug</li>
<li>Bugfix: event_time not taken into consideration in ordering events, fixed</li>
<li>Bugfix: on calendar for days after 28  on the event calendar view</li>
<li>Bugfix: for events in days with single digit</li>
<li>Bugfix: events link in the calendar now work with permalink</li>
<li>Bugfix: today in next mont was not matched in the calendar </li>
<li>Bugfix: _RESPPHONE was not matched in emails</li>
<li>Bugfix: fixed security vulnerability, which could lead to sql inject attacks      </li>
<li>Bugfix: locations with apostrophe were duplicated</li>
<li>Bugfix: bloginfo(&#8216;wpurl&#8217;) instead of bloginfo(&#8216;url&#8217;)  </li>
<li>Bugfix: now loading textdomain in the new (not deprecated) way</li>
</ul>
<p>Most of the bugfixes, and some of the features, were sponsored by Sara of <a href="http://www.paperlantern.com/">Paperlantern</a>, to whom I am most grateful.</p>
<p>Also, I just got a haircut:</p>
<p><img src="http://davidebenini.it/wp-content/uploads/2010/03/Foto-del-61365666-03-2455260-alle-1702-300x225.jpg" alt="" title="Foto-del-61365666-03-2455260-alle-1702.jpg" width="300" height="225" class="aligncenter size-medium wp-image-547" /></p>
<p>Cheers,<br />
Davide</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2010/03/04/events-manager-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress: disable moderation for a single comment</title>
		<link>http://davidebenini.it/2009/12/16/wordpress-disable-moderation-for-a-single-comment/</link>
		<comments>http://davidebenini.it/2009/12/16/wordpress-disable-moderation-for-a-single-comment/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 11:47:13 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[moderation]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=531</guid>
		<description><![CDATA[I am working an very complex portal based on Wordpress. The more I code, the more I befriend the functions.php file, where all my small tweaks reside. Last in the list (pun!) a super simple action to automatically approve comments belonging to a specific post (which I use as a guestbook):

function approve_guestbook_comments&#40;$comment_ID&#41; &#123;
	$comment = get_comment&#40;$comment_ID&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>I am working an very complex portal based on Wordpress. The more I code, the more I befriend the <code>functions.php</code> file, where all my small tweaks reside. Last in the list (pun!) a super simple action to automatically approve comments belonging to a specific post (which I use as a guestbook):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> approve_guestbook_comments<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_ID</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> get_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">comment_post_ID</span> <span style="color: #339933;">==</span> guestbook_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		wp_set_comment_status<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment_ID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'approve'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_post'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'approve_guestbook_comments'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As you see it&#8217;s a super-simple tweak, but it&#8217;s quite effective.</p>
<p>Enjoy,<br />
Davide</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/12/16/wordpress-disable-moderation-for-a-single-comment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mass import users into WP</title>
		<link>http://davidebenini.it/2009/11/30/mass-import-users-into-wp/</link>
		<comments>http://davidebenini.it/2009/11/30/mass-import-users-into-wp/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 18:04:09 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress users import]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=522</guid>
		<description><![CDATA[How to import a huge number of users into Wordpress]]></description>
			<content:encoded><![CDATA[<p>I am working on a complex blog/e-commerce system together with my colleagues at @ntw. I had to import some 10.000 users into WP. The task was easier than expected. The basic idea is leveraging on the <code>wp_insert_user($userdata)</code> function, defined in <code>wp-includes/registration.php</code>. If you look at the source, you&#8217;ll see that <code>$userdata</code> is an array containing a number of keys:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #339933;">*</span> The <span style="color: #000088;">$userdata</span> <span style="color: #990000;">array</span> can contain the following fields<span style="color: #339933;">:</span>
	<span style="color: #339933;">*</span> <span style="color: #0000ff;">'ID'</span> <span style="color: #339933;">-</span> An integer that will be used <span style="color: #b1b100;">for</span> updating an existing user<span style="color: #339933;">.</span>
	<span style="color: #339933;">*</span> <span style="color: #0000ff;">'user_pass'</span> <span style="color: #339933;">-</span> A string that contains the plain text password <span style="color: #b1b100;">for</span> the user<span style="color: #339933;">.</span>
	<span style="color: #339933;">*</span> <span style="color: #0000ff;">'user_login'</span> <span style="color: #339933;">-</span> A string that contains the user<span style="color: #0000ff;">'s username for logging in.
	* '</span>user_nicename<span style="color: #0000ff;">' - A string that contains a nicer looking name for the user.
	*		The default is the user'</span>s username<span style="color: #339933;">.</span></pre></div></div>

<p>The other keys are <code>user_url</code>,<code>user_email</code>, <code>display_name</code>, <code>nickname</code>, <code>first_name</code>, <code>last_name</code>, <code>description</code>, <code>rich_editing</code>, <code>user_registered</code>, <code>role</code>, <code>jabber</code>, <code>aim</code>, <code>yim</code>; for more detal consult the source itself.</p>
<p>My script goes like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'wp-blog-header.php'</span><span style="color: #339933;">;</span> 
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'wp-includes/registration.php'</span><span style="color: #339933;">;</span>   
<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'wp-includes/pluggable.php'</span><span style="color: #339933;">;</span> 
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;memory_limit&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;1024M&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;max_execution_time&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;240&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;h1&gt;Importazione utenti EC&lt;/h1&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;host&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;user&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Unable to connect to MySQL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;database&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Unable to connect to the database&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM source_users ;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;strong&gt;ID:&lt;/strong&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;strong&gt;login:&lt;/strong&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_name</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;strong&gt;password:&lt;/strong&gt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;strong&gt;e-mail:&lt;/strong&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">email_address</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;strong&gt;name:&lt;/strong&gt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; &lt;strong&gt;surname:&lt;/strong&gt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">surname</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>  
		<span style="color: #666666; font-style: italic;">// Add the ID to trick WP</span>
		<span style="color: #000088;">$add_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">users</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; (id, user_login) VALUES (&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,'&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$row-&gt;user_name</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' ); &quot;</span><span style="color: #339933;">;</span>
		 <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$add_id</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_error</span><span style="color: #009900;">&#40;</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;">// Add the rest</span>
		<span style="color: #000088;">$userdata</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		 <span style="color: #0000ff;">'ID'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">id</span><span style="color: #339933;">,</span>  
		 <span style="color: #0000ff;">'user_login'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_name</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'user_pass'</span> <span style="color: #339933;">=&gt;</span> wp_hash_password<span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'user_nicename'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user_name</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'user_email'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">email_address</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'first_name'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'last_name'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$row</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">surname</span><span style="color: #339933;">,</span>
		 <span style="color: #0000ff;">'role'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'subscriber'</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                          
		wp_insert_user<span style="color: #009900;">&#40;</span><span style="color: #000088;">$userdata</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Some highlights:</p>
<ul>
<li>Import all the WP files you need </li>
<li>Change PHP memory and time limits if you have many records</li>
<li>Explicitly encrypt the password with <code>wp_hash_password</code>. I have no idea why this is necessary, the WP code should do this by itself; but trust me, it is.</li>
</ul>
<p>Since we are using the <code>wp_insert_user()</code> function, WP will crate records both in the users and in the usermeta tables.</p>
<p>A last warning. This huge amount of users could conflict with your php settings. To get WP working properly I had to add this line to <code>wp-config.php</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">	<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_MEMORY_LIMIT'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'64M'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Without it I could not get the users list in the admin session. I also <a href="http://core.trac.wordpress.org/ticket/11151">filed a bug</a>, but this last line should keep you on the safe side.<br />
Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/11/30/mass-import-users-into-wp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faking an IP with Webrat</title>
		<link>http://davidebenini.it/2009/08/29/faking-an-ip-with-webrat/</link>
		<comments>http://davidebenini.it/2009/08/29/faking-an-ip-with-webrat/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 10:42:37 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[remote_ip]]></category>
		<category><![CDATA[webrat]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=520</guid>
		<description><![CDATA[Lately I have been diving into TDD, and more specifically BDD, thanks to the wonderful Cucumber testing framework.
Today I have had to test a specifical IP based feature. Simply put, I get the user IP and store it into the database. 
The simple rails way to get a visitor IP address is
request.remote_ip

If you do this [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I have been diving into <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>, and more specifically <a href="http://en.wikipedia.org/wiki/Behavior_Driven_Development">BDD</a>, thanks to the wonderful <a href="http://en.wikipedia.org/wiki/Behavior_Driven_Development">Cucumber</a> testing framework.</p>
<p>Today I have had to test a specifical IP based feature. Simply put, I get the user IP and store it into the database. </p>
<p>The simple rails way to get a visitor IP address is</p>
<pre><code>request.remote_ip
</code></pre>
<p>If you do this while developing you&#8217;ll usually get a predictable</p>
<pre><code>127.0.0.1
</code></pre>
<p>How do I test that my controller puts a correct IP in the database?<br />
At first I thought about creating a mock request object. But this way I would be testing only the saving portion of the method, not the part detecting the IP. In other words, I needed to simulate an IP address at a lower layer.</p>
<p>Webrat to the rescue! Thanks to the nice folks at the webrat irc channel I got an answer. Simply:</p>
<pre><code>header('REMOTE_ADDR', ip_address)
</code></pre>
<p>The Webrat <code>header</code>method lets you set all the header variable of you session. Handy, isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/08/29/faking-an-ip-with-webrat/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Events Manager comments disabled</title>
		<link>http://davidebenini.it/2009/08/10/events-manager-comments-disabled/</link>
		<comments>http://davidebenini.it/2009/08/10/events-manager-comments-disabled/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 13:06:56 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Events Manager]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=515</guid>
		<description><![CDATA[Events Manager, Wordpress]]></description>
			<content:encoded><![CDATA[<p>Hi folks,<br />
just a quick note for warning that comments on EM are going to be disabled for a while.<br />
Why?<br />
Despite a disclaimer at the beginning of the post and a huge banner people is posting support problems as comments, instead that on the forum. I guess I should increase the banner size of make it flashy with JS.<br />
As soon as I have some time (not that sooinish) I&#8217;ll clean the thread and leave only relevant comments (pre-forum tweak suggestions and release announcements). And re-enable commenting.<br />
For now comments are closed. Use the forum, PLEASE!<br />
Davide</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/08/10/events-manager-comments-disabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Say hello to Marcus AKA netweblogic</title>
		<link>http://davidebenini.it/2009/08/06/say-hello-to-marcus-aka-netweblogic/</link>
		<comments>http://davidebenini.it/2009/08/06/say-hello-to-marcus-aka-netweblogic/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 15:21:09 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Events Manager]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[em]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=510</guid>
		<description><![CDATA[There's a new co-author for Events Manager]]></description>
			<content:encoded><![CDATA[<p>Great news for all ye Events Manager fans. Let us all say hello to Marcus Skyes that jumped on board, and is now co-authoring Events Manager.</p>
<p>Marcus contacted me a few weeks ago, sending a modded version of Events Manager. As soon as I gave it a try I realised that Marcus had done a wonderful job patching and integrating new features into EM. </p>
<p>Thanks to Marcus&#8217;s work now we have a number of frequently requested features:</p>
<ul>
<li>WP 2.8 support</li>
<li>Events Categories</li>
<li>WYSIWYG editor for events description (and you can add pictures too!)</li>
<li>multi-day events, kinda</li>
</ul>
<p>And much more.<sup>1</sup></p>
<p>Since Marcus is expanding the plugin for some of his gigs, I invited him to co-author Events Manager, and I am glad he accepted. </p>
<p>I just tagged EM 2.0rc2 with Marcus&#8217;s integration, hope you&#8217;ll enjoy it as much as I did.</p>
<p><a href="http://downloads.wordpress.org/plugin/events-manager.2.0rc2.zip">Download EM 2.0rc2<br />
</a></p>
<p>Davide</p>
<h4>Notes</h4>
<ol class="footnotes">
<li id="footnote_0_510" class="footnote">Since these features are not yet fully documented, I suggest you take a look at the change log in the readme for instructions.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/08/06/say-hello-to-marcus-aka-netweblogic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.3 + Ruby 1.8.7 + Gmail SMTP settings</title>
		<link>http://davidebenini.it/2009/06/25/rails-233-ruby-187-gmail-smtp-settings/</link>
		<comments>http://davidebenini.it/2009/06/25/rails-233-ruby-187-gmail-smtp-settings/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:11:45 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Technolalia]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[1.8.7]]></category>
		<category><![CDATA[2.3.2]]></category>
		<category><![CDATA[actionmailer]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=506</guid>
		<description><![CDATA[How to setup Rails to use you gmail smtp without installing any plugin]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not rocket science, but since I took a while to figure this out I thought I&#8217;d share:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">ActionMailer::Base</span>.<span style="color:#9900CC;">smtp_settings</span> = <span style="color:#006600; font-weight:bold;">&#123;</span>
  <span style="color:#ff3333; font-weight:bold;">:enable_starttls_auto</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>,
  <span style="color:#ff3333; font-weight:bold;">:address</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;smtp.gmail.com&quot;</span>,
  <span style="color:#ff3333; font-weight:bold;">:port</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">587</span>,
  <span style="color:#ff3333; font-weight:bold;">:domain</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;your-google-apps-domain&quot;</span>,
  <span style="color:#ff3333; font-weight:bold;">:authentication</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:plain</span>,
  <span style="color:#ff3333; font-weight:bold;">:user_name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;username&quot;</span>,
  <span style="color:#ff3333; font-weight:bold;">:password</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;password&quot;</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>The most important line is <code>enable_starttls_auto =&gt; true</code>.</p>
<p>Unlike pre 2.2 Rails, no plugin is required. Not sure this setup works with Rails 2.2 though, never tried it.</p>
<p>Via <a href="http://www.railsforum.com/viewtopic.php?id=28480">this forum discussion</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/06/25/rails-233-ruby-187-gmail-smtp-settings/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How I blueprint semantically</title>
		<link>http://davidebenini.it/2009/05/12/how-i-blueprint-semantically/</link>
		<comments>http://davidebenini.it/2009/05/12/how-i-blueprint-semantically/#comments</comments>
		<pubDate>Tue, 12 May 2009 14:29:53 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Technolalia]]></category>
		<category><![CDATA[advantages]]></category>
		<category><![CDATA[blueprint]]></category>
		<category><![CDATA[blueprintcss]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[disadvantages]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=415</guid>
		<description><![CDATA[Lately there&#8217;s been a lot of talk about CSS frameworks, their advantages and disadvantages, and why you should or should not use them. Myself, I was quite curious about the concept of a CSS framework, but frankly had no idea about what a CSS framework could be. Then I had to refactor an existing style-sheet [...]]]></description>
			<content:encoded><![CDATA[<p>Lately there&#8217;s been a lot of talk about CSS frameworks, their advantages and disadvantages, and why you should or should not use them. Myself, I was quite curious about the concept of a CSS framework, but frankly had no idea about what a CSS framework could be. Then I had to refactor an existing style-sheet based on blueprint CSS, and that&#8217;s how I learned how blueprint works.</p>
<p><a href="http://www.blueprintcss.org/">Blueprint</a> is probably the most widespread CSS framework out there; I ignore whether Josh Clayton, blueprint&#8217;s dad, was the first to think about CSS frameworks, but for certain blueprint was the first framework to get good coverage in the geek news.</p>
<p>Since I had to deal with it anyway, I said &#8220;Why shouldn&#8217;t I use this gig as an occasion to learn something new?&#8221; And I did indeed. Not sure the last line is graceful to the ear, but let&#8217;s roll on.</p>
<h3>How I blueprinted at first</h3>
<p>The style-sheet I was working on wasn&#8217;t exactly tidy. To tidy it up, I had to look into the infamous grid.css and try to understand what those weird &#8220;span-n&#8221; classes were doing. Luckily, all of blueprint source files [[I know what you're thinking, <code>source files</code>, what now, do I have to use gcc for a css style-sheet? Not quite, but we'll get there.]] are well commented and clear.</p>
<p>The basic concept is that your layout is divided i 24 columns. You can put div whose width is determined by the aforementioned <code>.span-n</code> class. Just remember:</p>
<ul>
<li>put all you columns in the <code>.container</code> class</li>
<li>to make sure you reach &#8220;24&#8243; as a sum</li>
<li>you include <code>.last</code> in the last column of each row.</li>
</ul>
<p>You know the headaches of creating a well-clearing three-columns layout? Here&#8217;s how you do that with blueprint:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class='container'&gt;
	&lt;div class='span-6'&gt;
		left column
	&lt;/div&gt;
	&lt;div class='span-12'&gt;
		center column
	&lt;/div&gt;
	&lt;div class='span-6 last'&gt;
		right column
	&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>And this is it; but not all of it. You can add <code>.prepend-n</code> classes to prepend empty column, and <code>.append-n</code>to append them. You also have other nifty classes for hr, vertical lines and so on. In addition, and maybe more importantly, blueprint gives good typography [[Ever heard about vertical rhythm?]] and a CSS reset to make sure your website is cross-browser compatible. And it&#8217;s free.<br />
So it is good, why shouldn&#8217;t I use it?</p>
<h3>Ehm, what about semantic mark-up?</h3>
<p>Exactly, that is the problem. Just when we managed to get rid of the tables and their meaningless cell classes, here comes a CSS framework which binds you to class names that are just referred to measures, not semantic at all. Also, someone with no awareness of the concept of semantic could (mis)use blueprint as a pseudo-table; <code>.span-n</code> could be seen as a regurgitation of the <code>colspan</code> attribute of <code>td</code> cells. And sure we don&#8217;t want that, do we?</p>
<h3>Luckily there&#8217;s more</h3>
<p>Earlier I mentioned the <code>source</code>files, and I am sure some of you startled and thought that they had to learn c to use blueprint. Luckily that&#8217;s not the case, although there&#8217;s some ruby behind blueprint&#8217;s magic. The stylesheet you are supposed to attach to your html files (<code>screen.css</code>,<code>print.css</code>,<code>ie.css</code>) originally result from the compilation of the source style-sheets (<code>grid.css</code>,<code>typography.css</code> ans so an, all in the <code>src</code> directory) according to certain criteria. You can choose to ignore all of this, or you can decide you want to be a good, semantic coder and become a blueprint superuser. You don&#8217;t have much of a choice, do you?</p>
<h3>Welcome settings.yml</h3>
<p><code>settings.yml</code> is your best friend. Really, it is. This nice guy allows you to customise any aspect of the blueprint stylesheet. You might want more or less columns, wider ones, or more space between them. josh has a <a href="http://www.jdclayton.com/blueprints_compress_a_walkthrough.html">nice page</a> illustrating how you can customise blueprint. </p>
<p>I have a settings.yml file in <code>~/developing/bluprint/lib</code>, containing all the settings for each single project I am working on.<br />
When I start a new blueprint-based project, I just add a new entry to this file.</p>
<p>What I want to stress is the importance of leaving the <code>span-n</code> class alone (unless occasionally and during wireframing) and use the <em>semantic classes</em>. These classes (or ids) are defined at the end of each project entry. What they do is associating a semantic name to a geometric blueprint class. Look at the entry corresponding to my current project:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">personalproject:
	path: ~<span style="color:#006600; font-weight:bold;">/</span>blahblah<span style="color:#006600; font-weight:bold;">/</span>personalproject<span style="color:#006600; font-weight:bold;">/</span>
	custom_css:
    	ie.<span style="color:#9900CC;">css</span>:
    		<span style="color:#006600; font-weight:bold;">-</span> custom<span style="color:#006600; font-weight:bold;">-</span>ie.<span style="color:#9900CC;">css</span>
    	screen.<span style="color:#9900CC;">css</span>:
    		<span style="color:#006600; font-weight:bold;">-</span> custom<span style="color:#006600; font-weight:bold;">-</span>screen.<span style="color:#9900CC;">css</span>
  	custom_layout:
    	column_count: <span style="color:#006666;">24</span>
    	column_width: <span style="color:#006666;">30</span>
    	gutter_width: <span style="color:#006666;">10</span>
  	semantic_classes:
    	<span style="color:#996600;">&quot;#featured&quot;</span>: <span style="color:#996600;">&quot;.span-15, div.span-15&quot;</span></pre></div></div>

<p>In the last section, <code>#featured</code> is defined as equivalent to <code>.span-15, div.span-15</code>. In this way my layout will contain this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id='featured'&gt;
	blah
&lt;/div&gt;</pre></div></div>

<p>instead of this</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class='span-15'&gt;
	blah
&lt;/div&gt;</pre></div></div>

<p>The difference is obvious.</p>
<p>And there&#8217;s more. Think about how easy it is to manage your layout this way. You don&#8217;t have to think about paddings and margins, you just think about columns, their number and their width. If I decide that I want to give a column more to my <code>#featured</code> article, I just alter a line in <code>settings.yml</code>: [[Of course you must also contract the following column, the sum must always be the same. ]]</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">	<span style="color:#996600;">&quot;#featured&quot;</span>: <span style="color:#996600;">&quot;.span-16, div.span-16&quot;</span></pre></div></div>

<p>and recompress through this terminal command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">	ruby compress.rb <span style="color: #660033;">-p</span> personalproject</pre></div></div>

<p>If you decide your whole website is too wide, just narrow the columns and recompile. And so on.<br />
Of course your workflow has to adjust a little, but the advantages in terms of flexibility are enormous.</p>
<h3>Blueprint is not a ghetto</h3>
<p>Blueprint is perfectly suited for building an entire layout, but if you decide this is not your piece of cake, there&#8217;s no problem at all. All you have to do is insert one or more <code>.container</code>s into you css layout. I generally prefer to use blueprint for the main textual area, and leave the header (and sometimes the footer) alone. This way I can use wider divs for the background, and avoid using empty columns at the sides.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;[...]&lt;/head&gt;
&lt;body&gt;
	&lt;div id='wrapper'&gt;
		&lt;!-- This div has a nice background with shadows ad stuff --&gt;
		&lt;!-- Here I often put my header --&gt;
		&lt;div class='container'&gt;
			&lt;!-- Here goes the blueprint stuff --&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<h3>How I blueprint now</h3>
<p>Remember that first super-fast layout? Now we can remake it semantically. We just have to play a bit with <code>settings.yml</code> and <code>compress.rb</code>. </p>
<p>Here&#8217;s our <code>settings.yml</code></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">semanticlayout:
	path: ~<span style="color:#006600; font-weight:bold;">/</span>blahblah<span style="color:#006600; font-weight:bold;">/</span>semanticlayout<span style="color:#006600; font-weight:bold;">/</span>
	custom_css:
  		ie.<span style="color:#9900CC;">css</span>:
   			<span style="color:#006600; font-weight:bold;">-</span> custom<span style="color:#006600; font-weight:bold;">-</span>ie.<span style="color:#9900CC;">css</span>
   		screen.<span style="color:#9900CC;">css</span>:
   			<span style="color:#006600; font-weight:bold;">-</span> custom<span style="color:#006600; font-weight:bold;">-</span>screen.<span style="color:#9900CC;">css</span>
	custom_layout:
  		column_count: <span style="color:#006666;">24</span>
   		column_width: <span style="color:#006666;">30</span>
   		gutter_width: <span style="color:#006666;">10</span>
	semantic_classes:
   		<span style="color:#996600;">&quot;#left-sidebar&quot;</span>: <span style="color:#996600;">&quot;.span-6, div.span-6&quot;</span>
   		<span style="color:#996600;">&quot;#content&quot;</span>: <span style="color:#996600;">&quot;.span-12, div.span-12&quot;</span>
   		<span style="color:#996600;">&quot;#right-sidebar&quot;</span>: <span style="color:#996600;">&quot;.span-6, div.span-6, .last&quot;</span></pre></div></div>

<p>And here&#8217;s a clear-as-crystal layout:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class='container'&gt;
	&lt;div id='left-sidebar'&gt;
		left column
	&lt;/div&gt;
	&lt;div id='content'&gt;
		center column
	&lt;/div&gt;
	&lt;div class='right-sidebar'&gt;
		right column
	&lt;/div&gt;
&lt;/div&gt;</pre></div></div>

<p>Ain&#8217;t it nice? Fast, reliable, typographical <em>and</em> semantic.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/05/12/how-i-blueprint-semantically/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Capo for Mac Os X</title>
		<link>http://davidebenini.it/2009/04/21/capo-for-mac-os-x/</link>
		<comments>http://davidebenini.it/2009/04/21/capo-for-mac-os-x/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 10:56:17 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[capo]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[slowdowner]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=408</guid>
		<description><![CDATA[I don&#8217;t think I&#8217;ve ever recommended any software here, but this little gem is too good not to be shared.
If you play music and have a Mac you must get Capo by Chris Liscio of SuperMegaUltraGroovy.

Capo is the slow downer I had been waiting for for years. You might know that there&#8217;s another one, supposed [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t think I&#8217;ve ever recommended any software here, but this little gem is too good not to be shared.</p>
<p>If you play music and have a Mac you <em>must</em> get <a href="http://capoapp.com/">Capo</a> by Chris Liscio of <a href="http://www.supermegaultragroovy.com/">SuperMegaUltraGroovy</a>.</p>
<div style="text-align:center;"><img src="http://davidebenini.it/wp-content/uploads/2009/04/bonny-kate-jennie-s-chicken-reels-1.png" alt="Bonny Kate_Jennie_s chicken (reels)-1.png" border="0" width="455" height="274" /></div>
<p>Capo is the slow downer I had been waiting for for years. You might know that there&#8217;s another one, supposed to be amazing, but trust me, the amazement is all in Capo.</p>
<p>You import tunes simply by dragging them over the icon or Capo windows, you adjust the rate and pitch, and you&#8217;re done. If you&#8217;re obsessive-compulsive about hearing the exact not you can drop markers on the timeline, they&#8217;lll get saved with the capo document.</p>
<p>Capo is not available yet, but you can sign in for a sneak peek <a href="http://capoapp.com/">here</a>; moreover, the beta is very stable, and I guess that app will be released in a matter of days.</p>
<p>By the way, Andy McGann is also amazing.</p>
<p>Davide</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/04/21/capo-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing the Events Manager support forum</title>
		<link>http://davidebenini.it/2009/03/30/introducing-the-events-manager-support-forum/</link>
		<comments>http://davidebenini.it/2009/03/30/introducing-the-events-manager-support-forum/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 13:24:43 +0000</pubDate>
		<dc:creator>Davide</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Events Manager]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://davidebenini.it/?p=401</guid>
		<description><![CDATA[The Events Manager Support Forum is open!]]></description>
			<content:encoded><![CDATA[<p>Hey folks,<br />
just a quick note to announce the opening of the official <a href="http://davidebenini.it/events-manager-forum">Events Manager Support Forum</a>. </p>
<div style="text-align:center;"><img src="http://davidebenini.it/wp-content/uploads/2009/03/events-manager-support.png" alt="Events Manager Support.png" border="0" width="380" height="241" /></div>
<p>If you have any question about Events Manager 2.0, after checking out the <a href="http://davidebenini.it/wordpress-plugins/events-manager/">docs</a>, please register on the forum and post your questions there.</p>
<div style="text-align:center;"><img src="http://davidebenini.it/wp-content/uploads/2009/03/events-manager-support-2.png" alt="Events Manager Support 2.png" border="0" width="388" height="122" /></div>
<p>As you see there are 3 areas so far, bugs, how-to and feature requests. Enjoy!<br />
Davide</p>
]]></content:encoded>
			<wfw:commentRss>http://davidebenini.it/2009/03/30/introducing-the-events-manager-support-forum/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 2.819 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-09 16:07:15 -->
