how do I show the top posters in the block as a column and not with commas like in 1.1.16?
the old code does not play well anymore...lol
in block:
ssi_topPoster(25);
There is a "Top Posters" block built into SMF 2.0. Create a new block (or change the old block if it will let you) with SSI functions as the option and save it. Then edit the block and choose "Top Posters".
thanks but, how to make them appear as a column with totals and not with commas
Sounds like you probably want a custom block.
if you please. I have the code used when they helped with the previous 1.1.16 version but it is not worded like what is in the SSI file, will that help?
I'm not a coder but think you should post this in the block request board.
ok thanks
darkangel,
Post the code that worked with 1.1.16 so that I can look at it. What is that other column in your picture you posted. Is that each member's number of posts?
ZarPrime
the one in 1.1.6 show them in a column...left is name with the right showing actual posts
but
while trolling the area where requests are placed I foudn this code
in a php block:
global $smcFunc, $scripturl, $modSettings;
// Height and width of avatar
$width = '40px';
$height = '40px';
// Number of top posters displayed
$topPoster = 8;
// Find the latest poster.
$request = $smcFunc['db_query']('', '
SELECT mem.id_member, mem.show_online, mem.real_name, mem.posts, mem.avatar, a.id_attach, a.attachment_type, a.filename
FROM ({db_prefix}members as mem)
LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = mem.id_member)
WHERE show_online = 1
ORDER BY posts DESC
LIMIT {int:limit}',
array('limit' => $topPoster)
);
$users = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$users[] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
'posts' => $row['posts'],
'show' => $row['show_online'],
'avatar' => array(
'image' => empty($row['avatar']) ? ($row['id_attach'] > 0 ? 'src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : '') : (stristr($row['avatar'], 'http://') ? 'src="' . $row['avatar'] . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />' : 'src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" border="0" width="'.$width.'" height="'.$height.'" title="'.$row['real_name'].'" />'),
),
);
}
$smcFunc['db_free_result']($request);
// Output our array of users with avatar, posts, and name
echo '
<table cellpadding="0" cellspacing="8">';
foreach ($users as $user)
{
echo '
<tr>
<td>',empty($user['avatar']['image']) ? '<a href="'.$user['href'].'"><img src="'.$settings['images_url'].'/noavatar.gif" width="'.$width.'" height="'.$height.'" alt="" title="'.$user['name'].'" /></a>' : '<a href="'.$user['href'].'"><img '.$user['avatar']['image'].'</a>';
echo '
</td>
<td><h5 style="margin: 4px;">'.$user['link'].'</h5><h5 style="margin: 4px;">'. $user['posts'] .'</h5></td>
</tr>';
}
echo '
</table>';
That works nicely--sort of. it works with the avas being able to be adjusted in size and for showing up to 8 users but when I update the main forum and we have 20 showing this is gonna be reaalllllll long...lol
If we could try to remove the ava and just leave the name/post count that would be great.