News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Online User's avatars rotation

Started by Fizzy, July 10, 2004, 03:39:46 AM

Previous topic - Next topic

babylonking

Thanks Senkusha but the text still below the members avatar  ::)

here is the link http://www.babylonking.net/include44.php

and here is the code i'm using now
// Shows a list of recent users:  YY Guests, ZZ Users and then a list...
function ssi_whosRecent($output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $modSettings;

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));
// Load the users online for the past 24 hours.
$result = db_query("
SELECT
mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,
mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
WHERE mem.lastLogin <= '$midnight'
ORDER BY mem.realName
LIMIT 5", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;

while ($tmp = mysql_fetch_assoc($result))
{
if (!isset($tmp['realName']))
{
$return['guests']++;
continue;
}
elseif (empty($tmp['showOnline']))
{
$return['hidden']++;
continue;
}

$link = '<tr><td><fieldset><table border="0"><tr>';

// The user Avatar...
if ($tmp['avatar'] == '')
{
$AvatarReq = mysql_query ("SELECT * FROM yabbse_attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'") or die(mysql_error());
$AvatarRes = mysql_fetch_assoc($AvatarReq);
if (mysql_num_rows ($AvatarReq) == 1)
$link .= '<td><img src="' . $scripturl . '?action=dlattach;id=' . $AvatarRes['ID_ATTACH'] . ';type=avatar" height="40"></td></td><table>';
$link .= '
<td valign="middle" width="40">&nbsp;</td><td><table>';
}
elseif (strtoupper(substr($tmp['avatar'],0,7)) == 'HTTP://')
$link .= '
<td align="center" valign="middle"><img src="' . $tmp['avatar'] . '" height="40"></td><td><table>';
else
$link .= '
<td align="center" valign="top"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a></font></td>
</tr>';
else
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '">' . $tmp['realName'] . '</a></font></td>
</tr>';
// Number of total posts
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Posts:&nbsp;' . $tmp['posts'] . '</font></td>
</tr>';
// Time the member last logged in
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Last On:&nbsp;' . date("H:i", $tmp['lastLogin']) . '</font></td>
</tr></table></td></tr></table></fieldset></td></tr>';


$return['users'][] = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'],
'link' => $link,
'is_last' => false
);
}
mysql_free_result($result);

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if (!empty($return['users']))
$return['users'][count($return['users']) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], $return['hidden'] > 0 ? ' (' . $return['hidden'] . ' ' . $txt['hidden'] . ')' : '', '<br />
';

echo '<table align="left" border="0">';
foreach ($return['users'] as $user)
echo $user['link'], !$user['is_last'] ? '' : '';
echo '</table>';
}

Senkusha

Quote
$link .= '
<td align="center" valign="top"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

should be
Quote
$link .= '
<td align="center" valign="middle"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

Also you might want to change this:
Quote
WHERE mem.lastLogin <= '$midnight'

to this:
Quote
WHERE mem.lastLogin >= '$midnight'

Finally change this to:
Quote
$AvatarReq = mysql_query ("SELECT * FROM yabbse_attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'") or die(mysql_error());

to this: (I will be changing the code posting)
Quote
$AvatarReq = db_query ("SELECT * FROM {$db_prefix}attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'", __FILE__, __LINE__);

That should do it.
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

babylonking

Thanks again but the text still below the members avatar  ::)

http://www.babylonking.net/include44.php

Any idea ?

// Shows a list of recent users:  YY Guests, ZZ Users and then a list...
function ssi_whosRecent($output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $modSettings;

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));
// Load the users online for the past 24 hours.
$result = db_query("
SELECT
mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,
mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
WHERE mem.lastLogin >= '$midnight'
ORDER BY mem.realName
LIMIT 5", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;

while ($tmp = mysql_fetch_assoc($result))
{
if (!isset($tmp['realName']))
{
$return['guests']++;
continue;
}
elseif (empty($tmp['showOnline']))
{
$return['hidden']++;
continue;
}

$link = '<tr><td><fieldset><table border="0"><tr>';

// The user Avatar...
if ($tmp['avatar'] == '')
{
$AvatarReq = db_query ("SELECT * FROM {$db_prefix}attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'", __FILE__, __LINE__);
$AvatarRes = mysql_fetch_assoc($AvatarReq);
if (mysql_num_rows ($AvatarReq) == 1)
$link .= '<td><img src="' . $scripturl . '?action=dlattach;id=' . $AvatarRes['ID_ATTACH'] . ';type=avatar" height="40"></td></td><table>';
$link .= '
<td valign="middle" width="40">&nbsp;</td><td><table>';
}
elseif (strtoupper(substr($tmp['avatar'],0,7)) == 'HTTP://')
$link .= '
<td align="center" valign="middle"><img src="' . $tmp['avatar'] . '" height="40"></td><td><table>';
else
$link .= '
<td align="center" valign="middle"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a></font></td>
</tr>';
else
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '">' . $tmp['realName'] . '</a></font></td>
</tr>';
// Number of total posts
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Posts:&nbsp;' . $tmp['posts'] . '</font></td>
</tr>';
// Time the member last logged in
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Last On:&nbsp;' . date("H:i", $tmp['lastLogin']) . '</font></td>
</tr></table></td></tr></table></fieldset></td></tr>';


$return['users'][] = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'],
'link' => $link,
'is_last' => false
);
}
mysql_free_result($result);

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if (!empty($return['users']))
$return['users'][count($return['users']) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], $return['hidden'] > 0 ? ' (' . $return['hidden'] . ' ' . $txt['hidden'] . ')' : '', '<br />
';

