PDA

View Full Version : Using phpinclude_start - summary


heavi
04-13-2005, 06:04 PM
After reviewing various forums to trying and understand how to code my own variables and functions for use with templates in vB. I have found that PHPINCLUDE_START and PHPINCLUDE_END are the only places to add your own code without voiding your user support eligibility. I am creating this thread to get comments, feedback, and clarification on the use of PHPINCLUDE_START.

PHPINCLUDE_START;
- executes before any other templates are parsed
- is the place to define variables, constants, and globals for use in all templates
- is the place to add your own code for use in the templates

Templates that are used in functions do not have access to variables in PHPINCLUDE_START unless the variables are declared a defined as a superglobal ($GLOBALS[]).

A great tutorial by Michael Morris is TUTORIAL: USING PHPINCLUDE_START (https://vborg.vbsupport.ru/showthread.php?t=71313&highlight=custom+functions)

Any comments or feedback?

Zachery
04-13-2005, 06:12 PM
After reviewing various forums to trying and understand how to code my own variables and functions for use with templates in vB. I have found that PHPINCLUDE_START and PHPINCLUDE_END are the only places to add your own code without voiding your user support eligibility. I am creating this thread to get comments, feedback, and clarification on the use of PHPINCLUDE_START.

PHPINCLUDE_START;
- executes before any other templates are parsed
- is the place to define variables, constants, and globals for use in all templates
- is the place to add your own code for use in the templates

Templates that are used in functions do not have access to variables in PHPINCLUDE_START unless the variables are declared a defined as a superglobal ($GLOBALS[]).

A great tutorial by Michael Morris is TUTORIAL: USING PHPINCLUDE_START (https://vborg.vbsupport.ru/showthread.php?t=71313&highlight=custom+functions)

Any comments or feedback?
Actually, any custom code can void support, our first question is usually whats wrong, and then what hacks or template changes have you made and does the forum work ok without said changes :)

bchertov
04-13-2005, 06:25 PM
Actually, any custom code can void support, our first question is usually whats wrong, and then what hacks or template changes have you made and does the forum work ok without said changes :)

I note the word "can". I understand your need to just support your (VB) code and not customized code and your question of whether it works without changes is fair. That said, does it matter whether our customizations are done in PHP_INCLUDIE_START/END or elsewhere in the code? What is considered good coding practice?