View Single Post
  #9  
Old 07-19-2004, 02:47 PM
CarCdr CarCdr is offline
 
Join Date: Apr 2004
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nexialys
hum.. looks like i see where is your point... you would like to have parts of vB to become OOP... i don't think it's planned... OOP is not even recognised at php.net, even in PHP5...

your leveled navbar example is not concise...:
PHP Code:
$navbits construct_navbits(array(
                                    
'element_url.html'  => 'element_name',
                                    
''                  => 'last_element_name_without_link'
                            
)   ); 
is it so complicated to build ?!... you tell in your explanation that our actual structure is hard to understand... i think that OOP is complicated, not pure php...
It could just as easily be straight functions. using a class is a simple means of keeping information without using global variables. (Classes does require PHP 4. Creating a class does not require that vB be OOP. It's just standard PHP.)

As for my navbar call, it would work fine. In the initial call we were supplied the page title and the page URL. We save three pieces of information in globals:

1) The file name, saved in say $EXT_filename. E.g., foo.php
2) The URL, in say $EXT_url. E.g., ./foo.php
3) The page title, in say $pagetitle.

A call to generate a two-level navbar then only requires the page title of the sub-page. Hence, the call:
PHP Code:
$navbar get_navbar('Sub-page name'); 
would contain code along these lines:
PHP Code:
construct_navbits(array($EXT_url => $pagetitle
                        
''       => 'Sub-page name'
                        
)); 
It is the most common sort of design consideration to hide the structure of data where feasible. We now have the details of building a navbar in exactly one place, called by extensions.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02127 seconds
  • Memory Usage 1,778KB
  • 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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (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_onlinestatus
  • (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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete