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

Poster cloud

Started by JPDeni, August 04, 2006, 05:51:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

londonhogfan

what code uses their actual "display name"  Mine shows their login name.  I am using the code from a couple posts up.

top right block here:

http://www.the-rota.com

JPDeni

I'm making an assumption, which may not be warranted. I'm testing it now. Since my database was imported, there is no difference between real names and poster names. So I've changed my poster name and added a post. Now I'll go look at my database.

Things are a little slow on my server at present. Just talk among yourselves for a moment.  ;) [humming the tune from Jeopardy]

Ah-ha! I made an unwarranted assumption. My apologies. Back to the drawing board.  :)

mnichols7

Sorry, but the code posted by JPG still shows the user/log in name and I really don't want anyone to know the administration user log-in.

So I will disabled it again. I don't mess with my databases, I don't know what I am doing so I leave it alone.  I ask for help and will pay for it when it becomes really necessary to adjust things there.

JPDeni

Okay. I got it. It is confusing when the names are labeled the way they are. I would think that "realName" would be the name people log in with. Live 'n' learn.

This code counts the number of times each poster has added a post within the last 100 posts, excluding those made by admins and global moderators. It prints out the display name of the poster in relative size, depending on how many of those 100 posts the member contributed, with a minimum size of 8pt and a maximum of 20. Those numbers can be changed if you have a very narrow side block. Each name prints out a link to the poster's profile.


global $db_prefix, $scripturl;
$count= array();
$poster_number = array();
$query = db_query(
   "SELECT realName, {$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
    WHERE ID_GROUP <> 1 AND ID_GROUP <> 2
    ORDER BY posterTime DESC
    LIMIT 100", __FILE__, __LINE__);

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

$random = array_rand($count, count($count));
echo '<div style="text-align: center">';
foreach ($random as $value)
{
 $fsize = $count[$value] + 7;
 if ($fsize > 20)
   $fsize = 20;
 elseif ($fsize < 8)
   $fsize = 8;
 $name = str_replace(" ",'ÂÃ,·',$value);
 echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$value] . '">
         <span style="font-size:' . $fsize . 'pt;">' . $name . '</span></a> ';
}
echo '</div>';


Marian, you just needed to be a little more patient. This prints out the display name.

mnichols7

 ;) Sorry, did I sound impatient?  Didn't intend too.  So, I'll try this. Thanks, you're a sweetie.

mnichols7

 :up:   :)  Yay, That worked.

JPDeni

Cool! I just made an assumption that the name with the post would be the name displayed on the post. That's what I get for making assumptions.

I'm glad it worked for you. :)

Jpg

Ok. Thanx for the update!

Max


JPDeni have a small idea..

The person with the biggest name gets a different colour from the rest,
would make um stand out more  :)

JPDeni

Sure. That would be fine. You'd have to do a sort just before the line
$random = array_rand($count, count($count));
in order to determine who the most prolific poster was.

Or if you had different colors for different groups, you could do that, too.

This website is proudly hosted on Crocweb Cloud Website Hosting.