コード例 #1
0
ファイル: google_sitemap.php プロジェクト: Doluci/tomatocart
 function createGoogleSitemap()
 {
     global $toC_Json, $osC_Language;
     $google_sitemap = new toC_Google_Sitemap($_REQUEST['products_frequency'], $_REQUEST['products_priority'], $_REQUEST['categories_frequency'], $_REQUEST['categories_priority'], $_REQUEST['articles_frequency'], $_REQUEST['articles_priority']);
     if ($google_sitemap->generateSitemap()) {
         $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
     }
     echo $toC_Json->encode($response);
 }
コード例 #2
0
 function createGoogleSitemap()
 {
     global $toC_Json, $osC_Language;
     //check whether the root directory is writable
     if ($_POST['languages_code'] != 'en_US' && !is_writable(DIR_FS_CATALOG)) {
         $response = array('success' => false, 'feedback' => $osC_Language->get('error_directory_not_writable'));
     } else {
         $google_sitemap = new toC_Google_Sitemap($_POST['languages_code'], $_POST['products_frequency'], $_POST['products_priority'], $_POST['categories_frequency'], $_POST['categories_priority'], $_POST['articles_frequency'], $_POST['articles_priority']);
         if ($google_sitemap->generateSitemap()) {
             $response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
         } else {
             $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
         }
     }
     echo $toC_Json->encode($response);
 }