View Single Post
  #4  
Old 09-06-2000, 04:26 PM
Guest
 
Posts: n/a
Default

There are a couple errors in your code involving extra and missing brackets so I wonder how you are running it. Here is a "fixed" version as in it seems to work

Code:
// ###################### Start makeforumjump ####################### 
function makeforumjump () 
{ 
   // this generates the jump to box 
   global $DB_site, $forumid, $optionselected, $usecategories, $jumpforumid, $jumpforumtitle, $jumpforumbits, $curforumid; 
   global $hideprivateforums, $defaultselected, $forumjump, $bbuserid, $bbusergroupid; 

   if ($forumid != "") 
   { $curforumid = $forumid; } 
   else 
   { if ($threadid != "") 
     { 
        $getforumid = $DB_site->query_first ("SELECT forumid FROM thread WHERE threadid=$threadid"); 
        $curforumid = $getforumid["forumid"]; 
     } 
   } 

   $categorys = $DB_site->query ("SELECT category.categoryid, category.title as ctitle, category.displayorder , forum.forumid, forum.title as ftitle, forum.displayorder FROM category,forum WHERE forum.categoryid=category.categoryid AND forum.displayorder <>0 and category.displayorder<>0 and forum.active=1 order by category.displayorder, forum.displayorder"); 
   $this_cat=0; 
   $old_categoryid=0; 
   $old_ctitle=""; 

   while ($category = $DB_site->fetch_array ($categorys)) 
   { 
      $forum=$category; 

      if ( $this_cat != $category["categoryid"] ) 
      { 
         if ($this_cat >0) 
         { 
            if ($usecategories == 1 and $forumshown == 1) 
            { 
               $jumpforumid = ""; 
               $jumpforumtitle = ""; 
               eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 

               if ($curforumid == "cat$old_categoryid") 
               {  $optionselected = "selected";   } 
               $jumpforumid = "cat$old_categoryid"; 
               $jumpforumtitle = "Category: $old_ctitle"; 
               eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
               $optionselected = ""; 
               $jumpforumid = ""; 
               $jumpforumtitle = "--------------------"; 
               eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
            } 
            // add forum bits 
            $jumpforumbits.= $tempjumpforumbits; 
         } 

         $optionselected = ""; 
         $forumshown = 0; 
         $tempjumpforumbits = ""; 
         $this_cat = $category["categoryid"]; 
         $old_categoryid = $this_cat; 
         $old_ctitle=$category["ctitle"]; 
     }
     if ($hideprivateforums == 1) 
     {  $getperms = getpermissions ($bbuserid, $bbusergroupid, $forum["forumid"]); } 
     else 
     {  $getperms["canview"] = 1; } 

     if ($getperms["canview"] == 1) 
     { 
        $forumshown = 1; 
        $jumpforumid = $forum["forumid"]; 
        $jumpforumtitle = " " . $forum["ftitle"]; 
     }
     else 
     {  $optionselected = ""; } 
     eval ("\$tempjumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
   } // end if $getperms... 
 
   if ($usecategories == 1 and $forumshown == 1) 
   { 
      $jumpforumid = ""; 
      $jumpforumtitle = ""; 
      eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
 
      //if ($curforumid == "cat".$category["categoryid"]) 
      if ($curforumid == "cat$old_categoryid") 
      {  $optionselected = "selected";    } 
      // $jumpforumid = "cat" . $category["categoryid"]; 
      $jumpforumid = "cat$old_categoryid"; 
      // $jumpforumtitle = "Category: " . $category["ctitle"]; 
      $jumpforumtitle = "Category: $old_ctitle"; 
      eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
      $optionselected = ""; 
      $jumpforumid = ""; 
      $jumpforumtitle = "--------------------"; 
      eval ("\$jumpforumbits .= \"".gettemplate ("jumpforumbit")."\";"); 
   } 

   // add forum bits 
   $jumpforumbits.= $tempjumpforumbits; 

   if ($selectedone != 1) 
   {   $defaultselected = "selected"; } 
   eval ("\$forumjump = \"".gettemplate ("forumjump")."\";"); 

   if ($curforumid == $jumpforumid) 
   { 
      $optionselected = "selected"; 
      $selectedone = 1; 
   } 
}
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01083 seconds
  • Memory Usage 1,789KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete