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>

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.