TinyPortal

Development => Block Codes => Topic started by: evillair on June 11, 2007, 06:07:53 AM

Title: Top Posters with posts II
Post by: evillair on June 11, 2007, 06:07:53 AM
There's already a 'top poster with posts' snippet but this on doesn't affect any files (SSI.php).
It's all done within the block.

Make a new phpbox and paste this in:

$myposterarray = ssi_topPoster(5,'array');

echo'<table width="100%" border="0" cellpadding="2">
  <tr>
    <td align="left" class="middletext"><b>Member</b></td>
    <td align="right" class="middletext"><b>Posts</b></td>
  </tr>';
foreach ($myposterarray as $member)
{
  echo'
    <tr><td align="left" class="smalltext">'. $member['link'] .'</td>
    <td align="right" class="smalltext">'. $member['posts'] .'</td></tr>';
}

echo'</table>';



Just change the 5 on the first line to how many members you want to display.
You can also change (or remove) the classes from the <td>'s if you want, I like the text small. ;)

Demo (http://pixelmorgue.com/forums/):  bottom right block.

Thanks.

Title: Re: Top Posters with posts II
Post by: soMzE on June 11, 2007, 09:41:12 AM
Cool thnx a lot!  Using it right now  :)

And you've got a very nice forum, looks great! One off-topic question, how did you get that rating system onto your forum on the message index?
Title: Re: Top Posters with posts II
Post by: evillair on June 11, 2007, 09:58:29 AM
Thanks

It's just this MOD: http://custom.simplemachines.org/mods/index.php?mod=91

I just edited it a bit to fit what I wanted.