From: Pierre Habouzit (MadCoder Date: Fri, 3 Dec 2004 12:05:27 +0000 (+0000) Subject: newsletter is roughly standalone X-Git-Tag: xorg/old~714 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=5f35202fa5f6821683689c4c63b2e2a9afaa20d2;p=platal.git newsletter is roughly standalone * Newsletter: roughly standalone. (see #242) git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-28 --- diff --git a/ChangeLog b/ChangeLog index f7758b3..1218788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ New : - New skin : openweb. -MC - No more annoying submit button, onclick is used to submit. -MC - This is the first autonom module of the site ! -MC + + * WebRedirect (was: Carva) : now standalone. -MC Bug/Wish : diff --git a/bin/connect.db.inc.php b/bin/connect.db.inc.php new file mode 100644 index 0000000..d66790f --- /dev/null +++ b/bin/connect.db.inc.php @@ -0,0 +1,28 @@ +dbconnect(); + +?> diff --git a/bin/cron/connect.db.inc.php b/bin/cron/connect.db.inc.php deleted file mode 100644 index 606388e..0000000 --- a/bin/cron/connect.db.inc.php +++ /dev/null @@ -1,28 +0,0 @@ -dbconnect(); - -?> diff --git a/bin/cron/connect.db.inc.php b/bin/cron/connect.db.inc.php new file mode 120000 index 0000000..55b7297 --- /dev/null +++ b/bin/cron/connect.db.inc.php @@ -0,0 +1 @@ +../connect.db.inc.php \ No newline at end of file diff --git a/bin/cron/send_nl.php b/bin/newsletter.send.php similarity index 98% rename from bin/cron/send_nl.php rename to bin/newsletter.send.php index c90ebcc..6273c5f 100755 --- a/bin/cron/send_nl.php +++ b/bin/newsletter.send.php @@ -21,7 +21,7 @@ ***************************************************************************/ require('./connect.db.inc.php'); -require("../../include/newsletter.inc.php"); +require("newsletter.inc.php"); function query ($sql) { mysql_query($sql); diff --git a/hooks/core/newsletter.inc.php b/hooks/core/newsletter.inc.php new file mode 100644 index 0000000..9e9676e --- /dev/null +++ b/hooks/core/newsletter.inc.php @@ -0,0 +1,36 @@ + diff --git a/htdocs/login.php b/htdocs/login.php index ea026f6..90b3efd 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -50,10 +50,6 @@ mysql_free_result($res); // affichage de la boîte avec quelques liens -$res = $globals->db->query("SELECT id FROM newsletter ORDER BY date DESC"); -list($nb) = mysql_fetch_row($res); -mysql_free_result($res); - require_once('login.conf.php') ; $pub_nbElem = $pub_nbLig * $pub_nbCol ; if (count($pub_tjs) <= $pub_nbElem) diff --git a/include/.arch-inventory b/include/.arch-inventory index e3c1067..a0b4a85 100644 --- a/include/.arch-inventory +++ b/include/.arch-inventory @@ -1 +1 @@ -precious ^xorg.globals.inc.php +precious ^xorg.globals.inc.php$ diff --git a/include/conf.d/newsletter.menu.inc.php b/include/conf.d/newsletter.menu.inc.php new file mode 100644 index 0000000..a17c214 --- /dev/null +++ b/include/conf.d/newsletter.menu.inc.php @@ -0,0 +1,3 @@ +addPrivateEntry(XOM_INFOS, 00, 'Lettres mensuelles', 'newsletter/'); +?> diff --git a/include/conf.d/tmp.menu.inc.php b/include/conf.d/tmp.menu.inc.php index adb1840..9608eca 100644 --- a/include/conf.d/tmp.menu.inc.php +++ b/include/conf.d/tmp.menu.inc.php @@ -18,7 +18,6 @@ $this->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent.php' $this->addPrivateEntry(XOM_GROUPS, 30, 'Groupes X', 'http://www.polytechnique.net/plan.php'); $this->addPrivateEntry(XOM_GROUPS, 40, 'Web Polytechnicien', 'http://www.polytechnique.net/'); -$this->addPrivateEntry(XOM_INFOS, 00, 'Lettres mensuelles', 'newsletter/'); $this->addPrivateEntry(XOM_INFOS, 10, 'Documentations', 'docs/'); $this->addPrivateEntry(XOM_INFOS, 20, 'Nous contacter', 'docs/contacts.php'); $this->addPrivateEntry(XOM_INFOS, 30, 'Emploi', 'http://www.manageurs.com/'); diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 8a0f916..df8905b 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -77,12 +77,10 @@ function user_clear_all_subs($user_id, $really_del=true) function inscription_listes_base($uid,$pass,$promo) { require_once('xml-rpc-client.inc.php'); - require_once('newsletter.inc.php'); global $globals; // récupération de l'id de la liste promo $client = new xmlrpc_client("http://$uid:$pass@localhost:4949/polytechnique.org"); $client->subscribe("promo$promo"); - subscribe_nl(); } // }}} diff --git a/include/xorg.globals.inc.php.in b/include/xorg.globals.inc.php.in new file mode 100644 index 0000000..94ae3c6 --- /dev/null +++ b/include/xorg.globals.inc.php.in @@ -0,0 +1,94 @@ +"auth_user_md5"); + var $tlabel = array('native'=>"X.Org"); + + /** paths */ + var $baseurl = "http://localhost/xorg"; + var $spoolroot = "/var/spool/xorg"; + var $root = null; + + function XorgGlobals() { + $this->root = dirname(dirname(__FILE__)); + + foreach(glob($this->root.'/include/conf.d/*.globals.inc.php') as $inc) { + require_once($inc); + } + + $array = parse_ini_file($this->root.'/configs/platal.conf', true); + if (!is_array($array)) { + return; + } + + foreach ($array as $cat=>$conf) { + $c = strtolower($cat); + foreach ($conf as $key=>$val) { + if ($c == 'core' && isset($this->$key)) { + $this->$key=$val; + } else { + $this->$c->$key = $val; + } + } + } + + $this->menu = new XOrgMenu($this->root.'/include/conf.d/'); + + session_start(); + + $this->dbconnect(); + if ($this->debug) { + $this->db->trace_on(); + } + } +} + +// }}} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +?> diff --git a/install.d/STATE b/install.d/STATE index e87c17e..931ac9f 100644 --- a/install.d/STATE +++ b/install.d/STATE @@ -15,6 +15,11 @@ banana quite good shape. converting banana into templates would be great though +newsletter + + it's mixed into the lists module ... + we have to repair this, and all will be OK + IN PROGRESS ----------- @@ -30,7 +35,6 @@ mail marketing money news -newsletter platal platal-dev profile diff --git a/install.d/lists/files b/install.d/lists/files index 33d80c3..981f4f5 100644 --- a/install.d/lists/files +++ b/install.d/lists/files @@ -1,24 +1,38 @@ +bin/mailman/foreach_template.py +bin/mailman/mailman-rpc.py +bin/mailman/mhonarc_by_month.pl +bin/mailman/mhonarc_pipe.sh htdocs/admin/lists.php +htdocs/images/lists_date.png +htdocs/images/lists_firstia.png +htdocs/images/lists_first.png +htdocs/images/lists_lastia.png +htdocs/images/lists_last.png +htdocs/images/lists_nextia.png +htdocs/images/lists_next.png +htdocs/images/lists_previa.png +htdocs/images/lists_prev.png +htdocs/images/lists_thread.png htdocs/listes/admin.php +htdocs/listes/archives.php htdocs/listes/check.php htdocs/listes/create.php +htdocs/listes/delete.php htdocs/listes/index.php htdocs/listes/members.php htdocs/listes/moderate.php htdocs/listes/options.php htdocs/listes/soptions.php htdocs/listes/trombi.php -htdocs/listes/delete.php -htdocs/listes/archives.php include/validations/listes.inc.php -bin/mailman/foreach_template.py -bin/mailman/mailman-rpc.py templates/admin/lists.tpl templates/include/form.valid.listes.tpl templates/include/form.valid.ml.tpl templates/listes/admin.tpl +templates/listes/archives.tpl templates/listes/check.tpl templates/listes/create.tpl +templates/listes/delete.tpl templates/listes/header_listes.tpl templates/listes/index.tpl templates/listes/listes.inc.tpl @@ -29,17 +43,5 @@ templates/listes/moderate.tpl templates/listes/options.tpl templates/listes/soptions.tpl templates/listes/trombi.tpl -templates/listes/delete.tpl -templates/listes/archives.tpl templates/mails/listes.promo.tpl templates/mails/valid.liste.tpl -htdocs/images/lists_date.png -htdocs/images/lists_firstia.png -htdocs/images/lists_first.png -htdocs/images/lists_lastia.png -htdocs/images/lists_last.png -htdocs/images/lists_nextia.png -htdocs/images/lists_next.png -htdocs/images/lists_previa.png -htdocs/images/lists_prev.png -htdocs/images/lists_thread.png diff --git a/install.d/newsletter/README b/install.d/newsletter/README new file mode 100644 index 0000000..b828bf3 --- /dev/null +++ b/install.d/newsletter/README @@ -0,0 +1,24 @@ + + Notes for the newsletter module for plat/al + + +CONFIG OPTIONS +-------------- + + All settings of the module are shown here with their default and meaning + + N/A + + +BUGS +---- + + http://trackers.polytechnique.org/index.php?cat=14 + + +DEPENDS +------- + + platal + + diff --git a/install.d/newsletter/files b/install.d/newsletter/files index 0983963..a2b85eb 100644 --- a/install.d/newsletter/files +++ b/install.d/newsletter/files @@ -1,3 +1,5 @@ +bin/newsletter.send.php +hooks/core/newsletter.inc.php htdocs/admin/newsletter_cats.php htdocs/admin/newsletter_edit.php htdocs/admin/newsletter.php @@ -5,8 +7,8 @@ htdocs/css/nl.css htdocs/newsletter/index.php htdocs/newsletter/show.php htdocs/newsletter/submit.php +include/conf.d/newsletter.menu.inc.php include/newsletter.inc.php -bin/cron/send_nl.php templates/admin/newsletter_edit.tpl templates/admin/newsletter.tpl templates/newsletter/head.tpl diff --git a/install.d/newsletter/install.sql b/install.d/newsletter/install.sql new file mode 100644 index 0000000..2b03767 --- /dev/null +++ b/install.d/newsletter/install.sql @@ -0,0 +1,58 @@ +insert into admin_h2 VALUES (2,6,'Newsletter',30); + +INSERT INTO admin_a VALUES (6,'Liste','admin/newsletter.php',0); +INSERT INTO admin_a VALUES (6,'Catégories','admin/newsletter_cats.php',10); +INSERT INTO admin_a VALUES (6,'Adresses en panne','admin/newsletter_pattecassee.php',20); + +-- +-- Table structure for table `newsletter` +-- + +CREATE TABLE `newsletter` ( + `id` int(11) NOT NULL auto_increment, + `date` date NOT NULL default '0000-00-00', + `titre` varchar(255) NOT NULL default '', + `bits` enum('sent','new') NOT NULL default 'new', + `head` mediumtext NOT NULL, + PRIMARY KEY (`id`) +) TYPE=MyISAM COMMENT='liste des NL envoyes'; + +-- +-- Table structure for table `newsletter_art` +-- + +CREATE TABLE `newsletter_art` ( + `id` int(10) unsigned NOT NULL default '0', + `aid` smallint(5) unsigned NOT NULL default '0', + `cid` smallint(5) unsigned NOT NULL default '0', + `pos` tinyint(3) unsigned NOT NULL default '0', + `title` mediumtext NOT NULL, + `body` mediumtext NOT NULL, + `append` mediumtext NOT NULL, + PRIMARY KEY (`id`,`aid`) +) TYPE=MyISAM; + +-- +-- Table structure for table `newsletter_cat` +-- + +CREATE TABLE `newsletter_cat` ( + `cid` tinyint(3) unsigned NOT NULL auto_increment, + `pos` tinyint(3) unsigned NOT NULL default '0', + `titre` varchar(128) NOT NULL default '', + PRIMARY KEY (`cid`), + KEY `pos` (`pos`) +) TYPE=MyISAM; + +-- +-- Table structure for table `newsletter_ins` +-- + +CREATE TABLE `newsletter_ins` ( + `user_id` smallint(4) unsigned NOT NULL default '0', + `last` int(11) NOT NULL default '0', + `pref` enum('text','html') NOT NULL default 'html', + PRIMARY KEY (`user_id`), + KEY `last` (`last`) +) TYPE=MyISAM COMMENT='liste des abonnés à la newsletter'; + diff --git a/install.d/newsletter/uninstall.sql b/install.d/newsletter/uninstall.sql new file mode 100644 index 0000000..9a44be9 --- /dev/null +++ b/install.d/newsletter/uninstall.sql @@ -0,0 +1,8 @@ + +delete from admin_h2 where h2id=6; +delete from admin_a where h2id=6; + +drop TABLE newsletter; +drop TABLE newsletter_art; +drop TABLE newsletter_cat; +drop TABLE newsletter_ins;