PDA

View Full Version : Integration Questions


rswyatt
11-06-2006, 04:36 PM
Hello,

I'm about 10 minutes from buying this great calendar!

I have done a unique thing (at least I haven't found anything on the forum that speaks to this yet)...

First - I do realize that the "Calendar" part of this package is able to be integrated via themes and 'includes'...

The tricky part is that I'm needing to display the Event Manager and Setup section within an IFRAME within my customer's already existing 'Administration' section of their site.

I've come this far:

I've replaced the 'index.php' in /setup with one that parses the link URL variables ($_GET) and then I pass those to my IFRAME (and have renamed your index.php to index_cal.php which is the src of the IFRAME)...

That was no problem.

The problem is trying to SAVE selections which you do via the $_POST method, it appears, in your forms.

What I'm having great trouble with is figuring out how I can make this scenario work with the $_POST'ing of forms within my IFRAME.

Any help here would be GREATLY appreciated... (I've tried the fsockopen and sending the POST variables in the headers, etc - however - I believe the result I'm getting is that I'm not 'logged in' - can't seem to get around that)

Anyway - any thoughts? I love this package - just this last thing I need before I buy.

Thanks!
Rich

rswyatt
11-06-2006, 07:26 PM
I actually believe I've figured it out...

So - for anybody who wants to do the same:

I've created an index.php page in the '/setup' folder to handle the url requests... I redirect back to my 'admin.php' page and pick up the $_GET vars and pass them to an iframe... I've also renamed the original index.php in /setup to index_cal.php:


<iframe src='/modules/calendar/setup/index_cal.php?name=<admin username>&pwdX=<admin password&$myvars


$myvars is what I've 'unserialize(base64_decode($_GET['build'))' where $_GET['build'] is what I've base64_encode(serialize()) the $_GET vars from clicking on the actual links inside the Setup page in my IFRAME

For handling the pressing of the 'SAVE' button in the Setup I do the following to POST the changes to the index_cal.php page:


$pf = unserialize(base64_decode($_GET['post']));

foreach($pf as $key=>$value)
{
$postfields .= "$key=$value&";
}

//require($_SERVER['DOCUMENT_ROOT'].'/inc/curl_class.inc.php');
//$curl = new CURL;
$url=http://yoururl/youreasyphpcalfolder/setup/index_cal.php(my renamed original index.php)?name=<usrname>&pwdX=<password>;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfields);
#curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
$content = curl_exec ($ch); # This returns HTML
curl_close ($ch);



If anyone needs more explanation I'd be happy to provide it. This took some playing to finally arrive at.