vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Switch Function Help (https://vborg.vbsupport.ru/showthread.php?t=49151)

sabret00the 02-20-2003 02:14 PM

Switch Function Help
 
Really wern't sure if this forum was only for vB related issues or not but since the help here seems to be the best i've come across i thought i'd risk a telling offf and ask, can someone tell me where i've gone wrong

PHP Code:

                  <?
                  switch ($page)
                  {
                      case "site":
                                  switch ($cat)
                          {
                              case "whatisebs":
                                  include "incl/site_whatisebs.ebs.php";
                              break;
                              case "staff":
                                  include "incl/site_staff.ebs.php";
                              break;
                              default:
                                  include "incl/site_index.ebs.php";
                          }
                  
                      break;
                      case "life":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/life_articles.ebs.php";
                              break;
                              case "gallery":
                                  include "incl/life_gallery.ebs.php";
                              break;
                              case "art":
                                  include "incl/life_art.ebs.php";
                              break;
                              case "cam":
                                  include "incl/life_cam.ebs.php";
                              break;
                              case "poems":
                                  include "incl/life_poems.ebs.php";
                              break;
                              default:
                                  include "incl/life_index.ebs.php";
                          }
                  
                      break;
                      case "music":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/music_articles.ebs.php";
                              break;
                              case "chart":
                                  include "incl/music_chart.ebs.php";
                              break;
                              case "weekly":
                                  include "incl/music_weekly.ebs.php";
                              break;
                              case "monthly":
                                  include "incl/music_monthly.ebs.php";
                              break;
                              default:
                                  include "incl/music_index.ebs.php";
                          }
                  
                      break;
                      case "screen":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/screen_articles.ebs.php";
                              break;
                              case "reviews":
                                  include "incl/screen_reviews.ebs.php";
                              break;
                              case "recommended":
                                  include "incl/screen_recommended.ebs.php";
                              break;
                              default:
                                  include "incl/screen_index.ebs.php";
                          }
                  
                      break;
                      case "sport":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/sport_articles.ebs.php";
                              break;
                              case "ebsprem":
                                  include "incl/sport_ebsprem.ebs.php";
                              break;
                              default:
                                  include "incl/sport_index.ebs.php";
                          }
                      break;
                      case "games":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/games_articles.ebs.php";
                              break;
                              case "reviews":
                                  include "incl/games_reviews.ebs.php";
                              break;
                              default:
                                  include "incl/games_index.ebs.php";
                          }

                      break;
                      case "web":
                                  switch ($cat)
                          {
                              case "articles":
                                  include "incl/web_articles.ebs.php";
                              break;
                              case "reviews":
                                  include "incl/web_reviews.ebs.php";
                              break;
                              case "links":
                                  include "incl/web_links.ebs.php";
                              break;
                              default:
                                  include "incl/web_index.ebs.php";
                          }

                      break;
                      default:
                          include "incl/index.ebs.php";
                  }
                  
                  ?>

the page switch works fine, but the cat switch doesn't seem to wanna work, help :squareeyed: :nervous:

filburt1 02-21-2003 02:49 PM

Don't see anything immediately but you should really indent things properly. The most likely thing is a screwed-up brace or missing break;.

Also a side note: switch () is a language construct, not a function :)

sabret00the 02-21-2003 07:45 PM

sorry about that, the code was perfect, i was just trying to recall something wrong :nervous:

/me is embarassed


All times are GMT. The time now is 10:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01132 seconds
  • Memory Usage 1,773KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete