<?xml version="1.0" encoding="ISO-8859-1"?><rss version="2.0"><channel><title>brauck[punt]nl</title><description>brauck[punt]nl</description><link>http://www.brauck.nl/</link><copyright>Copyright brauck[punt]nl</copyright><generator>sNews</generator><item><title>Dutch Language file for sNewsMU 1.6</title><description><![CDATA[<p>With the help of Frederic Cloquell (bramsyuur) and Kre&#353;imir Mihelec (Mika) Bob Baker made a Multi User MOD for sNews 1.6. I have been playing with multi user version of sNews the last couple of days, and as far as I can see it works gracefully. Many thanks to these guys for this terrific adjustment of sNews. (Visit their websites, you&#39;ll find them at the left).</p>
<p>To give my 2p to this project I made a Dutch language file, so Dutch developers can use this nice piece of work (sNewsMU I mean of course) right away. You can download the file <a href="http://www.brauck.nl/php/download.php?id=19" title="Download snews_NLMU here!">here</a>.</p>]]></description><pubDate>Wed, 22 Aug 2007 17:05:59 +0000</pubDate><link>http://www.brauck.nl/snews/dutch-language-file-for-snewsmu-16/</link><guid>http://www.brauck.nl/snews/dutch-language-file-for-snewsmu-16/</guid></item><item><title>Compressing your CSS Stylesheet</title><description><![CDATA[<p>Whether I am coding PHP, Javascript or CSS, I always force myself to comment the code for later reference. The drawback of this is that your files will grow in weight and that can, in case of JS- and CSS-files, cost you some extra bandwidth and download time.</p>
<p>Now there are tools to compress your script files and stylesheets, but the problem is maintenance. Especially when you develop locally, as I do, every time when you modify your stylesheet for instance you have to run this tool to compress your file before you upload it to your live server.  That didn&#39;t work for me, so I just upload the file as it is including all the comments. Until I ran into an article of Nicholas Gagne on <a href="http://www.ibloomstudios.com/articles/PHP_CSS_Compressor/" title="website ibloomstudios (new window)" rel="external">ibloomstudios.com</a><img src="img/new_window.gif" alt="" />.</p>
<p>In this article he comes up with a neat solution for this problem. A few lines of PHP code including in your css stylesheet will automatically handle the compression.</p>
<p>This is how it works:</p>
<ul>
<li>The user&#39;s browser requests the stylesheet as usual</li>
<li>The server compresses the stylesheet using PHP</li>
<li>The stylesheet is outputted to the browser</li>
</ul>
<div class="codeblock">
<h3>First, add this code to the very <em>top</em> of your css stylesheet:</h3>
<code>
&#60;?php<br />
header('Content-type: text/css');<br />
ob_start("compress");<br />
function compress($buffer) {<br />
&#160;&#160;// remove comments<br />
&#160;&#160;$buffer = preg_replace('!/***+(**+)*/!', '', $buffer);<br />
&#160;&#160;// remove tabs, spaces, newlines, etc.<br />
&#160;&#160;$buffer = str_replace(array("rn", "r", "n", "t", '  ', '    ', '    '), '', $buffer);<br />
&#160;&#160;return $buffer;<br />
}<br />
?&#62;<br />
</code>
</div>
<p>The first line let&#39;s the browser know that this is a CSS stylesheet. Next, it starts the overflow buffer collection for later processing with the &#34;compress&#34; function. The compress function is used to remove all comments and spacing. Finally, the compressed CSS is sent to the browser.</p>
<div class="codeblock">
<h3>Next, add this code to the very <em>bottom</em> of your CSS stylesheet:</h3>
<code>&#60;?php ob_end_flush();?&#62;</code>
</div>
<p>Basically, this tells PHP to stop collecting output, and to run the previously specified "compress" function. After that, the compressed CSS stylesheet is sent to the browser.</p>
<p>To make it all work, you have to tell the server to parse the PHP code in your stylesheet. To do so put a .htaccess file in the directory where you keep your stylesheet with the following lines</p>
<div class="codeblock">
<h3>assuming your stylesheet is called &#8217;style.css&#8217;:</h3>
<code>
&#60;Files style.css&#62;<br />
&#160;SetHandler  application/x-httpd-php<br />
&#60;/Files&#62;<br />
</code></div>
<p>All of this happens without the user ever realizing it. Best of all, it doesn&#39;t change your CSS stylesheet, allowing you to easily maintain and update it. Isn&#39;t that nice?</p>
<p>If you want, you can download the code <a href="http://www.brauck.nl/php/download.php?id=18" title="Download CSS Compressor">here</a>.</p>]]></description><pubDate>Wed, 21 Feb 2007 23:39:45 +0000</pubDate><link>http://www.brauck.nl/css/compressing-your-css-stylesheet/</link><guid>http://www.brauck.nl/css/compressing-your-css-stylesheet/</guid></item><item><title>My templates and the new version of sNews</title><description><![CDATA[<p>As one probably know a few days ago a new version of sNews was released (v.1.5.31). At this moment my template packages for version 1.5 contain still version 1.5.30. Because of some important differences between the two versions I have to modify the installation script that&#39;s a part of the package.</p><p>Unfortunately (well, not for me that is) I&#39;m rather busy at the moment and don&#39;t have the time to do it right away. But I will do my best to have this done by the end of next week. Sorry!</p>]]></description><pubDate>Mon, 05 Feb 2007 16:56:57 +0000</pubDate><link>http://www.brauck.nl/templates/my-templates-and-the-new-version-of-snews/</link><guid>http://www.brauck.nl/templates/my-templates-and-the-new-version-of-snews/</guid></item><item><title>Upgraded to version 1.5.31</title><description><![CDATA[<p>The last couple of weeks several sNews sites where hacked. Although Luka and Mika, the authors of sNews, in no time came up with a couple of preliminary security fixes still many sNews users became the victim of those idiots. Apparently not everybody who uses sNews reads the sNews forum regularly.</p><p>I&#39;m not going to say anything about these cowards who think that it is cool nagging other people and hide themselves behind a nickname because they don&#39;t have the guts to reveal themselves. They aren&#39;t worth talking about.</p><p>A few days ago a new version of sNews was released with more structural solutions and hopefully this will make an end to the so called &#8217;fun&#8217;.</p><p>I upgraded my site and everything seems to be ok.</p>]]></description><pubDate>Mon, 05 Feb 2007 16:25:19 +0000</pubDate><link>http://www.brauck.nl/home/upgraded-to-version-1531/</link><guid>http://www.brauck.nl/home/upgraded-to-version-1531/</guid></item><item><title>Standards compliant rollover script</title><description><![CDATA[<p>While surfing the web looking for a nifty multi-level menu, I stumbled over a neat little rollover script made by <a href="http://www.dnolan.com/" rel="external" title="Website Daniel Nolan (new window)">Daniel Nolan</a><img src="img/new_window.gif" alt="" />. It adds mouse rollover code to images without the hassle of coding in extra parameters to each image in your document and what's more, it is standards compliant and should not invalidate your document.</p><p>The script makes use of the class attribute of the image tag; so every image that requires a mouseover effect should have the class=&#34;imgover&#34; and look like this:</p>
<div class="codeblock"><code>&#60;img src="image" alt="some" title="what ever" class="imgover" /&#62;</code></div><p>You will need to create a rollover state for every image and name it exactly the same as the original, but give it the suffix  _o. For example you have an image called <em>button.gif</em>, then you should name the rollover image <em>button_o.gif</em>, simple as that. Oh, and they must both reside in the same directory off course.</p><div class="codeblock"><h3>This is the code</h3><code>function initRollovers() {<br /><br />
&#160;&#160;if (!document.getElementById) return<br /><br />

