<?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>iD Tech Camps - America's #1 Tech Camp&#187; code</title>
	<atom:link href="http://www.internaldrive.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.internaldrive.com</link>
	<description>America's #1 Tech Camp</description>
	<lastBuildDate>Tue, 07 Sep 2010 17:26:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Integrating Flickr with vBulletin</title>
		<link>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/</link>
		<comments>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:40:08 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[changes]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Flickr API]]></category>
		<category><![CDATA[Manager]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpFlickr]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[vBulletin]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=22446</guid>
		<description><![CDATA[Our support forums here at iD Tech run on the popular internet forum software, vBulletin. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff.
In addition, we also have a public Flickr [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Our support forums here at iD Tech run on the popular internet forum software, <a title="vBulletin" href="http://www.vbulletin.com" target="_blank">vBulletin</a>. Each year we constantly revamp the system with new upgrades, a new design, and new code plugins to make the process more specific to our business model and more accessible to our staff.</p>
<p>In addition, we also have a public Flickr stream. I wanted to pull these two elements together so that we could bring examples of our Flickr photos to our own support system. Here&#8217;s how I integrated them.</p>
<ol style="padding-left: 30px;">
<li>Download the phpFlickr API from here: http://www.phpflickr.com/</li>
<li>Unzip the files to your vBulletin <strong>/includes/</strong> folder.</li>
<li>If you want, you can rename the files to match the vBulletin naming convention (i.e. phpflickr.php -&gt; functions_phpflickr.php).</li>
<li><strong>Optional: </strong>Create a new vBulletin product. From the admin side, choose <strong>Manage Products</strong> from the <strong>Plugins &amp; Products </strong>menu. Then select <strong>Add/Import</strong> product. Fill in the information you need for a new product and hit save.</li>
<li> Add a new vBulletin plugin. From the <strong>Plugins &amp; Products </strong>admin menu, select <strong>Add New Plugin</strong>. Select the product you created in <strong>Step 4</strong>, or <strong>vBulletin</strong> otherwise. For hook location, you&#8217;ll need to select where you want the Flickr photos displayed. I&#8217;m placing them on our vBulletin homepage, so I select <strong>forumhome_start </strong>for my hook. Enter a title (such as <strong>Flickr Integration</strong>), leave the exectution order alone, and use the PHP code shown below.</li>
<li>From the <strong>Styles &amp; Templates </strong>menu, select <strong>Style Manager</strong>. Pick your style and choose <strong>Edit Templates</strong>. Find <strong>FORUMHOME </strong>(or whichever style is applicable to the hook location you chose) and double-click on it.</li>
<li> Find the location in the template where you want your photos displayed and enter <strong>$flickrbox</strong>, the name of the variable we are pulling from our PHP plugin.</li>
</ol>
<p>Now let&#8217;s take a look at the code we&#8217;re placing in our plugin.</p>
<pre style="padding: 30px 0px 30px 30px;">require_once("includes/phpFlickr.php");

// Create new phpFlickr object
$f = new phpFlickr("yourapikey");
$f-&gt;enableCache("db","mysql://user:password@server/database");

$limit = 11;

// Find the NSID of the username inputted via the form
$person = $f-&gt;people_findByUsername('iDTechCamp');

// Get the friendly URL of the user's photos
$photos_url = $f-&gt;urls_getUserPhotos($person['id']);

// Get the user's first X($limit) public photos
$photos = $f-&gt;people_getPublicPhotos($person['id'], NULL, NULL, $limit);
$flickrbox = "&lt;table class='flickrbox'&gt;&lt;tr&gt;";

// Loop through the photos and output the html
foreach ((array)$photos['photos']['photo'] as $photo) {
    $flickrbox .= "&lt;td&gt;&lt;a class='flickrimg' href=$photos_url$photo[id]&gt;";
    $flickrbox .= "&lt;img border='0' alt='$photo[title]' "
               ."src=" . $f-&gt;buildPhotoURL($photo, "Square") . "&gt;";
    $flickrbox .= "&lt;/a&gt;&lt;/td&gt;";
}

$flickrbox .= "&lt;/tr&gt;&lt;/table&gt;";</pre>
<p>First, we <strong>require_once</strong> the phpflickr php api library. Alter this line if you choose to name your library differently. Next, we create a new phpFlickr object, <strong>$f</strong>, and supply our Flickr API key. Change this line to reflect your unique API key. Next, we optionally enable the cache available with this library by supplying our mySQL database details. If you don&#8217;t have your details, don&#8217;t worry, this step isn&#8217;t required.</p>
<p>We then set a limit for how many photos we want. I&#8217;ve chosen 11. We use <strong>people_findByUsername</strong> to get photos for our particular user, in this case, the company username <strong>iDTechCamp</strong>. The resulting statements will pull <strong>$limit</strong> number of photos from the public profile of our user. Lastly, we need to construct a variable that holds the output as HTML. Our variable here is <strong>$flickrbox</strong> and as you can see I&#8217;m generating a table with CSS class style named <strong>flickrbox</strong>. Each image in the table is table cell and contains a link to that particular image. We also set the image title to the photo title pulled from <strong>Flickr</strong>.</p>
<p>You can easily alter the PHP code here to produce tableless HTML or any other structure you like. I hope these instructions help you to integrate your board and Flickr! Email me or comment with any questions you might have.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Populating a Combo-box in PHP Dynamically from MySQL</title>
		<link>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/</link>
		<comments>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 16:30:59 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[combo-box]]></category>
		<category><![CDATA[drop-down box]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21898</guid>
		<description><![CDATA[For this article, let&#8217;s pretend you have the following database table. There are two columns (I&#8217;m separating the fields with commas for readability), Item and Price:
Cheese Pizza, 1.00
Pepporoni Pizza, 1.50
Sausage Pizza, 1.50
Cheese Calzone, 1.50
Ham Calzone, 2.00
What if you want to populate a combo-box with your possible options? We can write php that generates a drop-down [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>For this article, let&#8217;s pretend you have the following database table. There are two columns (I&#8217;m separating the fields with commas for readability), Item and Price:</p>
<p>Cheese Pizza, 1.00<br />
Pepporoni Pizza, 1.50<br />
Sausage Pizza, 1.50<br />
Cheese Calzone, 1.50<br />
Ham Calzone, 2.00</p>
<p>What if you want to populate a combo-box with your possible options? We can write php that generates a drop-down box that has five item choices in it, based on our table above. Here is the sample code:</p>
<pre>&lt;?php

  // Connect to the database
  mysql_connect("localhost", "user", "password") or die(mysql_error());
  mysql_select_db("name") or die(mysql_error());

  // Has the form been submitted?
  if (isset($_POST['item'])) {

    // The form has been submitted, query results
    $queryitem = "SELECT * FROM table WHERE item = '".$_POST['item']."';";

    // Successful query?
    if($result = mysql_query($queryitem))  {

      // More than 0 results returned?
      if($success = mysql_num_rows($result) &gt; 0) {

        // For each result returned, display it
        while ($row = mysql_fetch_array($result)) echo $row[serial];
      }
      // Otherwise, no results, tell user
      else { echo "No results found."; }
    }
    // Error connecting? Tell user
    else { echo "Failed to connect to database."; }
  }
  // The form has NOT been submitted, so show the form instead of results
  else {

    // Create the form, post to the same file
    echo "&lt;form method='post' action='example.php'&gt;";

    // Form a query to populate the combo-box
    $queryitem = "SELECT DISTINCT item FROM table;";

    // Successful query?
    if($result = mysql_query($queryitem))  {

      // If there are results returned, prepare combo-box
      if($success = mysql_num_rows($result) &gt; 0) {
        // Start combo-box
        echo "&lt;select name='item'&gt;\n";
        echo "&lt;option&gt;-- Select Item --&lt;/option&gt;\n";

        // For each item in the results...
        while ($row = mysql_fetch_array($result))
          // Add a new option to the combo-box
          echo "&lt;option value='$row[item]'&gt;$row[item]&lt;/option&gt;\n";

        // End the combo-box
        echo "&lt;/select&gt;\n";
      }
      // No results found in the database
      else { echo "No results found."; }
    }
    // Error in the database
    else { echo "Failed to connect to database."; }

    // Add a submit button to the form
    echo "&lt;input type='submit' value='Submit' /&gt;&lt;/form&gt;";
  }
?&gt;</pre>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/31/populating-a-combo-box-in-php-dynamically-from-mysql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Changing the default Flash cursor</title>
		<link>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/</link>
		<comments>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 16:46:23 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=21306</guid>
		<description><![CDATA[Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click here for the source code.


]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Ever wanted to use a custom animated cursor in your Flash project? This video tutorial will show you how to do so via Actionscript. Click <a href="http://forum.internaldrive.com/files/vlog/VLog2FlashMouse_src.zip">here</a> for the source code.</p>
<p><object id="csSWF" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="498" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="src" value="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf"/><param name="bgcolor" value="#1a1a1a"/><param name="quality" value="best"/><param name="allowScriptAccess" value="always"/><param name="allowFullScreen" value="true"/><param name="scale" value="showall"/><param name="flashVars" value="autostart=false"/><embed name="csSWF" src="http://forum.internaldrive.com/files/vlog/Cursor_controller.swf" width="640" height="498" bgcolor="#1a1a1a" quality="best" allowScriptAccess="always" allowFullScreen="true" scale="showall" flashVars="autostart=false&#038;color=0x1A1A1A,0x1A1A1A" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></object></p>
<p></code></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/03/07/changing-the-default-flash-cursor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing the Default Flex Blue (and other style tips)</title>
		<link>http://www.internaldrive.com/2009/02/13/removing-the-default-flex-blue-and-other-style-tips/</link>
		<comments>http://www.internaldrive.com/2009/02/13/removing-the-default-flex-blue-and-other-style-tips/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 23:21:17 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=20999</guid>
		<description><![CDATA[Flex gives you a great deal of control when skinning your applications, but some of the options are less apparent than others. Although styling individual components of an application is easy accomplished through CSS file inclusion, there are global methods too.
The Pre-Loader
If your project is ambitious, you&#8217;ll probably want to design your own pre-loader to [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Flex gives you a great deal of control when skinning your applications, but some of the options are less apparent than others. Although styling individual components of an application is easy accomplished through CSS file inclusion, there are global methods too.</p>
<h2>The Pre-Loader</h2>
<p>If your project is ambitious, you&#8217;ll probably want to design your own pre-loader to replace the default Flex one. If you aren&#8217;t that interested in re-skinning the default, however, you can simply turn that default Flex-blue pre-loader off. In your application MXML declaration, add <strong>usePreloader=&#8221;false&#8221;</strong>, like so:</p>
<h2>Getting Rid of the Default Flex Blue</h2>
<p><a href="http://www.internaldrive.com/wp-content/uploads/2009/02/screenshot014.png"><img class="size-full wp-image-20998 alignright" src="http://www.internaldrive.com/wp-content/uploads/2009/02/screenshot014.png" alt="screenshot014 Removing the Default Flex Blue (and other style tips)" width="310" height="125" title="screenshot014" /></a>You know it when you see it &#8211; a Flash app starts to load and you see that familiar blue (#869ca7, or <span style="#ffffff;">this color</span>, in case you were wondering). Tracking down all the places it crops up can be a pain, but setting the default background color in your Flex Compiler options is an easy way. Right-click on a project, then choose Properties. Select compiler options and you&#8217;ll see the screen shown here. Simply add <strong>-default-background-color 0x######</strong>, where <strong>######</strong> is the html color code you want to use. Now Flex will generate the html template files with your color instead of the dreadful blue.</p>
<h2>Changing the Skin Globally</h2>
<p>You&#8217;ll also notice in the screen shot above that I have another option highlighted: <strong>-theme &#8216;myflexskin.css&#8217;</strong>. Using this option you can set the global (per project) use of that particular CSS file, versus having to include it individually in each MXML file.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/02/13/removing-the-default-flex-blue-and-other-style-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ternary Operator in Flash (if-else shorthand)</title>
		<link>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/</link>
		<comments>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 18:33:17 +0000</pubDate>
		<dc:creator>KenK</dc:creator>
				<category><![CDATA[iD Tech Bloggers]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conditionals]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ternary operations]]></category>

		<guid isPermaLink="false">http://www.internaldrive.com/?p=20864</guid>
		<description><![CDATA[Most people fluent in Flash Actionscript are familiar with unary and binary operators, but there is also a ternary operator that can be quite useful. First, a refresh on operators:
Unary: count++;
Binary: count = count * 2;
Ternary: var result:String = (count == 0) ? &#8220;Empty&#8221; : &#8220;Not Empty&#8221;);
So what does this mean? You can use the [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>Most people fluent in Flash Actionscript are familiar with unary and binary operators, but there is also a ternary operator that can be quite useful. First, a refresh on operators:</p>
<p><em>Unary:</em> <strong>count++;</strong></p>
<p><em>Binary:</em> <strong>count = count * 2;</strong></p>
<p><em>Ternary:</em> <strong>var result:String = (count == 0) ? &#8220;Empty&#8221; : &#8220;Not Empty&#8221;);</strong></p>
<p>So what does this mean? You can use the ternary form of the if statement as a shorthand. Let&#8217;s look at the equivalent full if-else statement:</p>
<p><strong>var result:String;<br />
if (count == 0) result = &#8220;Empty&#8221;;<br />
else result = &#8220;Not Empty&#8221;;</strong></p>
<p>Of course, using the ternary operator cuts down on code readability, but three lines can effectively be cut down to one. Remember, the form is this:</p>
<p><strong>(condition) ? ifTrueDoThis : ifFalseDoThis;</strong></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/02/09/the-ternary-operator-in-flash-if-else-shorthand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- loadstorm-27143 -->