here a small Howto for those, which want to build PHP files into phpMyFAQ. This is not so trivial, because a simple include() functions only displays the parsed php file completely at the beginning. The reason for this is our Template engine.
First we write a PHP file, which we want to include.
Code: Select all
<?php print "Das Datum: ".date("d.m.Y"); ?>
Next we insert a substitute symbol {TEST} in the template file index.html to the place, where our PHP file is to be inserted.
In order to communicate phpMyFAQ that the Template engine also parses the new variable, a little more must be changed.
Add the following code before the range with "/* Einzel-Templates der Unterseiten bestimmen */" in the index.php:
Code: Select all
$string = join ("", @file("test.php"));
ob_start();
eval(" ?>".$string."<?php ");
$value = ob_get_contents();
ob_end_clean();
Code: Select all
"userOnline" => userOnline(),
"TEST" => $value,
"copyright" => 'powered by <a href="http://www.phpmyfaq.de" target="_blank">phpMyFAQ</a> '.$version.'' ));
Now the file test.php is included into the FAQ and the PHP code in this file will be executed.
bye
Thorsten