showing php output in all pages

Discussion forum for MOD Writers regarding MOD Development.
robk123
Registered User
Posts: 8
Joined: Fri Mar 29, 2013 10:14 am

showing php output in all pages

Post by robk123 »

hi
i have a php script (lets just say that it has the line echo "hello world"; in it)
i want to be able to display the output of the php code below the header in phpbb

how would i do this?
thanks
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: showing php output in all pages

Post by david63 »

phpBB does not work like that.

Output is done via .html template files so whatever you want to output needs to be sent as a template variable to the template and then that variable needs to be placed in the template at the position you want it displaying.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
robk123
Registered User
Posts: 8
Joined: Fri Mar 29, 2013 10:14 am

Re: showing php output in all pages

Post by robk123 »

do u mean that i need to create a variable, and put it in the header template?

if so, how would i do that?


thanks
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: showing php output in all pages

Post by david63 »

robk123 wrote:do u mean that i need to create a variable, and put it in the header template?
Yes
robk123 wrote:if so, how would i do that?
Take a look at some of the core files - this is done in virtually every phpBB .php file
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
robk123
Registered User
Posts: 8
Joined: Fri Mar 29, 2013 10:14 am

Re: showing php output in all pages

Post by robk123 »

ok.. i have now made a php file in the root of the phpbb installation.
it calls $template->assign_var in it.

which file should i require it in, for it to run on every page?
User avatar
Lumpy Burgertushie
Registered User
Posts: 69228
Joined: Mon May 02, 2005 3:11 am

Re: showing php output in all pages

Post by Lumpy Burgertushie »

overall_header.html of whatever style(s) you are using.

robert
Premium phpBB 3.3 Styles by PlanetStyles.net

I am pleased to announce that I have completed the first item on my bucket list. I have the bucket.

Return to “[3.0.x] MOD Writers Discussion”