Count total credits
Started by Maeko

Posts:349
Tokens:
Reputation: 8
Go away
Administrators
Posts:349
Joined:Jan 2017
Reputation: 8
433
Tokens:
One Week OnlinePiggy BankHalloween Event 2017
01-25-2017, 03:41 PM
Might be useful to some statistics or some shit, but here's how to count the total credits (newpoints is required to make this work)

PHP Code:
$sum_credits $db->fetch_field$db->simple_select'users''SUM(newpoints) AS creditsfound' ), 'creditsfound' );
$credits number_format$sum_credits ); 

* If you encounter any errors, let me know.

NOTE: If you'd like to use the variable {$credits} everywhere, beware the query will run on ALL pages. Add the code to global.php

Posts:3
Tokens:
Reputation: 0
Member
Posts:3
Joined:Mar 2017
Reputation: 0
6
Tokens:
04-05-2017, 05:22 AM
Total credits as in a sum of everybody's credits or an individual?

Posts:349
Tokens:
Reputation: 8
Go away
Administrators
Posts:349
Joined:Jan 2017
Reputation: 8
433
Tokens:
One Week OnlinePiggy BankHalloween Event 2017
04-05-2017, 08:01 AM
(04-05-2017, 05:22 AM)Trust Wrote: Total credits as in a sum of everybody's credits or an individual?

Everybody's credits

Posts:33
Tokens:
Reputation: 4
Member
Posts:33
Joined:Jul 2017
Reputation: 4
77
Tokens:
07-02-2017, 09:26 AM (This post was last modified: 07-02-2017, 09:27 AM by Blue. Edit Reason: Derp )
(04-05-2017, 08:01 AM)Sam Wrote:
(04-05-2017, 05:22 AM)Trust Wrote: Total credits as in a sum of everybody's credits or an individual?

Everybody's credits

This is a variable already in the newpoints market I think {$credits} in the newpoints.php is what tells you


---

Never mind I only read 10% of everything :/
"Don't try to be what you're not. If you're nervous, be nervous. If you're shy, be shy. It's cute."

- Adriana Lima

Posts:44
Tokens:
Reputation: 0
Leave the world behind
Posts:44
Joined:Dec 2016
Reputation: 0
102
Tokens:
09-09-2017, 03:58 PM
Where do you exactly paste this?

Posts:32
Tokens:
Reputation: 0
Judgement
Elite
Posts:32
Joined:Sep 2017
Reputation: 0
69
Tokens:
09-10-2017, 09:21 AM
(09-09-2017, 03:58 PM)Jason Wrote: Where do you exactly paste this?

I assume in the newpoints.php
“What you do speaks so loudly that I cannot hear what you say.”



~Ralph Waldo Emerson

Posts:44
Tokens:
Reputation: 0
Leave the world behind
Posts:44
Joined:Dec 2016
Reputation: 0
102
Tokens:
09-10-2017, 05:29 PM
Which line though?

Posts:32
Tokens:
Reputation: 0
Judgement
Elite
Posts:32
Joined:Sep 2017
Reputation: 0
69
Tokens:
09-10-2017, 07:22 PM
(09-10-2017, 05:29 PM)Jason Wrote: Which line though?

That I couldn't tell you
“What you do speaks so loudly that I cannot hear what you say.”



~Ralph Waldo Emerson

Posts:349
Tokens:
Reputation: 8
Go away
Administrators
Posts:349
Joined:Jan 2017
Reputation: 8
433
Tokens:
One Week OnlinePiggy BankHalloween Event 2017
10-10-2017, 02:02 PM
(09-10-2017, 05:29 PM)Jason Wrote: Which line though?

Global.php

You can add it under this piece of code:
Code:
$mybb->user['ismoderator'] = is_moderator(0, '', $mybb->user['uid']);





Users browsing this thread: 1 Guest(s)