PDA

View Full Version : editing template with custom variable


jesus likes pie
07-07-2008, 05:22 AM
Alright so I have some code which outputs data from a database. It's in the member_start hook.

To test it I tried echoing the result and infact it does come out as expected at the top of the page. However, if I try and include the variable in a template so that it's outputted in the correct part of the page... it comes out blank.

How can I get templates to work with custom variables that are set from a plugin?

MoT3rror
07-07-2008, 05:51 AM
What template are you trying to use?

jesus likes pie
07-07-2008, 05:54 AM
memberinfo_block_statistics

--------------- Added 1215415281 at 1215415281 ---------------

so...

Opserty
07-07-2008, 08:06 AM
You probably need to use $GOBALS[yourvar] if your custom variable is $yourvar. As the hook is probably located inside or a class/function.

Looking at the PHP file in which the hook is located is always a good place to start debugging. ;)

jesus likes pie
07-07-2008, 12:41 PM
Thank you, worked like a charm!