Reply to Re: Change color of links that have a target of the page on which they are found.

Your name:

Reply:


Posted by Neredbojias on 06/22/07 02:26

On Thu, 21 Jun 2007 14:30:49 GMT rf scribed:

>> After reading Beauregard's and BootNic's advices, I decided mine
>> rather suck... er, was inelegant. Ergo, I tried something better.
>>
>> For example:
>>
>> Your "menu" page to be included could look something like this:
>>
>> <ul>
>> <li><? if ($exclude == 'page1') { ?><span
>> style="background:inherit;color:yellow;">Page 1</span><? } else {
>> ?><a href="page1.html">Page 1</a><? } ?>
>
> <searches archives for things I used to do>
>
> $page =
> array_shift(explode('.',array_pop(explode('/',$_SERVER['PHP_SELF']))));

Uh, who do you think I am, -Einstein?
I'd take it kindly if you'd please explain the above in detail so my
headache would go away and I could get back to watching those reruns of
"The Three Stooges" I enjoy so much...

> echo "<ul>\r\n";
> echo ($page == "page1") ? "<li><span>Page 1</span></li>\r\n" :
> "<li><a href='page1.php'>Page 1</a></li>\r\n";
> echo ($page == "page2") ? "<li><span>Page 2</span></li>\r\n" :
> "<li><a href='page2.php'>page 2</a></li>\r\n";
> echo "</ul>\r\n";

This part I get: ternary (sp?) conditionals, not much different than my
example.

> Watch the wrap.
>
> Style the <span>s and the <a>s to taste.
>
> Next stage is to wrap it up in a nice pretty function.

Sure. I can't wait to have at it...

--
Neredbojias
He who laughs last sounds like an idiot.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация