Add crosspost hook
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 12 Jul 2006 14:19:40 +0000 (14:19 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Wed, 12 Jul 2006 14:19:40 +0000 (14:19 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@452 839d8a87-29fc-0310-9880-83ba4fa771e5

include/banana.inc.php

index 84d50f3..bb967e3 100644 (file)
@@ -89,6 +89,20 @@ function hook_makeImg($img, $alt, $height, $width)
     return '<img src="' . $url . '"' . $height . $width . ' alt="' . $alt . '" />';
 }
 
+function hook_getSubject(&$subject)
+{
+    if (preg_match('!(.*\S)\s*\[=> ([^\]\s]+)\]!', $subject, $matches)) {
+        $subject = $matches[1];
+        global $banana;
+        if ($banana->state['group'] == $matches[2]) {
+            return ' [=> ' . $matches[2] . ']';
+        } else {
+            return ' [=> ' . makeHREF(Array('group' => $matches[2]), $matches[2]) . ']';
+        }
+    }
+    return null;
+}
+
 class PlatalBanana extends Banana
 {
     var $profile    = Array( 'name' => '', 'sig'  => '', 'org'  => 'Utilisateur de Polytechnique.org',