destination; $form['path_type'] = array( '#type' => 'textfield', '#title' => t('Product Link Destination'), '#default_value' => $destination, '#size' => 30, '#maxlength' => 255, '#weight' => -1, ); break; } } function affiliate_alter_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { if (uc_product_is_product($node->type)) { switch ($op) { case 'insert': case 'update': $result = db_query("INSERT INTO {uc_products} (vid, path) VALUES (%d,'%s') ON DUPLICATE KEY UPDATE path = '%s'", $node->nid, $node->path_type, $node->path_type); _uc_affiliate2_get_products($node); break; case 'load': $result = db_query("SELECT path FROM uc_products WHERE uc_products.vid = %d",$node->nid); $node->destination = db_fetch_object($result)->path; } } }