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.

CyberOPs

well it would already help if you could somehow set the max size of the names, so if there is anywat to do this

jdvarner

yup that did it thief. thanks.

jdvarner

thief, i install member color mod, but dont see a difference. did i have to activate that in admin panel? just asking. not trying to change topic of your thread here. but it kind of goes with your mod and thought i'd ask since you suggested the mod.

jd

Thief

#73
CyberOPs,
you can try to define maxlength:
$maxlength=20;
and then, using function substr, code like this:

$membername = (strlen($memberContext[$row['ID_MEMBER']]['name'])) > $maxlength) substr($memberContext[$row['ID_MEMBER']]['name']),0,$maxlength) : $memberContext[$row['ID_MEMBER']]['name'];


jdvarner,
Quote from: jdvarner on May 13, 2007, 06:14:40 AM
yup that did it thief. thanks.
glad to hear that :) you are wellcome
and yes, my code checks if Member color link mod enabled.

CyberOPs

#74
how would i put that in thief im not that good with all the coding could you maybe post a modified code from what i posted ?

Thief

#75
not tested:
global $db_prefix, $scripturl, $memberContext, $txt, $modSettings;
$maxlength=20;

// $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']);
$membername = (strlen($memberContext[$row['ID_MEMBER']]['name']) > $maxlength) ? substr($memberContext[$row['ID_MEMBER']]['name'],0,$maxlength) : $memberContext[$row['ID_MEMBER']]['name'];
$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'] . '">' . $membername . '</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>';

CyberOPs

Thief it didn't work im getting some sort of error about the database

Thief

Could you be more specific? It shoudn't change the way its working with database.
And please try updated code.

CyberOPs

Parse error: syntax error, unexpected T_STRING in /home/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 23

that is the error i get even with the updated code


Thief


This website is proudly hosted on Crocweb Cloud Website Hosting.