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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 211
  • Total: 212
  • @rjen

Top posters

Started by JPDeni, September 20, 2006, 01:27:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jdvarner

I understand. Thank You. Im not a good guy with codes, so thought i'd ask the professionals. :)


Shadow


jdvarner

Quote from: Shadow Queen on February 14, 2007, 04:55:10 AM
Which code is that? 

This is what i had asked...

Can it be coded to pull name and top 5 high rank person out of the member list? I do my members rank by post count and its all military rank.

couple of posts is a private, more posts and you move up of course. Just curious if this was possible, and i figured it was kind of related and thought i'd ask. Just would be cool to show top 5 highest ranked persons on the site. Just an idea.

Hey thanks all for your great bloc's, and responses. Love the site and this board.

John

John

Shadow

Here a pic you can see



I really don't know if the code can do that or what...

Sledge HaMMeR

#44
I'm back JPDeni  :o

I've combined some code from this topic to
- php side block (180 pixels)
- last week top posters
- used gfx-bars
- include admins/mods

global $db_prefix, $scripturl, $settings;

// $starttime = 1167609601; // Change this to the time you want the contest to start [http://www.onlineconversion.com/unix_time.htm]
// $endtime = 1199145601;  // Change this to the time you want the contest to end

$starttime = time() - 604800; // Last week posters
$endtime = time ();

$count= array();
$poster_number = array();
$query = db_query(
    "SELECT posterName, {$db_prefix}messages.ID_MEMBER, ID_GROUP
     FROM {$db_prefix}members
     JOIN {$db_prefix}messages
     ON {$db_prefix}members.ID_MEMBER = {$db_prefix}messages.ID_MEMBER
     AND posterTime > $starttime
     AND posterTime < $endtime", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
  if (!isset($count[$row['posterName']]))
    $count[$row['posterName']] = 0;
  ++$count[$row['posterName']];
    $poster_number[$row['posterName']] = $row['ID_MEMBER'];
}

arsort($count);
$list_number = 0;
$biggest = 0;
foreach ($count as $key => $value)
{
  if ($biggest == 0)
    $biggest = $value;
  $bar_length = intval(($value/$biggest) * 40);
  echo '
  <table width="100%" border="0">
  <tr>
    <td><div class="smalltext"><a href="' . $scripturl . '?action=profile;u=' . $poster_number[$key] . '">' . $key . '</a> (' . $value . ')</div></td>
    <td><div align="right"><img src="' . $settings['images_url'] . '/bar.gif" width="' . $bar_length . '" height="10" alt="" /></div></td>
  </tr>
</table>
  ';

  ++$list_number;
  if ($list_number > 4) 
    break;
}



but I have the same question as Gargoyle
Quote from: Gargoyle on January 07, 2007, 03:48:19 AM
I have a few users that registered under one name but then changed it later to a name they liked more. Now this block displays their "account" name but not the name they use in the rest of the forum. Is there a way to make it display their "used" name instead of the "account" name ??

I would like to echo the 'realName' from '{$db_prefix}members'
I assume it's not very tough, but I'm nothing like a php/db guru

tnx in advange

JPDeni

Change every instance of posterName to realName.

Sledge HaMMeR

Damn, it works.
I figured that was too easy because '{$db_prefix}messages' does not use 'realName'.

Tnx, it works perfect on our site.

JPDeni

Quote'{$db_prefix}messages' does not use 'realName'
Right. But '{$db_prefix}members' has it and the query joins the two tables on the ID_MEMBER field.

You're welcome. Glad I could help. :)

Shadow

I try that code in a phpbox and it's didn't show up for me at all. 

KiChU

Quote$numberofposters = 5; // You can change this to however many you want

require_once "SSI.php";
$top_posters = ssi_topPoster($numberofposters, "return");

foreach ($top_posters as $poster)
{
  echo $poster['link'] , ' (', $poster['posts'] , ')
';

Am Using this code , but it is not displaying the member group color.
Can u tell me the code for it ??

This website is proudly hosted on Crocweb Cloud Website Hosting.