SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict exhale81's Avatar
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face Easy integration of a script into a website

    OK so I have a lot of ideas for PHP scripts that I could eventually sell and I've already developed a few but the problem I always come across is "how do I make the integration on a current site design easy?". So far these are the ideas I've gathered:

    1) Make a customizable header and footer. This is very basic and easy to implement. The problem is that the page is still entirely generated by the script so for example it would not be possible to integrate a little news script at the bottom of a page.

    2) Ask the user to include a PHP file on his page. A few problems is that it forces people to rename their page to .php (so it doesn't work if they used SSI for other things) and also there is the problem of include files being relative which can be quite a mess if the script is supposed to be included on many pages.

    3) Generate the HTML code, store it somewhere on the script directory and then ask the user to include the file using SSI or Javascript

    4) Ask the user to add some custom HTML tags on the pages and to make these pages writtable. Then on the script specify which pages has to be modified. Then everytime a change is made, the script search the tags on those pages and make the changes. I've seen scripts doing this but this seems to be way too complicated.

    As you can see, none of these solutions are perfect so I'm still searching... Did anyone found the perfect solution for this? Or at least, what method do you think is preferrable and can you think of other methods?


    PS: I know none of the above seems complicated for experienced web developers but keep in mind that the goal is to make it clear and simple for anyone, even for those who don't know what 'chmod' means.
    Last edited by exhale81; Mar 23, 2002 at 14:43.
    Sebastien Rosset
    :: Commercial: BlackSonic | ScriptsCenter
    :: Non-Profit: VJCentral | ReclaimYourSoul

  2. #2
    SitePoint Addict LiveTronix's Avatar
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kind of off topic a little... You could provide .htaccess file that makes .html endings execute php style.

    But i would be intereted to what other people think!

    I've been struggeling with issues like this also.

  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure that adds a bit of overhead. A straight HTML file would get handed to the PHP engine to analyze....I'm sure there would be a bit of inefficiency. But I still have .htm's parsed as PHP.

    Sketch
    Aaron Brazell
    Technosailor



  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    one side effect of parsing straight HTML (.html) files as PHP, is that browser caching isn't used. this is because it's still a "dynamic" file, since it's being parsed for PHP, which means the Web server will not generate a Last-Modified header as is done with static files. so the client must download the page each time since it can't send an If-Modified-Since request.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  5. #5
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about making your little script into a separate file and adding it as an <IFRAME> ? i hate those like the next guy, but for what you want to do here it sounds reasonable enough.
    also (and unfortunately i don't have time to look this one up, so bear with me) isn't there an ugly "x-bit-hack" for php, which (if memory serves me right) can force apache to parse pages through php if the execute permission is set ? (this might be totally inaccurate...just have some vague thought of that crossing my mind)

  6. #6
    purple monkey dishwasher scoates's Avatar
    Join Date
    Nov 2001
    Location
    Montreal
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't hate them (IFRAMES). We use them regularly, if our clients have a reasonable spec ( anything newer than NS4).

    I even use them for form validation sometimes. Quite useful.

    S

  7. #7
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've thought about this at length and I think the ideal solution is to provide a script with a well defined API. Provide the script as a set of functions and classes that competent web developers can easily integrate into their existing sites (by including your files and executing function calls at the point in their application where they want your functionality to occur). You can then provide some example scripts with your main product which demonstrate how to use the API. If you ensure that these "skeletal" implementations include a version that uses header/footer files, a version that uses a single template file, a version that can be simply "included" where they want your content and a version that writes their flat HTML for them you should have all bases covered. If you do that you'll have to provide quite extensive (and very clear) documentation to avoid confusing users, but in the end they will thank you for it.

  8. #8
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    off topic...IFRAMES

    sorry if this might be the wrong thread for discussing this, but since it's been mentioned...
    i'm focussing on making a big site accessible with alternative browsers according to Disabilities Discrimination Act. new versions of Lynx, for instance, do support them, but in a very cumbersome way...
    The <IFRAME> tag is also supported. When Lynx encounters an inline (or floating) frame, it will display IFRAME: [Name_of_Source / Name_of_File]. The name of the source or file will be hyperlinked to the source file, letting you go there.
    from http://home4.pacific.net.sg/~kenneth...intertech.html
    so...that's the reason for my hatred for them. when they're used for things like integrating banner ads and stuff, they're ok - but once essential parts of a site are stuck into different IFRAMEs on a page, it becomes a nightmare to navigate text only...

  9. #9
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Agreed - that's why I would never "hide" my content in an iFrame (not to mention NS4 hasn't even heard of them...)

  10. #10
    SitePoint Addict exhale81's Avatar
    Join Date
    Aug 2001
    Location
    Switzerland
    Posts
    395
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Skunk, I agree that offering the maximum of possibilities is the best way to go, that way users can choose what they prefer. And indeed an extensive documentation will always help, I'm in the process of writing a full manual for one of my script. That's a lot of work but it'll probably cut down the need for support and improve customer satisfaction.



    PS: I saw several scripts offering an IFRAME version but they also always offered another way to implement the script. Obviously, the fact the script doesn't work in several browsers is not a selling point...
    Sebastien Rosset
    :: Commercial: BlackSonic | ScriptsCenter
    :: Non-Profit: VJCentral | ReclaimYourSoul


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
  •