Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-08-2004, 03:08 PM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default What does this do? (PHP question)

I am not new to PHP but can anybody try to explain what this code (extracted from register.php) in vB 3.0 RC2 actually does? Thanks in advance.

PHP Code:
$actiontemplates = array(
    
'requestemail' => array(
        
'activate_requestemail'
    
),
    
'none' => array(
        
'activateform'
    
)
); 
Reply With Quote
  #2  
Old 01-08-2004, 03:16 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the code just generates a multidimensional array

ie an array called action templates containing two arrays, called requestemail and none.

each of these arrays contains another entry.

the whole structure is used by vb3 to know which templates have to be cached
Reply With Quote
  #3  
Old 01-08-2004, 03:24 PM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xenon
the code just generates a multidimensional array

ie an array called action templates containing two arrays, called requestemail and none.

each of these arrays contains another entry.

the whole structure is used by vb3 to know which templates have to be cached
Thanks for getting back to me.
So this means PHP create 1 array named $actiontemplates containing 2 array:

- none
- requestemail

"none" contains a single string "activateform" and "requestemail" contains a single string "activate_requestemail"

Is this correct?
How does a statement have to look to access one of the strings?

$actiontemplates=>none[0]

???
Sorry for asking possibly stupid newbie stuff...
Reply With Quote
  #4  
Old 01-08-2004, 03:29 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no, the request-email and the none are array keys, so to access one of the strings you have to use:

$actiontemplates['none'][0]
Reply With Quote
  #5  
Old 01-08-2004, 03:38 PM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay. So they are keys but their values are again, array. And I could possibly iterate through the with the following statement?

PHP Code:
foreach ($actiontemplates as $key_at => $value_at) {
    echo (
"$key_at<br>");
    foreach (
$value_at as $item) {
        echo (
"...$item<br>");
    }        

Reply With Quote
  #6  
Old 01-08-2004, 03:44 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, that should work
Reply With Quote
  #7  
Old 01-08-2004, 03:48 PM
rrottman rrottman is offline
 
Join Date: Jun 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Xenon
yes, that should work
I'm so glad talking to one of the - huh!! - Administrators of this site... :-)
I always wonder whether there would be an option for the vB team to sell some kind of developer network membership on top of the vB license. I would be willing to pay for it. As far as I have seen it in the past, almost everybody gets interested in changing style, editing templates and sooner or later in starting to hack (a nice word for developing, actually).

I strongly feel for some kind of developer documentation. Explaining the basic concepts. How everything ties together. The docs which come with vB2 are - IMHO - way too smallsized for what you need to really work with vB.

I wonder, is there any site out there trying to explain some of the basic concepts? I'm not thinking of a PHP tutorial. I more or less think of something like a concepts guide.

The .php files I've looked in so far (register.php, login.php) seem to follow some basic structure. Including some functions. Registering some templates. Etc. etc. but it's difficult to grasp the concept behind just from focussing on source files.

Do you know any resource? Maybe another thread?
Any hint?!
Reply With Quote
  #8  
Old 01-08-2004, 03:50 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well going through modification hints and tips should help you for the beginning.
Afaik, there is a better documentation planned for vb3, but i don't know how detailed that will be, so we have to wait for gold until we will know exactly
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:23 PM.


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.04267 seconds
  • Memory Usage 2,231KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete