Completely Separate List, including different attributes

Solutions for other advanced phplisters

Completely Separate List, including different attributes

Postby Guest » 9:47pm, Wed 13 Aug, 2008

Is there anyway to set up a completely separate list with different attributes, not using the original global attributes?

My client has three lists that they use for different types of general customers, but they want me to set up two more lists that are for something else entirely (different divisions of the company).

The new list will have different attributes that will also need to be searchable criteria.

The list should also not be visible on the main subscribe page (it's only for internal use). I imagine the solution to the subscribe page issue is just setting up a custom subscribe page and not using the default page anymore, so people can't see the new lists, but I'm still at a loss as to the separate list with different attributes.

I tried searching on the topics in question, but didn't turn up anything.

Thanks to anyone who might be able to help out.
Guest
 

Postby Dragonrider » 6:07am, Thu 14 Aug, 2008

I don't say this is the "right" method, but it sounds to me like you could install a second phplist on your server, obviously with a different directory name (ie: not lists, perhaps privatelist, and where your first install uses phplist_ as a database prefix, use private_

That way you can use the same database for both lists without clashes.
My sites:- http://wharfedalefestival.co.uk, http://ilkleygardeners.org.uk, http://emergencyaid.net, http://dragonrider.co.uk
Latest phpList version is now 3.0.12 (3 February 2015) and requires a minimum of MySQL 5.0 and PHP 5.3.x
Dragonrider
Moderator
 
Posts: 3460
Joined: 6:58am, Sun 02 Jul, 2006
Location: Ilkley, West Yorkshire, United Kingdom

Postby Guest » 5:04pm, Thu 14 Aug, 2008

Hmmm... that might be a feasible workaround. Thanks, Dragonrider.

I was hoping that maybe there was a method to do this from within the install, to keep things lighter, but a second install may be the way to go.
Guest
 

Re: Completely Separate List, including different attributes

Postby 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
fabiof
phpList newbie
 
Posts: 1
Joined: 3:24pm, Fri 24 Sep, 2010


Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests