<?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>Bonuel Photography &#187; Web Development</title>
	<atom:link href="http://www.bonuel.ca/blog/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bonuel.ca</link>
	<description>Sports &#38; Travel Photography</description>
	<lastBuildDate>Mon, 23 Jan 2012 17:19:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A more useful 404 for&#160;wordpress</title>
		<link>http://www.bonuel.ca/blog/2009/01/05/a-more-useful-404-for-wordpress/</link>
		<comments>http://www.bonuel.ca/blog/2009/01/05/a-more-useful-404-for-wordpress/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 06:46:57 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[a list apart]]></category>
		<category><![CDATA[ala]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/?p=457</guid>
		<description><![CDATA[I stumbled upon a great article by Dean Frickey, entitled A More Useful 404, which discusses the need for blogs (and other pages) to have a more elaborated 404 page. I couldn&#8217;t agree more with the fact that most website out there offer very slim possibilities to their users to find what they were looking [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon a great article by Dean Frickey, entitled <a  href="http://www.alistapart.com/articles/amoreuseful404">A More Useful 404</a>, which discusses the need for blogs (and other pages) to have a more elaborated 404 page. I couldn&#8217;t agree more with the fact that most website out there offer very slim possibilities to their users to find what they were looking for on your site. I immediately thought that it would be a great little plugin to add to the ever increasing collection of <a  href="http://wordpress.org/extend/plugins/">wordpress plugins</a> out there (about 3758 as I write this). To my surprise, and delight, someone had already written a plugin for it, creatively called <a  href="http://skullbit.com/wordpress-plugin/useful-404s/">Useful 404</a> (Also found on <a  href="http://wordpress.org/extend/plugins/useful-404s/">wordpress&#8217;s download site</a>). I was happy to find that this plugin works great on wordpress 2.7, which is fabulous by the way. </p>
<p>Unfortunately, I may have to tweak the plugin a little bit since it is missing what is, in my opinion, the most important feature of a customized 404 page, which is to offer the user a list of possible candidates that actually exist on your site. This feature is apparently already available in another 404 plugin called <a  href="http://michael.tyson.id.au/wordpress/plugins/smart-404/">Smart 404</a> (Also on <a  href="http://wordpress.org/extend/plugins/smart-404/">wordpress&#8217;s download site</a>), but this one doesn&#8217;t seem to function on WordPress 2.7 yet. Anyways, I highly recommend the plugin <a  href="http://skullbit.com/wordpress-plugin/useful-404s/">Useful 404</a> for now. Simple to install and does the job very nicely for now. Any other 404 plugins out there?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2009/01/05/a-more-useful-404-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Auto margin shifts my page content to the&#160;left</title>
		<link>http://www.bonuel.ca/blog/2008/11/09/auto-margin-shifts-my-page-content-to-the-left/</link>
		<comments>http://www.bonuel.ca/blog/2008/11/09/auto-margin-shifts-my-page-content-to-the-left/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 20:06:24 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[margin]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/?p=347</guid>
		<description><![CDATA[I found myself wasting about 2 hours of my time trying to understand why only one of my pages moved about 16px to the left when switching back and forth between the different page. My problem is that I was using a template and that everything on the two pages were exactly the same. Here [...]]]></description>
			<content:encoded><![CDATA[<p>I found myself wasting about 2 hours of my time trying to understand why only one of my pages moved about 16px to the left when switching back and forth between the different page. My problem is that I was using a template and that everything on the two pages were exactly the same. <a  href="http://www.bonuel.ca/tests/wiggling/shortpage.html">Here is an example of what I mean</a>. </p>
<p>Using the famous divide-and-conquer problem solving method (ha ha!), I started to remove some text to find out the culprit paragraph, and realized that the problem was only present when I had a lot of content on the page. After a few google searches, I found a thread on sitepoint&#8217;s site that explains exactly my problem (titled: <a  href="http://www.sitepoint.com/forums/showthread.php?t=577754">Web Page Wiggle Issue</a> and <a  href="http://www.sitepoint.com/forums/showthread.php?p=4003699">Margin Auto Wiggles &#038; The Vertical Scrollbar</a>). The problem lies in the use of &#8220;auto&#8221; for centering pages, much like in the very popular &#8220;body {margin: 0 auto; width: 960px;}&#8221;. This causes the page to wiggle (move to the left) between pages where the vertical scrollbar is needed (longer content) and where it doesn&#8217;t appear (firefox adds the scrollbar as needed, whereas IE always keeps it!). From the website, I found two fixes for the problem:</p>
<p>You can easily fix this, using CSS, by adding this one line in your stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">html <span style="color: #00AA00;">&#123;</span>overflow-y<span style="color: #00AA00;">:</span> <span style="color: #993333;">scroll</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Another fix, if you are using JQuery, is the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;div/&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
        position<span style="color: #339933;">:</span> <span style="color: #3366CC;">'absolute'</span><span style="color: #339933;">,</span>
        top<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
        width<span style="color: #339933;">:</span> <span style="color: #3366CC;">'1px'</span><span style="color: #339933;">,</span>
        height<span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'px'</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'body'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2008/11/09/auto-margin-shifts-my-page-content-to-the-left/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading WordPress from 2.3.3 to&#160;2.6</title>
		<link>http://www.bonuel.ca/blog/2008/10/22/upgrading-wordpress-from-233-to-26/</link>
		<comments>http://www.bonuel.ca/blog/2008/10/22/upgrading-wordpress-from-233-to-26/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 01:31:01 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/?p=303</guid>
		<description><![CDATA[I reluctantly upgraded my WordPress installation yesterday night. I say reluctantly because, for some reason, even after having upgraded from 2.2 to 2.3.3 a while back, i thought that this was going to be a long and painful process. I once again was able to upgrade my whole installation, including backup of all my files, [...]]]></description>
			<content:encoded><![CDATA[<p>I reluctantly upgraded my <a  href="http://wordpress.org/">WordPress</a> installation yesterday night. I say reluctantly because, for some reason, even after <a  href="http://www.bonuel.ca/blog/2008/03/03/wordpress-upgrade-from-22-to-233/">having upgraded from 2.2 to 2.3.3 a while back</a>, i thought that this was going to be a long and painful process. I once again was able to upgrade my whole installation, including backup of all my files, in less than 30 minutes. I followed the great <a  href="http://codex.wordpress.org/Upgrading_WordPress">Three Step Upgrade</a> from the wordpress folks! I will not wait as long as I just did before upgrading next time. The design of the 2.6 version is awesome and was definitively worth the 30 minutes spent on the upgrade. I can&#8217;t wait for great new things that <a  href="http://wordpress.org/development/2008/10/the-new-27-dashboard/">the next version promises</a>. Good work wordpress!</p>
<p>What are you waiting for? Go <a  href="http://wordpress.org/download/">get the latest version</a> and get blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2008/10/22/upgrading-wordpress-from-233-to-26/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress upgrade from 2.2 to&#160;2.3.3</title>
		<link>http://www.bonuel.ca/blog/2008/03/03/wordpress-upgrade-from-22-to-233/</link>
		<comments>http://www.bonuel.ca/blog/2008/03/03/wordpress-upgrade-from-22-to-233/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 03:53:58 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[k2]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2008/03/03/wordpress-upgrade-from-22-to-233/</guid>
		<description><![CDATA[I&#8217;ve been very reluctant to upgrade WordPress because of the dreadful “backup” that needed to be done in advance. My problem was not that I didn&#8217;t know how to backup my databases, but more that I am just simply too lazy to undertake the task. Well, also the fact that they mention it just scares [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been very reluctant to upgrade WordPress because of the dreadful “<q>backup</q>” that needed to be done in advance. My problem was not that I didn&#8217;t know how to backup my databases, but more that I am just simply too lazy to undertake the task. Well, also the fact that they mention it just scares me and makes me think that I may have to re-install lots and lots of things.</p>
<p>If you a little like me and you&#8217;re scared to try to upgrade your wordpress engine&#8230; well, fear no more! I did it in about 30 minutes, following wordpress&#8217;s <a  href="http://codex.wordpress.org/Upgrading_WordPress">superb three step process</a>, and this including the upgrade of a handful of plugins (about 10 of them). Yes, among other things, WordPress 2.3.3 will tell you when a plugin is out-of-date and which, to my surprise, helped me realize that most of my plugins were due for a tune up.</p>
<p>The nicest thing about this upgrade is that my site is now using a <a  href="http://codex.wordpress.org/Version_2.3">much more secure, powerful, and faster</a> blogging engine. It also fixes some glitches with my new template K2 which were really annoying me. The problem was that when I was browsing categories, I would get the following error:</p>
<blockquote><p><strong> WordPress database error: </strong>[You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]<br />
<strong>SELECT wp_posts.post_date_gmt FROM</strong></p></blockquote>
<p>That was because the fine folks behind the latest K2 template were using the new mySQL database structure that WordPress introduced in their version 2.3.</p>
<p>I am usually reluctant to install a new version because of all the little bugs that tend to come out. I specifically waited a little while before installing, but now that I know that it takes about 30 minutes to upgrade, I don&#8217;t think I&#8217;ll wait as long next time. I highly recommend moving to 2.3.3!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2008/03/03/wordpress-upgrade-from-22-to-233/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Askimet&#160;is&#160;amazing</title>
		<link>http://www.bonuel.ca/blog/2007/03/31/askimet-is-amazing/</link>
		<comments>http://www.bonuel.ca/blog/2007/03/31/askimet-is-amazing/#comments</comments>
		<pubDate>Sat, 31 Mar 2007 07:38:13 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[askimet]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2007/03/31/askimet-is-amazing/</guid>
		<description><![CDATA[I&#8217;ve been bombarded by spam comments on my website lately. About 150 a day I&#8217;d say. I got tired and decided to do something about it. I knew that there was a tool out there that did the work for me. It took me a minute to find it using my favourite search engine and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been bombarded by spam comments on my website lately. About 150 a day I&#8217;d say. I got tired and decided to do something about it. I knew that there was a tool out there that did the work for me. It took me a minute to find it using my favourite <a  href="http://www.google.ca">search engine</a> and installed it. The spam comment problem was so bad that while I installed it, I got about four or five spam comments in my mailbox&#8230; Well, today <a  href="http://akismet.com/">Askimet</a> stopped 160 spam comments&#8230; I can&#8217;t believe it. This is so amazing, I&#8217;m loving it.</p>
<p>I&#8217;ll write more very soon. I am working on a personal project for the wedding and it&#8217;s been taking a LOT of my time. Anyways. Right now, I need to crash.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2007/03/31/askimet-is-amazing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALA: Long Live the&#160;Q Tag</title>
		<link>http://www.bonuel.ca/blog/2006/10/07/ala-long-live-the-q-tag/</link>
		<comments>http://www.bonuel.ca/blog/2006/10/07/ala-long-live-the-q-tag/#comments</comments>
		<pubDate>Sat, 07 Oct 2006 05:33:45 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[a list apart]]></category>
		<category><![CDATA[ala]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2006/10/07/ala-long-live-the-q-tag/</guid>
		<description><![CDATA[I must redirect anybody interested in learning more on how to render the Q tag correctly for IE/Win users to the new A List Apart article by Stacey Cordoni. Unfortunately, IE/Win does not yet support the Q tag and is making hard for developers, who wants to keep their web site accessible to screen readers, [...]]]></description>
			<content:encoded><![CDATA[<p>I must redirect anybody interested in learning more on how to render the Q tag correctly for IE/Win users to the new <a  href="http://www.alistapart.com/articles/qtag" title="Article at A List Apart about the Q tag">A List Apart article</a> by <a  href="http://www.utopiadesigns.ca/" title="Official website of Stacey Cordoni's company">Stacey Cordoni</a>. Unfortunately, IE/Win does not yet support the Q tag and is making hard for developers, who wants to keep their web site accessible to screen readers, to use it. As usual, the article is precise, concise, and very interesting. So yes, “<q>Long Live the Q Tag</q>”!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2006/10/07/ala-long-live-the-q-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome IE7: My&#160;first&#160;customer.</title>
		<link>http://www.bonuel.ca/blog/2006/10/06/welcome-ie7-my-first-customer/</link>
		<comments>http://www.bonuel.ca/blog/2006/10/06/welcome-ie7-my-first-customer/#comments</comments>
		<pubDate>Fri, 06 Oct 2006 07:01:23 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2006/10/06/welcome-ie7-my-first-customer/</guid>
		<description><![CDATA[Hey! You there. With the sup&#8217;d up browser. Yes, yes. The IE7. Welcome to my humble website. I hope the website is looking super for you. Well. That&#8217;s it for now. I&#8217;ll be monitoring you though&#8230; hope you come back! Oh, and don&#8217;t be shy to let us know if anything looks baaaadd around here. [...]]]></description>
			<content:encoded><![CDATA[<p>Hey! You there. With the sup&#8217;d up browser. Yes, yes. The IE7. Welcome to my humble website. I hope the website is looking super for you. Well. That&#8217;s it for now. I&#8217;ll be monitoring you though&#8230; hope you come back! Oh, and don&#8217;t be shy to let us know if anything looks baaaadd around here.</p>
<p><img src="http://www.mcb.mcgill.ca/%7Ejette/wordpress/wp-content/uploads/2006/10/analytics.gif" class="noborder" id="image197" alt="Google Analytics showing my first IE7 customer" height="193" width="450" /></p>
<p>In all seriousness though. I am glad to see that there are some people running IE7 already out there. I mean, I know the RC has been out for a while, it&#8217;s been out since <a  href="http://blogs.msdn.com/ie/archive/2006/08/24/715752.aspx" title="Post on the IE Blog about the release of the Release Candidate of Internet Explorer 7">August 24 2006</a>, but this means we should be getting feedback from the users very soon. I&#8217;m excited to know how much ground they have covered with this release. The sure have been working real hard on their <a  href="http://blogs.msdn.com/ie/archive/2006/08/22/712830.aspx" title="Post on the IE Blog mentioning all of the changes in their CSS support that they made in IE7">CSS support</a>, the CSS 2.1 specs that is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2006/10/06/welcome-ie7-my-first-customer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Today&#8217;s&#160;Wallpaper:&#160;HicksDesign</title>
		<link>http://www.bonuel.ca/blog/2006/10/05/todays-wallpaper-hicksdesign/</link>
		<comments>http://www.bonuel.ca/blog/2006/10/05/todays-wallpaper-hicksdesign/#comments</comments>
		<pubDate>Thu, 05 Oct 2006 23:20:34 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[hick]]></category>
		<category><![CDATA[hickdesign]]></category>
		<category><![CDATA[wallpaper]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2006/10/05/todays-wallpaper-hicksdesign/</guid>
		<description><![CDATA[There is a bit of a story behind this wallpaper. I found it through a post by Veerle entitled Design is Just Owning a Clip Art Gallery. I found it funny and saw that it was inspired by HicksDesign&#8217;s brilliant wallpaper shown above. Please, visit his website to download the proper wallpaper as I have [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.hicksdesign.co.uk/journal/design-is-just-making-things-line-up" title="Design is Just Making Things Line Up, HicksDesign"><img src="http://www.bonuel.ca/blog/wp-content/uploads/2006/10/liningup.jpg" alt="HicksDesign: Design is just making things line up" title="HicksDesign: Design is just making things line up" width="600" height="370" class="aligncenter size-full wp-image-862" /></a></p>
<p>There is a bit of a story behind this wallpaper. I found it through a post by Veerle entitled <a  href="http://veerle.duoh.com/blog/comments/design_is_just_owning_a_clip_art_gallery/" title="A wallpaper by Veerle inspired by the one of HicksDesign">Design is Just Owning a Clip Art Gallery</a>. I found it funny and saw that it was inspired by HicksDesign&#8217;s <a  href="http://www.hicksdesign.co.uk/journal/design-is-just-making-things-line-up" title="A very cool wallpaper by HicksDesign">brilliant wallpaper</a> shown above. Please, visit his website to download the proper wallpaper as I have resized it here to look better on the website. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2006/10/05/todays-wallpaper-hicksdesign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Number of days left&#160;until&#160;07.07.07</title>
		<link>http://www.bonuel.ca/blog/2006/10/01/number-of-days-until-070707/</link>
		<comments>http://www.bonuel.ca/blog/2006/10/01/number-of-days-until-070707/#comments</comments>
		<pubDate>Sun, 01 Oct 2006 21:55:01 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2006/10/01/number-of-days-until-070707/</guid>
		<description><![CDATA[According to my google analytics account, the most popular google search that brings people to my website is &#8220;days left until 07.07.07&#8220;. I found this interesting and also quite funny since I only put this information in our wedding section to inform people of the time left before my wedding. Regardless, I thought I could [...]]]></description>
			<content:encoded><![CDATA[<p>According to my google analytics account, the most popular google search that brings people to my website is &#8220;<em>days left until 07.07.07</em>&#8220;. I found this interesting and also quite funny since I only put this information in our <a  href="http://www.mcb.mcgill.ca/~jette/wordpress/wedding/">wedding section</a> to inform people of the time left before my wedding. Regardless, I thought I could share the script I wrote/edited in order to find the famous countdown.</p>
<p>Of course, there are many other ways to implement this. For example, I could use javascript to update the time every minutes (or seconds) without reloading the page, however I chose a server-side language so that the outcome is independent of the viewer&#8217;s setting (Javascript on/off).</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: #000000; font-weight: bold;">function</span> countdown<span style="color: #009900;">&#40;</span><span style="color: #000088;">$yr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$min</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #666666; font-style: italic;">// make a unix timestamp for the given date</span>
 <span style="color: #000088;">$countdown</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$hr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$min</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$month</span><span style="color: #339933;">,</span> <span style="color: #000088;">$day</span><span style="color: #339933;">,</span> <span style="color: #000088;">$yr</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// get current unix timestamp</span>
 <span style="color: #000088;">$today</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// get the number of minutes between the times</span>
 <span style="color: #000088;">$diff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$countdown</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$today</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// Make sure the date is not passed already</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$diff</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #666666; font-style: italic;">// Number of Days left</span>
 <span style="color: #000088;">$days</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$difference</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">// Number of Hours left</span>
 <span style="color: #000088;">$hours</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$days</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #666666; font-style: italic;">// Number of Minutes left</span>
 <span style="color: #000088;">$mins</span> <span style="color: #339933;">=</span> <span style="color: #990000;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$diff</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$days</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">86400</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$hours</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">3600</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$days</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; days &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$hours</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; hours &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$mins</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; minutes&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>To use the function, you simply call it using </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> countdown<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2007</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">14</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2006/10/01/number-of-days-until-070707/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALA&#160;Sandbags:&#160;Revisited</title>
		<link>http://www.bonuel.ca/blog/2006/09/12/sandbags-3/</link>
		<comments>http://www.bonuel.ca/blog/2006/09/12/sandbags-3/#comments</comments>
		<pubDate>Wed, 13 Sep 2006 00:36:13 +0000</pubDate>
		<dc:creator>Miguel</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[a list apart]]></category>
		<category><![CDATA[ala]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bonuel.ca/blog/2006/09/12/sandbags/</guid>
		<description><![CDATA[The picture used in this example is A List Apart&#8217;s own picture and is used on this blog to show how to create the effect originally posted on ALA. I recently bought Designing with Web Standards by Jeffrey Zeldman, which I mentioned in an earlier post, and do not stop learning. It is one of [...]]]></description>
			<content:encoded><![CDATA[<p class="updated">The picture used in this example is A List Apart&#8217;s own picture and is used on this blog to show how to create the effect originally posted on ALA.</p>
<div style="position: absolute; background-image: url('http://www.mcb.mcgill.ca/%7Ejette/wordpress/wp-content/uploads/2006/09/sandbags.gif') ; background-position: -30px -60px;top: 70px; right: -60px; background-repeat: no-repeat; width:270px; height:241px;"><span></span></div>
<div style="z-index: 10; padding-top: 0px; maring-top: 0px;">
<div style="relative; padding: 0px; margin: 0px; width: 127px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 169px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 181px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 183px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 185px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 188px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 199px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 214px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 231px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 270px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 261px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 0px; height:20px; float:right; clear:right;"><span></span></div>
<div style="relative; padding: 0px; margin: 0px; width: 0px; height:20px; float:right; clear:right;"><span></span></div>
</div>
<p>I recently bought <a  href="http://www.amazon.com/exec/obidos/ASIN/0321385551/migujettv40an-20?tag=migujettv40an-20">Designing with Web Standards</a> by Jeffrey Zeldman, which I mentioned in an <a  href="http://www.mcb.mcgill.ca/~jette/wordpress/2006/08/26/shopping-at-chapters/">earlier post</a>, and do not stop learning. It is one of the best purchases I have made in a long time. Whenever I take the time to sit down and read a chapter (or two for that matter), I just can&#8217;t stop. So, I recently decided to subscribe to the RSS feed of <a  href="http://www.alistapart.com">A List Apart</a> to get my fix of web standard compliant advices and tricks to add to my webpage. Last week, I was delighted to find a post on how to create a wrap around text effect, like the one in this post, which I had previously observed in action on <a  href="http://www.mikeindustries.com/blog/archive/2005/11/newsvine-next-steps">Mike Davidson&#8217;s site</a>.</p>
<p>I presume that Mike [Davidson] had computed the &#8220;sandbags&#8221; by hand, which would be fine, I guess, if you only have to do it once or twice a month, but could end up being a very long process. However, the article in question: <a  href="http://www.alistapart.com/articles/sandbags">&#8220;Sliced and Diced Sandbags&#8221;</a>, promised to automate the process using a little php script, written by the author himself, Rob Swan.  Automate the process it did. And very well I might add. It is based on the transparency values stored in png files, but let&#8217;s not get into the details. Explaining the nuts and bolts of his script is not the point to my story today.</p>
<p><span id="more-153"></span></p>
<h5>Installing the Script</h5>
<p>So I sat down and read the whole tutorial, in the hope of being able to use the newly acquired knowledge on my webpage. The first step was to copy and paste the script &#8220;as is&#8221; and to try it on my machine first. Perfect! It worked perfectly. I have to admit that the whole background-image idea in each &#8216;div&#8217; made it look a little too ugly for me, and reminded me of how Mike [Davidson] did it in his <a  href="http://www.mikeindustries.com/blog/archive/2005/11/newsvine-next-steps">original post</a>.</p>
<h5>The New Script</h5>
<p>So I decided to update the script to fit this &#8220;new&#8221; idea from Mike. It turns out it produces much simpler division blocks (divs) and is quite a bit smaller in size. Here is a snippet of the things I have changed from the original script (I obviously had to make it fit the box here and so it looks funny):</p>
<pre>
echo '&lt;div style="position: absolute;
  background-image: url(' . $imageName . ');
  background-position: -30px -60px;top: 10px;
  right: -60px; no-repeat; width:' . $width .'px;
  height:' . $height . 'px;"&gt;&lt;span&gt;
  &lt;/span&gt;&lt;/div&gt;';

echo '&lt;div style="z-index: 10; padding-top: 0px;"&gt;';

foreach ($sandbag as $position => $blankPixels) {

  $sandbagWidth = $width-$blankPixels;
  $yPos = $position*$sandbagHeight;

  echo '&lt;div style="relative; padding: 0px;
    margin: 0px; width: ' . $sandbagWidth . 'px;
    height:' . $sandbagHeight . 'px; float:' . $align
    . '; clear:' . $align . ';"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;';

}

echo '&lt;/div&gt;';
</pre>
<h5>Conclusion</h5>
<p>My two main problems with the script at the moment is that I can not find a way to include both inline css style and external css style, and the choice of putting the background image at -30px and -60px is completely ad hoc (and style dependent!). For the first problem, it seems like the browser totally disregards what is in the external css file when there is an inline style specified. I know that the inline style should have precedence on the external style, but does it take over completely ? Isn&#8217;t there a way around this ? As for the second problem, I do not expect a way around this, and plus, what&#8217;s a little ad hoc work when you have the sandbags automatically created for you ?</p>
<h5>References</h5>
<ul>
<li>A List Apart&#8217;s article by Rob Swan: <a  href="http://www.alistapart.com/articles/sandbags">Sliced and Diced Sandbags</a></li>
<li>Mike Davidson&#8217;s original post: <a  href="http://www.mikeindustries.com/blog/archive/2005/11/newsvine-next-steps">Newsvine: Next Steps</a>.</li>
<li>Great little tutorial: <a  href="http://www.axialis.com/tutorials/tutorial-misc001.html">Creating a PNG file using Photoshop</a></li>
</ul>
<p class="footnote">Get the complete script <a  href="http://www.mcb.mcgill.ca/~jette/shared/sandbags.php.txt">here</a>. And please, make sure you also give credit to Rob Swan hard work for creating the original version of the script.</p>
<p>I have to give props to Heather for noticing the error on the non-transparent image for Internet Explorer and the non-wrapping wrapping text for IE. It is now fixed and should not be a problem anymore. Please, let me know if you see anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonuel.ca/blog/2006/09/12/sandbags-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

