<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Faux Active Link</title>
	<atom:link href="http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/</link>
	<description>Hypertext rulez™</description>
	<lastBuildDate>Wed, 23 Mar 2011 22:34:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: PaulC</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-825</link>
		<dc:creator>PaulC</dc:creator>
		<pubDate>Thu, 28 Jul 2005 13:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-825</guid>
		<description>Couldnt you do this just by re-defining the body tag?

eg. you have these styles:
&lt;i&gt;
li, li a {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #333333;
	font-size: 10px;
	text-decoration: none;
}
body.home li .home, body.about li a.about, body.products li a.products{
	color: #FF0000;
	text-decoration: underline;
	font-weight: bold;
}&lt;/i&gt;

the you change the body tag to any of the following &lt;i&gt;&lt;body class=&quot;about&quot;&gt;  or &lt;body class=&quot;home&quot;&gt;&lt;/i&gt; etc. etc.

Then you list items / menu is as follows:
&lt;i&gt;&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href=&quot;index.php&quot; class=&quot;home&quot;&gt;home&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href=&quot;about.php&quot; class=&quot;about&quot;&gt;about&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href=&quot;products.php&quot; class=&quot;products&quot;&gt;products&lt;/a&gt; ,&lt; &gt; &lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;/i&gt;

Just a crazy idea..  :)

see also &lt;a href=&quot;http://www.apple-source.co.uk/&quot;&gt;http://www.apple-source.co.uk/&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Couldnt you do this just by re-defining the body tag?</p>
<p>eg. you have these styles:<br />
<i><br />
li, li a {<br />
	font-family: Verdana, Arial, Helvetica, sans-serif;<br />
	color: #333333;<br />
	font-size: 10px;<br />
	text-decoration: none;<br />
}<br />
body.home li .home, body.about li a.about, body.products li a.products{<br />
	color: #FF0000;<br />
	text-decoration: underline;<br />
	font-weight: bold;<br />
}</i></p>
<p>the you change the body tag to any of the following <i>&lt;body class=&#8221;about&#8221;&gt;  or &lt;body class=&#8221;home&#8221;&gt;</i> etc. etc.</p>
<p>Then you list items / menu is as follows:<br />
<i>&lt;ul&gt;<br />
&lt;li&gt;&lt;a href=&quot;index.php&quot; class=&quot;home&quot;&gt;home&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;about.php&quot; class=&quot;about&quot;&gt;about&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;products.php&quot; class=&quot;products&quot;&gt;products&lt;/a&gt; ,&amp;lt; &amp;gt; &lt;/li&gt;<br />
&lt;/ul&gt;</i></p>
<p>Just a crazy idea..  :)</p>
<p>see also <a href="http://www.apple-source.co.uk/">http://www.apple-source.co.uk/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Perkins</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-239</link>
		<dc:creator>Justin Perkins</dc:creator>
		<pubDate>Fri, 04 Feb 2005 08:41:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-239</guid>
		<description>Just wanted to point out the Server Variables are always full of good information, like the REQUEST_URI.

Nobody has talked about ASP since the beginning, maybe since it is so old school. Try using

