INCLUDEPHP in version 3.0.7-PL1

Discussion forum for MOD Writers regarding MOD Development.
Locked
carlosgrima
Registered User
Posts: 7
Joined: Mon May 11, 2009 7:27 pm

INCLUDEPHP in version 3.0.7-PL1

Post by carlosgrima »

Dear friends:

I had a phpbb forum on 3.0.1 version, and the next code in overall_header.html worked perfectly:

Code: Select all

<!-- INCLUDEPHP mySuperInclude.php -->
<!-- PHP -->
echo $mySuperVariable;
<!-- ENDPHP -->
And the file mySuperInclude.php is:

Code: Select all

<?php
$mySuperVariable = "hello";
?>
But now, in 3.0.7-PL1, it does not work (I can't see the "hello" on the screen)... and I do not why!!

Could someone help me and say me how to do the same in this new version?

Thank you very much for your time :-)

wadie
Registered User
Posts: 558
Joined: Sun May 02, 2010 5:05 am
Location: Your ACP
Name: Wadie

Re: INCLUDEPHP in version 3.0.7-PL1

Post by wadie »

Why not writing that using HTML ?
Need a custom style made ? want me to install a MOD for you ? Contact me here.

carlosgrima
Registered User
Posts: 7
Joined: Mon May 11, 2009 7:27 pm

Re: INCLUDEPHP in version 3.0.7-PL1

Post by carlosgrima »

Of course it is a simple example. The complete code is much more complex. But here is the problem: in the variables inside included php files. Does anybody have the answer to this error?

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: INCLUDEPHP in version 3.0.7-PL1

Post by ToonArmy »

We changed this a while back INCLUDEPHP paths are now relative to your forum root directory.
Chris SmithGitHub

carlosgrima
Registered User
Posts: 7
Joined: Mon May 11, 2009 7:27 pm

Re: INCLUDEPHP in version 3.0.7-PL1

Post by carlosgrima »

ToonArmy wrote:We changed this a while back INCLUDEPHP paths are now relative to your forum root directory.
I know. I have mySuperInclude.php in the forum root directory. This is not the error. If the mySuperInclude.php is:

Code: Select all

<?php
$mySuperVariable = "hello";
echo "I am carlos";
?>
... then, the program prints "I am carlos", but the variable does not work.

Please test it.

carlosgrima
Registered User
Posts: 7
Joined: Mon May 11, 2009 7:27 pm

Re: INCLUDEPHP in version 3.0.7-PL1

Post by carlosgrima »

does anyody have the answer?

ToonArmy
Former Team Member
Posts: 4608
Joined: Sat Mar 06, 2004 5:29 pm
Location: Worcestershire, UK
Name: Chris Smith
Contact:

Re: INCLUDEPHP in version 3.0.7-PL1

Post by ToonArmy »

carlosgrima wrote:does anyody have the answer?
The problem is this change: http://github.com/phpbb/phpbb3/commit/7 ... 1b3495b76d the included files are no longer executed in the same scope as the template. Can use as a workaround:

Code: Select all

<!-- PHP --> include('/path/to/file'); <!-- ENDPHP --> 
Chris SmithGitHub

carlosgrima
Registered User
Posts: 7
Joined: Mon May 11, 2009 7:27 pm

Re: INCLUDEPHP in version 3.0.7-PL1

Post by carlosgrima »

Thank you very much ToonArmy :-)

Locked

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