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

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.

RoarinRow

Quote from: Xarcell on August 04, 2006, 02:21:57 PM
I may have to put that on my site.

I put it in a right block and my name was huge and extended past the block  :o  How you change the size of the top poster so it's not that big?

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

JPDeni

Play around with the
$fsize = $count[$value] + 7;
line.

You could set a minimum and maximum. Something like

$fsize = $count[$value];
if ($fsize > 20)
  $fsize = 20;
elseif ($fsize < 7)
  $fsize = 7;


That is the area you want to experiment with. The code I used worked for my situation, but those with heavier or lighter posting loads would have to make alterations.

Max


JPDeni,

it iz easy enuff to link the names to their profiles? ;)

JPDeni

Linking names to profiles isn't too hard, I don't think. :)

To tell you the truth, I hadn't looked at the code since I posted this, and as I mentioned elsewhere, memory is not my long suit these days, so I'm not exactly sure. But it seems that it shouldn't be too hard to link to profiles without a JOIN, because the ID number for the poster is in the message table.

I'll work on it a while as my hair is drying. :) My husband just called from work and when he gets home he's taking me out to dinner, so I'll only work on this until I need to quit to get ready. I do have my priorities!  :2funny:  ;)

Max

no hassle, will give it a go myself  :)

JPDeni

#15
Got it.

This includes adding a link to the profile, not including admins and moderators and being able to adjust the minimum and maximum font sizes.
global $db_prefix, $scripturl;
$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
     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['posterName']]))
    $count[$row['posterName']] = 0;
  ++$count[$row['posterName']];
    $poster_number[$row['posterName']] = $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>';


Anything else? :)

sburke930


Max


That was fast JPDeni...

new code fills the error log with Undefined index:

JPDeni

#18
Let me check it and see if I can figure it out. Sorry.  :)

Got it. A little problem in the "echo" line.

Max


This website is proudly hosted on Crocweb Cloud Website Hosting.