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


Thief

#61
Okay, I've updated code once again. Hopefully it will shutdown those notices :)
(By the way I don't see any errors at my forum logs)

[edit] one more - fixes incorrect percent display on hovering bars.
[edit2] fixed - members without group (thus color) weren't shown. sql fixes. increased default member count to "7" as well.

jdvarner

must be my site and or my additional mods. still getting error (different one now) and i dont see any color difference even though there should be.

2: mysql_result(): Unable to jump to row 0 on MySQL result index 57
File: /home/content/j/d/w/jdworld/html/Themes/default/languages/Arcade.english.php (eval?)
Line: 16

Thief

Wait, now it doesn't show top posters at all, right?
Do you have Member Color Link mod installed?

Zetan

From my last error check, I had none from this snippit, I've just checked again since the updates you've made and I have no errors

QuoteForum Error Log
The error log tracks every error encountered by your forum. To delete any errors from the database, mark the checkbox, and click the Remove button at the bottom of the page.
Pages: [1]
No messages...
Pages: [1]

Thief

jdvarner, I assume that you haven't MemberColorLink mod installed and because code to check if it is available was really lame you were getting that error.
Now I did a proper check (I hope so, I'm not much a Tinyportal expert), so this issue should be solved.
Please check updated code and let me know if my assumptions are correct. Thanks.

CyberOPs

Im using the following code and it works great but when someone has a longer name the post count ends up under their name is there anything i can do to change that ?

global $db_prefix, $scripturl, $memberContext, $txt, $modSettings;

// $starttime = strtotime('24 hours ago'); //posters laatste 24 uur
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y')); //posters vandaag
$list_count = 10;

$poster = array();

$request = db_query("
SELECT  m.ID_MEMBER, COUNT(m.ID_MEMBER) as postCount
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b)
WHERE m.posterTime > " . $starttime . "
AND t.ID_TOPIC = m.ID_TOPIC
AND b.ID_BOARD = t.ID_BOARD" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? " AND b.ID_BOARD != $modSettings[recycle_board]" : '') . "
GROUP BY m.ID_MEMBER
ORDER BY postCount DESC LIMIT " . $list_count, __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($request))
{
    loadMemberData(array($row['ID_MEMBER']));
    loadMemberContext($row['ID_MEMBER']);
$poster[$row['ID_MEMBER']] = array (
  'id' => $row['ID_MEMBER'],
  'count' => $row['postCount'],
  'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $memberContext[$row['ID_MEMBER']]['name'] . '">' . '<font color="' . $memberContext[$row['ID_MEMBER']]['group_color'] . '">' . $memberContext[$row['ID_MEMBER']]['name'] . '</font>' . '</a>' );
}
mysql_free_result($request);

echo '<table width=100%>';
foreach($poster as $top_user)
{
echo '<tr>
      <td align="right" width=75%>' . $top_user['link'] . '</td>
      <td align="left">| '. $top_user['count'] . '</td>
      </tr>';
}
echo '</table>';

Thief

well, you can try to increase rows width. You have:
width=75%

CyberOPs

already tried that with no luck

Thief

hmm, then sorry no idea why it can wrap. can you provide screenshot/link to site?

This website is proudly hosted on Crocweb Cloud Website Hosting.