- XDB::execute('UPDATE evenements
- SET creation_date = creation_date,
- titre={?}, texte={?}, peremption={?}, promo_min={?}, promo_max={?}
- WHERE id = {?}',
- Post::v('titre'), Post::v('texte'), Post::v('peremption'),
- Post::v('promo_min'), Post::v('promo_max'), $eid);
- }
+ $res = XDB::query('SELECT flags FROM announces WHERE id = {?}', $eid);
+ $flags = new PlFlagSet($res->fetchOneCell());
+ $flags->addFlag('wiki');
+ if (Post::v('important')) {
+ $flags->addFlag('important');
+ } else {
+ $flags->rmFlag('important');
+ }
+
+ XDB::execute('UPDATE announces
+ SET creation_date = creation_date,
+ titre={?}, texte={?}, expiration={?}, promo_min={?}, promo_max={?},
+ flags = {?}
+ WHERE id = {?}',
+ Post::v('titre'), Post::v('texte'), Post::v('expiration'),
+ Post::v('promo_min'), Post::v('promo_max'),
+ $flags, $eid);
+ if ($upload->exists() && list($x, $y, $type) = $upload->imageInfo()) {
+ XDB::execute('INSERT INTO announce_photos (eid, attachmime, attach, x, y)
+ VALUES ({?}, {?}, {?}, {?}, {?})
+ ON DUPLICATE KEY UPDATE attachmime = VALUES(attachmime), attach = VALUES(attach), x = VALUES(x), y = VALUES(y)',
+ $eid, $type, $upload->getContents(), $x, $y);
+ $upload->rm();
+ }
+ }