<?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>mikerochford.com &#187; PHP</title>
	<atom:link href="http://mikerochford.com/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikerochford.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 11 Aug 2010 16:27:33 +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>Accessing gallery2 using the API to return information about a gallery</title>
		<link>http://mikerochford.com/blog/2009/05/26/accessing-gallery2-using-the-api-to-return-information-about-a-gallery/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://mikerochford.com/blog/2009/05/26/accessing-gallery2-using-the-api-to-return-information-about-a-gallery/#comments</comments>
		<pubDate>Tue, 26 May 2009 18:18:51 +0000</pubDate>
		<dc:creator>mrochford</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mikerochford.com/blog/?p=34</guid>
		<description><![CDATA[I designed a website for a friend to sell a litter of puppies. He wanted a simple site that had galleries for each dog and one for the litter. I didn&#8217;t want to maintain the site at all so I used a lot of pre built software. I chose to use Gallery2 to do all [...]]]></description>
			<content:encoded><![CDATA[<p>I designed a website for a friend to sell a litter of puppies. He wanted a simple site that had galleries for each dog and one for the litter. I didn&#8217;t want to maintain the site at all so I used a lot of pre built software. I chose to use <a href="http://gallery.menalto.com/">Gallery2</a> to do all the picture stuff.  It did everything I wanted (resize,rotate,etc). I didn&#8217;t like how it looked though. I wanted to just have it do the back end stuff and I wanted to design the layout. To do this all I needed was the urls to access the images. Below is a function I wrote that will output all the information of a picture and its uri.</p>
<p>The script is located <a href="http://mikerochford.com/code/php/gallery2_to_array.php">here</a></p>
<p>which outputs:</p>
<pre>
Array
(
    [0] =&gt; Array
        (
            [title] =&gt; IMG_0028.JPG
            [width] =&gt; 2272
            [height] =&gt; 1704
            [large_picture] =&gt; /p/d/71-1/IMG_0028.JPG
            [thumb_picture] =&gt; /p/d/72-2/IMG_0028.JPG
            [resized_picture] =&gt; Array
                (
                    [0] =&gt; /p/d/73-2/IMG_0028.JPG
                    [1] =&gt; /p/d/74-2/IMG_0028.JPG
                    [2] =&gt; /p/d/75-2/IMG_0028.JPG
                )

        )

    [1] =&gt; Array
        (
            [title] =&gt; IMG_0029.JPG
            [width] =&gt; 2272
            [height] =&gt; 1704
            [large_picture] =&gt; /p/d/77-1/IMG_0029.JPG
            [thumb_picture] =&gt; /p/d/78-2/IMG_0029.JPG
            [resized_picture] =&gt; Array
                (
                    [0] =&gt; /p/d/79-2/IMG_0029.JPG
                    [1] =&gt; /p/d/80-2/IMG_0029.JPG
                    [2] =&gt; /p/d/81-2/IMG_0029.JPG
                )

        )
)
</pre>
<p>You will need to modify the paths in the function to your installation.</p>
<p>A side note&#8230; To find gallery ids you will need to to run the following query.</p>
<div class="dean_ch" style="white-space: wrap;">mysql&gt; <span class="kw1">SELECT</span> g2_id,g2_title <span class="kw1">FROM</span> g2_Item <span class="kw1">WHERE</span> g2_canContainChildren=<span class="nu0">1</span>;</div>
<img src="http://mikerochford.com/blog/?ak_action=api_record_view&id=34&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://mikerochford.com/blog/2009/05/26/accessing-gallery2-using-the-api-to-return-information-about-a-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
