hey guys, im trying to change a menu items color, if a user was on the members section, the member menu icon would be a different colour to the other menu items etc.
initially the menu item <li> has no css class assigned to it, but once they visit a page, the <li> tag is assigned a class ie .visited{colour:#fff;)
its implemented in php, firstly ive got a url check to see what page the current url is on, and then change the class
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
if($pageURL=="http://mysite.com/")
{
return
}
else if($pageURL=="http://mysite.com/category.php?id_category=26")
{
help here..
}
else if($pageURL=="http://mysite.com/cms.php?id_cms=16")
{
and here..
}
else if($pageURL=="http://mysite.com/cms.php?id_cms=31")
{
and here..
}
else if($pageURL=="http://mysite.com/cms.php?id_cms=22")
{
and here..
}
}
as you can see above, im finding it hard to finish the last piece to this puzzle.. how to change the class of the li tag to a different one. would really appreciate any input.
Cheers
D