News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Want to add total posts under the info about messages and how long logged on

Started by jaccione, August 01, 2006, 11:02:45 PM

Previous topic - Next topic

jaccione

I want to add a line of information at the top, next to my avatar, under the :

Hey, Jacci, you have 2 memos, 0 are new.
Total time logged on: 11 days 22 hours and 15 minutes.
Show unread posts since last visit.
Show new replies to your posts.
August 02, 2006, 12:49:09 PM


section


I would like it to tell me under the date, this extra information:
### Posts, ### Members

I have found the section in the index template i think it needs to go...

// Show the total time logged in?
      if (!empty($context['user']['total_time_logged_in']))
      {
         echo '
                     <br />', $txt['totalTimeLogged1'];

         // If days is just zero, don't bother to show it.
         if ($context['user']['total_time_logged_in']['days'] > 0)
            echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

         // Same with hours - only show it if it's above zero.
         if ($context['user']['total_time_logged_in']['hours'] > 0)
            echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

         // But, let's always show minutes - Time wasted here: 0 minutes ;).
         echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
      }
      echo '<br />
                     <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br />
                     <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
                     ', $context['current_time'];
   }


thanks in advance
www.math.net.au for all your math homework needs

B Patterson


// Show the total posts?
if(!empty($context['user']['posts']))
{
  echo '
<br />', $txt['posts'], ' ', $context['user']['posts'];
}


Something like that... you may have to modify the $txt array key, but it seems right.

jaccione

Thanks, but that didn't work at all

i got this instead underneath my current stats

August 03, 2006, 03:18:48 AM Welcome, Guest. Please login or register.


and an extra login box
www.math.net.au for all your math homework needs

Leipe Po

you may want to use:

$context['common_stats']['total_members']

and:

$context['common_stats']['total_posts']

your welcome
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

jaccione

Thanks to both of you, that worked like a charm once i figured out what $txt to put in there.

php is still a foreign language to me but i am getting there....

thanks again for your help, now i am happy happy.

jacs
www.math.net.au for all your math homework needs

Advertisement: