MyBB Community Forums

Full Version: How to count posts/threads of selected forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to assign some group promotions and want users to post xthreads/posts in selected forum to get it. 
I read this already that how to not count posts in selected forums
But i need to count post on selected forums for promotions
u get a usergroup promotion for posting x posts/threads in y forum.

No matter you have 1000 posts overall but if you do not have x posts in y forum you cannot be promoted.
Hope i get it solve from experts.
Thanks
$count = $db->write_query( "SELECT COUNT(*) AS totalthreads FROM ".TABLE_PREFIX."threads WHERE fid='FID HERE' || fid='ANOTHER FID HERE' ");
$totalthreads = my_number_format($db->fetch_field($count, "totalthreads"));
Where to put tht code
In any template? 
Can u pls explain

Experts /Staff
Anyone?
Do some one know how to achieve this?
(2015-09-17, 10:01 PM)basha Wrote: [ -> ]Where to put tht code
In any template? 
Can u pls explain

Experts /Staff
Anyone?
Do some one know how to achieve this?

in index ? if yeah then put that code in index.php below -> $lang->load('index');

and then goto your templates>any template you wanna show count in > add {$totalthreads} <-- that variables where you wanna display the counts.
(2015-09-17, 07:43 PM)basha Wrote: [ -> ]I need to assign some group promotions and want users to post xthreads/posts in selected forum to get it. 
I read this already that how to not count posts in selected forums
But i need to count post on selected forums for promotions
u get a usergroup promotion for posting x posts/threads in y forum.

No matter you have 1000 posts overall but if you do not have x posts in y forum you cannot be promoted.
Hope i get it solve from experts.
Thanks

You need a plugin for getting a promotion conditions like that.
(2015-09-18, 10:55 AM)linkzy Wrote: [ -> ]in index ? if yeah then put that code in index.php below -> $lang->load('index');
But no i dont wanna mess up my index template for that even if it doesnt work than what all forum will collapse.

(2015-09-18, 03:44 PM)RateU Wrote: [ -> ]You need a plugin for getting a promotion conditions like that.

And where do i get that because there is no plugin yet . I've searched alot and then i post.
(2015-09-18, 03:59 PM)basha Wrote: [ -> ]And where do i get that because there is no plugin yet .

You can try this plugin. It was made for 1.6, so maybe you need to change the compatibility of the plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=1296
(2015-09-18, 04:04 PM)RateU Wrote: [ -> ]You can try this plugin. It was made for 1.6, so maybe you need to change the compatibility of the plugin:
http://mybbhacks.zingaburga.com/showthread.php?tid=1296

Thanks mate i downloaded it and see if it works on 1.8 btw this is exactly the thing which i wanted, I hope it'll work
(2015-09-18, 03:59 PM)basha Wrote: [ -> ]
(2015-09-18, 10:55 AM)linkzy Wrote: [ -> ]in index ? if yeah then put that code in index.php below -> $lang->load('index');
But no i dont wanna mess up my index template for that even if it doesnt work than what all forum will collapse.

(2015-09-18, 03:44 PM)RateU Wrote: [ -> ]You need a plugin for getting a promotion conditions like that.

And where do i get that because there is no plugin yet . I've searched alot and then i post.

just keep a backup. and it wont mess up as i have tried these stuffs already. or else just make new plugin with that code and run it by using that variable.