echo '<table align="left" border="0">';
foreach ($return['users'] as $user)
echo $user['link'], !$user['is_last'] ? '' : '';
echo '</table>';
}

Senkusha

Found the problem (I hope)  Try this code (I had a double </td>)


Quote from: babylonking on August 13, 2004, 05:23:10 PM
Thanks again but the text still below the members avatar  ::)

http://www.babylonking.net/include44.php

Any idea ?

// Shows a list of recent users:  YY Guests, ZZ Users and then a list...
function ssi_whosRecent($output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $modSettings;

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));
// Load the users online for the past 24 hours.
$result = db_query("
SELECT
mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,
mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
WHERE mem.lastLogin >= '$midnight'
ORDER BY mem.realName
LIMIT 5", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;

while ($tmp = mysql_fetch_assoc($result))
{
if (!isset($tmp['realName']))
{
$return['guests']++;
continue;
}
elseif (empty($tmp['showOnline']))
{
$return['hidden']++;
continue;
}

$link = '<tr><td><fieldset><table border="0"><tr>';

// The user Avatar...
if ($tmp['avatar'] == '')
{
$AvatarReq = db_query ("SELECT * FROM {$db_prefix}attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'", __FILE__, __LINE__);
$AvatarRes = mysql_fetch_assoc($AvatarReq);
if (mysql_num_rows ($AvatarReq) == 1)
$link .= '<td><img src="' . $scripturl . '?action=dlattach;id=' . $AvatarRes['ID_ATTACH'] . ';type=avatar" height="40"></td><td><table>';
$link .= '
<td valign="middle" width="40">&nbsp;</td><td><table>';
}
elseif (strtoupper(substr($tmp['avatar'],0,7)) == 'HTTP://')
$link .= '
<td align="center" valign="middle"><img src="' . $tmp['avatar'] . '" height="40"></td><td><table>';
else
$link .= '
<td align="center" valign="middle"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a></font></td>
</tr>';
else
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '">' . $tmp['realName'] . '</a></font></td>
</tr>';
// Number of total posts
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Posts:&nbsp;' . $tmp['posts'] . '</font></td>
</tr>';
// Time the member last logged in
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Last On:&nbsp;' . date("H:i", $tmp['lastLogin']) . '</font></td>
</tr></table></td></tr></table></fieldset></td></tr>';


$return['users'][] = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'],
'link' => $link,
'is_last' => false
);
}
mysql_free_result($result);

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if (!empty($return['users']))
$return['users'][count($return['users']) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], $return['hidden'] > 0 ? ' (' . $return['hidden'] . ' ' . $txt['hidden'] . ')' : '', '<br />
';

echo '<table align="left" border="0">';
foreach ($return['users'] as $user)
echo $user['link'], !$user['is_last'] ? '' : '';
echo '</table>';
}

--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

babylonking


Senkusha

I'll have to look a bit later.  It looks like somehow the first avatar is being called, but it is skipping the information, then it is moving on to the next member, that has no avatar assigned.  If you want viewing the Source of the html document would help trouble shoot this problem.  I have to do a few things around the house for now though.
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

babylonking

Quote from: Senkusha on August 13, 2004, 05:46:46 PM
I'll have to look a bit later.  It looks like somehow the first avatar is being called, but it is skipping the information, then it is moving on to the next member, that has no avatar assigned.  If you want viewing the Source of the html document would help trouble shoot this problem.  I have to do a few things around the house for now though.

Take your time I'm also busy now fixing my dish  ;)

Mysterio

Okay, that's what I did, as well. I used that exact code to edit and replace as needed in BoardIndex.php, and those errors that I showed you is what came back.

So, I don't know what I did wrong.

Would it be possible to make the changes to you're own BoardIndex.php?

