<?php // -------------------- // SNIPPET: PopUpGuide // -------------------- // Version: 1.0 // Date: January 6th, 2008 // Plugin By: Soshite on ModXCMS.com ([email protected]) // A big thanks goes to... // - BobRay (Sr. Member) // - sottwell (Documentation Team) // // This snippet is designed to output a selected guide in a new page. // The document that has the snippet call should be a "minimal" template, w/out any formatting. // Thus, you could put DIV layers in between the snippet call to create a header+footer for info about the guide author, etc. // If you need multiple URL parameters, duplicate this plugin, and change $urlParam. // Note that HTML entities are removed when the file is parsed, so there shouldn't be any injection issues. ;) // CONFIGURATION SETTINGS // $urlParam [string] // By default, the plugin uses "data" for it's the URL parameter, but you can change it here. $urlParam = isset($urlParam) ? $urlParam : 'data'; // END CONFIG SETTINGS --- DO NOT EDIT BELOW THIS LINE $filename = $_GET[$urlParam]; // Grab the url parameter $text = file_get_contents ($filename); $output='<div id="header"><div class="float"><p></p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a><br />*Permission from the author of this guide was obtained before it was uploaded to the website.*<br><br><b><a href="'.$filename.'">Download Original Version (.txt)</a></b><p></p></div></div><div class="fileOutput">'; // so you can style it $output .= '<pre>'; $output .= htmlentities($text, ENT_QUOTES); $output .='</pre>'; $output .='</div><div id="footer"><div class="float"><p></p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a><br />*Permission from the author of this guide was obtained before it was uploaded to the website.*<br><br><b><a href="'.$filename.'">Download Original Version (.txt)</a><p></p></div></div>'; return $output; ?>
$css = isset($css) ? $css : 'tab3';
$fSize = filesize ( $filename );
[[FileSize? &filename=`myfile`]]
return filesize($filename);

<?php $output = <<<EOD <div id="header"> <div class="float"> <p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a></p> <p>*Permission from the author of this guide was obtained before it was uploaded to the website.*</p> <strong><a href="$filename">Download Original Version (.txt)</a></strong> </div> </div> <div class="fileOutput"> <pre> htmlentities($text, ENT_QUOTES) </pre> </div> <div id="footer"> <div class="float"> <p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a></p> <p>*Permission from the author of this guide was obtained before it was uploaded to the website.*</p> <p><strong><a href="$filename">Download Original Version (.txt)</a></strong></p> </div> </div> EOD; ?>
<?php
$output = <<<EOD
<div id="header">
<div class="float">
<p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a></p>
<p>*Permission from the author of this guide was obtained before it was uploaded to the website.*</p>
<strong><a href="$filename">Download Original Version (.txt)</a></strong>
</div> <!-- end of float div -->
</div> <!-- end of header div -->
<div class="fileOutput">
<pre>
htmlentities($text, ENT_QUOTES)
</pre>
</div> <!-- end of fileOutput div -->
<div id="footer">
<div class="float">
<p>Hosted by <a href="http://symphonicheaven.com">Symphonic Heaven</a></p>
<p>*Permission from the author of this guide was obtained before it was uploaded to the website.*</p>
<p><strong><a href="$filename">Download Original Version (.txt)</a></strong></p>
</div> <!-- End of float div -->
</div> <!-- end of footer div -->
EOD;
?>

...(BTW, what would be the difference between b and strong, semantics-wise?)