<?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>Robertdot, A Web Design Blog &#187; PHP</title>
	<atom:link href="http://robertdot.org/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertdot.org</link>
	<description>A web design blog for designers that develop or developers that design.</description>
	<lastBuildDate>Fri, 05 Mar 2010 15:59:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Adding Location Awareness to Your Site</title>
		<link>http://robertdot.org/2009/01/09/adding-location-awareness-to-your-site/</link>
		<comments>http://robertdot.org/2009/01/09/adding-location-awareness-to-your-site/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 19:46:52 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Fire Eagle]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Location Services]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[Yahoo Weather]]></category>

		<guid isPermaLink="false">http://robertdot-org.robertb.org/?p=18</guid>
		<description><![CDATA[
 I recently launched a new personal site.  I wanted to integrate some level of location awareness to it.  My initial design sketches called for the weather information and a position on a map of my last known location.


 Initially, I was using a program on my iPhone called Loopt.  Loopt is like Twitter with [...]]]></description>
			<content:encoded><![CDATA[<p>
 I recently launched a new personal site.  I wanted to integrate some level of location awareness to it.  My initial design sketches called for the weather information and a position on a map of my last known location.
</p>
<p>
 Initially, I was using a program on my iPhone called Loopt.  Loopt is like Twitter with location.  That involved jumping through hoops, as Loopt&#8217;s RSS feed only shows the GPS position of the last post.  Not only would I have to post a message every time I got somewhere, I&#8217;d have to reverse geocode my position to grab the zip code to send to get the weather information.  I achieved this through JavaScript with the Google Maps API.  This worked until I found out about <a href="http://fireeagle.yahoo.net/">Fire Eagle</a>.
</p>
<p>
 All Fire Eagle does is log your location.  Luckily, Fire Eagle has an <abbr title="Application Programming Interface">API</abbr>.  <a href="http://www.eaglefeed.me">Eagle Feed</a> turns your location into a publicly accessible <abbr title="Really Simple Syndication">RSS</abbr> feed.  So, getting your location is as easy as parsing an RSS feed.  By setting the read level of Eagle Feed to <samp>my zip code</samp>, the <code>title</code> of the single <code>item</code> in the RSS feed reports my city, state, and zip (e.g. <samp>Birmingham, AL 35223</samp>), and my GPS coordinates are also in the feed.
</p>
<p>
 You can update Fire Eagle by manually by entering your location on the site.  However, there are mobile applications, such as Active Eagle on the iPhone, that use the <abbr title="Global Positioning Satellite">GPS</abbr> functionality of your device to update Fire Eagle.  In Active Eagle, I simply tap &#8220;Update Fire Eagle&#8221; to update my location, and my Eagle Feed.
</p>
<p>
 Once you can get your feed there are plenty of cool things you can do.
</p>
<p>
 I wrote a simple <abbr title="PHP Hypertext Preprocessor">PHP</abbr> script to open my feed (or pull it from a cached file), grab the human-readable location from the <code>title</code> and parse out the zip code and my GPS position.
</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="php" style="font-family:monospace;"><span style="color: #000088;">$out</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/&lt;title&gt;(.*?)&lt;\/title&gt;/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$out</span><span style="color: #339933;">,</span> <span style="color: #000088;">$loc_matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$human_loc</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$loc_matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/\d{5}/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$human_loc</span><span style="color: #339933;">,</span> <span style="color: #000088;">$loc_matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$human_zip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$loc_matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/&lt;abbr class=&quot;latitude&quot;.*?&gt;(.*?)&lt;\/abbr&gt;/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$out</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lat</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$loc_lat</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$lat</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/&lt;abbr class=&quot;longitude&quot;.*?&gt;(.*?)&lt;\/abbr&gt;/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$out</span><span style="color: #339933;">,</span> <span style="color: #000088;">$long</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$loc_long</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$long</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>
 I then pass my zip code to <a href="http://developer.yahoo.com/weather/">Yahoo&#8217;s weather feeds</a> to get weather data.  I also pass my GPS position to <a href="http://code.google.com/apis/maps/documentation/staticmaps/">Google Maps Static API</a> to get a map of where I am.
</p>
<p>
 Another idea would be to show Flickr photos in your area via the <a href="http://www.flickr.com/services/api/">Flickr API</a>.  I&#8217;m sure there are tons of other things that would be fun or useful.  Come up with some more ideas and make some cool stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertdot.org/2009/01/09/adding-location-awareness-to-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Documentation Generators</title>
		<link>http://robertdot.org/2007/02/15/php-documentation-generators/</link>
		<comments>http://robertdot.org/2007/02/15/php-documentation-generators/#comments</comments>
		<pubDate>Thu, 15 Feb 2007 10:31:41 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://robertdot.org/2007/02/15/php-documentation-generators/</guid>
		<description><![CDATA[
 I&#8217;ve been looking at documentation generators recently.  Specifically, I&#8217;m playing with a new website that I want to do Right.  Here are some notes for anyone looking at PHP documentation generators.

Languages

 I needed a documentation generator primarily for PHP.  However, I thought it&#8217;d be nice if it&#8217;d create documentation for JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>
 I&#8217;ve been looking at documentation generators recently.  Specifically, I&#8217;m playing with a new website that I want to do Right.  Here are some notes for anyone looking at PHP documentation generators.
</p>
<h2>Languages</h2>
<p>
 I needed a documentation generator primarily for <abbr title="PHP Hypertext Preprocessor">PHP</abbr>.  However, I thought it&#8217;d be nice if it&#8217;d create documentation for JavaScript as well.
</p>
<h2>Possible Options</h2>
<ol>
<li>
<h3>PHPDocumentor</h3>
<p>
   Formerly called PHPDoc, <a href="http://phpdoc.org/">PHPDocumentor</a> was my first choice because I&#8217;ve heard of it before.  It&#8217;s based on JavaDoc, and is conveniently packaged in <abbr title="PHP Extension and Application Repository">PEAR</abbr>.  The syntax is a little weird at first, and documenting blocks of code inline doesn&#8217;t seem to be possible.  However, it figures out a lot of useful stuff.  PHPDocumentor, of course, doesn&#8217;t work with JavaScript.  Despite the lacking feature, this is document generator I implemented.
  </p>
</li>
<li>
<h3>HeaderDoc</h3>
<p>
   <a href="http://developer.apple.com/opensource/tools/headerdoc.html">HeaderDoc</a> is Apple&#8217;s documentation system.  It works with both PHP and JavaScript (as well as several other languages).  I browsed the documentation, but haven&#8217;t bothered downloading the PERL code to compile it.  I skipped on it because it seems far too robust (that is, bloated) for what I need and lacked some of the niceties of PHPDocumentor (<abbr title="for example">e.g.</abbr> detecting function names).
  </p>
</li>
<li>
<h3>Natural Docs</h3>
<p>
   I was <em>really</em> excited about <a href="http://www.naturaldocs.org/">Natural Docs</a> when I first heard about it.  The syntax seemed easy and it was supposed to understand inheritance, which would be a boon for JavaScript.  Unfortunately, JavaScript and PHP are only supported insofar as they can be read in the document.  No nifty features like they have with ActionScript, PERL, and <abbr title="C Sharp">C#</abbr>.  Too bad.
  </p>
</li>
<li>
<h3>Others</h3>
<p>
   I briefly looked at a few others that supported PHP and JavaScript.  <a href="http://www.xs4all.nl/~rfsber/Robo/robodoc.html">RoboDoc</a> has <abbr title="fucking ugly">fugly</abbr> syntax and TwinText is supposedly Windows only (assuming it existed).  Neither were going to be right for me.
  </p>
</li>
</ol>
<h2>PHPDocumentor in Use</h2>
<h3>Install</h3>
<p>
 As I mentioned, PHPDocumentor is a PEAR package.  That made the install very easy.  I actually overcomplicated it quite a bit because of a few errors I had with the script.  For future reference, you want to run <kbd>pear install PHPDocumentor-beta</kbd> since PHPDoc is depreciated. One will override the other.
</p>
<p>
 As I said, when I tried to run <kbd>phpdoc</kbd>, I got an error about a file missing.  Mac OS X apparently stores files in different places than the package expects.  So, I had to edit the package and add <code>chdir("/usr/lib/php/");</code> so that <code>include("PhpDocumentor/phpDocumentor/phpdoc.inc");</code> would be run in the proper directory.
</p>
<p>
 Since I wanted to have my documentation as a sub directory of my site, I had to write a shell script to clean out my documentation folder then run the PHPDocumentor command.  Otherwise, PHPDocumentor would attempt to document the documentation.
</p>
<h3>Learning</h3>
<p>
 I was a little bewildered by the syntax at first.  This is mainly because it&#8217;s really hard to find solid examples of how to document code.  The <a href="http://manual.phpdoc.org">manual</a> provides a little bit of instruction, but lacks real world examples.  Luckily, I found a good example in the <a href="http://pear.php.net/manual/en/standards.sample.php">PEAR coding standards documentation</a>.  It wasn&#8217;t long until the syntax was second nature.
</p>
<p>
 The only real gripe I have is that I&#8217;d like to be able to make inline comments about specific blocks of code.  For example, a <code>switch</code>.  It turns out that you have to do that within the function discussion.  You can print code blocks in the discussion area, however.  So, it&#8217;s almost as though you can do inline documentation.
</p>
<p>
 I also should note that <code>@var</code> can only be attached to a class variable declaration, not any variable at all.
</p>
<h3>Output</h3>
<p>
 I struggled with the output.  I hate frames.  So, I used the Smarty layouts for output at first.  Eventually, I switched to the default frames layout because it handled some of the output better (e.g. unordered lists in discussions).  Otherwise, it makes nice legible documentation that can be read on a web browser.  It can also output <abbr title="Portable Document Format">PDF</abbr>, and Windows Help files.
</p>
<h2>Final Opinions</h2>
<p>
 PHPDocumentor is a pretty nice tool.  Not only does it create documentation, it introduces a standard for commenting that is very legible.  While I wish I cold have found a JavaScript and PHP document generator that I was happy with, PHPDocumentor does its job well.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertdot.org/2007/02/15/php-documentation-generators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wikka Wiki Bread Crumbs</title>
		<link>http://robertdot.org/2006/11/10/wikka-wiki-bread-crumbs/</link>
		<comments>http://robertdot.org/2006/11/10/wikka-wiki-bread-crumbs/#comments</comments>
		<pubDate>Sat, 11 Nov 2006 04:20:02 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[Wikka Wiki]]></category>

		<guid isPermaLink="false">http://robertdot.org/2006/11/10/wikka-wiki-bread-crumbs/</guid>
		<description><![CDATA[
 Dan decided he wanted to set up a wiki to build content.  I wasn&#8217;t involved in the process, but I got the job of making a bread crumbs script for the site.


 Dan decided to use Wikka Wiki.  When I asked why he didn&#8217;t use Media Wiki (the software that Wikipedia uses, [...]]]></description>
			<content:encoded><![CDATA[<p>
 Dan decided he wanted to set up a wiki to build content.  I wasn&#8217;t involved in the process, but I got the job of making a bread crumbs script for the site.
</p>
<p>
 Dan decided to use <a href="http://wikkawiki.org/">Wikka Wiki</a>.  When I asked why he didn&#8217;t use <a href="http://www.mediawiki.org/">Media Wiki</a> (the software that <a href="http://www.wikipedia.org/">Wikipedia</a> uses, which seems to be the de-facto standard), he said it required <abbr title="PHP Hypertext Preprocessor">PHP</abbr> 5, which our server doesn&#8217;t have.  I guess that was a good-enough reason.
</p>
<p>
 For all my niggles with Wikka Wiki, it is actually pretty standards compliant and has a cute name.  The main issue with Wikka Wiki, which might be an issue with all wikis (I wouldn&#8217;t know since this is the first one I&#8217;ve ever coded on), is how it stores links from one page to another.  It has a links table with a <code>from_tag</code> and <code>to_tag</code>.  This is logical and works quite well until you try to do bread crumbs.
</p>
<p>
 When you send a query to get every link that should go on a page, recursive links aren&#8217;t a problem.  When you are trying to make a recursive function to get a bread crumb trail, it is quite annoying.  Since Dan was in a hurry, he just did 10 left joins on the same table with a limit of one.  That got the job done but didn&#8217;t always show a logical or short-route path to the current page.  Dan decided that I was better at recursive functions and told me to work on it when I had time (except he calls them cookie crumbs instead of bread crumbs, which you&#8217;ll see in the code).  After about 10 tries, I came up with the following:
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> BuildCookieCrumbs2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span> <span style="color: #000088;">$depth</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CareerOpportunities&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;DefaultMenu&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;CurrentFrontPage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$depth</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$page</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT to_tag, from_tag FROM career_opportunities_links WHERE from_tag IN ('&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;')&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SET NAMES UTF8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>Query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$o</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;">$f</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: #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;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$o</span><span style="color: #009900;">&#91;</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;">&quot;to_tag&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$f</span><span style="color: #009900;">&#91;</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;">&quot;from_tag&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_search</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span><span style="color: #000088;">$o</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$f</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$o</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#93;</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;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$bcc</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>BuildCookieCrumbs2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span><span style="color: #000088;">$depth</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #000088;">$o</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$ret</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$bcc</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$tmp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT FIND_IN_SET(from_tag,'&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;') as fis FROM career_opportunities_links WHERE from_tag IN ('&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;','&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;') AND to_tag = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$tmp</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SET NAMES UTF8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$r</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>Query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;fis&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$ret</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span><span style="color: #000088;">$tmp</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$ret</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> BuildCookieCrumbs<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>BuildCookieCrumbs2<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$ret</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&amp;gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">array_values</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>
 These two functions can be dropped into the <code>Wakka.class.php</code> file.  I have no idea how to call it and put it into the template, as that part was already done when I started working on it.  Sending the current page will return an array of tags to use in the bread crumb trail.  You&#8217;ll probably want to change the default menu array in the <code>BuildCookieCrumbs2</code>, as it is set up to reflect our site.
</p>
<p>
 This may not be the best solution, but it works pretty well.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertdot.org/2006/11/10/wikka-wiki-bread-crumbs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