If you don't have one that's available, that's unedited and unchanged, want me to upload one that you can edit then re-upload yourself and then I can try that one out?

I'd be most appreciative if you could do that for me.

But I hear that you're busy at the moment, np... take you're time.

Thanks.

Senkusha

Try this one.

Quote from: Senkusha on August 13, 2004, 05:26:57 PM
Found the problem (I hope)  Try this code (I had a double </td>)


Quote from: babylonking on August 13, 2004, 05:23:10 PM
Thanks again but the text still below the members avatar  ::)

http://www.babylonking.net/include44.php

Any idea ?

// Shows a list of recent users:  YY Guests, ZZ Users and then a list...
function ssi_whosRecent($output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $modSettings;

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));
// Load the users online for the past 24 hours.
$result = db_query("
SELECT
mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,
mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
WHERE mem.lastLogin >= '$midnight'
ORDER BY mem.realName
LIMIT 5", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;

while ($tmp = mysql_fetch_assoc($result))
{
if (!isset($tmp['realName']))
{
$return['guests']++;
continue;
}
elseif (empty($tmp['showOnline']))
{
$return['hidden']++;
continue;
}

$link = '<tr><td><fieldset><table border="0"><tr>';

// The user Avatar...
if ($tmp['avatar'] == '')
{
$AvatarReq = db_query ("SELECT * FROM {$db_prefix}attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'", __FILE__, __LINE__);
$AvatarRes = mysql_fetch_assoc($AvatarReq);
if (mysql_num_rows ($AvatarReq) == 1)
$link .= '<td><img src="' . $scripturl . '?action=dlattach;id=' . $AvatarRes['ID_ATTACH'] . ';type=avatar" height="40"></td><td><table>';
else
$link .= '
<td valign="middle" width="40">&nbsp;</td><td><table>';
}
elseif (strtoupper(substr($tmp['avatar'],0,7)) == 'HTTP://')
$link .= '
<td align="center" valign="middle"><img src="' . $tmp['avatar'] . '" height="40"></td><td><table>';
else
$link .= '
<td align="center" valign="middle"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a></font></td>
</tr>';
else
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '">' . $tmp['realName'] . '</a></font></td>
</tr>';
// Number of total posts
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Posts:&nbsp;' . $tmp['posts'] . '</font></td>
</tr>';
// Time the member last logged in
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Last On:&nbsp;' . date("H:i", $tmp['lastLogin']) . '</font></td>
</tr></table></td></tr></table></fieldset></td></tr>';


$return['users'][] = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'],
'link' => $link,
'is_last' => false
);
}
mysql_free_result($result);

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if (!empty($return['users']))
$return['users'][count($return['users']) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], $return['hidden'] > 0 ? ' (' . $return['hidden'] . ' ' . $txt['hidden'] . ')' : '', '<br />
';

echo '<table align="left" border="0">';
foreach ($return['users'] as $user)
echo $user['link'], !$user['is_last'] ? '' : '';
echo '</table>';
}

--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Senkusha

Quote from: Mysterio on August 13, 2004, 06:02:32 PM
Okay, that's what I did, as well. I used that exact code to edit and replace as needed in BoardIndex.php, and those errors that I showed you is what came back.

So, I don't know what I did wrong.

Would it be possible to make the changes to you're own BoardIndex.php?

If you don't have one that's available, that's unedited and unchanged, want me to upload one that you can edit then re-upload yourself and then I can try that one out?

I'd be most appreciative if you could do that for me.

But I hear that you're busy at the moment, np... take you're time.

Thanks.

Hmm, can you provide a link so I can see what it is not doing?  It works fine on mine.  Also, that mod only displays the avatar for the current online users.  This is what you want, correct?  Or do you want it to display since midnight?
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

babylonking

Everything is fine here http://www.babylonking.net/include44.php

