Menu

New feature: Dump HTML to directory (520295)

2002-02-20
2012-10-11
  • Cuthbert Cat

    Cuthbert Cat - 2002-02-20

    Hi,
      I know there's been a little interest in enabling a static dump of HTML pages - I've just submitted a patch with my solution to this, listed as patch:520295 from cuthbertcat. It's not the most efficient thing in the world (it copies the entire themes tree, rather than just the images) but hey it works and if you have any improvements let me know.

    I've basically copied the DumpToDir and instead of using MailifyPage I'm using a copy of GeneratePage, itself changed to return the structure rather than printing it. Combine that with a switch to ignore BASE_URL and DATA_PATH in these cases, and hey presto it seems to work.

    The next thing I'll be going for is the same feature integrated with the zip-lib, followed by a way of getting hardcopy (probably starting with static HTML with labeled page numbers and moving on from that).
    If others are working on similar features let me know and I'll be happy to work with you on this!

    Cheers

     
    • Carsten Klapp

      Carsten Klapp - 2002-02-20

      Hi,
      I submitted some dump to html features to cvs today, also using a modified copy of DumpToDir and GeneratePage, but didn't do anything with BASE_URL or the images yet. I'd like to see what you've done--I had some trouble and couldn't get the browse Template to work in GeneratePage.

      (Didn't see any files uploaded to your patch message yet, would you email them to me?)

       
    • Cuthbert Cat

      Cuthbert Cat - 2002-02-20

      Erk - you're right. I can't see the file either.
      Well I'm on another machine now, I'll mail you the files probably about this time tomorrow, which is the first time I'll be able to get home again. Anyway what I'm doing with BASE_URL and DATA_PATH is in GenerateHTMLPage I do a
      define('DUMP_HTML2FILE',"true);
      and in top.tmpl I have:
      <?php if (!defined('DUMP_HTML2FILE')) { ?>
         <base=<?php BASE_URL?> >
      <?php } ?>
      or something like that. Elsewhere I have
      similar tests. There are a couple of places
      where you do something like:
      return ? defined('DATA_PATH') : $DATA_PATH . "/$path" : $path
      ...and I've simply added in an extra && !defined('DUMP_HTML2FILE') in there.

      Finally in the DumpHTMLToDir function I have a rec_copy code snippet I copied from a PHP Manual somewhere, and I do:
      thisdir=getcwd();
      rec_copy("$thisdir/themes/","$directory/themes/");

      The net result of all this is that all the images and buttons still display correctly, although of course none of the actions work ;)

      Anyway, I'll send you the lot tomorrow - sorry about the patch mix-up, maybe my file was too big for the server to accept...:(

       
    • Cuthbert Cat

      Cuthbert Cat - 2002-02-21

      Update - have emailed you the files as requested, and there's a diff file in the patch section also.
      Hope this helps!

       
    • Eric van der Knaap

      Hi, I'm interested in using this.
      I have a slightly altered phpWiki running (it is made into a module for postnuke cms(www.postnuke.com), so I won't be able to use the changes made by Carsten.

      Is there someone that can give me a short explanation on how to implement this?

      Thanks,
      Eric

       
    • Cuthbert Cat

      Cuthbert Cat - 2002-08-29

      PostNuke looks interesting, and I'd be happy to help get these features running on it. I'm a little hazy as to what alterations you've made to phpWiki to get it to run as a postnuke module, though. If you send me details I can try to implement it myself, which would help.
      Also, is there a site running with this module that I can get to?

      Cheers

       
      • Eric van der Knaap

        Although I'd like to be able to code PHP, I have not made the alterations myself. These were made by Lawrence Akka.
        Of what I understand the most important changes are the fact that the permissions system of Postnuke is integrated with phpWiki and that phpWiki picks up the current Postnuke skin, instead of using the phpWiki Look & Feel.
        I have a Wiki running on http://www.vanderknaap.org (InteractiveStories english) that you can have a look at.

        The module software itself can be found via a link in the Download section, under software.

        I do not think a lot of changes have been made to the code and assume that your changes will work almost directly. I just do not understand from the description what I need to change.

        Thanks for your help,
        Eric

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.