/** * Add hooks here. */ function execute() { global $languages_id; // Update Google Base (Product Search) feed. $google_base_feed_builder = new GoogleBaseFeedBuilder($languages_id); $file = fopen(DIR_FS_CATALOG . 'googlecheckout/feeds/products-static.xml', "w"); if ($file) { fwrite($file, $google_base_feed_builder->get_xml()); fclose($file); } // Update Site Map feed. $google_sitemap_builder = new GoogleSitemapBuilder(); $file = fopen(DIR_FS_CATALOG . 'googlecheckout/feeds/sitemap-static.xml', "w"); if ($file) { fwrite($file, $google_sitemap_builder->get_xml()); fclose($file); } // Record the time of the last update. $file = fopen(DIR_FS_CATALOG . 'googlecheckout/logs/last_updated.log', "w"); if ($file) { fwrite($file, "Last updated: " . date("F j, Y, G:i a")); fclose($file); } }
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * Google Checkout v1.5.0 * * Generates a Google Base RSS feed. * * If destination webserver supports the "AddType" .htaccess directive, * then "products.xml" in this same directory will generate the same * feed and meet the .xml file extension requirement. * * Otherwise, this page generates a feed and copies it into * "products-static.xml" (also in this directory). */ // Require application_top.php to get access to configuration data. chdir('./../..'); $curr_dir = getcwd(); require_once $curr_dir . '/includes/application_top.php'; // Require googlecheckout files. require_once DIR_FS_CATALOG . 'googlecheckout/library/google_base_feed_builder.php'; // Get the feed. $google_base_feed_builder = new GoogleBaseFeedBuilder($languages_id); $feed = $google_base_feed_builder->get_xml(); // And output it here. header("Content-Type: text/xml; charset=utf-8"); echo $feed;