Monkuar Posted May 12, 2009 Share Posted May 12, 2009 Ok here's the deal. My forum shows subforums on each category if there any, here is the code for that: ///------------------------------- // Get The Subforums //------------------------------- $querysub = $DB->query("SELECT name, id, read_perms FROM ibf_forums WHERE parent_id = '{$forum_data['id']}' ORDER BY ibf_forums.position"); if($DB->get_num_rows($querysub) > 0) { $subinfo = "<span class=desc><br>Subforums: "; while($subin = $DB->fetch_row($querysub)) { if ( $subin['read_perms'] != '*' ) { if ( ! preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $subin['read_perms'] ) ) { $subinfo .= ""; } else if ( preg_match( "/(^|,)".$ibforums->member['mgroup']."(,|$)/", $subin['read_perms'] ) ) { $subinfo .= "<a href='{$ibforums->base_url}showforum={$subin['id']}'>{$subin['name']}</a>, "; } } else if ( $subin['read_perms'] == '*' ) { $subinfo .= "<span class=desc><a href='index.php?showforum={$subin['id']}'>{$subin['name']}</a></span> - "; } } $subinfo = substr ($subinfo, 0, -2); } Ok now, I want a user to beable to switch on and off by clicking 1 link to show those subforums and hide those subforums: kinda like this picture: Ok so your saying that it's a different question and im asking for help on a forum? Wrong I have the link and the functions to use the link here: In my Login.php there's this thing I added. case '08': $this->showhidesubforums(); break; I did that so then When people click: forums/index.php?act=Login&CODE=08 It reads off this function showhidesubforums(): function showhidesubforums() { global $ibforums, $DB, $std, $_COOKIE; put my code in this spot so i can show/hide subforums $std->boink_it($ibforums->base_url); exit(); } Ok please please I am willing to stay with u and get help from u and obsorb your knowledge in.. but I need ur help (im french srry for language) But yea, I need to put in a case switch php to show/hide the subforums code way above or what? Please please guys, Help Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/ Share on other sites More sharing options...
Monkuar Posted May 12, 2009 Author Share Posted May 12, 2009 Im going to school But I gota bump this Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-832381 Share on other sites More sharing options...
radi8 Posted May 12, 2009 Share Posted May 12, 2009 I have accomplished this in 2 ways. First, in my learning days, I would put a button on the form to force a page reload and then have the new form drawn. This is old school and not very efficient, although extremely effective. It can be frustrating for a user to have to wait for the page reload especially if a lot of db access is going on. The second method is to use javascript and to manipulate div sections, essentially turning a div section on/off on the fly. This does not require a page reload and is extremely fast and effective. Check the java script section for samples of this or pm me and I will supply an example of my crappy code. Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-832517 Share on other sites More sharing options...
Monkuar Posted May 13, 2009 Author Share Posted May 13, 2009 I would love example of this code if u can post it below mine sir, please.? If u have aol or msn can add me for more help too? Thanks sir! Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-832993 Share on other sites More sharing options...
Monkuar Posted May 13, 2009 Author Share Posted May 13, 2009 Bumping this Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-833533 Share on other sites More sharing options...
Monkuar Posted May 14, 2009 Author Share Posted May 14, 2009 5$.. VIA PAypal if I get it to work Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-833759 Share on other sites More sharing options...
Monkuar Posted May 14, 2009 Author Share Posted May 14, 2009 Bump lol been 3rd day! Quote Link to comment https://forums.phpfreaks.com/topic/157770-toggle-view-with-php-case-switch-maybe/#findComment-834279 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.