1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

Integration with existing site

Discussion in 'General' started by BenBarbour, Aug 30, 2005.

Thread Status:
Not open for further replies.
  1. I have a site that is designed with the following logic:

    1) User accesses a PHP page that compiles necessary data needed for the page.
    2) an HTML template is then parsed and the data (HTML code) is placed in the appropriate locations and the page is displayed to the user.

    I like this program's look/feel but unfortunately the way it is coded I'm not sure I can use it with my existing site (due to the extensive use of the "echo" function).

    Is there a way, assuming I purchase this, to return the HTML code as a string variable as opposed to including a PHP script that writes directly?

    Thanks...
  2. ve9gra

    ve9gra Support Team

    By using the ob_start() and ob_get_clean(), yes you can acheive this. PHP.net provides all the information you'd need, but I'll try to describe it in a somewhat consise manner.

    This would be the generic way for every section that you want seperated on the template.
    PHP:
    ob_start();
    //** Put required code here **//
    $template_variable ob_get_clean();
    And here's the sections that you could use as a "plug-and-play"

    PHP:
    ob_start();
    $CSS=1; require("calendar/calendar.php");
    $epc_css ob_get_clean();
    PHP:
    ob_start();
    $OL=1; require("calendar/calendar.php");
    $epc_ol ob_get_clean();
    PHP:
    ob_start();
    require(
    "calendar/calendar.php");
    $epc_calendar ob_get_clean();
    PHP:
    ob_start();
    $TOC=1;
    require (
    "calendar/calendar.php");
    $epc_toc ob_get_clean();
    PHP:
    ob_start();
    $LIST=1;
    $DF "D - M d";
    $template="monthly.php";
    require (
    "calendar/calendar.php");
    $epc_list ob_get_clean();
    And from there you can use epc_css, epc_ol, epc_calendar, epc_toc, and epc_list in your template. Note that you should still follow the proper implementation instructions (ie: have the epc_css included in the <head> section of your page, etc...).

    Hope this helps.
    Last edited: Apr 18, 2006
  3. Brian

    Brian EPC Developer Staff Member

    Very good explanation! This deserves a sticky! :)
  4. Hi - I am currently moving over to using ExpressionEngine (pMachine) for our website - I would really like to keep my EasyPHP calendar - does anyone know of a way I can integrate it with EE??
  5. ve9gra

    ve9gra Support Team

    It would seem that EE can let PHP be executed inside of its templates. That's all you should require to make EPC work.
  6. ok sooooooo... still trying to figure things out here.

    I tried to "intergrate the calendar into my template, no luck.... any ideas??

    http://www.passforkids.com/calendar.php

    thats what i get.. dunno if i did it right, really doubt it..

    help PLEASE.....
  7. Brian

    Brian EPC Developer Staff Member

    You should really start a new thread instead of replying to one from 2005.

    When you do, attach your calendar.php that you've created so we can see the source code.
Thread Status:
Not open for further replies.

Share This Page