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,970
  • Latest: bynw
Stats
  • Total Posts: 196,061
  • Total Topics: 21,338
  • Online today: 234
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 123
  • Total: 124
  • lurkalot

Need Help Putting Profile Stats On Index Template

Started by Xarcell, September 01, 2008, 05:09:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Xarcell

Here is the theme I'm working on if your curious, just keep in mind it's still under experimentation.(layout-wise) The empty box in the header is where I'm trying to place the script.

http://xarthemes.com/index.php?theme=4

Ianedres

Try require('Stats.php'); and call the function DailyStats(); prior to using those variables...  The 'Stats.php' populates the $context variables you're wanting to use...   or so I think.  :-\

feline

This variables do help  ;)

isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers']
$context['user']['total_time_logged_in']['days']
$context['user']['total_time_logged_in']['hours']
$context['user']['total_time_logged_in']['minutes']
$modSettings['totalMessages']
$modSettings['totalTopics']

polls and votes .. I don't where to find ...

Fel

JPDeni


Xarcell

Bah! I can't get it to work.

I the variables I was used was from the profile.template.php. I tried using them in the index.template.php file.

feline

I wrote in the index.template.php ...

global $context, $modSettings;
echo '
Members: ', isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'], '<br />
Logged in: ', $context['user']['total_time_logged_in']['days'],'d, ', $context['user']['total_time_logged_in']['hours'],'h, ',$context['user']['total_time_logged_in']['minutes'],'m<br />
Posts: ', $modSettings['totalMessages'], '<br />
Topics: ', $modSettings['totalTopics'], '<br />';


and is see it. Look at the attach.

Fel

Xarcell

Quote from: feline on September 05, 2008, 04:07:57 AM
I wrote in the index.template.php ...

global $context, $modSettings;
echo '
Members: ', isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'], '<br />
Logged in: ', $context['user']['total_time_logged_in']['days'],'d, ', $context['user']['total_time_logged_in']['hours'],'h, ',$context['user']['total_time_logged_in']['minutes'],'m<br />
Posts: ', $modSettings['totalMessages'], '<br />
Topics: ', $modSettings['totalTopics'], '<br />';


and is see it. Look at the attach.

Fel

What I'm trying to add to the index.template.php is completely different than what your putting Feline. I was trying to add a user's total topics, posts, polls created, and votes. You can see these stats by going to: http://www.tinyportal.net/index.php?action=profile;u=1259;sa=statPanel

This website is proudly hosted on Crocweb Cloud Website Hosting.