TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 20, 2024, 05:36:06 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,165
  • Total Topics: 21,219
  • Online today: 118
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 71
  • Total: 71

Top Posters - Post Count

Started by ontap, March 24, 2006, 07:17:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ontap

the top posters block dosent show the post count of the top posters,
i decided to change it around so it would...

*cought* backup file first

Open SSI.php

Find:

// Show the top poster's name and profile
function ssi_topPoster($topNumber = 1, $output_method = 'echo')
{
global $db_prefix, $scripturl;

// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'posts' => $row['posts']
);
mysql_free_result($request);

// Just return all the top posters.
if ($output_method != 'echo')
return $return;

// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];

echo implode(', ', $temp_array);
}


Replace With:

// Show the top poster's name and profile link.
// Theres no post count... so lets show it
function ssi_topPoster($topNumber = 3, $output_method = 'echo')
{
global $db_prefix, $scripturl;

// Find the latest poster.
$request = db_query("
SELECT ID_MEMBER, realName, posts
FROM {$db_prefix}members
ORDER BY posts DESC
LIMIT $topNumber", __FILE__, __LINE__);
$return = array();
while ($row = mysql_fetch_assoc($request))
$return[] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<table border="0" cellpadding="0" cellspacing="3" width="100%"><font size="1"><td><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">  ' . $row['realName' ] . '</a></td><td align="right">' . $row['posts' ] . '</font><br></td></table>',
);
mysql_free_result($request);

// Just return all the top posters.
if ($output_method != 'echo')
return $return;

// Make a quick array to list the links in.
$temp_array = array();
foreach ($return as $member)
$temp_array[] = $member['link'];

echo implode($temp_array);
}

G6Cad

work like a charm  :D
Thanks OnTap  :-*

Xarcell

Very very sweet...

Thanks, lots,

-Xarcell

deadpoeticstar

its not really displaying anything... what do i need to do to make it display on the frontpage?

G6Cad

Go to your Block maganger and choose to create an ssi block. Pick the Top Posters and save it :)

deadpoeticstar

thats cool...i was hoping to maybe mix it in with my stats block

londonhogfan

how would I show the top 10 posters instead of just 5

deadpoeticstar

function ssi_topPoster($topNumber = 3, $output_method = 'echo')

change the part in bold to 10

londonhogfan

no matter what I change it to it always comes back with the top 5

k_4_kelly