Reference a specific url in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thexyzaffair
Forum Newbie
Posts: 1
Joined: Wed Apr 15, 2009 10:29 am

Reference a specific url in php

Post by thexyzaffair »

I'm using a Joomla site and I have a problem. I'm using the right module on the front page and on several other pages. The result I want is for the module background (referenced below) to only appear when I'm using the right module on the front page. I'm trying to do this by saying: "If there is a right module AND the url is "www.peopleadmin.com/15/index.php" then use the background below. For all other urls in the site I want no background. Can anyone help modify the code below to make that work correctly?

*By default it states that if there is a right module (no url reference) use this background so it uses it on every page where a right module exists*

if ($has_right && ($_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] == "www.peopleadmin.com/15/index.php") && ($_SERVER['QUERY_STRING'] == "")) {
$tw -= $rw;
echo '
#jsn-content_inner2 {
background: transparent url('.$template_path.'/images/bg/rightside'.$rw.'-bg-full.png) repeat-y '.(100-$rw).'% top;
padding: 0;
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

Re: Reference a specific url in php

Post by php_east »

1.5 right ?

Code: Select all

//( $template_path and $rw to be defined ealier )
 
$menu   = & JSite::getMenu();
$style  = '<style type="text/css">
    #jsn-content_inner2 
        {
        background: transparent url('.$template_path.'/images/bg/rightside'.$rw.'-bg-full.png) repeat-y '.(100-$rw).'% top;
        padding: 0;
        }
    </style>';
 
if ($menu->getActive() == $menu->getDefault()) 
{
//   echo 'This is the front page';
if ($this->countModules('right'))
    {
    echo $style;
    }
}
 
Post Reply