function hook_formatDisplayHeader($_header,$_text) {
global $globals;
if ($_header == 'x-org-id') {
- return $_text . ' [<a href="' . $globals->baseurl . '/fiche.php?user='
- . $_text . '" class="popup2">fiche</a>]';
+ return $_text . ' [<a href="' . $globals->baseurl . '/fiche.php?user='
+ . $_text . '" class="popup2">fiche</a>]';
}
}
}
function hook_makeLink($params) {
- global $globals;
- $base = $globals->baseurl . '/banana';
- if ($params['subscribe'] == 1) {
- return $base . '/subscription';
- }
-
- if (!isset($params['group'])) {
- return $base;
- }
- $base .= '/' . $params['group'];
-
- if (isset($params['first'])) {
- return $base . '/from/' . $params['first'];
- }
- if (isset($params['artid'])) {
- if ($params['action'] == 'new') {
- $base .= '/reply';
- } elseif ($params['action'] == 'cancel') {
- $base .= '/cancel';
- } else {
- $base .= '/read';
- }
- return $base . '/' . $params['artid'];
- }
-
- if ($params['action'] == 'new') {
- return $base . '/new';
- }
- return $base;
+ global $globals;
+ $base = $globals->baseurl . '/banana';
+ if ($params['subscribe'] == 1) {
+ return $base . '/subscription';
+ }
+ if (isset($params['xface'])) {
+ return $base . '/xface/' . $params['xface'];
+ }
+
+ if (!isset($params['group'])) {
+ return $base;
+ }
+ $base .= '/' . $params['group'];
+
+ if (isset($params['first'])) {
+ return $base . '/from/' . $params['first'];
+ }
+ if (isset($params['artid'])) {
+ if ($params['action'] == 'new') {
+ $base .= '/reply';
+ } elseif ($params['action'] == 'cancel') {
+ $base .= '/cancel';
+ } else {
+ $base .= '/read';
+ }
+ return $base . '/' . $params['artid'];
+ }
+
+ if ($params['action'] == 'new') {
+ return $base . '/new';
+ }
+ return $base;
}
function hook_makeImg($img, $alt, $height, $width)
global $banana, $globals;
if (Get::get('banana') == 'updateall'
- || (!is_null($params) && isset($params['banana']) && $params['banana'] == 'updateall')) {
+ || (!is_null($params) && isset($params['banana']) && $params['banana'] == 'updateall')) {
$globals->xdb->execute('UPDATE auth_user_quick SET banana_last={?} WHERE user_id={?}', gmdate('YmdHis'), Session::getInt('uid'));
$_SESSION['banana_last'] = time();
}
'banana/profile' => $this->make_hook('profile', AUTH_MDP),
'banana/subscription' => $this->make_hook('subscription', AUTH_COOKIE),
'banana/updateall' => $this->make_hook('updateall', AUTH_COOKIE),
+ 'banana/xface' => $this->make_hook('xface', AUTH_COOKIE),
);
}
return $this->run_banana($page, Array('subscribe' => 1));
}
+ function handler_xface(&$page, $face = null)
+ {
+ header('Content-Type: image/jpeg');
+ passthru('echo ' . escapeshellarg(base64_decode($face))
+ . '| uncompface -X '
+ . '| convert xbm:- jpg:-');
+ return PL_OK;
+ }
+
function run_banana(&$page, $params = null)
{
$page->changeTpl('banana/index.tpl');