* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
while (list($cid, $title) = $res->next()) {
$this->_cats[$cid] = $title;
}
while (list($cid, $title) = $res->next()) {
$this->_cats[$cid] = $title;
}
"SELECT a.title,a.body,a.append,a.aid,a.cid,a.pos
FROM newsletter_art AS a
INNER JOIN newsletter AS n USING(id)
"SELECT a.title,a.body,a.append,a.aid,a.cid,a.pos
FROM newsletter_art AS a
INNER JOIN newsletter AS n USING(id)
- global $globals;
- $globals->xdb->execute('UPDATE newsletter SET date={?},titre={?},head={?} WHERE id={?}',
- $this->_date, $this->_title, $this->_head, $this->_id);
+ XDB::execute('UPDATE newsletter SET date={?},titre={?},head={?} WHERE id={?}',
+ $this->_date, $this->_title, $this->_head, $this->_id);
- $globals->xdb->execute('REPLACE INTO newsletter_art (id,aid,cid,pos,title,body,append)
+ XDB::execute('REPLACE INTO newsletter_art (id,aid,cid,pos,title,body,append)
VALUES ({?},{?},{?},{?},{?},{?},{?})',
$this->_id, $a->_aid, $a->_cid, $a->_pos,
$a->_title, $a->_body, $a->_append);
$this->_arts['a'.$a->_aid] = $a;
} else {
VALUES ({?},{?},{?},{?},{?},{?},{?})',
$this->_id, $a->_aid, $a->_cid, $a->_pos,
$a->_title, $a->_body, $a->_append);
$this->_arts['a'.$a->_aid] = $a;
} else {
'INSERT INTO newsletter_art
SELECT {?},MAX(aid)+1,{?},'.($a->_pos ? intval($a->_pos) : 'MAX(pos)+1').',{?},{?},{?}
FROM newsletter_art AS a
'INSERT INTO newsletter_art
SELECT {?},MAX(aid)+1,{?},'.($a->_pos ? intval($a->_pos) : 'MAX(pos)+1').',{?},{?},{?}
FROM newsletter_art AS a
- . "[<a href=\"$url/newsletter/\">archives</a> | "
- . "<a href=\"$url/newsletter/submit.php\">écrire dans la NL</a> | "
- . "<a href=\"$url/newsletter/?out=1\">ne plus recevoir</a>]"
+ . "[<a href=\"$url/nl\">archives</a> | "
+ . "<a href=\"$url/nl/submit\">écrire dans la NL</a> | "
+ . "<a href=\"$url/nl/out\">ne plus recevoir</a>]"
. '</div>';
} else {
return "\n\n--------------------------------------------------------------------\n"
. "Cette lettre est envoyée à tous les Polytechniciens sur Internet par\n"
. "l'intermédiaire de Polytechnique.org.\n"
. "\n"
. '</div>';
} else {
return "\n\n--------------------------------------------------------------------\n"
. "Cette lettre est envoyée à tous les Polytechniciens sur Internet par\n"
. "l'intermédiaire de Polytechnique.org.\n"
. "\n"
- . "archives : [$url/newsletter/]\n"
- . "écrire : [$url/newsletter/submit.php]\n"
- . "ne plus recevoir: [$url/newsletter/?out=1]\n";
+ . "archives : [$url/nl]\n"
+ . "écrire : [$url/nl/submit]\n"
+ . "ne plus recevoir: [$url/nl/out]\n";
foreach ($this->_arts as $cid=>$arts) {
$res .= "<div class='lnk'><a href='#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
foreach ($arts as $art) {
foreach ($this->_arts as $cid=>$arts) {
$res .= "<div class='lnk'><a href='#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
foreach ($arts as $art) {
foreach ($this->_arts as $cid=>$arts) {
$res .= "<h1><a id='cat$cid'></a><span>".$this->_cats[$cid].'</span></h1>';
foreach($arts as $art) {
foreach ($this->_arts as $cid=>$arts) {
$res .= "<h1><a id='cat$cid'></a><span>".$this->_cats[$cid].'</span></h1>';
foreach($arts as $art) {
- global $globals;
- $res = $globals->xdb->query("SELECT id,date,titre FROM newsletter WHERE bits!='new' ORDER BY date DESC");
+ $res = XDB::query("SELECT id,date,titre FROM newsletter WHERE bits!='new' ORDER BY date DESC");
- global $globals;
- $user = ($uid == -1) ? Session::getInt('uid') : $uid;
- $globals->xdb->execute('REPLACE INTO newsletter_ins (user_id,last)
- VALUES ({?}, 0)', $user);
+ $user = ($uid == -1) ? S::v('uid') : $uid;
+ XDB::execute('REPLACE INTO newsletter_ins (user_id,last)
+ VALUES ({?}, 0)', $user);
$arr = array_map('trim',$arr);
$res = '';
foreach ($arr as $key => $line) {
$arr = array_map('trim',$arr);
$res = '';
foreach ($arr as $key => $line) {