Page 1 of 1

Reference a specific url in php

Posted: Wed Apr 15, 2009 10:35 am
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;

Re: Reference a specific url in php

Posted: Wed Apr 15, 2009 11:28 am
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;
    }
}