} elseif ($mode == 'enable_discussions') { $product_ids = db_get_fields("SELECT product_id FROM cscart_products"); foreach ($product_ids as $product_id) { $product_data = array(); $product_data['discussion_type'] = "B"; fn_discussion_update_product($product_data, $product_id); } } elseif ($mode == 'sync_vendors') { error_reporting(E_ALL); ini_set('display_errors', 1); include_once DIR_SYNC_VENDORS . "SyncVendor.php"; include_once DIR_SYNC_VENDORS . "PHPExcel.php"; ini_set('max_execution_time', 0); ini_set('memory_limit', '512M'); $svp = new SyncVendor(); $svp->downloadSheets(); $svp->run(); return array(CONTROLLER_STATUS_OK, "settings.manage§ion_id=Vendors?sync=y"); } elseif ($mode == 'show_log') { $lines = file(DIR_SYNC_VENDORS . "syncVendor.log"); foreach ($lines as $line) { fn_echo($line . "<br>"); } die; } // --------- ExIm core functions ------------------ //delete cache function deleteDirectory($dir) { if (!file_exists($dir)) { return true;