TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 465
  • Total: 465

Adding stats to the user block

Started by shinji, December 26, 2005, 05:30:54 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

shinji

I would like to add stats to the user block like how it is on this website.  However the only page I can get it working on is the stats page for some reason and in certain places like the Add board page in the forum administration some of the text labels disappear.  Any other place the labels appear but no stat information.  Here is what I got so far.  Tell me if I am missing something.  The text labels and array references were located in Stats.template.php in the default template.  I am only working within the default template.  Changes will propogate to the other templates...

I have found the right part in the code...

Open TPortalBlocks.template.php

Locate:

           // add stats in here
            echo '
                  <hr /><img src="'.$settings['images_url'].'/icons/members.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=mlist"><b>'.$txt[19].'</b></a>
                 <br />'.$bullet.$txt[488].': ' , isset($modSettings['totalMembers']) ? $modSettings['totalMembers'] : $modSettings['memberCount'] , '
                 <br />'.$bullet.$txt[656]. ': <a href="', $scripturl, '?action=profile;u=', $modSettings['latestMember'], '"><b>', $modSettings['latestReallName'], '</b></a>';


Then after I put:
            echo '
                  <hr /><img src="'.$settings['images_url'].'/icons/info.gif" style="margin: 0;" align="bottom" alt="" />
                 <a href="'.$scripturl.'?action=stats"><b>'.$txt['stats'].'</b></a>';
                 echo '<br />'.$bullet.$txt[489].': '.$context['num_posts'];
                 echo '<br />'.$bullet.$txt[490].': '.$context['num_topics'];
                 echo '<br />'.$bullet.$txt['users_online_today'].': '.$context['online_today'];
                 echo '<br />'.$bullet.$txt[888].': '.$context['most_members_online']['number'];


Open languages/index.english.php
Locate:
?>

Right before insert:
$txt['stats'] = 'Stats';


All of this was based on code around the point of insertion.

borgBOB

The next release of TP should have that included. And it is comming soon....


This website is proudly hosted on Crocweb Cloud Website Hosting.