From 27934b36c1dde85201c67845e1e247c8cc3ef51f Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Sun, 30 Sep 2007 09:55:43 +0000 Subject: [PATCH] Can overload the xface generation using a custom image 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 | 4 ++++ banana/message.inc.php | 7 ++++++- banana/templates/banana-message.inc.tpl | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 2ee3c7f..606026a 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +Sun, 30 Sep 2007 Florent Bruneau + + * Can overlaod the xface generation + Wed, 15 Aug 2007 Florent Bruneau * Bugfix: don't show an empty forum when it contains no unread post diff --git a/banana/message.inc.php b/banana/message.inc.php index ed733d1..ff08fd3 100644 --- a/banana/message.inc.php +++ b/banana/message.inc.php @@ -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) diff --git a/banana/templates/banana-message.inc.tpl b/banana/templates/banana-message.inc.tpl index 1110e80..8181892 100644 --- a/banana/templates/banana-message.inc.tpl +++ b/banana/templates/banana-message.inc.tpl @@ -34,7 +34,7 @@ {if $smarty.foreach.headers.first} {if $message->hasXFace()} - [ X-Face ] + [ X-Face ] {/if} {/if} -- 2.1.4