<?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 &#187; api</title>
	<atom:link href="http://www.internaldrive.com/tag/api/feed/" rel="self" type="application/rss+xml" >
	<link>http://www.internaldrive.com</link>
	<description>Summer Computer Camps for Kids, Teens &#38; Youth</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:58:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<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>admin</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 [...]]]></description>
			<content:encoded><![CDATA[<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>
]]></content:encoded>
			<wfw:commentRss>http://www.internaldrive.com/2009/04/30/integrating-flickr-with-vbulletin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

