Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: monkey38 - joulukuu 03, 2005, 10:55:13 IP

Otsikko: Display Signature with SSI Includes
Kirjoitti: monkey38 - joulukuu 03, 2005, 10:55:13 IP
How can display member's signature at homepage with SSI includes ?

function ssi_welcome display user name by $context['user']['name']
but, $context['user']['signature'] can't show anything  :-[


Otsikko: Re: Display Signature with SSI Includes
Kirjoitti: Oldiesmann - joulukuu 04, 2005, 06:57:44 IP
It's a bit trickier to do because loadUserSettings doesn't include that info.

However, this will get you access to everything (YIM, AIM, etc.)...

<?php
include_once('/path/to/SSI.php');

// Get member data (loadMemberData has to be called prior to loadMemberContext)
loadMemberData($context['user']['id']);
loadMemberContext($context['user']['id']);

// Append all the new info to $context['user']...
$context['user'] = array_merge($context['user'], $themeUser[$context['user']['id']]);

// Now we've got the signature, and all the other goodies :)
echo $context['user']['signature'];
?>


Example: http://smf.oldiesmann.us/test.php
Otsikko: Re: Display Signature with SSI Includes
Kirjoitti: monkey38 - joulukuu 07, 2005, 04:07:42 AP
Thanks your info. I'll try it !  ;D