Jump to content

MyBB - Auto Counting Additional Stats


Recommended Posts

Hi, I'm having a Day, lol

 

I was wondering if I could get a little more help with using this guide?

 

I'm having a failure at figuring out how to make it work. I've tried looking at similar guides but yeah. I'm just failing. x.x

 

Anyone with the time to help would be so appreciated

 

❤️

 

 

HaLp2lk.png
October-2017.png 

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Admin

I've looked at this thread a dozen times. Unfortunately, without an example its hard to assist with why its not working. The guide is pretty clear.

0_mainsignature.jpg

image.png

Profile set made by myself and original Artwork by Fae Merriman, my daughter.

 

 

Link to comment
Share on other sites

  • 2 weeks later...

I really don't understand it and I know there is like, one thing I'm missing to make it all click into place and I feel dumb as dirt. But I simply cannot get it to work.

 

I have the php:

 

$countquery = $db->fetch_field(
	$db->query("
		SELECT COUNT(*) as countquery
		FROM ".TABLE_PREFIX."users
		WHERE ".TABLE_PREFIX."users.usergroup IN (10,11,12,13,14)
	"), 'countquery');

 

I'm putting it inside <?php code here ?> like so

 

Then I'm shoving the code above into its own template, as I have the PHP in Templates enabled.


Save.

 

Then I call the template into the index template via the following:  <template census> 

(which works with various other templates, so I know that's not the issue)

 

When I load the page up, its dead: 

b4ca07274f7b176819745e00570999d3.png

 

If I remove the <?php ?> portion, so its just text, it is called forth and makes my page ugly:

 

74956070350359bc5eac6cb282977161.png'

 

So it is working. But it isn't. And I'll be damned if I can figure out what on earth I'm doing wrong :(

 

I'm running:

MyBB 1.8.24

PHP 7.1.33

HaLp2lk.png
October-2017.png 

Link to comment
Share on other sites

  • 2 weeks later...

Hi!

 

I've been off the earth for a while but I'm here to help if needed still.

 

The only thing I can think is possibly the code itself is being a pain about format. Try

<?
$countquery = $db->fetch_field(
	$db->query("
		SELECT COUNT(*) as countquery
		FROM ".TABLE_PREFIX."users
		WHERE ".TABLE_PREFIX."users.usergroup IN (10,11,12,13,14)
	"), 'countquery');
?>

 

If you have further questions please contact my discord Tay#8632 directly. Once we sort out the issue here I can post the fix here so if others have it as well they can figure it out. :)

 

@ThistleProse

wcc_aff_one.png.ee644d7c84e4471ab7231d79aa59872c.png freerphostaffbutton.png.2c941043f4d1bcb22ada2b22d3e60dfc.png myrpg-affiliate.png.5453a73021a9354b5b772ac4e15f7ef9.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.