Customizing SMF > SMF Coding Discussion

Statsbar next to each post.

(1/4) > >>

fiver:
SMF 2.0RC3

Hi,

There are Most Time Online statsbar under index.php?action=stats. I'd like to add that statsbar under the user name next to each post. With zero php knowledge, I tried copying the codes from Stats.php over to MessageIndex.php but nothing happens.

Really appreciate any help with the right codes. Thanks.

fiver:
I've put the following codes from memberlist into Display.template but still nothing happens



--- Code: ---   if (!empty($context['members']))
   {
      foreach ($context['members'] as $member)
      {
                  if (!empty($member['post_percent']))
            echo '
                  <li class="bar" style="width: ', $member['post_percent'] + 4, 'px;">
                     <div style="width: ', $member['post_percent'], 'px;"><>
                  </li>';
      }
   }
--- End code ---


Any suggestions from anyone please? Thanks.

fiver:
Bump after 2 weeks. :)


Really eager to get this working in the forum.

Kays:
Hi, it's not going to work the same way in Display.template.php. In Stats, there are queries run to get that info.

A member's time on line is in the profile as total_time_logged_in, But I don't known in what format is used in Display.php. Also if you want to show a % graph, you will need to do a query to find the user with the most time online.

fiver:
Hi Kays,


Thanks for the reply.


If it works in stats page and memberlist page, I wonder how to make it work in display.template.php so it shows next to each post.


Any suggestion is most welcome.

Navigation

[0] Message Index

[#] Next page

Go to full version