&#160;&#160;&#160;&#160;var aPreLoad = new Array();<br />
&#160;&#160;&#160;&#160;var sTempSrc;<br />
&#160;&#160;&#160;&#160;var aImages = document.getElementsByTagName('img');<br /><br />

&#160;&#160;&#160;&#160;for (var i = 0; i &#60; aImages.length; i++) {<br />
&#160;&#160;&#160;&#160;if (aImages.className == 'imgover') {<br />
&#160;&#160;&#160;&#160;&#160;&#160;var src = aImages.getAttribute('src');<br />
&#160;&#160;&#160;&#160;&#160;&#160;var ftype = src.substring(src.lastIndexOf('.'), src.length);<br />
&#160;&#160;&#160;&#160;&#160;&#160;var hsrc = src.replace(ftype, '_o'+ftype);<br /><br />

&#160;&#160;&#160;&#160;&#160;&#160;aImages.setAttribute('hsrc', hsrc);<br /><br />

&#160;&#160;&#160;&#160;&#160;&#160;aPreLoad = new Image();<br />
&#160;&#160;&#160;&#160;&#160;&#160;aPreLoad.src = hsrc;<br /><br />

&#160;&#160;&#160;&#160;&#160;&#160;aImages.onmouseover = function() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;sTempSrc = this.getAttribute('src');<br />
&#160;&#160;&#160;&#160;&#160;&#160;this.setAttribute('src', this.getAttribute('hsrc'));<br />
&#160;&#160;&#160;&#160;}<br /><br />

&#160;&#160;&#160;&#160;aImages.onmouseout = function() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;if (!sTempSrc) sTempSrc = this.getAttribute('src').<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;replace('_o'+ftype, ftype);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.setAttribute('src', sTempSrc);<br />
&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;}<br />
&#160;&#160;}<br />
}<br /><br />
window.onload = initRollovers;<br /></code></div><p>I tested this script in IE6, IE7, FF1.5, Netscape8, Opera9 all for Windows and it worked fine.</p>]]></description><pubDate>Thu, 25 Jan 2007 16:38:09 +0000</pubDate><link>http://www.brauck.nl/javascript/standards-compliant-rollover-script/</link><guid>http://www.brauck.nl/javascript/standards-compliant-rollover-script/</guid></item></channel></rss>