function get_product($product_id) { if (!$GLOBALS['db']) { $GLOBALS['db'] =& instantiate_db(); } global $db; $conf = $db->get_product($product_id); //return database record for product return new product($conf); }
if ($h_diff || $d_diff) { $db->save_cron_time(1); } if ($h_diff) { plugin_hourly(); } if ($d_diff) { plugin_daily(); } } global $db; /* * Database (db) object * @global object $db **/ $db =& instantiate_db(); // set error handler set_error_handler('_amember_error_handler'); // load language load_language_defs(); load_language("/language"); /// load plugins load_plugins('protect'); load_plugins('payment'); global $config; if ($config['product_paysystem']) { $ps_list = array('' => '* Choose a paysystem *'); foreach ($l = get_paysystems_list() as $p) { $ps_list[$p['paysys_id']] = $p['title']; } add_product_field('paysys_id', 'Payment System', 'select', "Choose payment system to be used with this product.<br />\n This option only available if you have enabled option<br />\n \"Assign paysystem to product\" in aMember CP => Setup => Advanced\n ", '', array('options' => $ps_list));