* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: newsletter.inc.php,v 1.3 2004-10-15 14:30:54 x2000habouzit Exp $
+ $Id: newsletter.inc.php,v 1.4 2004-10-15 15:39:40 x2000habouzit Exp $
***************************************************************************/
define('HOMME', 0);
class NewsLetter {
- function NewsLetter() { }
+ $_cats;
+
+ function NewsLetter() {
+ global $globals;
+
+ $res = $globals->db->query("SELECT cid,title FROM newsletter_cat ORDER BY pos");
+ $this->_cats = Array();
+ while(list($cid,$title) = mysql_fetch_row($res)) {
+ $this->_cats[$cid] = $title;
+ }
+ mysql_free_result($res)
+
+ }
}
class NLArticle {
+-- -----------------------------------------------------------------------------
+-- update old table
+--
alter table newsletter change id id int not null;
alter table newsletter change `date` `date` date not null;
alter table newsletter add column bits enum('old','sent','new') default 'new' not null;
alter table newsletter_ins add column last int;
alter table newsletter_ins add index (last);
-
+--
+-- -----------------------------------------------------------------------------
+-- newsletter categories
+--
create table newsletter_cat (
cid tinyint unsigned not null auto_increment,
pos tinyint unsigned not null,
insert into newsletter_cat values(2,2,'Communications institutionnelles');
insert into newsletter_cat values(3,3,'Groupes X');
insert into newsletter_cat values(4,4,'Activités polytechniciennes');
-
+--
+-- -----------------------------------------------------------------------------
+-- newsletter articles
+--
+create table newsletter_art (
+ id int unsigned not null,
+ aid smallint unsigned not null,
+ cid smallint unsigned not null,
+ pos tinyint unsigned not null,
+ texte mediumtext not null,
+ PRIMARY KEY (id,aid)
+);
+--
+-- -----------------------------------------------------------------------------
+-- newsletter appends
+--
+create table newsletter_contact (
+ id int unsigned not null,
+ aid smallint unsigned not null,
+ titre varchar(128) not null,
+ content varchar(128) not null,
+ type enum('url','mail','text','none'),
+ PRIMARY KEY (id,aid)
+);
+-- -----------------------------------------------------------------------------