PHP block:
{
global $smcFunc, $memberContext, $context, $user_info, $txt, $scripturl, $modSettings, $settings, $sc;
global $color_profile;
if($context['user']['is_logged'])
{
$member_id = $user_info['id'];
loadMemberData($member_id);
loadMemberContext($member_id);
//If you install the Membercolor Link the colors will be autmaticly set.
if(empty($modSettings['MemberColorLinkInstalled']) && sp_loadColors($member_id) !== false)
$memberContext[$member_id]['colored_name'] = $color_profile[$member_id]['colored_name'];
$memberContext[$member_id]['karma']['total'] = $memberContext[$member_id]['karma']['good'] - $memberContext[$member_id]['karma']['bad'];
}
echo '<div align="center">';
if ($context['user']['is_guest'])
{
echo '<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<table border="0" cellspacing="1" cellpadding="0" class="ssi_table">
<tr>
<td align="right"><label for="user">', $txt['username'], ':</label></td>
<td><input type="text" id="sp_user" name="user" size="9" value="', !empty($user_info['username']) ? $user_info['username'] : '', '" /></td>
</tr><tr>
<td align="right"><label for="passwrd">', $txt['password'], ':</label></td>
<td><input type="password" name="passwrd" id="sp_passwrd" size="9" /></td>
</tr><tr>
<td>
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
</td>
<td><input type="submit" value="', $txt['login'], '" /></td>
</tr>
</table>
</form>', sprintf($txt['welcome_guest'], $txt['guest_title']);
}
else
{
echo $txt['hello_member'], ' <b>', (!empty($memberContext[$member_id]['colored_name']) ? $memberContext[$member_id]['colored_name'] : $context['user']['name']), '</b><br /><br />';
if (!empty($context['user']['avatar']))
echo $context['user']['avatar']['image'], '<br /><br />';
if (!empty($memberContext[$member_id]['group']))
echo $memberContext[$member_id]['group'];
else
echo $memberContext[$member_id]['post_group'];
echo '<br />', $memberContext[$member_id]['group_stars'], '<hr /></div>';
if ($context['user']['is_logged'])
{
echo '
<span style="font-size: 100%;"> <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br /></span><br>';
}
echo '
', $txt['posts'], ': ',$memberContext[$member_id]['posts'],'<br />';
if(!empty($modSettings['karmaMode']))
echo '
', $txt['sp-userkarma'], ': ';
if($modSettings['karmaMode'] == '1')
echo $memberContext[$member_id]['karma']['total'],'<br />';
elseif($modSettings['karmaMode'] == '2')
echo '+', $memberContext[$member_id]['karma']['good'],'/-', $memberContext[$member_id]['karma']['bad'], '<br />';
}
if(allowedTo('pm_read'))
echo '
', $txt['sp-usertmessage'], ': <a href="' . $scripturl . '?action=pm">' . $context['user']['messages'], '</a><br />
', $txt['sp-usernmessage'], ': ' . $context['user']['unread_messages'], '<hr />';
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<span style="font-size: 100%;"> ', $txt['totalTimeLogged1'];
echo'
<br>';
// 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 /></span>';
}
if (!$context['user']['is_guest'])
echo '
<div align="center"><img src="' . $settings['images_url'] . '/arrow.gif" alt="', $txt['sp-arrow'], '" /> <a href="'.$scripturl.'?action=profile">', $txt['profile'], '</a> <img src="' . $settings['images_url'] . '/arrow.gif" alt="', $txt['sp-arrow'], '" /> <a href="', $scripturl, '?action=logout;sesc=', $sc, '">', $txt['logout'], '</a>';
echo '</div><hr />';
$totals = array(
'members' => $modSettings['totalMembers'],
'posts' => $modSettings['totalMessages'],
'topics' => $modSettings['totalTopics']
);
$request = $smcFunc['db_query']('','
SELECT COUNT(*)
FROM {db_prefix}boards'
);
list ($totals['boards']) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
$request = $smcFunc['db_query']('','
SELECT COUNT(*)
FROM {db_prefix}categories'
);
list ($totals['categories']) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);;
// Statistieken
echo '
<div class="normaltext">
<img src="http://www.kaartenleggen.nl/zigeunerkaarten/Themes/zigeunerkaarten/images/icons/info.gif" alt="" title="statistieken">
<a href="http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=stats"><strong>Statistieken</strong></a>
</div>
<br />
', $txt['total_members'], ': <a href="', $scripturl . '?action=mlist">', $totals['members'], '</a>
<br />
', $txt['total_posts'], ': ', $totals['posts'],'
<br />
', $txt['total_topics'], ': ', $totals['topics'],'
<br />
', $txt['total_cats'], ': ', $totals['categories'],'
<br />
', $txt['total_boards'], ': ', $totals['boards'],'
<hr />';
// Members online
echo '
<div class="normaltext">
<img src="http://www.kaartenleggen.nl/zigeunerkaarten/Themes/zigeunerkaarten/images/icons/online.gif" alt="" title="online leden">
<a href="http://www.kaartenleggen.nl/zigeunerkaarten/index.php?action=who"><strong>Leden online</strong></a>
</div>';
global $txt, $scripturl;
require_once('SSI.php');
$limit = 20; // Limited number of users shown.
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
';
$online = ssi_whosOnline('array');
echo $txt['sp-onlineuser'].': '.$online['num_users']. '
<br />'.$txt['sp-onlineguest'].': '.$online['guests'].'
<br />'.$txt['sp-onlinetuser'].': '.$online['total_users'].'
<br /><br />
<width: 100%; ' , $online['num_users']>14 ? 'height: 23ex;overflow: auto;' : '' ,'">';
foreach($online['users'] as $user)
{
if ($limit <= 0)
break;
echo '
<img src="' . $settings['images_url'] . '/useron.gif" alt="', $txt['user'], '" /> ', $user['hidden'] ? '<em>' . $user['link'] . '</em>' : $user['link'];
echo '<br />';
$limit--;
}
echo '
<br />
<div class="smalltext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</div>
';
}
PHP Block:
global $context, $memberContext, $modSettings, $color_profile,$smcFunc;
//Edit the number of last members you want to show
$number_to_display = 5;
echo '
<div style="text-align: center;">
<table>';
$request = $smcFunc['db_query']('','
SELECT
id_member, member_name
FROM smf_members
ORDER BY id_member DESC LIMIT 0,'.$number_to_display
);
while ($row = $smcFunc['db_fetch_assoc']($request)){
loadMemberData($row['id_member']);
loadMemberContext($row['id_member']);
echo '
<tr><td>';
if (!empty($memberContext[$row['id_member']]['avatar']['href']))
echo '
<img src="'.$memberContext[$row['id_member']]['avatar']['href'].'" alt="" width="50" />';
else
echo '
<img src="avatars/noavatar.gif" alt="" width="30" />';
echo '
</td><td>', $memberContext[$row['id_member']]['link'], '</td></tr>';
}
echo '
</table></div>';
And some standard blocks:
Recent Posts Block
Quick Search Block
Calendar Block
Thanks for helping.
Stef.