Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 19, 2022, 05:42:26 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 52
Total: 52

Author Topic: Top Posters - Post Count  (Read 37006 times)

0 Members and 2 Guests are viewing this topic.

ontap

  • Guest
Top Posters - Post Count
« on: March 24, 2006, 12:17:59 AM »
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:
Code: [Select]
// 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:
Code: [Select]
// 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);
}
« Last Edit: March 13, 2007, 12:06:56 PM by G6â„¢ »

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: Top Posters - Post Count
« Reply #1 on: March 24, 2006, 12:53:58 AM »
work like a charm  :D
Thanks OnTap  :-*

Xarcell

  • Guest
Re: Top Posters - Post Count
« Reply #2 on: March 24, 2006, 06:55:33 AM »
Very very sweet...

Thanks, lots,

-Xarcell

deadpoeticstar

  • Guest
Re: Top Posters - Post Count
« Reply #3 on: April 27, 2006, 08:08:38 AM »
its not really displaying anything... what do i need to do to make it display on the frontpage?

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: Top Posters - Post Count
« Reply #4 on: April 27, 2006, 08:56:29 AM »
Go to your Block maganger and choose to create an ssi block. Pick the Top Posters and save it :)

deadpoeticstar

  • Guest
Re: Top Posters - Post Count
« Reply #5 on: April 27, 2006, 09:00:14 AM »
thats cool...i was hoping to maybe mix it in with my stats block

londonhogfan

  • Guest
Re: Top Posters - Post Count
« Reply #6 on: May 02, 2006, 09:20:45 AM »
how would I show the top 10 posters instead of just 5

deadpoeticstar

  • Guest
Re: Top Posters - Post Count
« Reply #7 on: May 02, 2006, 09:23:38 AM »
function ssi_topPoster($topNumber = 3, $output_method = 'echo')

change the part in bold to 10

londonhogfan

  • Guest
Re: Top Posters - Post Count
« Reply #8 on: May 02, 2006, 09:33:22 AM »
no matter what I change it to it always comes back with the top 5

k_4_kelly

  • Guest
Re: Top Posters - Post Count
« Reply #9 on: July 24, 2006, 07:22:24 AM »
thanks! works well for me!