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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-19-2003, 08:35 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHPInclude Variables in Formbit Templates

The variables in PHPInclude do no show up in any of the formbit templates where I have inserted them (though they work fine on other templates).

The search feature referenced me to a post which suggested that I add $session to a specified line in the functions.php file. This, however, seems to have already been done with 2.3.0 but to no affect.

Any help on forcing PHPInclude variables to be displayed in the formbit templates would be appreciated. Thanks.
Reply With Quote
  #2  
Old 05-20-2003, 09:11 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bit variables areoften called within functions.
and functions just can use variables from other part of the script (phpinclude her) if you made em global in that function
Basic php knowledge
Reply With Quote
  #3  
Old 05-20-2003, 02:31 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 11:11 AM Xenon said this in Post #2
bit variables areoften called within functions.
and functions just can use variables from other part of the script (phpinclude her) if you made em global in that function
Basic php knowledge

Can you please provide an example?
Reply With Quote
  #4  
Old 05-20-2003, 02:50 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check out http://www.php.net/manual/en/languag...bles.scope.php for what he's talking about.
Reply With Quote
  #5  
Old 05-20-2003, 05:58 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 04:50 PM filburt1 said this in Post #4
Check out http://www.php.net/manual/en/languag...bles.scope.php for what he's talking about.

Thank you for the link. I have a better understanding of globals within functions but at the same time, I'm still unsure as to how to apply this in order for the fuction to show on postbit. Are you saying I need to put global on fuctions made in phpinclude?

My code in the external script isn't incased in a fuction syntax. All it does is echo out html based on whether or not if this is the first instance of the code being applied.

A real world example using this problem would be most helpful. Thanks.
Reply With Quote
  #6  
Old 05-20-2003, 05:58 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Put simply, there's nothing you can do without editing how phpinclude itself works.
Reply With Quote
  #7  
Old 05-20-2003, 06:09 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 07:58 PM filburt1 said this in Post #6
Put simply, there's nothing you can do without editing how phpinclude itself works.

Would you be willing to dilvulge a little more detail? Perhaps I can ask a programmer who is knowledgable with PHP. All I would need to know is what areas need to be edited.
Reply With Quote
  #8  
Old 05-20-2003, 06:22 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am knowledgable in PHP considering I have developed a full emergency messenging system in it at NASA. phpinclude is eval'ed after bit templates, which is why it does not have acccess to the bit templates (which are eval'ed before it).
Reply With Quote
  #9  
Old 05-20-2003, 06:28 PM
Boeman Boeman is offline
 
Join Date: Apr 2003
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 08:22 PM filburt1 said this in Post #8
I am knowledgable in PHP considering I have developed a full emergency messenging system in it at NASA. phpinclude is eval'ed after bit templates, which is why it does not have acccess to the bit templates (which are eval'ed before it).
So in basic terms, what do I need to do to get my phpinclude functions to evaluate along with the formbit_level_1 template? I looked around various hacks listed here but could not find one that allows this.
Reply With Quote
  #10  
Old 05-20-2003, 06:31 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't without rewriting a significant chunk of gettemplate() to:

1. See if a flag is set
2. If not, eval phpinclude and set it
3. Continue with normal gettemplate functions

...also removing it from (IIRC) global.php.
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 03:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04241 seconds
  • Memory Usage 2,254KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete