GeekFist Posted June 4, 2008 Share Posted June 4, 2008 Greetings, I'm getting the run around everywhere else I go with this issue so I hope the php guru's here can help me. I have a joomla site set up with a template a purchased last year. Unfortunately, the images on the menu buttons aren't doing what they are supposed to do and I tracked down the issue to a possible php coding or html problem. Hopefully someone can shed some light on this issue. Currently, my site is supposed to have big buttons near the top that have images. These images are pre-set in a specific folder so that the template can find and use them easily. This was already set up with the default installation. Unfortunately, no matter what button codes I use the only one that shows up is b0. The number can be anywhere between b0 and b20. b0 displays a blank button and b11 displays a home image inside the button, b17 puts a mail image inside a button, etc. Please excuse my coding newbieness and lack of proper terms. My HTML code currently has the variable $menu_buttons declared as such: $menu_buttons = array("b11","b18","b19","b16", "b17"); Using this function allows different images to be displayed on different buttons. This $menu_buttons variable is dependent on other variables being declared correctly, which they are and have been tested as such. The line that states that a certain php file is to be read for this configuration is stated as such: require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/rt_splitmenu2.php"); Now, the line that I found in the rt_splitmenu2.php file that I believe is causing all of the problems is this: if (isset($menu_buttons)) { $img_class .= ' class="' . $menu_buttons[($button_index)%count($menu_buttons)] . '"'; $button_index++; } else { $img_class .= ' class="b0"'; As you recall, all of my buttons use the b0 designation no matter what I put in $menu_buttons array();. I've tried changing class="b0" to class="b11" in the php file and it changed all of my menu buttons to the correct image for b11 but I cannot make it so that there is a different image in each button. So something in the first part of that code block is causing the issue. Thing is, I have no idea what those lines of code do. I've tried fiddling around with the code (after I backed up everything of course) and I've gotten nowhere. There is more code to that php file but I only included what I thought was relevant, there are other instances of $img_class and $button_index in the php file. I'm sorry if this is vague or not enough information, I can provide whatever you want as long as I can get this working. Thanks. GF Link to comment https://forums.phpfreaks.com/topic/108656-menu-buttons-not-displaying-correctly/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.