<?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>Ed Roesch</title>
	<atom:link href="http://www.edroesch.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edroesch.com</link>
	<description>10 percent inspiration, 90 percent debugging</description>
	<lastBuildDate>Fri, 20 Apr 2012 06:46:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>CSS2 Background Compliant Vignette</title>
		<link>http://www.edroesch.com/2012/04/css2-background-compliant-vignette/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css2-background-compliant-vignette</link>
		<comments>http://www.edroesch.com/2012/04/css2-background-compliant-vignette/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 07:07:35 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[background-image]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css2]]></category>
		<category><![CDATA[vignette]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=83</guid>
		<description><![CDATA[We all love the look and feel of vignettes on websites, however short of using CSS3 to display them as a background image, we are stuck using &#8220;hackish&#8221; CSS2 styling to achieve a 100% width vignette. Since my customers usually demand cross browser compatibility, I have developed a CSS2 compliant way of achieving a 100% &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2012/04/css2-background-compliant-vignette/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>We all love the look and feel of vignettes on websites, however short of using CSS3 to display them as a background image, we are stuck using &#8220;hackish&#8221; CSS2 styling to achieve a 100% width vignette. Since my customers usually demand cross browser compatibility, I have developed a CSS2 compliant way of achieving a 100% width vignette. To do this, you&#8217;ll need to break up your vignette into 3 images. The left, middle, and right. </p>
<p><div id="attachment_84" class="wp-caption aligncenter" style="width: 101px"><a href="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Left.gif"><img src="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Left.gif" alt="Left Vignette" title="Header_Left" width="91" height="140" class="size-full wp-image-84" /></a><p class="wp-caption-text">Left Vignette</p></div><br />
<div id="attachment_85" class="wp-caption aligncenter" style="width: 100px"><a href="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Middle.gif"><img src="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Middle.gif" alt="Middle Vignette" title="Header_Middle" width="90" height="140" class="size-full wp-image-85" /></a><p class="wp-caption-text">Middle Vignette</p></div><br />
<div id="attachment_86" class="wp-caption aligncenter" style="width: 101px"><a href="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Right.gif"><img src="http://www.edroesch.com/wp-content/uploads/2012/04/Header_Right.gif" alt="Right Vignette" title="Header_Right" width="91" height="140" class="size-full wp-image-86" /></a><p class="wp-caption-text">Right Vignette</p></div></p>
<p>Once you have your vignette properly broken up, time to insert your vignette into your CSS.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/bg/Header_Left.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> 
	         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/bg/Header_Right.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #933;">100%</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span>
	         <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/bg/Header_Middle.gif'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span> <span style="color: #933;">30%</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Your website should have a vignette similar to this:<br />
<a href="http://www.edroesch.com/wp-content/uploads/2012/04/vignette_full.png"><img src="http://www.edroesch.com/wp-content/uploads/2012/04/vignette_full-300x38.png" alt="Full Vignette" title="vignette_full" width="300" height="38" class="aligncenter size-medium wp-image-92" /></a></p>
<p>This is only required if utilizing multiple background images. If your vignette is the only background image you need, simply use CSS: body { background: url(&#8216;my-vignette.gif&#8217;) no-repeat; }</p>
<p>Tested on Internet Explorer 9+, Firefox 5+, Chrome 12+, Safari 5+<br />
For IE8 and lower, sorry folks your stuck only using the &#8220;hackish&#8221; absolute/relative positioned <code>&lt;img /&gt;</code> tags.</p>
<p>Comments/questions please reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2012/04/css2-background-compliant-vignette/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Rewrite URLs using Output Buffer</title>
		<link>http://www.edroesch.com/2012/04/php-rewrite-urls-using-output-buffer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-rewrite-urls-using-output-buffer</link>
		<comments>http://www.edroesch.com/2012/04/php-rewrite-urls-using-output-buffer/#comments</comments>
		<pubDate>Sat, 14 Apr 2012 06:12:36 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[output buffer]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[url rewriting]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=81</guid>
		<description><![CDATA[I recently was in need of replacing URLs to SEO friendly ones, the only hiccup was I wanted to maintain the PHP $_GET params in the source code. As this is tried and true, and mod_rewrite can have its hiccups now and then. So after some research I found a solution that fit me perfectly. &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2012/04/php-rewrite-urls-using-output-buffer/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I recently was in need of replacing URLs to SEO friendly ones, the only hiccup was I wanted to maintain the PHP $_GET params in the source code. As this is tried and true, and mod_rewrite can have its hiccups now and then. So after some research I found a solution that fit me perfectly. Using PHP&#8217;s output buffer I can utilize a callback function and a few preg_replace() functions to achieve all the necessary rewrites. And if for some reason I do not want to have rewrites enabled, I can comment out the callback and all my PHP URLs are back in place with no need for code editing. Here&#8217;s my example.</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>
&nbsp;
<span style="color: #666666; font-style: italic;">// initialize output buffer to compress page.</span>
<span style="color: #666666; font-style: italic;">// note: I recommend using 'ob_gzhandler' for pages &gt;5kb. Any smaller its not worth it.</span>
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ob_gzhandler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// call the rewrite function.</span>
HandleRewrite<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;">// do your page stuff...</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;index.php?subpage=MYPAGE&quot;&gt;Hello World!&lt;/a&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// handle the URL rewriting</span>
<span style="color: #000000; font-weight: bold;">function</span> HandleRewrite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// rewrite URLS from output buffer</span>
	<span style="color: #666666; font-style: italic;">// note: it is IMPERATIVE this function is ABOVE the ob_start('rewrite') callback.</span>
	<span style="color: #000000; font-weight: bold;">function</span> rewrite<span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// this preg_replace changes &quot;mysite.com/index.php?subpage=TEST to mysite.com/TEST</span>
		<span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/index.php\?subpage=(\w)/is'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$1</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// start the output buffer for rewriting ('rewrite' being the callback function)</span>
	<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rewrite'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Utilizing this method makes it so your entire page can be re-written to any mod_rewrite (or whatever SEO utility you use) without search/replace of every link in your code. </p>
<p>As always, if you have any questions or comments, please reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2012/04/php-rewrite-urls-using-output-buffer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace default hashtag scrolling in browser</title>
		<link>http://www.edroesch.com/2012/03/replace-default-hashtag-scrolling-in-browser/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=replace-default-hashtag-scrolling-in-browser</link>
		<comments>http://www.edroesch.com/2012/03/replace-default-hashtag-scrolling-in-browser/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 03:37:59 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[hashtag]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[scrolling]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=77</guid>
		<description><![CDATA[Tired of the fluid-less jumps when going to a URL with a #hashtag? You can replace this using jQuery&#8217;s .scrollTo() method in the document.ready of your javascript. Here&#8217;s an example: $&#40;document&#41;.ready&#40;function&#40;&#41; &#123; if&#40;window.location.hash&#41; &#123; $&#40;'html, body'&#41;.animate&#40;&#123; scrollTop: $&#40;window.location.hash&#41;.offset&#40;&#41;.top &#125;, 1000&#41;; &#125; &#125;&#41;; Now on page load this will fluidly scroll to the DOM element you&#8217;ve &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2012/03/replace-default-hashtag-scrolling-in-browser/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Tired of the fluid-less jumps when going to a URL with a #hashtag? You can replace this using jQuery&#8217;s .scrollTo() method in the document.ready of your javascript. Here&#8217;s an example:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><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: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">hash</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'html, body'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			scrollTop<span style="color: #339933;">:</span> $<span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">hash</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">offset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">top</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now on page load this will fluidly scroll to the DOM element you&#8217;ve requested. I have not added error handling if say, the hashtag does not exist in the DOM, but you get the general idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2012/03/replace-default-hashtag-scrolling-in-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery UI Rename Tabs</title>
		<link>http://www.edroesch.com/2012/02/jquery-ui-rename-tabs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jquery-ui-rename-tabs</link>
		<comments>http://www.edroesch.com/2012/02/jquery-ui-rename-tabs/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 06:39:18 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[Rename Tabs]]></category>
		<category><![CDATA[Tabs]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=66</guid>
		<description><![CDATA[I found myself in the position of needing jQuery UI&#8217;s tabs plugin to have the option of being renamed while still maintaining the tab. I came up with this function to easily rename a tab by passing the tab&#8217;s id selector and desired value. function renameTab&#40;selector, value&#41; &#123; $&#40;'a[href=&#34;' + selector + '&#34;'&#41;.text&#40;value&#41;; &#125; Keep &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2012/02/jquery-ui-rename-tabs/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I found myself in the position of needing jQuery UI&#8217;s tabs plugin to have the option of being renamed while still maintaining the tab. I came up with this function to easily rename a tab by passing the tab&#8217;s id selector and desired value.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> renameTab<span style="color: #009900;">&#40;</span>selector<span style="color: #339933;">,</span> value<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a[href=&quot;'</span> <span style="color: #339933;">+</span> selector <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Keep in mind you should be using jQuery UI&#8217;s example of adding tabs template</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;tabs&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#tab-1&quot;&gt;Tab 1&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#tab-2&quot;&gt;Tab 2&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
&lt;/div&gt;</pre></div></div>

<p>This will work even if you are calling the href to load remote content via AJAX since the tabs use a unique identifier for those (i.e. #ui-tabs-1, #ui-tabs-2, etc.).</p>
<p>Simply rename &#8220;Tab 1&#8243; to &#8220;Tab 1337&#8243;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">renameTab<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#tab-1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;Tab 1337&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Any questions/insight feel free to reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2012/02/jquery-ui-rename-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move Row Up/Down with MySQL/PHP</title>
		<link>http://www.edroesch.com/2011/11/move-row-updown-with-mysqlphp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=move-row-updown-with-mysqlphp</link>
		<comments>http://www.edroesch.com/2011/11/move-row-updown-with-mysqlphp/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 11:09:34 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[movedown]]></category>
		<category><![CDATA[moveup]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=61</guid>
		<description><![CDATA[Want to move rows with a click of a link and not have to worry about text boxes with position ID&#8217;s in them? Use this script/query to achieve this. Basically the idea is to have in your items table where it contains all the records you potentially want to move. In that table add a &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2011/11/move-row-updown-with-mysqlphp/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Want to move rows with a click of a link and not have to worry about text boxes with position ID&#8217;s in them? Use this script/query to achieve this. Basically the idea is to have in your items table where it contains all the records you potentially want to move. In that table add a column named &#8220;position&#8221; with a unique integer for each new item you insert (do this by using a MAX(position) query when inserting the new item. It is imperative you have this unique integer or your results will not be fluid. Once that&#8217;s done copy and paste the following code to your website, filling in the proper variables indicated in the code. My method takes the previous (or next) record found from the current record (depending on whether you want to move it up/down, and swaps the position columns with each other. Then all you need to do for your table listing is &#8220;ORDER BY position&#8221; to have your items neatly sorted based on user or administrative preference.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Variables -- Fill these out from the results of your page. (i.e. what item id to move up or down)</span>
<span style="color: #000088;">$id_item</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">// ID of item you want to move up/down</span>
<span style="color: #000088;">$isUp</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">// Change to false if you want to move item down</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// MySQL structure -- Fill these out to execute your queries without needing to update my code</span>
<span style="color: #000088;">$table_name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;tbl_items&quot;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">// Name of table with your items in it</span>
<span style="color: #000088;">$col_position</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;position&quot;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">// Name of column with position ID (Remember, this must be UNIQUE to all items)</span>
<span style="color: #000088;">$col_id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>			<span style="color: #666666; font-style: italic;">// Name of column containing the items id (most likely the auto_incremented column)</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$isUp</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$operator</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$order</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;DESC&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$operator</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$order</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;ASC&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get row we are moving</span>
<span style="color: #000088;">$request</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 '.<span style="color: #006699; font-weight: bold;">$col_position</span>.', '.<span style="color: #006699; font-weight: bold;">$col_id</span>.' FROM '.<span style="color: #006699; font-weight: bold;">$table_name</span>.'
	WHERE '.<span style="color: #006699; font-weight: bold;">$col_id</span>.' = '.<span style="color: #006699; font-weight: bold;">$id_item</span>.'
	LIMIT 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Save data for row we are moving</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$isPos1</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</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_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$position1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$col_position</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$id_item1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$col_id</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get row we want to swap with</span>
<span style="color: #000088;">$request2</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 '.<span style="color: #006699; font-weight: bold;">$col_position</span>.', '.<span style="color: #006699; font-weight: bold;">$col_id</span>.' FROM '.<span style="color: #006699; font-weight: bold;">$table_name</span>.'
	WHERE '.<span style="color: #006699; font-weight: bold;">$col_position</span>.' '.<span style="color: #006699; font-weight: bold;">$operator</span>.' '.<span style="color: #006699; font-weight: bold;">$position1</span>.'
	ORDER BY '.<span style="color: #006699; font-weight: bold;">$col_position</span>.' '.<span style="color: #006699; font-weight: bold;">$order</span>.' LIMIT 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Save data from row we want to swap with</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$isPos2</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</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_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$request2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$position2</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$col_position</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$id_item2</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$col_id</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// If both rows exist (indicating not top or bottom row), continue</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$isPos1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$isPos2</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$query_update</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
		UPDATE '.<span style="color: #006699; font-weight: bold;">$table_name</span>.'
		SET '.<span style="color: #006699; font-weight: bold;">$col_position</span>.' = '.<span style="color: #006699; font-weight: bold;">$position2</span>.'
		WHERE '.<span style="color: #006699; font-weight: bold;">$col_id</span>.' = '.<span style="color: #006699; font-weight: bold;">$id_item1</span>.'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$query_update2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;
		UPDATE '.<span style="color: #006699; font-weight: bold;">$table_name</span>.'
		SET '.<span style="color: #006699; font-weight: bold;">$col_position</span>.' = '.<span style="color: #006699; font-weight: bold;">$position1</span>.'
		WHERE '.<span style="color: #006699; font-weight: bold;">$col_id</span>.' = '.<span style="color: #006699; font-weight: bold;">$id_item2</span>.'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Any questions or issues with this method please reply.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/11/move-row-updown-with-mysqlphp/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Category Hierarchy into Select Box</title>
		<link>http://www.edroesch.com/2011/10/category-hierarchy-into-select-box/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=category-hierarchy-into-select-box</link>
		<comments>http://www.edroesch.com/2011/10/category-hierarchy-into-select-box/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 04:59:29 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[hierarchy]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=40</guid>
		<description><![CDATA[For those interested in implementing a list of category items into a select box, here is a simple method for doing so. This will require only 1 query (assuming you store the category id and the parent id in the table). Organize your categories into a set of arrays function OrganizeCategories&#40;&#41; &#123; $refs = array&#40;&#41;; &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2011/10/category-hierarchy-into-select-box/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>For those interested in implementing a list of category items into a select box, here is a simple method for doing so. This will require only 1 query (assuming you store the category id and the parent id in the table).</p>
<p>Organize your categories into a set of arrays</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> OrganizeCategories<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$refs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$list</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$sql</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 id_category, id_parent, name FROM tbl_categories	ORDER BY name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</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_assoc</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$thisref</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$refs</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_category'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000088;">$thisref</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'parent_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_parent'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$thisref</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_parent'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$list</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_category'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$thisref</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$refs</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_parent'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'children'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id_category'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$thisref</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$list</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Create the option values from the organizational array</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> toSelect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$list</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$count</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$spacers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$spacers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'='</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$spacers</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$spacers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&amp;gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$arr</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;option&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$spacers</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array_key_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'children'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> toSelect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$v</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'children'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$html</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;/option&gt;'</span><span style="color: #339933;">.</span>PHP_EOL<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$html</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Sample PHP code using the previous functions</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$categories</span> <span style="color: #339933;">=</span> OrganizeCategories<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> toSelect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$categories</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;select name=&quot;cat&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$options</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/select&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Assuming we have a full database of categories, it will output something like this</p>
<select name="cat">
<option>Category 1</option>
<option>==&gt; Sub Category 1</option>
<option>==&gt; Sub Category 1</option>
<option>====&gt; Sub Sub Category 1</option>
<option>Category 2</option>
<option>==&gt; Sub Category 2</option>
</select>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/10/category-hierarchy-into-select-box/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Get return value from Invoke()</title>
		<link>http://www.edroesch.com/2011/03/get-return-value-from-invoke/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-return-value-from-invoke</link>
		<comments>http://www.edroesch.com/2011/03/get-return-value-from-invoke/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 03:55:28 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Invoke]]></category>
		<category><![CDATA[Return Value]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=33</guid>
		<description><![CDATA[So you may wonder how to get a return value from a function that requires you to Invoke(). It&#8217;s actually quite simple. You&#8217;ll need another delegate type, here is an example of returning the key of a tabControls selected tab: public string CurrentTabKey&#40;&#41; &#123; if &#40;tabControl.InvokeRequired&#41; &#123; return &#40;string&#41;tabControl.Invoke&#40; new Func&#60;String&#62;&#40;&#40;&#41; =&#62; CurrentTabKey&#40;&#41;&#41; &#41;; &#125; &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2011/03/get-return-value-from-invoke/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>So you may wonder how to get a return value from a function that requires you to Invoke(). It&#8217;s actually quite simple. You&#8217;ll need another delegate type, here is an example of returning the key of a tabControls selected tab:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> CurrentTabKey<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>tabControl<span style="color: #008000;">.</span><span style="color: #0000FF;">InvokeRequired</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>tabControl<span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span>
          <span style="color: #008000;">new</span> Func<span style="color: #008000;">&lt;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> CurrentTabKey<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0600FF; font-weight: bold;">else</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>tabControl<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedTab</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/03/get-return-value-from-invoke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add jQuery code to AJAX loaded content</title>
		<link>http://www.edroesch.com/2011/02/add-jquery-code-to-ajax-loaded-content/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-jquery-code-to-ajax-loaded-content</link>
		<comments>http://www.edroesch.com/2011/02/add-jquery-code-to-ajax-loaded-content/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 22:10:19 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[live]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=19</guid>
		<description><![CDATA[You may have noticed you cannot pass jQuery functions to content loaded using AJAX technology simply. One way is to use the jQuery .live() event. This can be used with a number of handlers and events to automatically pass functions to dynamically loaded content. The example below shows how you can add fancybox to a &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2011/02/add-jquery-code-to-ajax-loaded-content/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>You may have noticed you cannot pass jQuery functions to content loaded using AJAX technology simply. One way is to use the jQuery <a href="http://api.jquery.com/live/" target="_blank">.live()</a> event. This can be used with a number of handlers and events to automatically pass functions to dynamically loaded content. The example below shows how you can add <a href="http://fancybox.net/" target="_blank">fancybox</a> to a dynamically loaded container with class name &#8220;fancify&#8221;.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.fancify'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</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: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fancybox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #3366CC;">'width'</span>			<span style="color: #339933;">:</span> <span style="color: #3366CC;">'40%'</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">'height'</span>		<span style="color: #339933;">:</span> <span style="color: #3366CC;">'70%'</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">'autoScale'</span>		<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">'transitionIn'</span>		<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">'transitionOut'</span>		<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
		<span style="color: #3366CC;">'type'</span>			<span style="color: #339933;">:</span> <span style="color: #3366CC;">'iframe'</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/02/add-jquery-code-to-ajax-loaded-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Open links in default browser from WebBrowser control</title>
		<link>http://www.edroesch.com/2011/02/open-links-in-default-browser/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-links-in-default-browser</link>
		<comments>http://www.edroesch.com/2011/02/open-links-in-default-browser/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 03:10:32 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Navigating]]></category>
		<category><![CDATA[WebBrowser]]></category>

		<guid isPermaLink="false">http://www.edroesch.com/?p=7</guid>
		<description><![CDATA[If your looking to use C#&#8217;s web browser control but don&#8217;t want links to open in the same browser control (i.e. open them in a real browser like Chrome or Firefox), simply change the navigating handler to process the URL and fire the link in the diagnostics (which will open the URL in the user&#8217;s &#8230; </p><p><a class="more-link block-button" href="http://www.edroesch.com/2011/02/open-links-in-default-browser/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>If your looking to use C#&#8217;s web browser control but don&#8217;t want links to open in the same browser control (i.e. open them in a real browser like Chrome or Firefox), simply change the navigating handler to process the URL and fire the link in the diagnostics (which will open the URL in the user&#8217;s default browser). Here is what I used.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> browser_Navigating<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, WebBrowserNavigatingEventArgs e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
     <span style="color: #000000;">System.<span style="color: #0000FF;">Diagnostics</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Process</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Start</span><span style="color: #008000;">&#40;</span>e<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     e<span style="color: #008000;">.</span><span style="color: #0000FF;">Cancel</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/02/open-links-in-default-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Blog</title>
		<link>http://www.edroesch.com/2011/02/hello-world/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hello-world</link>
		<comments>http://www.edroesch.com/2011/02/hello-world/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 06:12:51 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://edroesch.com/?p=1</guid>
		<description><![CDATA[My new blog. Mainly about programming tips and tricks I have used to create several projects.]]></description>
			<content:encoded><![CDATA[<p>My new blog. Mainly about programming tips and tricks I have used to create several projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edroesch.com/2011/02/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

