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: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 509
  • Total: 509

Top Stats - 3 in 1 Block

Started by akulion, November 04, 2006, 03:53:42 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

knat

ohh sorry i did not know that there was other topic for this..  ??? so i post again  ^-^

But if the top poster of the week (poster cloud thing) shows from this week only would it not be empty on a monday morning then ??

The reason i am asking is that i use the code myself and i changed it to Top Posters of the Last 7 days  :)

JPDeni

If you want to talk about the Poster Cloud, please post in the Poster Cloud topic. The original code in the Poster Cloud looks for the past 100 posts. There is no time frame involved.

The code you borrowed dealing with time frames is from the New members Block.

QuoteThe reason i am asking is that i use the code myself and i changed it to Top Posters of the Last 7 days
If you used the code I wrote, then your title is incorrect.

brianjw

JPDeni, that code did nothing different. This is the code I am using.
global $db_prefix, $memberContext;

$count = 3;
$users = array();

$request = db_query("
SELECT ID_MEMBER FROM {$db_prefix}members WHERE is_activated = 1 ORDER BY ID_MEMBER DESC LIMIT ".$count, __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($request)) {
$users[] = intval($row['ID_MEMBER']);
}

loadMemberData($users);
echo'<table border="1" width="100%" id="table1" cellpadding="2" style="border-collapse: collapse">
<tr><td  bgcolor="#FF9900" width="150"><font color="#FFFFFF" face="Verdana" size="2"><b>Newest Members</b></font></td><td bgcolor="#660066" width="200"><font color="#FFFFFF" face="Verdana" size="2"><b>Top 20 Posters</b></font></td><td  bgcolor="#336699"><font color="#FFFFFF" face="Verdana" size="2"><b>This Weeks Top Posters</b></font></td><td  bgcolor="#00CC33"><font color="#FFFFFF" face="Verdana" size="2"><b>Stats</b></font></td></tr><tr>
<td>';
$i = 0;
foreach($users as $user_id) {
if ($i > 0) echo '<hr>';
$i++;

loadMemberContext($user_id);

if (!empty($memberContext[$user_id]['avatar']['image']))
echo '<div align="center">'.$memberContext[$user_id]['avatar']['image'].'<BR>'.$memberContext[$user_id]['link'].'</div>';
else
echo '<div align="center"><img src="http://brianjwilson.com/forum/noava.gif" height=80 widh=80><BR><BR>'.$memberContext[$user_id]['link'].'</div>';
}

global $scripturl;
echo'</td><td>';
$numberofposters = 20; // You can change this to however many you want

$request = db_query("
  SELECT ID_MEMBER, memberName, posts
  FROM {$db_prefix}members
  ORDER BY posts DESC
  LIMIT $numberofposters", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
  echo '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['memberName'] . '</a>' , ' (', $row['posts'] , ')<br />';
mysql_free_result($request);

echo'</td><td>';

global $db_prefix;
$count= array();

$query = db_query(
    "SELECT posterName
     FROM {$db_prefix}messages
     ORDER BY posterTime DESC
     LIMIT 100", __FILE__, __LINE__);

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

$random = array_rand($count, count($count));
echo '<div style="text-align: center">';
foreach ($random as $value)
{
  $fsize = $count[$value] + 7;
  $name = str_replace(" ",'Ã,·',$value);
  echo '<span style="font-size:' . $fsize . 'pt;">' . $name . '</span> ';
}
echo '</div></td><td>';
TPortal_statsbox();
echo'</td></tr>
</table>';


Brianjw

JPDeni

You wanted to change the name that was used on the top posters, yes? There are two fields in the "member" table that hold the member name -- realName and memberName. I can never tell which one is which, but I know that the SSI.php file uses the realName field, so if you wanted something different, it would have to be the memberName field.

Maybe someone else has an idea of how to do what you want to do.

brianjw

Yes maybe. I was thinking maybe I coppied your code wrong or something :P lol
Anyone have some ideas. Code posted above.

http://www.brianjwilson.com veiw seen here

wilsy

Hi Aku,

Are there any copyright issues with the images in this post?

http://www.tinyportal.net/index.php?topic=10278.msg85217#msg85217

Regards,

Wilsy.

Shadow

Do you have other avatars for no avatar?

knat

#77
i use this one... and now i come to think about it that avatar will look cool on that new scribbles theme  :D

Anyway feel free to use it  ;)

Shadow

Yea, But I mean anymore beside he posted on this topic.  I am trying to found one to match the blood-n-roses theme I am using.....

brianjw

Shadow Queen, you could always make one in Photoshop if you have it ;) If you want, I can even make one for you just pm me.

This website is proudly hosted on Crocweb Cloud Website Hosting.