Including separate dynamic files

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Timmer
Registered User
Posts: 112
Joined: Fri Sep 24, 2004 4:21 pm
Location: Portland, OR
Contact:

Including separate dynamic files

Post by Timmer »

I have a cron job that generates some dynamic snippets of HTML that I would like to include on my PHPBB3 pages. (Like a weather bug, news, etc.)

On HTML pages I would use a server-side include to perform this function. Does the PHPBB3 software include a built-in library function for performing a similar task?

Thanks!

User avatar
Timmer
Registered User
Posts: 112
Joined: Fri Sep 24, 2004 4:21 pm
Location: Portland, OR
Contact:

Re: Including separate dynamic files

Post by Timmer »

I guess there is no such function? I was hoping this would have been a no-brainer. :cry:

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10365
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Including separate dynamic files

Post by Noxwizard »

The template files are HTML, so you could try using the Server Side Include, as long as the server supports it.

If that doesn't work, you can try the "include" template command.

Code: Select all

<!-- INCLUDE file.html -->
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.

User avatar
Timmer
Registered User
Posts: 112
Joined: Fri Sep 24, 2004 4:21 pm
Location: Portland, OR
Contact:

Re: Including separate dynamic files

Post by Timmer »

Noxwizard wrote:If that doesn't work, you can try the "include" template command.

Code: Select all

<!-- INCLUDE file.html -->
Thank you! That is exactly what I needed to know. Tested and it works great. :)

User avatar
Timmer
Registered User
Posts: 112
Joined: Fri Sep 24, 2004 4:21 pm
Location: Portland, OR
Contact:

Re: Including separate dynamic files

Post by Timmer »

Oops. One additional minor problem. The dynamic file that is included doesn't show changes until the template is refreshed. Is there any way around that?

User avatar
Noxwizard
Support Team Leader
Support Team Leader
Posts: 10365
Joined: Mon Jun 27, 2005 8:41 pm
Location: Texas, USA
Name: Patrick Webster
Contact:

Re: Including separate dynamic files

Post by Noxwizard »

Try having it check for stale style components.

ACP -> Load Settings -> Recompile stale style components
[Support Template] - [Read Before Posting] - [phpBB Knowledge Base]
Do not contact me for private support, please share the question in our forums.

User avatar
Timmer
Registered User
Posts: 112
Joined: Fri Sep 24, 2004 4:21 pm
Location: Portland, OR
Contact:

Re: Including separate dynamic files

Post by Timmer »

Noxwizard wrote:Try having it check for stale style components.
First page refresh after turning that on seemed to be successful. I will play with it and see if it does what I want.

Thanks again!

User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: Including separate dynamic files

Post by Phil »

It may be worth pointing out that this is liable to increase server load in the future.
Moving on, with the wind. | My Corner of the Web

Locked

Return to “[3.0.x] Support Forum”