Can overload the xface generation using a custom image
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 30 Sep 2007 09:55:43 +0000 (09:55 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:49 +0000 (00:35 +0100)
 Changelog                               |    4 ++++
 banana/message.inc.php                  |    7 ++++++-
 banana/templates/banana-message.inc.tpl |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@273 9869982d-c50d-0410-be91-f2a2ec7c7c7b

Changelog
banana/message.inc.php
banana/templates/banana-message.inc.tpl

index 2ee3c7f..606026a 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+Sun, 30 Sep 2007                                   Florent Bruneau <florent.bruneau@m4x.org>
+
+       * Can overlaod the xface generation
+
 Wed, 15 Aug 2007                                       Florent Bruneau <florent.bruneau@m4x.org>
 
        * Bugfix: don't show an empty forum when it contains no unread post
index ed733d1..ff08fd3 100644 (file)
@@ -248,11 +248,16 @@ final class BananaMessage extends BananaMimePart
 
     public function hasXFace()
     {
-        return Banana::$msgshow_xface && isset($this->headers['x-face']);
+        return Banana::$msgshow_xface && 
+               ((function_exists('hook_hasxface') && hook_hasXFace($this->headers))
+               || isset($this->headers['x-face']));
     }
 
     public function getXFace()
     {
+        if (function_exists('hook_getxface') && hook_getXFace($this->headers)) {
+            return;
+        }
         header('Content-Type: image/gif');
         $xface = $this->headers['x-face'];
         passthru('echo ' . escapeshellarg($xface)
index 1110e80..8181892 100644 (file)
@@ -34,7 +34,7 @@
     {if $smarty.foreach.headers.first}
     <td class="xface" rowspan="{$headers|@count}">
       {if $message->hasXFace()}
-      <img src="{url group=$group artid=$artid part="xface"}" alt="[ X-Face ]" />
+      <img src="{url group=$group artid=$artid part="xface"}" style="width: 48px" alt="[ X-Face ]" />
       {/if}
     </td>
     {/if}