vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   how to create a recursive function in vbb (https://vborg.vbsupport.ru/showthread.php?t=234204)

Dev.Sun 01-26-2010 12:31 PM

how to create a recursive function in vbb
 
I got a Fatal error
Code:

Fatal error: Call to a member function query_read() on a non-object in public_html/vbbtest/includes/adminfunctions_navbarmanager.php on line 36
Bellow is my code and recursive function


PHP Code:

    $navbars $db->query_read ("SELECT * FROM " TABLE_PREFIX "navbar_manager ORDER BY navbarid ASC,sortorder ASC");
    while (
$navbar $db->fetch_array ($navbars))
    {
        
$mc++;
        
print_cells_row (array ($navbar['navbarname'], 
                                
$navbar['navbarname'], 
                                
$navbar['sortorder'],
            
construct_link_code ($vbphrase['edit'], "navbar_manager.php?" $vbulletin->session->vars['sessionurl'] . "do=manager&so=edit&navbarid=$navbar[navbarid]") .
            
construct_link_code ($vbphrase['delete'], "navbar_manager.php?" $vbulletin->session->vars['sessionurl'] . "do=manager&so=delete&navbarid=$navbar[navbarid]")
        ));
    
        
getMenucon($navbar['navbarid']);    
    } 

recursive function
PHP Code:


function getMenucon($id_cha){
    
$sqlMenuCon $db->query_read("SELECT * FROM " TABLE_PREFIX "navbar_manager WHERE navbarparentid = "intval ($id_cha) ." order by sortorder");
    while(
$navbar2 $db->fetch_array($sqlMenuCon))
    {
        
print_cells_row (array ($navbar['navbarname'], 
                                        
$navbar['navbarname'], 
                                        
$navbar['sortorder'],
                    
construct_link_code ($vbphrase['edit'], "navbar_manager.php?" $vbulletin->session->vars['sessionurl'] . "do=manager&so=edit&navbarid=$navbar[navbarid]") .
                    
construct_link_code ($vbphrase['delete'], "navbar_manager.php?" $vbulletin->session->vars['sessionurl'] . "do=manager&so=delete&navbarid=$navbar[navbarid]")
                ));
    }  


this code work when i test out site vbulletin.

Anybody can help me?


All times are GMT. The time now is 05:27 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.01025 seconds
  • Memory Usage 1,728KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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