Request.ServerVariables(&quot;SCRIPT_NAME&quot;)</description>
		<content:encoded><![CDATA[<p>Just wanted to point out the Server Variables are always full of good information, like the REQUEST_URI.</p>
<p>Nobody has talked about ASP since the beginning, maybe since it is so old school. Try using</p>
<p>Request.ServerVariables(&#8220;SCRIPT_NAME&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-229</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Sun, 16 Jan 2005 11:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-229</guid>
		<description>Ryan,

Let&#8217;s stay on topic here. The logic for the last scenario is pretty much the same. You just need &lt;a href=&quot;http://www.php.net/manual/en/function.split.php&quot;&gt;some function&lt;/a&gt; to split the string &lt;code&gt;REQUEST_URI&lt;/code&gt; and place the substrings in an array. Something like:
&lt;code&gt;&lt;?php
list($directory, $subdirectory) = split(&#039;/&#039;, $_SERVER[&quot;REQUEST_URI&quot;]);
echo &#039;&lt;div class=&quot;&#039; . $directory . &#039; id=&quot;&#039; . $subdirectory . &#039;&quot;&gt;&#039;;
?&gt;&lt;/code&gt;
I have no time to test it, but it&#8217;s a good start for you to dive into it.

Yes, the &lt;a href=&quot;http://www.maratz.com/blog/archives/2004/08/21/comment-form-preview-script/&quot;&gt;comment form preview script&lt;/a&gt; have been explained and there is also a full &lt;a href=&quot;http://www.maratz.com/blog/archives/category/codingdesign/&quot;&gt;list of posts about coding&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Ryan,</p>
<p>Let&#8217;s stay on topic here. The logic for the last scenario is pretty much the same. You just need <a href="http://www.php.net/manual/en/function.split.php">some function</a> to split the string <code>REQUEST_URI</code> and place the substrings in an array. Something like:<br />
<code>&#60;?php<br />
list($directory, $subdirectory) = split('/', $_SERVER["REQUEST_URI"]);<br />
echo '&#60;div class="' . $directory . ' id="' . $subdirectory . '">';<br />
?></code><br />
I have no time to test it, but it&#8217;s a good start for you to dive into it.</p>
<p>Yes, the <a href="http://www.maratz.com/blog/archives/2004/08/21/comment-form-preview-script/">comment form preview script</a> have been explained and there is also a full <a href="http://www.maratz.com/blog/archives/category/codingdesign/">list of posts about coding</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-227</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Sat, 15 Jan 2005 23:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-227</guid>
		<description>I have one more question if you have time. By the way I&#039;m a beginner at php. :) 

This works with this url ....com/rideshare/:
&lt;code&gt;&lt;?php if ($_SERVER[&quot;REQUEST_URI&quot;] == &#039;/rideshare/&#039;) { echo &#039;ridesharetitle&#039;; } else { echo &#039;hometitle&#039;; } ?&gt;&lt;/code&gt;

Within the /rideshare/ folder  I have dynamic premalinks gernerated by WP.
ex: ....com/rideshare/&lt;strong&gt;this-title/&lt;/strong&gt;

How can I get the code
&lt;code&gt;&lt;?php if ($_SERVER[&quot;REQUEST_URI&quot;] == &#039;/rideshare/&#039;) { echo &#039;ridesharetitle&#039;; } else { echo &#039;hometitle&#039;; } ?&gt;&lt;/code&gt;
to include all the dynamic directories under the /rideshare/ directory? Hence, directories such as  &lt;em&gt;....com/rideshare/this-title/&lt;/em&gt; or &lt;em&gt;....com/rideshare/generated-title/&lt;/em&gt; or &lt;em&gt;....com/rideshare/could-be-anything/&lt;/em&gt;

Site in development is here:
&lt;a href=&quot;http://www.panictour.com/rideshare/&quot; title=&quot;Site in question.&quot;&gt;http://www.panictour.com/rideshare/&lt;/a&gt;

Postscript:
Have you ever released your &quot;preview comment&quot; code? I know hicks  has his version but your seems alot nicer.  I&#039;d like to get ahold of yours if you don&#039;t mind. By the way your site is very clean and professional.  I like it! 

Thanks again  for the help.

-Ryan</description>
		<content:encoded><![CDATA[<p>I have one more question if you have time. By the way I&#8217;m a beginner at php. :) </p>
<p>This works with this url &#8230;.com/rideshare/:<br />
<code>&#60;?php if ($_SERVER["REQUEST_URI"] == '/rideshare/') { echo 'ridesharetitle'; } else { echo 'hometitle'; } ?&#62;</code></p>
<p>Within the /rideshare/ folder  I have dynamic premalinks gernerated by WP.<br />
ex: &#8230;.com/rideshare/<strong>this-title/</strong></p>
<p>How can I get the code<br />
<code>&#60;?php if ($_SERVER["REQUEST_URI"] == '/rideshare/') { echo 'ridesharetitle'; } else { echo 'hometitle'; } ?&#62;</code><br />
to include all the dynamic directories under the /rideshare/ directory? Hence, directories such as  <em>&#8230;.com/rideshare/this-title/</em> or <em>&#8230;.com/rideshare/generated-title/</em> or <em>&#8230;.com/rideshare/could-be-anything/</em></p>
<p>Site in development is here:<br />
<a href="http://www.panictour.com/rideshare/" title="Site in question.">http://www.panictour.com/rideshare/</a></p>
<p>Postscript:<br />
Have you ever released your &#8220;preview comment&#8221; code? I know hicks  has his version but your seems alot nicer.  I&#8217;d like to get ahold of yours if you don&#8217;t mind. By the way your site is very clean and professional.  I like it! </p>
<p>Thanks again  for the help.</p>
<p>-Ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-226</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Sat, 15 Jan 2005 21:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-226</guid>
		<description>Works like a charm. Thanks for all your help. I appreciate it.

Thanks,

Ryan</description>
		<content:encoded><![CDATA[<p>Works like a charm. Thanks for all your help. I appreciate it.</p>
<p>Thanks,</p>
<p>Ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-222</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Sat, 15 Jan 2005 09:34:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-222</guid>
		<description>Ryan,

Regarding the code not showing up&#8212;use &#060; instead of  &lt;, otherwise it will be stripped. You don&#039;t have to place any unnecessary spaces.

If you place &lt;code&gt;&lt;?php $pageName = &quot;rideshare&quot;; ?&gt;&lt;/code&gt;in your &lt;code&gt;index.php&lt;/code&gt;, then all the subpages will have a &#8216;name&#8217; &#8220;rideshare&#8221;, because all of them are actually this same &lt;code&gt;index.php&lt;/code&gt;, but with a different query strings. To make you this clear, place somewhere inside the &lt;code&gt;body&lt;/code&gt; following line &lt;code&gt;&lt;?php  echo $pageName; ?&gt;&lt;/code&gt;.

Following example should solve the header problem. You don&#8217;t have to label page with &lt;code&gt;$pageName&lt;/code&gt;:

&lt;code&gt;&lt;div id=&quot;&lt;?php if ($_SERVER[&quot;REQUEST_URI&quot;] == &#039;/rideshare/&#039; /* or /rideshare.php or whatever URI for this page is... */) { echo &#039;ridesharetitle&#039;; } else { echo &#039;hometitle&#039;; } ?&gt;&quot;&gt;&lt;/code&gt;. 

(&lt;code&gt;REQUEST_URI&lt;/code&gt; is the URI without &lt;code&gt;http://domainname.com&lt;/code&gt; and starts with a slash.</description>
		<content:encoded><![CDATA[<p>Ryan,</p>
<p>Regarding the code not showing up&#8212;use &#38;#60; instead of  &#60;, otherwise it will be stripped. You don&#8217;t have to place any unnecessary spaces.</p>
<p>If you place <code>&#60;?php $pageName = "rideshare"; ?></code>in your <code>index.php</code>, then all the subpages will have a &#8216;name&#8217; &#8220;rideshare&#8221;, because all of them are actually this same <code>index.php</code>, but with a different query strings. To make you this clear, place somewhere inside the <code>body</code> following line <code>&#60;?php  echo $pageName; ?></code>.</p>
<p>Following example should solve the header problem. You don&#8217;t have to label page with <code>$pageName</code>:</p>
<p><code>&#60;div id="&#60;?php if ($_SERVER["REQUEST_URI"] == '/rideshare/' /* or /rideshare.php or whatever URI for this page is... */) { echo 'ridesharetitle'; } else { echo 'hometitle'; } ?>"></code>. </p>
<p>(<code>REQUEST_URI</code> is the URI without <code><a href="http://domainname.com" rel="nofollow">http://domainname.com</a></code> and starts with a slash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-221</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Fri, 14 Jan 2005 18:46:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-221</guid>
		<description>None of my code showed up! It did in the preview.</description>
		<content:encoded><![CDATA[<p>None of my code showed up! It did in the preview.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-220</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Fri, 14 Jan 2005 18:46:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-220</guid>
		<description>Thanks marko. I still can&#039;t get this to work. Works fine outside of WP but inside it does&#039;nt.

Here is what I&#039;m trying to do:

&lt;code&gt;&lt;div id= &quot;&lt;?php if ($pageName == &#039;rideshare&#039;) { echo &#039;ridesharetitle&#039;; } else { echo &#039;hometitle&#039;; } ?&gt;&quot;&gt;&lt;/code&gt;

This is in my WP index.php page on the very top:

&lt;code&gt;&lt;?php $pageName = &quot;rideshare&quot;;  ?&gt;
&lt;?php require(&#039;./wp-blog-header.php&#039;);  ?&gt;
&lt;?php require_once(&#039;http://www.panictour.com/graphical/header.php&#039;); ?&gt;&lt;/code&gt;

I&#039;m doing image relplacements for  titles  for each page of my site. I have the corrispoding css id for each page in my css.  I have a header.php include where this code is being called. I include this header inside my wp index.php page.  This works outside of WP perfectly. * the &quot;&lt;&gt;&quot; have no pspaces of course.

Thanks for you help on this.

-ryan</description>
		<content:encoded><![CDATA[<p>Thanks marko. I still can&#8217;t get this to work. Works fine outside of WP but inside it does&#8217;nt.</p>
<p>Here is what I&#8217;m trying to do:</p>
<p><code>&#60;div id= "&#60;?php if ($pageName == 'rideshare') { echo 'ridesharetitle'; } else { echo 'hometitle'; } ?>"></code></p>
<p>This is in my WP index.php page on the very top:</p>
<p><code>&#60;?php $pageName = "rideshare";  ?><br />
&#60;?php require('./wp-blog-header.php');  ?><br />
&#60;?php require_once('<a href="http://www.panictour.com/graphical/header.php" rel="nofollow">http://www.panictour.com/graphical/header.php</a>'); ?></code></p>
<p>I&#8217;m doing image relplacements for  titles  for each page of my site. I have the corrispoding css id for each page in my css.  I have a header.php include where this code is being called. I include this header inside my wp index.php page.  This works outside of WP perfectly. * the &#8220;&#60;>&#8221; have no pspaces of course.</p>
<p>Thanks for you help on this.</p>
<p>-ryan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-217</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Fri, 14 Jan 2005 10:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-217</guid>
		<description>Ryan,

This is  a bit tricky solution, but try something like following code. You don&#8217;t have to name every page, just copy -&gt; paste or include it it where your navigation should be. You should enable mod_rewrite (read WP manual for this). &lt;code&gt;$_SERVER[&quot;REQUEST_URI&quot;]&lt;/code&gt; returns something like &lt;code&gt;/wp/archive/2005/&lt;/code&gt;, depending on page requested.

&lt;code&gt;&lt;?php
    $nav_links = array(
        &quot;home&quot;             =&gt; &quot;/&quot;,
        &quot;archive&quot;           =&gt; &quot;/archive/&quot;
    );    
    $requestedPage = $_SERVER[&quot;REQUEST_URI&quot;];
    echo &#039;&lt;ul id=&quot;mainNav&quot;&gt;&#039; . &quot;\n&quot;;
    foreach ( $nav_links as $link_text =&gt; $link ) {
        if (strpos($requestedPage , $linkText) != false) {
            echo &#039;&lt;li&gt;&lt;span&gt;&#039; . $link_text . &#039;&lt;/span&gt;&lt;/li&gt;&#039; . &quot;\n&quot;;
        } else {
            echo &#039;&lt;li&gt;&lt;a href=&quot;&#039; . $link. &#039;&quot;&gt;&#039; . $link_text. &#039;&lt;/a&gt;&lt;/li&gt;&#039; . &quot;\n&quot;;
        }
    }
    echo &#039;&lt;/ul&gt;&#039; . &quot;\n&quot;;    
?&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ryan,</p>
<p>This is  a bit tricky solution, but try something like following code. You don&#8217;t have to name every page, just copy -> paste or include it it where your navigation should be. You should enable mod_rewrite (read WP manual for this). <code>$_SERVER["REQUEST_URI"]</code> returns something like <code>/wp/archive/2005/</code>, depending on page requested.</p>
<p><code>&#60;?php<br />
    $nav_links = array(<br />
        "home"             => "/",<br />
        "archive"           => "/archive/"<br />
    );<br />
    $requestedPage = $_SERVER["REQUEST_URI"];<br />
    echo '&#60;ul id="mainNav">' . "\n";<br />
    foreach ( $nav_links as $link_text => $link ) {<br />
        if (strpos($requestedPage , $linkText) != false) {<br />
            echo '&#60;li>&#60;span>' . $link_text . '&#60;/span>&#60;/li>' . "\n";<br />
        } else {<br />
            echo '&#60;li>&#60;a href="' . $link. '">' . $link_text. '&#60;/a>&#60;/li>' . "\n";<br />
        }<br />
    }<br />
    echo '&#60;/ul>' . "\n";<br />
?></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimbo</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-215</link>
		<dc:creator>Jimbo</dc:creator>
		<pubDate>Fri, 14 Jan 2005 09:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-215</guid>
		<description>This is a great solution and it avoids a query string which is what I most like about it, I used the exact same method when I first started making my new website a few months ago in PHP, before this post (still not live!).

Spooky.</description>
		<content:encoded><![CDATA[<p>This is a great solution and it avoids a query string which is what I most like about it, I used the exact same method when I first started making my new website a few months ago in PHP, before this post (still not live!).</p>
<p>Spooky.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-213</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Thu, 13 Jan 2005 23:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-213</guid>
		<description>I tryed your technique with a header include that is inside my wordpress application. I can&#8217;t get the  if/else statements to work. It just leaves it blank. 

Any ideas?</description>
		<content:encoded><![CDATA[<p>I tryed your technique with a header include that is inside my wordpress application. I can&#8217;t get the  if/else statements to work. It just leaves it blank. </p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-211</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Thu, 13 Jan 2005 17:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-211</guid>
		<description>I tried to explain this awhile back but didnt do such a good job as this! Thanks.

Here&#039;s what I had to say:

http://parrfolio.com/thoughts/index.php?p=19</description>
		<content:encoded><![CDATA[<p>I tried to explain this awhile back but didnt do such a good job as this! Thanks.</p>
<p>Here&#8217;s what I had to say:</p>
<p><a href="http://parrfolio.com/thoughts/index.php?p=19" rel="nofollow">http://parrfolio.com/thoughts/index.php?p=19</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B.J. Schaefer</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-192</link>
		<dc:creator>B.J. Schaefer</dc:creator>
		<pubDate>Wed, 22 Dec 2004 00:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-192</guid>
		<description>&lt;p&gt;Duh.  Guess I should have double checked my code.  Oh well.  Anyway - I&#039;m really digging your site (so many wonderful and thoughtful touches).  Oh, and, um, if you ever need a PHP/MySQL developer...you&#039;ve got my email *wink wink* (too bad I don&#039;t live in Croatia)&lt;/p&gt;
&lt;p&gt;Peace out,
B.J. Schaefer&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Duh.  Guess I should have double checked my code.  Oh well.  Anyway &#8211; I&#8217;m really digging your site (so many wonderful and thoughtful touches).  Oh, and, um, if you ever need a PHP/MySQL developer&#8230;you&#8217;ve got my email *wink wink* (too bad I don&#8217;t live in Croatia)</p>
<p>Peace out,<br />
B.J. Schaefer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-191</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Tue, 21 Dec 2004 10:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-191</guid>
		<description>B.J., this is excellent, because one doesn&#8217;t have to set conditions for each page. Now, the script handles it all automatically. I&#8217;ve just added the &lt;code&gt;&lt;li&gt;&lt;/code&gt;s in your example. Once again&#8212;great solution!</description>
		<content:encoded><![CDATA[<p>B.J., this is excellent, because one doesn&#8217;t have to set conditions for each page. Now, the script handles it all automatically. I&#8217;ve just added the <code>&#60;li></code>s in your example. Once again&#8212;great solution!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: B.J. Schaefer</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-190</link>
		<dc:creator>B.J. Schaefer</dc:creator>
		<pubDate>Tue, 21 Dec 2004 02:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-190</guid>
		<description>Here&#039;s my oh-so-humble contribution.  This is a bit more extensible, and much easier to manage.
It uses the same concept as your example: set &lt;var&gt;$pageName&lt;/var&gt; to the name of the current page, and include the &lt;var&gt;mainNav.php&lt;/var&gt; file wherever you want it inserted.&lt;code&gt;
// mainNav.php
/*
  Put this up at the top.  It&#039;s a just simple array with the page name as the key, and the URL as the value.
*/
  $nav_links = array(
    &quot;home&quot; =&gt; &quot;/&quot;,
    &quot;products&quot; =&gt; &quot;/products/&quot;
  );
&lt;/code&gt;
&lt;code&gt;
/*
  A simple foreach construct to cycle through each of the navigation links in the $nav_links array.  It checks against the key to see if it&#039;s the current page, and prints out a span instead of an anchor if so. 
*/
  print &quot;&lt;ul id=&quot;mainNav&quot;&gt;&quot;;
  foreach( $nav_links as $link_text=&gt;$link ){
    if( $link_text == $pageName ){
      print &quot;&lt;li&gt;&lt;span&gt;$link_text&lt;/span&gt;&lt;/li&gt;&quot;;
    }
    else {
      print &quot;&lt;li&gt;&lt;a href=&quot;$link&quot;&gt;$link_text&lt;/a&gt;&lt;/li&gt;&quot;;
    }
  }
  print &quot;&lt;/ul&gt;&quot;;
&lt;/code&gt;
Have Fun, and I hope this helps! ;)</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my oh-so-humble contribution.  This is a bit more extensible, and much easier to manage.<br />
It uses the same concept as your example: set <var>$pageName</var> to the name of the current page, and include the <var>mainNav.php</var> file wherever you want it inserted.<code><br />
// mainNav.php<br />
/*<br />
  Put this up at the top.  It's a just simple array with the page name as the key, and the URL as the value.<br />
*/<br />
  $nav_links = array(<br />
    "home" => "/",<br />
    "products" => "/products/"<br />
  );<br />
</code><br />
<code><br />
/*<br />
  A simple foreach construct to cycle through each of the navigation links in the $nav_links array.  It checks against the key to see if it's the current page, and prints out a span instead of an anchor if so.<br />
*/<br />
  print "&lt;ul id="mainNav">";<br />
  foreach( $nav_links as $link_text=>$link ){<br />
    if( $link_text == $pageName ){<br />
      print "&#60;li>&lt;span>$link_text&lt;/span>&#60;/li>";<br />
    }<br />
    else {<br />
      print "&#60;li>&lt;a href="$link">$link_text&lt;/a>&#60;/li>";<br />
    }<br />
  }<br />
  print "&lt;/ul>";<br />
</code><br />
Have Fun, and I hope this helps! ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-113</link>
		<dc:creator>Arjen</dc:creator>
		<pubDate>Wed, 15 Dec 2004 16:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-113</guid>
		<description>Renaming seems to do the trick. Many thanks!
If only I understood why exactly this is happening...

Oh well, it works so I&#039;m happy.

Thanks again.</description>
		<content:encoded><![CDATA[<p>Renaming seems to do the trick. Many thanks!<br />
If only I understood why exactly this is happening&#8230;</p>
<p>Oh well, it works so I&#8217;m happy.</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-112</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Wed, 15 Dec 2004 15:28:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-112</guid>
		<description>I don&#8217;t have an idea about this, but there is &lt;a href=&quot;http://webdesign.maratz.com/lab/faux_active_link/index.php&quot;&gt;full working example&lt;/a&gt; and also a &lt;a href=&quot;http://webdesign.maratz.com/lab/faux_active_link/faux_active_link.zip&quot;&gt;ZIP file&lt;/a&gt;, so you can check with it.

Try to rename file extension of &lt;code&gt;mainNav.php&lt;/code&gt; to &lt;code&gt;mainNav.php.txt&lt;/code&gt;, and then include it. The only explanation apart from misspelling is that the file which should be included is executed before including.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t have an idea about this, but there is <a href="http://webdesign.maratz.com/lab/faux_active_link/index.php">full working example</a> and also a <a href="http://webdesign.maratz.com/lab/faux_active_link/faux_active_link.zip">ZIP file</a>, so you can check with it.</p>
<p>Try to rename file extension of <code>mainNav.php</code> to <code>mainNav.php.txt</code>, and then include it. The only explanation apart from misspelling is that the file which should be included is executed before including.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-111</link>
		<dc:creator>Arjen</dc:creator>
		<pubDate>Wed, 15 Dec 2004 14:17:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-111</guid>
		<description>Hi Marko, thanks for the useful tutorial.

However, I have a small question about this. When I test this locally it works fine. When I upload it, the php gets included but somehow doesn&#039;t see the $pageName variable, so I never get the active link.

When I put this before the include:
&lt;code&gt;
echo $pageName ; 
&lt;/code&gt;

it nicely says: &#039;homePage&#039;.  However the following menu include doesn&#039;t &#039;see&#039; this. Any ideas??</description>
		<content:encoded><![CDATA[<p>Hi Marko, thanks for the useful tutorial.</p>
<p>However, I have a small question about this. When I test this locally it works fine. When I upload it, the php gets included but somehow doesn&#8217;t see the $pageName variable, so I never get the active link.</p>
<p>When I put this before the include:<br />
<code><br />
echo $pageName ;<br />
</code></p>
<p>it nicely says: &#8216;homePage&#8217;.  However the following menu include doesn&#8217;t &#8216;see&#8217; this. Any ideas??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dusoft</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-88</link>
		<dc:creator>dusoft</dc:creator>
		<pubDate>Fri, 19 Nov 2004 14:53:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-88</guid>
		<description>Even easier solution is just check for the page name if there are multiple pages used, e.g.:
&lt;pre&gt;
$basename=pathinfo($_SERVER[&quot;PHP_SELF&quot;]);
$basename=$basename[&quot;basename&quot;];
if ($basename==&quot;book.php&quot;) //do something
elseif ($basename==&quot;index.php&quot;) // do something
.
.
.
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Even easier solution is just check for the page name if there are multiple pages used, e.g.:</p>
<pre>
$basename=pathinfo($_SERVER["PHP_SELF"]);
$basename=$basename["basename"];
if ($basename=="book.php") //do something
elseif ($basename=="index.php") // do something
.
.
.
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-86</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Fri, 19 Nov 2004 08:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2004/11/18/faux-active-link/#comment-86</guid>
		<description>Trovster, you&#8217;re right! It&#8217;s fixed now : )</description>
		<content:encoded><![CDATA[<p>Trovster, you&#8217;re right! It&#8217;s fixed now : )</p>
]]></content:encoded>
	</item>
</channel>
</rss>

