'Classique', 'price' => 40, ) ); } if (!in_array($prefixeTable.'ppppp_config', $tables)) { $query = " CREATE TABLE IF NOT EXISTS ".$prefixeTable."ppppp_config ( param varchar(40) NOT NULL, value text NOT NULL, PRIMARY KEY (param) ) ;"; pwg_query($query); mass_inserts( $prefixeTable."ppppp_config", array('param', 'value'), array( array('param' => 'fixed_shipping', 'value' => '0'), array('param' => 'currency', 'value' => 'EUR'), ) ); } // add a new column to existing table $result = pwg_query('SHOW COLUMNS FROM `'.CATEGORIES_TABLE.'` LIKE "paypal_active";'); if (!pwg_db_num_rows($result)) { pwg_query('ALTER TABLE `'.CATEGORIES_TABLE.'` ADD `paypal_active` enum(\'true\', \'false\') default \'false\';'); } // add config parameter if (empty($conf['PayPalShoppingCart'])) { $default_config = serialize(array( 'apply_to_albums' => 'all', )); conf_update_param('PayPalShoppingCart', $default_config); $conf['PayPalShoppingCart'] = $default_config; $template->delete_compiled_templates(); } } /** * list all tables in an array * * @return array */ function ppppp_get_tables() { global $prefixeTable; $tables = array(); $query = ' SHOW TABLES ;'; $result = pwg_query($query); while ($row = pwg_db_fetch_row($result)) { if (preg_match('/^'.$prefixeTable.'/', $row[0])) { array_push($tables, $row[0]); } } return $tables; } ?>