Fail to using if/else to hover image by dynamic url
I'm using the basic way to doing the hover image as the CSS method doesn't
work for me. Current I'm using the if/else statement to do so. If the
contain the URL like abc.com it will hover the image.
But now I only can hover the group url but if there is sub categories in
groups I won't able to hover, how can I do it all the activity inside the
group, the image will hover?
Similar like we doing searching in MySQL the words/variable as using "%".
<?php
$request_url = apache_getenv("HTTP_HOST") . apache_getenv("REQUEST_URI");
$e = 'abc.com/dev/';
$f = 'abc.com/dev/groups/';
$g = 'abc.com/dev/user/';
?>
<div class="submenu">
<?php
if ($request_url == $e) {
echo '<a href="' . get_settings('home') . '"><div
class="icon-home active"></div></a>';
} else {
echo '<a href = "' . get_settings('home') . '"><div class =
"icon-home"></div></a>';
}
?>
<?php
if ($request_url == $f) {
echo '<a href="' . get_settings('home') . '/groups/"><div
class="icon-groups active"></div></a>';
} else {
echo '<a href = "' . get_settings('home') . '/groups/"><div
class = "icon-groups"></div></a>';
}
?>
</div>
No comments:
Post a Comment