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: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 122
  • Total: 122

How can I create a center block with just two stats?

Started by ApplianceJunk, August 02, 2008, 04:17:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ApplianceJunk

Using SMF 1.1.5 and T.P 0.9.8

I would like have these stats in a center block.

Total Members: 1960 - Total Posts: 5361

I found this code in the TPortalBlocks.template.php file.

'.$bullet.$txt[488].': ' , isset($modSettings['memberCount']) ? $modSettings['memberCount'] : $modSettings['totalMembers'] , '

'.$bullet.$txt[489].': '.$modSettings['totalMessages']. '


Thought I could maybe just put that in a php block, but it does not seem to work that way.

I did a quick search, but did not anything that I could work with.

Am I even on the right track?

Thanks,

Ianedres

Place in a php block:

$context['num_posts'] = &$modSettings['totalMessages'];
$context['num_members'] = &$modSettings['totalMembers'];

echo $bullet.$txt[488] . ' : ' . $context['num_posts'] . ' - ';
echo $bullet.$txt[489] . ' : ' . $context['num_members'];

ApplianceJunk

Thank you for the reply.

I put the code in a php block and get this.

Total Members : - Total Posts :

There does not seem to be any numbers to go with it.


Ianedres

It currently works in my SMF 1.1.5 / TP 0.9.8 site- click here to see.

ApplianceJunk

Hmm, that just how I would like mine to look. :)

I turned on the block I have it in so you can see what I'm looking at too.

http://www.appliancejunk.com/forums/


ApplianceJunk

#5
Just checked my error log and I get these two errors with that code.

QuoteAJ                                         Today at 10:54:16 PM 
96.2.185.56                                    8c64d7b6d2e630bcc2f0eb6cca6f99f1 

http://appliancejunk.com/forums/index.php 

8: Undefined variable: bullet
File: /home/applianc/public_html/forums/Themes/dilbermc/BoardIndex.template.php (main_above sub template - eval?)
Line: 5

   AJ                                     Today at 10:54:16 PM 
96.2.185.56                        8c64d7b6d2e630bcc2f0eb6cca6f99f1

http://appliancejunk.com/forums/index.php 

8: Undefined variable: bullet
File: /home/applianc/public_html/forums/Themes/dilbermc/BoardIndex.template.php (main_above sub template - eval?)
Line: 4


Thought maybe it would be a clue.

I'm going to guess it's some other code in my BoardIndex.template.php that is screwing with things?

Edited to add: going to mark this solved as the code I asked for is correct and now I need to look at my theme as to why it's not working.

Thanks,

This website is proudly hosted on Crocweb Cloud Website Hosting.