You know
I’m not a coder...
I’ve seen a lot of request for a PhpList Module/Snippet...
I’ve made this little peace of code 2-3 years ago, trying to create a PHpList > Nuke7.4 Integration.
This code (added in Nuke Your Account form registration) works and at the same time records the user on PhpList and Nuke cms.
i hope can help anyone to create a PhpList module/snippet/plugin for MODx.
/* PHPList integration */
$uid = md5(uniqid(mt_rand()));
$listquery = sprintf('insert into lists_user_user
(email, entered, uniqid, confirmed, htmlemail, subscribepage, rssfrequency)
values ("%s", now(), "%s", 1, 1, 1, "")', addslashes($row[user_email]), $uid);
$db->sql_query($listquery);
$res = $db->sql_query("select id from lists_user_user where email = '" . $row[user_email] . "'");
if ($db->sql_numrows($res))
{
$entry = $db->sql_fetchrow($res);
$listquery = sprintf('insert into lists_listuser (userid, listid) values (%d, 2)', $entry[id]);
$db->sql_query($listquery);
}
/* END PHPList integration */