Jump to content

[SOLVED] shouldnt the echo produce the results


bigbenbuilders

Recommended Posts

sorry guys one more issue when the section id is 10 11 12 etc. it pulls the 1 also?  Here is the code please help

 

<?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=1') !== false) {
$class = 'alumni_tab_1_index';
$mouseOver='alumni_tab_1_on_index';
$mouseOut = 'alumni_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">alumni</div>

here is pretty much the entire code...what it does it turns one tab on or off depending on what page you are on.  sectionid11 is also turning on sectionid1

 

<?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=1') !== false) {
$class = 'alumni_tab_1_index';
$mouseOver='alumni_tab_1_on_index';
$mouseOut = 'alumni_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">alumni</div>
            </a></td>
            <td width="105"><a href="index.php?option=com_content&task=category&sectionid=2&id=14&Itemid=37" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=2') !== false) {
$class = 'giving_tab_1_index';
$mouseOver='giving_tab_1_on_index';
$mouseOut = 'giving_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">giving</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=11&id=232&Itemid=250" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=11') !== false) {
$class = 'kreft_tab_1_index';
$mouseOver='kreft_tab_1_on_index';
$mouseOut = 'kreft_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">kreft arts</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=3&id=198&Itemid=207" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=3') !== false) {
$class = 'library_tab_1_index';
$mouseOver='library_tab_1_on_index';
$mouseOut = 'library_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">library</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=12&id=240&Itemid=257" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=12') !== false) {
$class = 'graduate_tab_1_index';
$mouseOver='graduate_tab_1_on_index';
$mouseOut = 'graduate_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">graduate studies</div>

Problem solved. Single digit section ID's (1, 2, etc) now have leading zeroes (01, 02, etc).

I updated it in the below script, but you might need to update it in different site links.

 

<?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=01') !== false) {
$class = 'alumni_tab_1_index';
$mouseOver='alumni_tab_1_on_index';
$mouseOut = 'alumni_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">alumni</div>
            </a></td>
            <td width="105"><a href="index.php?option=com_content&task=category&sectionid=02&id=14&Itemid=37" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=02') !== false) {
$class = 'giving_tab_1_index';
$mouseOver='giving_tab_1_on_index';
$mouseOut = 'giving_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_01_on';
$mouseOut = 'tab_01';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">giving</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=11&id=232&Itemid=250" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=11') !== false) {
$class = 'kreft_tab_1_index';
$mouseOver='kreft_tab_1_on_index';
$mouseOut = 'kreft_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">kreft arts</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=3&id=198&Itemid=207" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=3') !== false) {
$class = 'library_tab_1_index';
$mouseOver='library_tab_1_on_index';
$mouseOut = 'library_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">library</div>
            </a></td>
             <td width="105"><a href="index.php?option=com_content&task=category&sectionid=12&id=240&Itemid=257" class="a_black text_10">
              <?php if (stripos($_SERVER['REQUEST_URI'],'sectionid=12') !== false) {
$class = 'graduate_tab_1_index';
$mouseOver='graduate_tab_1_on_index';
$mouseOut = 'graduate_tab_1_index';
}
else {
$class = 'tab_1';
$mouseOver = 'tab_1_on';
$mouseOut = 'tab_1';

}
?>
              <div class="<?php echo $class; ?>" onMouseOver="this.className='<?php echo $mouseOver; ?>'" onMouseOut="this.className='<?php echo $mouseOut; ?>'">graduate studies</div>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.