Sure, no problem. And yeah, I know... I wish I could be around more often to help out more... *sigh*!
So here's some code.
1. Create a new file called xml_proxy.php on your site. This is the file that will prepare the info needed for the Export Manager code. You'll need to update the variables at the top with whatever values are appropriate for your own environment.
Code:
<?php
/**
* xml_proxy.php
*/
// need to be updated
$form_id = 1;
$view_id = 1;
$order = "submission_date-DESC"; // format: [column name]-[ASC|DESC]
$export_group_id = 4;
$export_type_id = 6;
// ---------------------------------------------------------------
require_once("path/to/formtools/global/session_start.php");
$_SESSION["ft"]["curr_form_id"] = $form_id;
$_SESSION["ft"]["form_{$form_id}_view_id"] = $view_id;
$_SESSION["ft"]["current_search"]["order"] = $order;
$_SESSION["ft"]["current_search"]["search_fields"] = array(
"search_field" => "",
"search_date" => "",
"search_keyword" => ""
);
// can anyone say "hack"?
$_GET["export_group_id"] = $export_group_id;
$_GET["export_type_id"] = $export_type_id;
require_once("ft204/modules/export_manager/export.php");
2. Make a small change to this file: /modules/export_manager/export.php
The very first line reads:
Code:
require("../../global/session_start.php");
Change it to:
Code:
require_once(realpath((dirname(__FILE__) . "/../../global/session_start.php")));
3. In your Export Manager settings, edit the XML Export Group and make sure that the "Action" setting is set to "Open in new Window".
And that's pretty much it!
To test it, just create a new file called test.php and add this content:
Code:
<?php
$xml = file_get_contents("http://yoursite.com/xml_proxy.php");
echo $xml;
Assuming file_get_contents is permitted to scrape URLs (it usually is), that should output the live XML feed.
Let me know if you have any trouble!
- Ben