pdf include

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
Findus
Posts: 48
Joined: Fri 15. Apr 2005, 10:56
Location: Neustadt
Contact:

pdf include

Post by Findus »

Hi,

my first replacementtag. :D This include a pdf file inside the content. :!:

Use a plain text content:

Code: Select all

{PDFINCLUDE:link/to/pdf/file/test.pdf}
this are the changes:

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;
}
Testet with phpwcms v1.2.1-DEV, firefox and IE6.

Wishes: CSS for this replacement. Any idear :?:
Image
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

Hi

try to follow the Rules for 'own'-REP-Tags and put the Code into ./phpwcsm_template/inc_script/frontend_render or frontend_init - there is no need to touch the Source-Code. :lol: :wink:
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
Findus
Posts: 48
Joined: Fri 15. Apr 2005, 10:56
Location: Neustadt
Contact:

Post by Findus »

Hi,

so put all this line

Code: Select all

<?php

// PDFINCLUDE:alias replacement (by Thomas Bornhaupt, 2005)
$content["all"] = preg_replace('/\{PDFINCLUDE:(.*?)\}/ie', 'get_pdfinclude_content("$1");', $content["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;
}

?>
in ./phpwcsm_template/inc_script/frontend_render/phpinclude.php

Every day there is something to learn. :D

The replamenttag is

Code: Select all

{PDFINCLUDE:link/to/pdf/file/test.pdf}
Image
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hi findus,

great rt! thank you for sharing.

are you familar with making pdf files from pages too?

would be another great enhancement for wcms.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Findus
Posts: 48
Joined: Fri 15. Apr 2005, 10:56
Location: Neustadt
Contact:

Post by Findus »

years ago i buy

pdfFactory

from http://www.fineprint.com/
Image
User avatar
pico
Posts: 2595
Joined: Wed 28. Jul 2004, 18:04
Location: Frankfurt/M Germany
Contact:

Post by pico »

:wink: that's the right way

great Job :D
Lieber Gott gib mir Geduld - ABER BEEIL DICH
Horst - find me at Musiker-Board
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

nice to know this findus - thank you.

have seen just for windows server, no linux...

ok, sometimes it will works...
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Post Reply