miniBB Support Forums | 16 years on The Web
miniBB ®


 | Begin | Register | Reply | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Showing the number of topics in the header

Author tom322
Active Member
#1 | Posted: 10 Aug 2012 17:44 
I wanted to include the number of topics of a logged user in the main_header.tpl. I tried {$user_num_topics} but it didn't work (the value was always '0'). Is there a simple way to do it (other than an extra DB query)? Maybe some row[x] or similar ;). Thanks.

Author Paul
Lead Developer
#2 | Posted: 10 Aug 2012 18:25 | Edited by: Paul 
main_header.tpl? Well, not sure if I know the template of such filename in miniBB :) I suppose, you mean templates/main_header.html...

If so, I'm also afraid there is no simple way to get the number of user topics in the default version.
You may try to modify bb_cookie.php for that.

Look up for the following string:


It should be extended to have the other field after it:

$GLOBALS['dbUserSheme']['num_posts'][1].', '.$GLOBALS['dbUserSheme']['num_topics'][1]

Then where it says


add the following:


for example, for the admin procedure, it should look like:


for regular users procedure, it may look by default like:


Only after you have updated this file, you may refer to the topics amount in any template as to:


Author tom322
Active Member
#3 | Posted: 10 Aug 2012 18:31 | Edited by: tom322 
Yes, sorry - that's what happens what posting without coffee, I meant main_header.html ;).

Not the first time something seemed simple is not simple at all (except for you ;). I'll check it out and if problems will report here, thank you!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Showing the number of topics in the header
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message

Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.

Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.


miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.