<?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>Paul.Bagosy.Com &#187; PHP</title>
	<atom:link href="http://paul.bagosy.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://paul.bagosy.com</link>
	<description></description>
	<lastBuildDate>Sun, 25 Jul 2010 13:42:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>New WordPress Widgets</title>
		<link>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/</link>
		<comments>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 13:42:20 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=894</guid>
		<description><![CDATA[Having been kicking around the exciting world of installing and customizing WordPress, I felt it was high time I launched myself into the even more exciting world of developing for WordPress.  And here&#8217;s what I&#8217;ve come up with: Recent User Posts Recent Category Posts Both of these are widgets that do basically the same thing, [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Having been kicking around the exciting world of installing and customizing WordPress, I felt it was high time I launched myself into the even more exciting world of developing for WordPress.  And here&#8217;s what I&#8217;ve come up with:</p>
<p><a href="http://paul.bagosy.com/files/2010/07/recent-user-posts.1.0.zip" >Recent User Posts</a></p>
<p><a href="http://paul.bagosy.com/files/2010/07/recent-category-posts.1.0.zip" >Recent Category Posts</a></p>
<p>Both of these are widgets that do basically the same thing, so I&#8217;ll describe them together here.</p>
<p>In developing the new Wharton Magazine blog, we needed a widget to display the Editor&#8217;s most recent post.  I poked around for a bit, and realized that there really wasn&#8217;t a plugin to handle this, so the need for one was obvious.  After getting the basics down, I decided that it actually had more applications than just a single post, and started adding features.</p>
<p>So, the end result is two widgets.  Enter a title, select the user/category you want to display, enter the number of posts to display, and select if you want to display a link to the user/category and the time and date.  Not complicated to use and does just what it says it does.</p>
<p>Before I release it to the WordPress Plugins Codex, I&#8217;d like to see if anyone wants a shot at debugging or can offer any tips or suggestions.  Files are at the links above, and thanks in advance!</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2010/07/25/new-wordpress-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0</title>
		<link>http://paul.bagosy.com/2010/06/30/wordpress-3-0/</link>
		<comments>http://paul.bagosy.com/2010/06/30/wordpress-3-0/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:45:17 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PennridgeAlumni]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=890</guid>
		<description><![CDATA[I&#8217;m getting really drawn into WordPress and all its wonderful functionality, especially with the release of 3.0.  I retooled the back end of this site to run on WordPress MU a few months ago, because I run a few separate blogs and am in the process of expanding that for family members. I was happy [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>I&#8217;m getting really drawn into WordPress and all its wonderful functionality, especially with the release of 3.0.  I retooled the back end of this site to run on WordPress MU a few months ago, because I run a few separate blogs and am in the process of expanding that for family members.</p>
<p>I was happy to see that WordPress merged the base and MU codebases into one, fully-functional software package.  The upgrade wasn&#8217;t as smooth as I&#8217;d have liked it, but I guess they figure that if you&#8217;ve managed to install and maintain MU, you shouldn&#8217;t have a problem editing PHP and .htaccess files on your own (as opposed to automating what boils down to three lines of code).   Stupid me misread one of the steps and wound up with no images displaying sitewide for 24 hours, and wondering if I was going to have to re-import all of them.  Once I figured out my mistake, though, the problem seemed pretty trivial.  Other than that, installing and upgrading are remarkably simple.</p>
<p>WordPress has been getting better and better for the end user and administrator since I began using it about two years ago, and now that I&#8217;ve begun really getting into the heart of it, I&#8217;m really glad that the development has gone toward all of those things that I wish it did.  It&#8217;s like they&#8217;re reading my mind!</p>
<p>So, on the horizon are three projects that I&#8217;d love to tackle.  One is a freelance job that I&#8217;m hoping pans out, because it&#8217;s a site that I&#8217;d love to do.  The second is here at Wharton, which again, I&#8217;d love to do.  The third is a complete revamp of PennridgeAlumni.com, a site that I&#8217;ve been studiously avoiding for far, far too long.  Redoing it entirely in WordPress now seems like a possibility, and I&#8217;m already working on a development version of that.  Let&#8217;s see how far I get&#8230;</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2010/06/30/wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE6 &#8211; is there nothing it can’t make complicated?</title>
		<link>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/</link>
		<comments>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:43:22 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=566</guid>
		<description><![CDATA[Here&#8217;s some info on PNGs in IE6 that will hopefully save you from throwing yourself out a window sometime between now and 2014: We all know that PNGs are not natively supported in the browser that time (but not all of humanity) forgot, but PNGs are so wonderfully useful as to make them indispensable. What [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Here&#8217;s some info on PNGs in IE6 that will hopefully save you from throwing yourself out a window sometime between now and 2014:</p>
<p>We all know that PNGs are not natively supported in the browser that time (but not all of humanity) forgot, but PNGs are <i>so wonderfully useful</i> as to make them indispensable. What to do?</p>
<p>Well, some brave soul made a <a href="http://www.twinhelix.com/css/iepngfix/"  target="_blank">fix for this very problem</a> that works very well once you have it set up correctly.  There are two very very important things to note (I&#8217;m sure there are more, but these are the two I&#8217;ve encountered):</p>
<p>1) <b>background-position:bottom</b> absolutely positively does not work with this.  If you&#8217;re trying to do a neat drop shadow effect over a textured background using an alpha-layered PNG, throw yourself out that window now (or just deal with the fact that IE6 isn&#8217;t going to support it).  Don&#8217;t waste hours agonizing over why it appears to load and then disappears, just know that you&#8217;re not going to fix it and move on to different ways to make your effect work.  I suggest getting as close a match possible with a GIF or scrapping it altogether in IE6.  Don&#8217;t agonize over making it perfect in IE6 if this is what you&#8217;re trying to accomplish, because people should be punished for using IE6 anyway.</p>
<p>2) <b>Google Maps uses its own PNG fixing</b> that is completely derailed by iepngfix.htc.  You&#8217;ll notice that your Google Map appears for a second and then disappears once the page has finished loading. So once you&#8217;ve got your style set up like so:</p>
<pre>
img, div, a, input  { behavior:url(/iepngfix.htc); }
</pre>
<p>it&#8217;s going to completely hose your Google Map.  How does one fix this, you ask?</p>
<pre>
#map img, #map div, #map a, #map input  { behavior:none !important; }
</pre>
<p>Of course!  But could it be that simple?</p>
<p>We&#8217;re talking IE6 here, so I think that answers itself.  You see, if you&#8217;re using the neat <a href="/2009/09/browser-checking-blood-on-the-information-superhighway/">browser checking</a> information I wrote about a while ago to put all that into a CSS file behind an IE include tag, you&#8217;re in for a nasty shock.  Apparently, this doesn&#8217;t work (at least it didn&#8217;t for me).  So, we need to revert to server-side checking:</p>
<pre>
&lt;?
	$useragent = $_SERVER["HTTP_USER_AGENT"];
	if(preg_match("|MSIE ([0-9].[0-9]{1,2})|", $useragent, $matched)){
		if($matched[1] &lt;= 6){;
?&gt;
  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/ie6.css" /&gt;
&lt;?
		}
	}
?&gt;
</pre>
<p>Of course, you could always use an iframe, but you&#8217;re better off just throwing yourself out a window at that point. I must also point out that if you&#8217;re using jQuery, you&#8217;re going to want to include this css file <i>after</i> your jQuery include.  Why?  IE6 &#8211; did you need a better answer?</p>
<p>It&#8217;s also worth noting that IE6 has a strange relationship with the !important tag.  It will normally accept it, say if you&#8217;ve got a structure like so:</p>
<pre>
.tag  { width:500px; height:500px; color:#FFF; }
#tag2 .tag { color:#000 !important; }
</pre>
<p>That&#8217;s useful for a ton of applications.  However, if you happen to put two declarations on one line:</p>
<pre>
.tag  { width:500px; height:500px;  color:#000 !important; color:#FFF; }
</pre>
<p>IE6 will ignore the !important tag in favor of the last declaration it finds.  So, in this case, it will revert to color:#FFF; whereas every other browser will assume you meant color:#000; (because, you know, you said <i>!important</i>).</p>
<p>This is a useful bug, though, and it can be used to your advantage.  Say you&#8217;re trying to add a min-height to a div.  We all know that min-height is new and IE6 screams at it and its friend max-height to get off its lawn, because height was good enough in IE6&#8242;s day and it doesn&#8217;t need newfangled tags.  So, we just use the !important tag to confuse it:</p>
<pre>
.tag { min-height: 250px; height: auto !important; height: 250px; }
</pre>
<p>This tells most browsers that your div needs to be at least 250 pixels tall, or however tall it needs to be beyond that.  It also tells IE6 to make the div 250 pixels tall &#8211; but IE6 is kind of sloppy, so if the content in that div takes up more than 250 pixels, IE6 will expand to compensate &#8211; but won&#8217;t go below 250 pixels.  This is coding Aikido &#8211; use your enemy against itself!</p>
<p>And I don&#8217;t think it&#8217;s unfair to call a nine-year-old browser that still enjoys a ridiculous market share despite its overwhelming flaws <b>the enemy</b>.</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/11/11/ie6-is-there-nothing-it-can%e2%80%99t-make-complicated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browser Checking: Blood on the Information Superhighway</title>
		<link>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/</link>
		<comments>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 13:04:06 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=537</guid>
		<description><![CDATA[Yes, I know I don&#8217;t update here as often as I should, but hey, I do this, I just don&#8217;t frequently write about it. So, let&#8217;s say you&#8217;ve coded a beautiful site, and you&#8217;re really proud of it, and you check it in IE6 and it looks like someone wrapped the entire thing in marquee [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>Yes, I know I don&#8217;t update here as often as I should, but hey, I <em>do</em> this, I just don&#8217;t frequently <em>write</em> about it.</p>
<p>So, let&#8217;s say you&#8217;ve coded a beautiful site, and you&#8217;re really proud of it, and you check it in IE6 and it looks like someone wrapped the entire thing in marquee and blink tags and then had their dog recode it for you.  The natural inclination is to scream and toss your monitor out the window, and then hire Tom Clancy to write you into a Rainbow Six novel where you take out Microsoft Headquarters.  While that would be an exciting read, what&#8217;s really going to solve your problem is to simply write a new CSS file to compensate for IE6 not being a real browser and a large (but slowly shrinking) segment of the browsing population not understanding that.</p>
<p>So, here&#8217;s how you handle adding a new CSS file in the most painless way possible:</p>
<p>You&#8217;ll already have your css declaration, which should look like this:</p>
<pre>  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;</pre>
<p>So, all you do is create your new CSS file, name it something like ie6.css, and throw that in there too.</p>
<pre>  &lt;link rel="stylesheet" type="text/css" media="screen" href="/css/ie6.css" /&gt;</pre>
<p>But you don&#8217;t want Firefox (or Opera, or Safari, or even IE7) to see this web-based atrocity, so we&#8217;ve got to tell them to just move along, nothing to see here, folks:</p>
<pre>  &lt;!--[if IE 6]&gt;&lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;&lt;![endif]--&gt;</pre>
<p>That&#8217;s right, that&#8217;s all there is to it!  Now, only IE6 will see it that CSS file.</p>
<p>BUT WAIT THERE&#8217;S MORE!  This little trick is actually a bit more powerful.</p>
<p>You can wrap whole sections of code in this block:</p>
<pre>&lt;!--[if...]&gt;

...

&lt;[endif]--&gt;</pre>
<p>And, it&#8217;s not just for IE6.  You can check for any IE version or even a range of versions with this syntax:</p>
<p><strong>if IE 5.5</strong> Single version specific<br />
<strong>if gt IE 5.5</strong> all versions greater than the specified version<br />
<strong>if gte IE 6</strong> all version greater than or equal to the specified version<br />
<strong>if lt IE 7</strong> all versions lower than<br />
<strong>if lte IE 6</strong> all versions lower than or equal to the specified version</p>
<p>So, if your problem exists in IE6 <em>and</em> IE7, but not IE 8, you&#8217;d just add</p>
<pre>  &lt;!--[if lte IE 7]&gt;&lt;link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" /&gt;&lt;![endif]--&gt;</pre>
<p>to capture anything equal to or lower than IE7.</p>
<p>Now, a quick note on crafting your CSS files.  In my IE .css files, I just take the line that&#8217;s not working in IE, copy it to my IE6 css, and beat it until it complies.  The problem with this method is that you&#8217;ve now got two lines crashing into each other, fighting a bloody struggle for dominance (and submission!).  How, you ask, do you get the desired line to be the one that works?  Give it an inflated sense of importance.</p>
<p>Say you&#8217;ve got this line:</p>
<pre> .page_content { background:#0CF; padding:10px 15px 10px 297px; }</pre>
<p>but IE6 doesn&#8217;t understand pixels (or turquose), so you need to change it to:</p>
<pre> .page_content { background:#FC0; padding:11px 16px 12px 15px; }</pre>
<p>the way to make sure that the line from your IE css is to add <strong>!important</strong> to the end of every statement, before the semicolon:</p>
<pre> .page_content { background:#FC0 !important; padding:11px 16px 12px 15px !important; }</pre>
<p>That will guarantee that those declarations are the ones that are recognized when there&#8217;s the possibility for confusion.</p>
<h3>It&#8217;s not enough!  I need more!  IE checking doesn&#8217;t seem to satisfy.</h3>
<p>Do you need more advanced browser checking?  Are you encountering a 1-pixel variance in Chrome?  Do you want to have your website make fun of backwards Safari users?  Well, simply checking for IE6 isn&#8217;t going to help you.  You need <em>more power (ah! ah! ah!)</em>:</p>
<pre>&lt;?
	if(preg_match("|Opera/([0-9].[0-9]{1,2})|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Opera";
	}elseif(preg_match("|MSIE ([0-9].[0-9]{1,2})|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "IE";
	}elseif(preg_match("|Firefox/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Firefox";
	}elseif(preg_match("|Chrome/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Chrome";
	}elseif(preg_match("|Safari/([0-9\.]+)|", $useragent, $matched)){
		$browser_version = $matched[1];
		$browser = "Safari";
	}else{
		$browser_version = 0;
		$browser = "Other";
	}
?&gt;</pre>
<p>The output of this will get you down to the very version number, so if you&#8217;ve got some philosophical disagreement with anyone running Firefox 3.0.12, you can pick that version out specifically (but why?  <em>WHY?!</em>).</p>
<p>It&#8217;s a good idea to leave this whole code chunk intact an in order, because Opera can masquerade as IE if you&#8217;re just checking for IE, and Chrome will pretend it&#8217;s Safari if you&#8217;re just checking for Safari.</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2009/09/28/browser-checking-blood-on-the-information-superhighway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In Process</title>
		<link>http://paul.bagosy.com/2008/10/19/in-process/</link>
		<comments>http://paul.bagosy.com/2008/10/19/in-process/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 22:18:35 +0000</pubDate>
		<dc:creator>Paul Bagosy</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PennridgeAlumni]]></category>
		<category><![CDATA[Web Sites]]></category>

		<guid isPermaLink="false">http://paul.bagosy.com/?p=196</guid>
		<description><![CDATA[I&#8217;m working feverishly to get PennridgeAlumni.Com relaunched before I have to renew hosting, which isn&#8217;t going to be with the same company. Of course, that means recoding from Classic ASP into PHP, so no sense in simply translating, I&#8217;m working on redesigning the entire thing. Getting a lot done with AJAX. I&#8217;m shifting the user [...]]]></description>
			<content:encoded><![CDATA[<!-- wp-jquery-lightbox, a WordPress plugin by ulfben --> <p>I&#8217;m working feverishly to get PennridgeAlumni.Com relaunched before I have to renew hosting, which isn&#8217;t going to be with the same company.  Of course, that means recoding from Classic ASP into PHP, so no sense in simply translating, I&#8217;m working on <em>redesigning</em> the entire thing.</p>
<p>Getting a lot done with AJAX.  I&#8217;m shifting the user paradigm from a central account area to allowing users to edit things they have access to edit right on the page for instant gratification.</p>
<p>I&#8217;m also working on turning PhillyGoth into a WordPress site.</p>
<p>-pb</p>
<div id="crp_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://paul.bagosy.com/2008/10/19/in-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