here is the code
// Shows a list of recent users:  YY Guests, ZZ Users and then a list...
function ssi_whosRecent($output_method = 'echo')
{
global $scripturl, $db_prefix, $txt, $modSettings;

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));
// Load the users online for the past 24 hours.
$result = db_query("
SELECT
mem.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline, mem.avatar, mem.lastLogin, mem.posts,
mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
WHERE mem.lastLogin >= '$midnight'
ORDER BY mem.realName
LIMIT 5", __FILE__, __LINE__);

$return['users'] = array();
$return['guests'] = 0;
$return['hidden'] = 0;

while ($tmp = mysql_fetch_assoc($result))
{
if (!isset($tmp['realName']))
{
$return['guests']++;
continue;
}
elseif (empty($tmp['showOnline']))
{
$return['hidden']++;
continue;
}

$link = '<table border="0"><tr>';

// The user Avatar...
if ($tmp['avatar'] == '')
{
$AvatarReq = db_query ("SELECT * FROM {$db_prefix}attachments WHERE ID_MEMBER = '$tmp[ID_MEMBER]'", __FILE__, __LINE__);
$AvatarRes = mysql_fetch_assoc($AvatarReq);
if (mysql_num_rows ($AvatarReq) == 1)
$link .= '<td></td><table>';
$link .= '
<td valign="middle" width="40"><img src="' . $scripturl . '?action=dlattach;id=' . $AvatarRes['ID_ATTACH'] . ';type=avatar" height="40"></td><td><table>';
}
elseif (strtoupper(substr($tmp['avatar'],0,7)) == 'HTTP://')
$link .= '
<td align="center" valign="middle"><img src="' . $tmp['avatar'] . '" height="40"></td><td><table>';
else
$link .= '
<td align="center" valign="middle"><img src="' . $modSettings['avatar_url'] . '/' . $tmp['avatar'] . '" height="40"></td><td><table>';

// Some basic color coding...
if (!empty($row['onlineColor']))
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '" style="color: ' . $tmp['onlineColor'] . ';">' . $tmp['realName'] . '</a></font></td>
</tr>';
else
$link .= '
<tr>
<td align="left" valign="top" nowrap><font size="1" face="Tahoma"><a href="' . $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'] . '">' . $tmp['realName'] . '</a></font></td>
</tr>';
// Number of total posts
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Posts:&nbsp;' . $tmp['posts'] . '</font></td>
</tr>';
// Time the member last logged in
$link .= '<tr>
<td align="left" valign="top"><font size="1" face="Tahoma">Last On:&nbsp;' . date("H:i", $tmp['lastLogin']) . '</font></td>
</tr></table></td>
</tr></table>';


$return['users'][] = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER'],
'link' => $link,
'is_last' => false
);
}
mysql_free_result($result);

$return['num_users'] = count($return['users']) + $return['hidden'];
$return['total_users'] = $return['num_users'] + $return['guests'];

if (!empty($return['users']))
$return['users'][count($return['users']) - 1]['is_last'] = true;

if ($output_method != 'echo')
return $return;

echo '
', $return['guests'], ' ', $return['guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $return['num_users'], ' ', $return['num_users'] == 1 ? $txt['user'] : $txt['users'], $return['hidden'] > 0 ? ' (' . $return['hidden'] . ' ' . $txt['hidden'] . ')' : '', '<br />
';

echo '<table align="left" border="0">';
foreach ($return['users'] as $user)
echo $user['link'], !$user['is_last'] ? '' : '';
echo '</table>';
}

Vinoth

ah great, i will add it tommorow.
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Elisa

I have this error!!! Help!!!

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at D:\Inetpub\webs\lovemusicit\forum\recent.php:8) in D:\Inetpub\webs\lovemusicit\forum\SSI.php on line 93

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:\Inetpub\webs\lovemusicit\forum\recent.php:8) in D:\Inetpub\webs\lovemusicit\forum\SSI.php on line 93

Warning: Cannot modify header information - headers already sent by (output started at D:\Inetpub\webs\lovemusicit\forum\recent.php:8) in D:\Inetpub\webs\lovemusicit\forum\SSI.php on line 96
Recent Members



babylonking

I guess you should remove the session  ::)

Remove this in SSI.php
// Start the session... known to scramble SSI includes in cases...
if (!headers_sent())
loadSession();
else
{
if (!isset($_SESSION['rand_code']))
$_SESSION['rand_code'] = '';
$sc = &$_SESSION['rand_code'];
}

Elisa

Thanks thanks thanks!!!  Thanks many to all!!!

Elisa

I have a problem, this night I have changed the serveur and I have transferred the forum on serveur linux.  From that moment the hour is behind of 6 hours.

I have regulated the "Overall offset Time" and the timetable currently is corrected, but I must change the code in the SSI.php file why it does not have to calculate from midnight, but from midnight more six hours! How I make?

$midnight = ((date("U") - (date("H") * 3600)) - (date("i") * 60));

Senkusha

I'll have to add code that checks the overall time offset of the message board.
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Elisa

You can make?  I do not know like saying to you thanks!   :) :)

You can also add IP address of the users beyond that the number post and the avatar?

Senkusha

For security reasons, I would highly recommend not displaying the IP address of any users.
--Senkusha
The Anime Brigade
Anime-style Role Playing Games and Discussion.
(SMF v. 2.1.4, PHP v. 8.0)

Vinoth

Did u make users online in a day my friend senkushsa
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

Advertisement: