PDA

View Full Version : Integration with existing site


BenBarbour
08-30-2005, 06:15 PM
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...

ve9gra
08-30-2005, 08:57 PM
By using the ob_start() and ob_get_clean(), yes you can acheive this. PHP.net (http://ca.php.net/manual/en/function.ob-start.php) 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.
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"

ob_start();
$CSS=1; require("calendar/calendar.php");
$epc_css = ob_get_clean();

ob_start();
$OL=1; require("calendar/calendar.php");
$epc_ol = ob_get_clean();

ob_start();
require("calendar/calendar.php");
$epc_calendar = ob_get_clean();

ob_start();
$TOC=1;
require ("calendar/calendar.php");
$epc_toc = ob_get_clean();

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.

Brian
08-30-2005, 09:36 PM
Very good explanation! This deserves a sticky! :)

meginc
10-12-2006, 09:40 AM
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??

ve9gra
10-13-2006, 09:37 AM
It would seem that EE can let PHP be executed inside of its templates. That's all you should require to make EPC work.

moosenet
01-15-2008, 10:47 PM
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.....

Brian
01-16-2008, 12:08 AM
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.