function createGoogleSitemap() { $google = new GoogleSitemap(); $submit = true; $product_sitemap = false; if (SITEMAP_PRODUCTEN == '1') { $product_sitemap = true; if ($google->GenerateProductSitemap()) { //echo 'De producten sitemap is succesvol aangemaakt!' . "<br />"; } else { $prods_query = tep_db_query('SELECT products_id FROM products limit 1'); if (tep_db_num_rows($prods_query) > 0) { $submit = false; echo 'ERROR: De producten sitemap is niet correct aangemaakt!' . "<br />"; } else { $product_sitemap = false; echo 'OPGELET: De producten sitemap is niet aangemaakt! Er zijn geen producten!' . "<br />"; } } } $category_sitemap = false; if (SITEMAP_CATEGORIEEN == '1') { $category_sitemap = true; if ($google->GenerateCategorySitemap()) { //echo 'De Categorieën sitemap is succesvol aangemaakt!' . "<br />"; } else { $cats_query = tep_db_query('SELECT categories_id FROM categories limit 1'); if (tep_db_num_rows($cats_query) > 0) { $submit = false; echo 'ERROR: De categorieën sitemap is niet correct aangemaakt!' . "<br />"; } else { $category_sitemap = false; echo 'OPGELET: De categorieën sitemap is niet aangemaakt! Er zijn geen categorieën!' . "<br />"; } } } $showManufacturers = false; if (SITEMAP_FABRIKANTEN == '1') { $showManufacturers = true; if ($google->GenerateManufacturerSitemap()) { //echo 'De fabrikanten sitemap is succesvol aangemaakt!' . "<br />"; } else { $manufacturers_query = tep_db_query("select manufacturers_id from " . TABLE_MANUFACTURERS . " limit 1"); if (tep_db_num_rows($manufacturers_query) > 0) { $submit = false; echo 'ERROR: De fabrikanten sitemap is niet correct aangemaakt!' . "<br />"; } else { $showManufacturers = false; echo 'OPGELET: De fabrikanten sitemap is niet aangemaakt! Er zijn geen fabrikanten!' . "<br />"; } } } $showSpecials = false; if (SITEMAP_PROMOTIES == '1') { $showSpecials = true; if ($google->GenerateSpecialsSitemap($languages_id)) { //echo 'De promotie sitemap is succesvol aangemaakt!' . "<br />"; } else { $specials_query = tep_db_query("select products_id from specials WHERE expires_date > NOW() AND status = '1' limit 1"); if (tep_db_num_rows($specials_query) > 0) { $submit = false; echo 'ERROR: De promotie sitemap is niet correct aangemaakt!' . "<br />"; } else { $showSpecials = false; echo 'OPGELET: De promotie sitemap is niet aangemaakt! Er zijn geen promoties!' . "<br />"; } } } $showInfopages = false; if (SITEMAP_INFOPAGINA == '1') { $showInfopages = true; if ($google->GeneratePagesSitemap()) { //echo 'De infopagina sitemap is succesvol aangepast!' . "<br />"; } else { $infopages_query = tep_db_query("select infopages_id from infopages WHERE infopages_status = '1' limit 1"); if (tep_db_num_rows($infopages_query) > 0) { $submit = false; echo 'ERROR: De infopagina sitemap is niet correct aangemaakt!' . "<br />"; } else { $showInfopages = false; echo 'OPGELET: De infopagina sitemap is niet aangemaakt! Er zijn geen infopagina\'s!' . "<br />"; } } } if ($google->GenerateSitemapIndex($showInfopages, $showManufacturers, $showSpecials, $category_sitemap, $product_sitemap)) { //echo 'De index sitemap is succesvol aangemaakt!' . "<br />"; } else { $submit = false; } if ($submit) { //echo "<br />".'Alle sitemaps zijn correct aangemaakt!' . "<br /><br />"; /*echo 'Dit is de index sitemap: ' . $google->base_url . 'sitemapindex.xml' . "<br />"; if ($product_sitemap) echo 'Dit is de producten sitemap: ' . $google->base_url . 'sitemapproducts.xml' . "<br />"; if ($category_sitemap) echo 'Dit is de categorieën sitemap: ' . $google->base_url . 'sitemapcategories.xml' . "<br />"; if ($showManufacturers) echo 'Dit is de fabrikanten sitemap: ' . $google->base_url . 'sitemapmanufacturers.xml' . "<br />"; if ($showSpecials) echo 'Dit is de promotie sitemap: ' . $google->base_url . 'sitemapspecials.xml' . "<br />"; if ($showInfopages) echo 'Dit is de infopagina sitemap: ' . $google->base_url . 'sitemappages.xml' . "<br />"; */ } else { echo '<pre>'; print_r($google->debug); echo '</pre>'; } }
$dbconn->Execute("UPDATE $configurationtable SET configuration_value = '" . date("Ymd") . "' WHERE configuration_key = 'CRON_GOOGLE_RUN'"); } } else { $configurationtable = $oostable['configuration']; $dbconn->Execute("INSERT INTO $configurationtable (configuration_key, configuration_value, configuration_group_id) VALUES ('CRON_GOOGLE_RUN', '" . date("Ymd") . "', '6')"); } require_once MYOOS_INCLUDE_PATH . '/includes/classes/class_googlesitemap.php'; $oGoogle = new GoogleSitemap; $submit = true; echo '<pre>'; if ($oGoogle->GenerateProductSitemap()){ echo 'Generated Google Product Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Product Sitemap Generation FAILED!' . "\n\n"; } if ($oGoogle->GenerateCategorySitemap()){ echo 'Generated Google Category Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Category Sitemap Generation FAILED!' . "\n\n"; } if ($oGoogle->GenerateSitemapIndex()){ echo 'Generated Google Sitemap Index Successfully' . "\n\n";
if ($prevent_result->RecordCount() > 0) { $prevent = $prevent_result->fields; if ($prevent['configuration_value'] == date("Ymd")) { # die('Halt! Already executed - should not execute more than once a day.'); } } require_once MYOOS_INCLUDE_PATH . '/includes/classes/class_googlesitemap.php'; $oSitemap = new GoogleSitemap; $submit = true; echo '<pre>'; if ($oSitemap->GenerateProductSitemap()){ echo 'Generated Google Product Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Product Sitemap Generation FAILED!' . "\n\n"; } if ($oSitemap->GenerateCategorySitemap()){ echo 'Generated Google Category Sitemap Successfully' . "\n\n"; } else { $submit = false; echo 'ERROR: Google Category Sitemap Generation FAILED!' . "\n\n"; } if ($oSitemap->GenerateSitemapIndex()){ echo 'Generated Google Sitemap Index Successfully' . "\n\n";