What
- A basic include that will load a text file into the page.
Usage
- Syntax: {{include name='file.txt'}}
- Includes the raw file in the output stream (Not safe HTML)
Installation
- Put the following code into actions/includefile.php
includefile.php
<?php
$file_name = $vars['name'];
if(isset($file_name)) {
if(is_readable($file_name)) {
if(isset($pre)) echo '<pre>';
@include($file_name);
if(isset($pre)) echo '</pre>';
} else {
echo "{{includefile}} File $fname not found";
}
} else {
echo 'usage: {{includefile <b><u>name</u></b>="<i>filename</i>"}} (Missing name)';
}
?>
$file_name = $vars['name'];
if(isset($file_name)) {
if(is_readable($file_name)) {
if(isset($pre)) echo '<pre>';
@include($file_name);
if(isset($pre)) echo '</pre>';
} else {
echo "{{includefile}} File $fname not found";
}
} else {
echo 'usage: {{includefile <b><u>name</u></b>="<i>filename</i>"}} (Missing name)';
}
?>
Issues
- Very Dangerous! - Caution
- Not for a public Wiki since it can get ANY file on the system.
- Can include PHP code too.
To Do
- Lock it down to only a given sub-folder
- Maybe pass it through safe HTML