Renameing template.html to php - Page 2 Renameing template.html to php - Page 2
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Renameing template.html to php

Started by NeoID, November 12, 2005, 03:21:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nibbler

If it contains static content then use

return file_get_contents('file');

If it contains php code then do

ob_start();
include('file');
return ob_get_clean();

NeoID

Thanks for the suggestion, but those two commands were the first one I tried and both gives me a blank (white) screen.  :(

Edit: When I put this into the theme.php

ob_start();
include('file');


...and this into the template.html

return ob_get_clean();

The content of the php shows up on the template fil, but the command wipes everything else..

Joachim Müller

why don't you post what file.php is suppossed to do instead?

NeoID

Quote from: GauGau on November 16, 2005, 12:00:50 AM
why don't you post what file.php is suppossed to do instead?

I want to include a php file(s) that allows me to get information from my phpbb forum. I've included two files (there are more)
that gives an example of what I mean. While the engine file connects to the forum, the newposts file shows the actual content.

Joachim Müller

The database connectors of phpbb and cpg will interfere, you can't do that. If you have bridged coppermine and phpbb already, you won't have to connect twice to phpbb. You simply can't include anything.