From e219710aa66342ed9e7593e68a77f2049dbbf6d7 Mon Sep 17 00:00:00 2001
From: x2003bruneau
\n',strlen('$1'))", "str_repeat('\n',strlen('$1'))", "ligne1\\\\\nligne2");
+ // * unordered list
+ MiniWiki::Markup("/(^|\n)\*(([^\n]*(\n|$))(\*[^\n]*(\n|$))*)/se", "'
'", "$0", "* element1\n* element2\n* element3");
+ // # unordered list
+ MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'
'", "$0", "# element1\n# element2\n# element3");
+
// bold, italic and others
// ''' bold '''
MiniWiki::Markup("/'''(.*?)'''/",'$1','*$1*', "'''gras'''");
@@ -61,11 +66,6 @@ class MiniWiki
MiniWiki::$title_index = MiniWiki::Markup('/(\n|^)(!+)([^\n]*)/se', "'$1
'", "$0", "* element1\n* element2\n* element3");
- // # unordered list
- MiniWiki::Markup("/(^|\n)#(([^\n]*(\n|$))(#[^\n]*(\n|$))*)/se", "'
'", "$0", "# element1\n# element2\n# element3");
-
// links
MiniWiki::Markup('/((?:https?|ftp):\/\/(?:[\.\,\;\!\:]*[\w@~%$£µ&i#\-+=_\/\?])*)/ui', '\\0', '[\\0]');
MiniWiki::Markup('/(\s|^|\\[\\[)www\.((?:[\.\,\;\!\:]*[\w@~%$£µ&i#\-+=_\/\?])*)/iu', '\\1www.\\2', '[http://www.\\2]');
@@ -144,6 +144,7 @@ class MiniWiki
$oldrule12 = MiniWiki::$replacementHTML[MiniWiki::$title_index];
MiniWiki::$replacementHTML[MiniWiki::$title_index] = "'$0'";
}
+ $text = trim($wiki);
$text = preg_replace(MiniWiki::$patternsWiki, MiniWiki::$replacementText, trim($wiki));
if (!$title) {
MiniWiki::$replacementHTML[MiniWiki::$title_index] = $oldrule12;
diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php
index 88547d8..057bcc7 100644
--- a/modules/xnetgrp.php
+++ b/modules/xnetgrp.php
@@ -1015,17 +1015,28 @@ class XnetGrpModule extends PLModule
$promo_min = ($art['public'] ? 0 : $art['promo_min']);
$promo_max = ($art['public'] ? 0 : $art['promo_max']);
if (is_null($aid)) {
+ $fulltext = $art['texte'];
+ if (!empty($art['contact_html'])) {
+ $fulltext .= "\n\n'''Contacts :'''\\\\\n" . $art['contact_html'];
+ }
+ $post = null;
+ if ($globals->asso('forum')) {
+ require_once 'banana/forum.inc.php';
+ $banana = new ForumsBanana(S::v('forlife'));
+ $post = $banana->post($globals->asso('forum'), null,
+ $art['titre'], MiniWiki::wikiToText($fulltext, false, 0, 80));
+ }
XDB::query("INSERT INTO groupex.announces
(user_id, asso_id, create_date, titre, texte, contacts,
- peremption, promo_min, promo_max, flags)
- VALUES ({?}, {?}, NOW(), {?}, {?}, {?}, {?}, {?}, {?}, {?})",
+ peremption, promo_min, promo_max, flags, post_id)
+ VALUES ({?}, {?}, NOW(), {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
S::i('uid'), $globals->asso('id'), $art['titre'], $art['texte'], $art['contact_html'],
- $art['peremption'], $promo_min, $promo_max, $art['public'] ? 'public' : '');
+ $art['peremption'], $promo_min, $promo_max, $art['public'] ? 'public' : '', $post);
$aid = XDB::insertId();
if ($art['xorg']) {
require_once('validations.inc.php');
$article = new EvtReq("[{$globals->asso('nom')}] " . $art['titre'],
- MiniWiki::WikiToHTML($art['texte'] . (!empty($art['contact_html']) ? "\n\nContacts :\n" . $art['contact_html'] : "")),
+ MiniWiki::WikiToHTML($fulltext),
$art['promo_min'], $art['promo_max'], $art['peremption'], "", S::v('uid'));
$article->submit();
$page->trig("L'affichage sur la page d'accueil de Polytechnique.org est en attente de validation");
@@ -1087,14 +1098,14 @@ class XnetGrpModule extends PLModule
$page->changeTpl('xnetgrp/announce-admin.tpl');
if (Env::has('del')) {
- XDB::execute("DELETE FROM groupex.announces
- WHERE id = {?} AND asso_id = {?}",
+ XDB::execute("DELETE FROM groupex.announces
+ WHERE id = {?} AND asso_id = {?}",
Env::i('del'), $globals->asso('id'));
}
- $res = XDB::iterator("SELECT a.id, a.titre, a.peremption, a.peremption < CURRENT_DATE() AS perime
- FROM groupex.announces AS a
- WHERE a.asso_id = {?}
- ORDER BY a.peremption DESC",
+ $res = XDB::iterator("SELECT a.id, a.titre, a.peremption, a.peremption < CURRENT_DATE() AS perime
+ FROM groupex.announces AS a
+ WHERE a.asso_id = {?}
+ ORDER BY a.peremption DESC",
$globals->asso('id'));
$page->assign('articles', $res);
}
diff --git a/templates/xnetgrp/asso.tpl b/templates/xnetgrp/asso.tpl
index d29ea84..b616d7b 100644
--- a/templates/xnetgrp/asso.tpl
+++ b/templates/xnetgrp/asso.tpl
@@ -151,7 +151,7 @@ respectifs et sont publiées à leur initiative. L'association Polytechnique.org
ne pourrait en aucun cas être tenue responsable de la nature des propos relatés
sur cet espace d'expression et d'information. Elle se réserve le droit de
refuser ou de retirer toute information de nature diffamante ou pouvant être
-interprétée comme polémique par un membre de la communauté polytechnicienne.
+interprétée comme polémique par un lecteur.