View Full Version : Question about export
brendan
10-16-2006, 05:17 PM
I have a joomla component that allows users to unsubscribe from Joomla. If a person is not in joomla, can the update change the user to unconfirmed in phplist?
Hung Dinh
10-17-2006, 08:26 AM
The phplist bridge will work with Joomla users only, it mean that if the person is not in Joomla, the users information will not be updated into phplist
brendan
10-17-2006, 08:49 PM
But does it unly run update queries? For example, if a person is removed from Joomla are they removed from PHPlist?
Hung Dinh
10-18-2006, 02:29 AM
But does it unly run update queries? For example, if a person is removed from Joomla are they removed from PHPlist?
Yes, it will be updated. :)
brendan
10-23-2006, 11:27 PM
Thanks!
Can you point out in the update.php what query deletes the records?
brendan
11-11-2006, 01:23 AM
I had a user change his email in joomla and the bridge did add the new email address but did NOT delete or unconfirm the old email in PHPlist.
This is kinda messy. Is it possible to have to unconfirm all unmatched records after the initial update queries are run?
brendan
12-04-2006, 09:47 PM
Well I made another php file that runs as it's own Cron job incase the bridge gets and update and I wont have too look for code changes. The key is having the same username/pass for the joomla and phplist DB.
What this does is compare the emails in PHPLIST with joomla. If they do not match, they are unconfirmed in phplist. I need this since people change thier email in Joomla. Also, put this file in with your PHPlist Bridge stuff since it uses the config.php.
error_reporting(E_ALL & ~ E_NOTICE & ~ E_WARNING);
include('config.php');
/*
* connect to database of Joomla & PHPList
*/
# connect 2 Joomla server
$jos_lk = mysql_connect($jos_ser, $jos_user, $jos_pass) or die("Error 1: ".mysql_error());
# connect 2 PHPList server
$lst_lk = mysql_connect($lst_ser, $lst_user, $lst_pass) or die("Error 2: ".mysql_error());
# select db on Joomla server
//mysql_select_db($jos_db, $jos_lk) or die("Error 3: ".mysql_error());
//mysql_select_db($lst_db, $lst_lk) or die("Error 4: ".mysql_error());
/*
* Fetch all users in Joomla,
* process each off all records (gid= 18 ~ normal users) with `email` is "primary key"
*/
# _e : export
$sql_e = "UPDATE YOURJOOMLADB.jos_users ";
$sql_e.= "RIGHT JOIN YOURPHPLISTDB.phplist_user_user ON YOURJOOMLADB.jos_users.email = YOURPHPLISTDB.phplist_user_user.email ";
$sql_e.= "SET YOURPHPLISTDB.phplist_user_user.confirmed = 0 "; // group id of normal user
$sql_e.= "WHERE (((YOURJOOMLADB.jos_users.email) Is Null))"; // group id of normal user
$rsl_e = mysql_query($sql_e) or die("Error 5: ".mysql_error());
mysql_close($jos_lk);
mysql_close($lst_lk);
# DONE ^^
?>
JosepCarreras
02-05-2007, 02:14 PM
I think it would be about time to update the phpbridge to manage the cases mentioned above.
Thanks
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.