Web Design and Development
Editing a phpBB template can be rather exasperating because you don’t have freedom to add dynamic code. In fact, if you do add php code to your template, you will find that it won’t be recognized. So what do you do?
The first step to adding PHP code is to enable PHP and INCLUDEPHP statements in your template.
By default, these statements are disabled because they can pose a significant security risk. So to allow the use of PHP, you will need to change your security settings.
To do this, login to the administration control panel. And then, under the general tab, scroll down to the bottom of the page and click on Security settings under the Server Configuration subheading, as shown in the image.
Next, towards the bottom of the Security Settings page, you will see the setting that we are looking for: Allow php in templates. Select "Yes" as shown below.
Now, to add PHP to your template, simple enclose your PHP code within special PHP template tags. For example, if you wanted to use the echo function, your code might look something like the following:
<!-- PHP --> echo "Hello World!"; <!-- ENDPHP -->
Similarly, if you wanted to include an external file, your code might look like this:
<!-- PHP --> include("externalFile.php"); <!-- ENDPHP -->
And that’s it! Adding PHP code to phpBB templates is easy.
More problems? Let us know.
Tags: content management system, open source, PHP, phpBB, softwareTrackback URL for this entry:
http://www.velvetblues.com/web-development-blog/add-php-code-to-your-phpbb-forum-templates/trackback/
Contact us today for a quote. Click here to submit details regarding your project.
If you are making a general inquiry, send an email to info@velvetblues.com
I had used PHPBB as a forum board solution for my previous forums. It is one of the most flexible board solutions available in terms of modifications and I love it. Mods (or modifications) also come with easy instructions as to where to place or replace the codes in order to install the plugins.
Yes, phpBB is my favorite forum software and has almost as great a user community as WordPress, which supplies the bulk of the Mods.
how will get value of template form in smarty
how to get a value of tpl form
thank you very much. I was looking for this everywhere. but you made it very clear.