my first replacementtag. This include a pdf file inside the content.
Use a plain text content:
Code: Select all
{PDFINCLUDE:link/to/pdf/file/test.pdf}
in /include/inc_front/content.func.inc.php
Code: Select all
// -------------------------------------------------------------
// PDFINCLUDE:alias replacement (by Thomas Bornhaupt, 2005)
$content["all"] = preg_replace('/\{PDFINCLUDE:(.*?)\}/ie', 'get_pdfinclude_content("$1");', $content["all"]);
// -------------------------------------------------------------
in /include/inc_front/front.func.inc.php
Code: Select all
// -------------------------------------------------------------
function get_pdfinclude_content ($url) {
$ret = '<iframe src="';
$ret .= $url;
$ret .= '" width="800px" style="height:800px">';
$ret .= '<embed src="';
$ret .= $url;
$ret .= '" width="800px" height="800px"></iframe>';
return $ret;
}
Wishes: CSS for this replacement. Any idear