PDA

View Full Version : vB product template has all empty vB variables


mrklewis
06-30-2009, 10:58 AM
I'm writing a new login template. The nearest hook I can find is in the header_redirect hook in includes/functions.php method exec_header_redirect().
I'm writing the template as part of a new product so I can avoid modifying login.php, etc.
However, when I view the new login page, all the vBulletin variables (eg: stylevar[doctype]) are empty, which results in a near-empty page, since no phrases are substituted, etc.

What I find even more frustrating about this problem is that I had originally written this new login page without using a product (hacking login.php, etc) and it worked like a charm. So this is a problem I have encountered in trying to port that hack to a vBulletin product. I feel like I'm really close to a solution, but missing some small step that is required in a product-based approach.

Has anyone else encountered this problem? Any help would be greatly appreciated!

--------------- Added 1246371749 at 1246371749 ---------------

Found my problem.
The template only has access to PHP variables at time of the fetch. Because I was trying to use header_redirect, which is a function (that does not have all the necessary global statements), all the variables were inaccessible and therefore empty.

By using a hook that is at the top level (eg: global_setup_complete), the variables in the template work just fine.