altering the phplist_message table

Once you've installed phpList Version 2... ask questions here!
Forum rules
Please help the volunteers to help you by supplying the version of phpList you are using, browser & version and if possible, a link to your phpList installation. This is for Version 2 of phpList (the orange one).

altering the phplist_message table

Postby pittstains » 5:57pm, Wed 28 Feb, 2007

Hello,

I've written a little custom snippet for my website which displays a list of all the sent messages. When you click the link, it displays the individual message.

I didn't want the web page to display drafts, so my code depends on the values in the status field of the phplist_message table.

The catch is that there are some sent messages that I want to hide (targeted action alerts, for instance). I have been setting the status value to "hidden" (via phpMyAdmin) to achieve this, but this method has drawbacks.

First, I can't view the message stats in phpList unless I set the status value back to "sent." Secondly, every time I send a new message, phpList goes back to my "hidden" messages, checks for recipients, finds none, and sets the status value back to "sent."

My questions is this: If I add a new field to the phpList_message table, will this cause problems for phpList? I guess I would just add a column called hidden and set it to accept a boolean value. I'm hoping phpList is written in such a way that it won't even notice that the new column is there, but I suppose it's possible that some of the queries are written without specifying column names. E.g.:

Code: Select all
INSERT INTO table VALUES ('a', 'b', 'c')

vs.
Code: Select all
INSERT INTO table (col1, col2, col3) VALUES ('a', 'b', 'c')

Can anyone advise?
pittstains
PL Nut
 
Posts: 16
Joined: 5:29am, Sat 02 Dec, 2006

Postby michiel » 12:17am, Thu 01 Mar, 2007

the only place where it might go wrong is in places where stuff is put in the database, without using column references, eg

insert into message values(....)

but I don't think there is any place like that, as I never code like that, so it should be safe to make a change.

make sure to name it something not obvious, like "hidden" but name it something like "MyCustomFieldToHideThings" so that
(a) it won't clash with future reserved names in Mysql and
(b) it won't clash with future changes in phplist itself.
michiel
Admin
 
Posts: 1022
Joined: 10:18pm, Fri 11 Apr, 2003
Location: Buenos Aires, Argentina

Postby pittstains » 2:32pm, Thu 01 Mar, 2007

Thanks, Michiel. I suppose if it does mess something up I can always just remove the column.
pittstains
PL Nut
 
Posts: 16
Joined: 5:29am, Sat 02 Dec, 2006


Return to Question & Problems - after installing

Who is online

Users browsing this forum: Google [Bot] and 4 guests