by fabiof » 8:30pm, Fri 24 Sep, 2010
Hi,
I solved this problem by doing a little hack on the way the user_attributes are read from the db.
Basically I decided to extract only the user_attributes present in the subscribepage owned by the owner of the list that is currently sending a message.
on line 1378 (more or less)
search the line
$attributes_request = Sql_Query("select * from $tables[attribute]");
and replace with this block
/************************************************************************************************/
//select user attributes from the subscribe pages of the list owned by the current owner
// Fabio Franci 09 2010
//$attributes_request = Sql_Query("select * from $tables[attribute]");
$owner=$_SESSION["logindetails"]["id"];
$ea_request=Sql_Query("select SD.data from $tables[subscribepage] AS S JOIN $tables[subscribepage_data] AS SD ON S.id=SD.id where S.owner=$owner AND SD.name='attributes'");
$ealist="";
while ($ea=Sql_Fetch_array($ea_request)) {
$ealist.=str_replace("+",",",$ea["data"]);
}
$ealist.="0"; //to close the last comma or to close the where clause
$attributes_request=Sql_Query("select * from $tables[attribute] where id in ($ealist)");
/************************************************************************************************/
Then search at line 1454 (more or less)
search the line
$attreq = Sql_Query(sprintf('select * from %s where type in ("select","radio","date","checkboxgroup","checkbox") %s',$tables["attribute"],$already_used));
and replace with
/************************************************************************************************/
//select user attributes from the subscribe pages of the list owned by the current owner
// Fabio Franci 09 2010
//$attreq = Sql_Query(sprintf('select * from %s where type in ("select","radio","date","checkboxgroup","checkbox") %s',$tables["attribute"],$already_used));
$attreq = Sql_Query(sprintf('select * from %s where type in ("select","radio","date","checkboxgroup","checkbox") %s and id in (%s)',$tables["attribute"],$already_used,$ealist));
/************************************************************************************************/
Same at line 1560