MyBB Community Forums

Full Version: How to grab users post count, reputation and referred?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
So I'm trying to get the users post count to display for them directly on the index so they don't have to go somewhere else if they'd like to check. I'd also like to have total reputation and members referred showing here. (see below)
[Image: FKXtxbs.png]

I've tried numerous things but as I'm not entirely experienced with MyBB I haven't had the best of luck.
Thanks in advance,
Z.
postnum

<a href="{$mybb->settings['bburl']}/search.php?action=finduser&uid={$mybb->user['uid']}">{$mybb->user['postnum']}</a>



theadnum

<a href="{$mybb->settings['bburl']}/search.php?action=finduserthreads&uid={$mybb->user['uid']}">{$mybb->user['threadnum']}</a>



reputation

<a href="{$mybb->settings['bburl']}/reputation.php?uid={$mybb->user['uid']}">{$mybb->user['reputation']}</a>



referrals

{$mybb->user['referrals']}
Thanks for the swift response, worked perfectly!
Now what I'm trying to do is add a board stat for total thread count as such
[Image: A5q0E9G.png]

I've added "$l['stats_threadcount'] = 'Total Threads: {1}';" into the languages, but how do I make it so that {1} will show as the thread count?
index.php file, search:

$lang->stats_posts_threads = $lang->sprintf($lang->stats_posts_threads, my_number_format($stats['numposts']), my_number_format($stats['numthreads']));

add after:

$lang->stats_threadcount = $lang->sprintf($lang->stats_threadcount, my_number_format($stats['numthreads']));
Awesome man, thanks.
Okay one last question. How can I grab staff online?
[Image: zMSXqJi.png]

I've tried using a plugin but whenever I'd try to install I'd receive the following two errors
SQL Error:
1366 - Incorrect integer value: 'NULL' for column 'gid' at row 1
Query:
INSERT INTO mybb_settinggroups (`gid`,`name`,`title`,`description`,`disporder`,`isdefault`) VALUES ('NULL','forumteamonline','Forum team online','Settings for plugin: Forum team online.',29,'0')
SQL Error:
1366 - Incorrect integer value: 'NULL' for column 'sid' at row 1
Query:
INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`,`isdefault`) VALUES ('NULL','forumteamonline_onoff','Plugin ON?','','onoff','1','1',31,'0'), ('NULL','forumteamonline_portal_onoff','Plugin portal enable?','With this option, you enable or disable the plugin on portal page.','onoff','1','1',31,'0'), ('NULL','forumteamonline_index_onoff','Plugin index enable?','With this option, you enable or disable the plugin on index page.','onoff','1','1',31,'0'), ('NULL','forumteamonline_avatar_onoff','Show avatar?','','onoff','1','2',31,'0'), ('NULL','forumteamonline_avatar_width_height','Avatar width height','Exemple 32x32..','text','32x32','3',31,'0'), ('NULL','forumteamonline_members_limit','Limit sers to display','','numeric','10','4',31,'0'), ('NULL','forumteamonline_sort_by','Sortuj users by','','select 0=User ID ascending , ascending user group 1=User ID ascending 2=User group ascending 3=User name ascending 4= Group disporder ascending 5=User group descending 6=User group descending 7=User name descending 8=Group disporder descending ','0','5',31,'0'), ('NULL','forumteamonline_stats_onoff','Show stats?','','onoff','1','6',31,'0')

How can I fix these, OR how can I just grab staff online without a plugin?
Thanks.
Open the plugin file forumteamonline.php, search for:

"NULL"

and replace with:

NULL

There are about 15 occurences.

Or, ask your hosting provider to disable MySQL Strict mode.
Thanks, it installed however it says there's 0 settings for it and {$forumteamonline} does nothing
Ah, try with this version: http://hastebin.com/acobeqilan.php
That works! Thanks heaps.