add("NEWSLETTER[$t_id].LINK[".$url."]"); $n_id=$t_id; } else { $sql="select newsletter_id, owner_id from ".($type=="a" ? "autoresponder" : "campaign_schedule").$config["table_prefix"]." where id='$t_id'"; $rs=$db->select($sql); if (isset($rs[0][0])) { $n_id=$rs[0]["newsletter_id"]; $stat->add("NEWSLETTER[".$rs[0]["newsletter_id"]."].LINK[".$url."]"); $stat->add("USER[".$rs[0]["owner_id"]."].NEWSLETTER[".$rs[0]["newsletter_id"]."].LINK[".$url."]"); $stat->add("USER[".$rs[0]["owner_id"]."].LINK[".$url."]"); } else $n_id=0; } $stat->add("LINK[".$url."]"); $stat->close(); $data=array( 'date_created' => time(), 'ip' => $REMOTE_ADDR, 'newsletter_id' => $n_id, 'subscriber_id' => $s_id, 'url' => $url, ); $fields='date_created, ip, newsletter_id, subscriber_id, url'; $sql=get_sql_insert('stat_links'.$config["table_prefix"], $fields, $data); $db->execute($sql); $db->close(); header("Location: $url"); exit; ?>