Wiki source for DanWestIncludeFile
==What==>>==See Also==
~- FormattedIncludeAction - Includes other pages (vs files)
>>
~- 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)
<?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)';
}
?>
%%
==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
~- FormattedIncludeAction - Includes other pages (vs files)
>>
~- 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)
<?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)';
}
?>
%%
==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