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: 0
  • Guests: 287
  • Total: 287

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.

akulion

i thought i would give it a try in asking jpdeni - she seems to have codes for everything :D

so we might just get one yet!

JPDeni

 :2funny: Well, I think you've got me stumped on that one, aku!!  :2funny:

akulion

hey u know when u view the stats page how they have those cool bar graphs alongside?

how would I include that in this?

thanks

JPDeni

#13
Oh, Aku. You always come up with something new. :)

I haven't tried this myself, but this seems like it would work.

First, add $settings to your global statement at the beginning of the code.

Then change

foreach ($count as $key => $value)
{
  echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$key] . '">' . $key . '</a> (' . $value . ')<br />';
  ++$list_number;
  if ($list_number > 9) 
    break;
}


to


$biggest = 0;
foreach ($count as $key => $value)
{
  if ($biggest == 0)
    $biggest = $value;
  $bar_length = intval(($value/$biggest) * 100);
  echo '<a class="normaltext" href="' . $scripturl . '?action=profile;u=' . $poster_number[$key] . '">' . $key . '</a> (' . $value . ')
<img src="' . $settings['images_url'] . '/bar.gif" width="' . $bar_length . '" height="15" alt="" /><br />';

  ++$list_number;
  if ($list_number > 9) 
    break;
}


The potential problem I see is that it might be too long, especially if you have this on a side block. The bar for the top poster will be 100 pixels long. If it turns out to be too long, change the 100 to something smaller.

Of course, it may not work at all. :)

akulion

Cool :D thanks :D

ill try it out until I can think of more things to ask :2funny:

Thank you very much :up:

JPDeni


akulion

got an error:

Quote
Parse error: syntax error, unexpected '>' in /home/.cash/akulion/goofy-goobers.com/forum/Sources/Load.php(1715) : eval()'d code(35) : eval()'d code on line 34

JPDeni

Sorry. There was an extra apostrophe in the code. I'll go change it.

akulion

aaahhh now it works very nicely!!

I like the cool mouse over effects with the popup java box and the flashing symbols :up:

thanks :D

Tron420

i tried it but all that shows up in the block is the code.
what am i doing wrong?

This website is proudly hosted on Crocweb Cloud Website Hosting.