Not Solved [How To?] How to grab users post count, reputation and referred?
#1
Not Solved
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.
Reply
#2
Not Solved
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']}
Reply
#3
Not Solved
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?
Reply
#4
Not Solved
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']));
Reply
#5
Not Solved
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.
Reply
#6
Not Solved
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.
Reply
#7
Not Solved
Thanks, it installed however it says there's 0 settings for it and {$forumteamonline} does nothing
Reply
#8
Not Solved
Ah, try with this version: http://hastebin.com/acobeqilan.php
Reply
#9
Not Solved
That works! Thanks heaps.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)