コード例 #1
0
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";
} else {
    $submit = false;
    echo 'ERROR: Google Sitemap Index Generation FAILED!' . "\n\n";
}

if ($submit){
    echo 'CONGRATULATIONS! All files generated successfully.' . "\n\n";
    echo 'If you have not already submitted the sitemap index to Google click the link below.' . "\n";
    echo 'Before you do I HIGHLY recommend that you view the XML files to make sure the data is correct.' . "\n\n";
    echo $oGoogle->GenerateSubmitURL() . "\n\n";

    echo 'Here is your sitemap index: ' .$oGoogle->base_url . 'sitemapindex.xml' . "\n";
    echo 'Here is your product sitemap: ' . $oGoogle->base_url . 'sitemapproducts.xml' . "\n";
    echo 'Here is your category sitemap: ' . $oGoogle->base_url . 'sitemapcategories.xml' . "\n";
コード例 #2
0
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";
} else {
    $submit = false;
    echo 'ERROR: Google Sitemap Index Generation FAILED!' . "\n\n";
}

if ($submit){

    if ($prevent_result->RecordCount() > 0) {
        $configurationtable = $oostable['configuration'];
        $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')");
    }
コード例 #3
0
ファイル: snoei.php プロジェクト: CristianCCIT/shop4office
 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&euml;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&euml;n sitemap is niet correct aangemaakt!' . "<br />";
             } else {
                 $category_sitemap = false;
                 echo 'OPGELET: De categorie&euml;n sitemap is niet aangemaakt! Er zijn geen categorie&euml;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&euml;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>';
     }
 }
コード例 #4
0
        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 />";
        }
    }
}
/************/
/*	Index	*/
/************/
if ($google->GenerateSitemapIndex($showInfopages, $showManufacturers, $showSpecials, $category_sitemap, $product_sitemap)) {
    echo 'De index sitemap is succesvol aangemaakt!' . "<br />";
} else {
    $submit = false;
}
/************/
/*	Output	*/
/************/
if ($submit) {
    echo "<br />" . 'Alle sitemaps zijn correct aangemaakt!' . "<br /><br />";
    echo 'Dit is de index sitemap: <a href="' . $google->base_url . 'sitemapindex.xml">' . $google->base_url . 'sitemapindex.xml</a><br />';
    if ($product_sitemap) {
        echo 'Dit is de producten sitemap: <a href="' . $google->base_url . 'sitemapproducts.xml">' . $google->base_url . 'sitemapproducts.xml</a> (' . $google->debug['QUERY']['PRODUCTS']['NUM_ROWS'] . ')<br />';
    }
    if ($category_sitemap) {
        echo 'Dit is de categorie&euml;n sitemap: <a href="' . $google->base_url . 'sitemapcategories.xml">' . $google->base_url . 'sitemapcategories.xml</a> (' . $google->debug['QUERY']['CATEGORY']['NUM_ROWS'] . ')<br />';