[thelist] How to insert php script in Invision Power Board
Brian Cummiskey
Brian at hondaswap.com
Wed Dec 21 08:34:31 CST 2005
Kirill Voronin wrote:
> Hi!
>
> I need insert (some kind of php-include) the php script (news) in the
> Invision Power Board.
>
> I’ve already tried to insert php script in the template but this doesn’t
> work.
> Probably because it isn’t interpreted in this case.
Right. php is not parsed by the template engine. Not only is this more
secure, it makes their caching method more efficient. IPB's PHP code
reads in the skin bits as though they are ASCII text files. It does lots
of database queries and then does searches and replaces on the skin
files to produce the final HTML which it then sends to the browser.
So you see IPB does not PHP 'include' the skin files. And because they
are not included, any include statements that you put into them cannot
be handled. They are treated as straight ASCII text.
If you are looking for something like:
<?php
include(news.php);
?>
The good news is, that they created a method to include php files.
However, this code block ONLY works in the board wrapper. The
individual template bits will not work.
<!--exec.file='news.php'-->
or
<!--exec.url='http://www.domain.com/news.php'-->
Throw it in your board wrapper template somewhere useful.
If you need it to show somewhere else, my suggestions is some CSS
positioning.
GL
-Brian
More information about the thelist
mailing list