Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

SSI.php to show Avatar?

Aloittaja ryanbsoftware, maaliskuu 15, 2005, 05:41:22 IP

« edellinen - seuraava »

ryanbsoftware

using ssi.php can i display your avatar on my main site?  or how does smf do that? i am completley intergrating my site and forums, so they look the same exept in the miidle you will see the pages conntent or the forums, depending on where you are at, and the title is a tad diffrent too.  but i want all the stats and all of that just as it is on the forums.

Oldiesmann

Include SSI.php and then use the same variable that index.template.php uses for the avatar (I think it's $context['user']['avatar'], but not sure).
Michael Eshom
Christian Metal Fans

ryanbsoftware

#2
Lainaus käyttäjältä: Oldiesmann - maaliskuu 15, 2005, 06:55:31 IP
Include SSI.php and then use the same variable that index.template.php uses for the avatar (I think it's $context['user']['avatar'], but not sure).

thanks i'll look at index.template.php frst to make sure. ;)

it's $context['user']['avatar']['image']

so is this code right to display the box with all the userinfo and news at the top right?
<table border="0" align="center" class="bordercolor" width="100%" cellspacing="1" cellpadding="4">
<tr class="catbg" colspan="3">
<td height="5" colspan="2" valign="middle" align="left">User Info</td>
<td height="5" valign="middle" align="center">Forum News</td>
</tr>
<tr colspan="3">
<td width="7%" class="windowbg" valign="middle" align="center"><?php $context['user']['avatar']['image'?>

</td>
<td width="60%" class="windowbg2" valign="top" align="left">
<?php ssi_welcome(); ?><br /><?php if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}
 
?>
<br />
<a href="http://e-security.info.tm/forums/index.php?action=unread"><?php echo '<br />
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time']; ?>
</td>
<td style="padding:3px" class="windowbg" valign="top" align="center"><?php ssi_news(); ?>
  </td>
</tr></table>


I did require ssi.php at the top of the page. ;)

Advertisement: