SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot Taranis's Avatar
    Join Date
    Aug 2002
    Location
    Franklin, TN
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Generating Static Pages - Thoughts?

    First, the basic idea is for the user to go through a process of picking clients, projects, and work that they want to include into a template for a portfolio.

    Right now, I already have a system for choosing the clients and projects and work. I also have all the management pieces that go with that.

    What I need help with is how to take the "configurations" of each user and turn that into static code in the easiest and fastest way. I am already able to write the static HTML files into variables and save them to disk if need be. I am also using Smarty for the templates for the portfolio and the rest of the site.

    Ideally, I would like to write all the HTML into a variable or array and then store the files in a ZIP somehow that the user could download. I just can't quite seem to get my heard around how to go about it.

    Any pointers, pitfalls, or other suggestions would be much appreciated as they might jog my vacation-clouded mind.

  2. #2
    SitePoint Evangelist Daijoubu's Avatar
    Join Date
    Oct 2002
    Location
    Canada QC
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.sitepointforums.com/showt...hreadid=124684

    The best would be using Turk MMCache and mmcache_cache_output Same as jpcache but about 6 times faster, also stores them gzipped

  3. #3
    SitePoint Zealot Taranis's Avatar
    Join Date
    Aug 2002
    Location
    Franklin, TN
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe.

    Here are some more details. Essentially, a script will go through a "configuration" record in the DB and for each piece of "work" that the user has specified, the script will create a static page with that image and client name, etc.

    These pages will named in such a way that links will also be built. Something like "work1.html, work2.html, etc." So, essentially, you have a static portfolio that you can download and burn to a disc.

    That's the ultimate goal of the project.

  4. #4
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the Create Archive feature in most web-browsers such as Internet Explorer. It'll recursively download a website to your harddrive for off-line browsing. You can then take the files and burn them to a CD.

    Owen

  5. #5
    SitePoint Zealot Taranis's Avatar
    Join Date
    Aug 2002
    Location
    Franklin, TN
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Owen, I've never used the feature. Are there any javascript/DOM or other programmatic hooks to enable the feature via a button press on a webpage or something of that nature?

    I need to make it dead easy for the users to get the archive.

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doubtful that you could actually use IE Features like this with Javascript ? Never seen this due to security issues though you may think more of Active X ?

    Have a look at the developers area of Microsoft might throw something up ?

  7. #7
    SitePoint Enthusiast escape164's Avatar
    Join Date
    Dec 2002
    Location
    Colorado, USA
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wonder if you could generate the pages into a temp directory, then gzip them (or just zip) them for the user to download via a button or link.

    I know that phpMyAdmin does something similar to this when you are downloading SQL files. i have found it to be very useful.

    I am also pretty sure that PHP has functions that you can use to natively handle gzipped files so you don't have to go to such extreme measures as executing stuff a'la command line.

    Good luck!

  8. #8
    SitePoint Zealot Taranis's Avatar
    Join Date
    Aug 2002
    Location
    Franklin, TN
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by escape164
    I wonder if you could generate the pages into a temp directory, then gzip them (or just zip) them for the user to download via a button or link.

    I am also pretty sure that PHP has functions that you can use to natively handle gzipped files so you don't have to go to such extreme measures as executing stuff a'la command line.
    I think this is the route I am going to take. I am using Smarty templates which makes it nice because I can render the all the dynamic stuff and then stick the output into a stream and use Smarty to write it to a file or display it. I am investigating now if instead of writing to a file, I could write directly into the Zip archive and skip actually saving the temp files on the disk.

    At any rate, I appreciate the suggestions and I will let you know how I get it working.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •