Hi there, I haven't fully dived into this on the database side of things yet, but wondered if someone might be able to explain it to me as I start doing that.
We are running MT 4.34 Pro, and our client (for accounting/budgeting reasons) needs to be able to count how many entries on their public site are of type A or type B. So we created a new field for "Entries" that is a simple radio button with the two values, and it defaults to one of the values.
So I figured I would just hand write a little PHP page that queries the database to give a running tally of ALL entries, broken down by those of type A and those of type B, giving a % calculation next to each.
Can someone point me to the best place to find our use of this field in the MySQL database itself? I don't need you to write out a SQL query for me, but where is my new, custom field actually stored?
Reported on Movable Type 4.3
Hi, Neal,
I'd like to recommend you to use MT's original tag, to display numbers of all published entries.
http://www.movabletype.org/documentation/appendices/tags/blogentrycount.html
You can use "include_blogs" modifier to indicate including blogs.
For example, there are two blogs and their blog's id is 2 and 3 each, then you can get the numbers of all published entries
<mt:BlogEntryCount include_blogs="all">
or
<mt:BlogEntryCount include_blogs="2,3>
More usage information is available at Japanese MT document.
http://www.movabletype.jp/documentation/appendices/tags/blogentrycount.html
Besides that, entry's custom-field data is ordinary placed to "mt_entry_meta" table. So please check this table with your sql client software, such as phpMyAdmin.
----------------------------------
MTJ
Information of MovableType and MTOS from Japan
http://www.mt-j.info
----------------------------------
You can do this with standard template tags, setting and retrieving some variables, and using available modifiers/operators to do a little math and formatting. I've used the more specific <mt:EntriesCount> tag to find the number of entries of each type (returning the number of entries in the context of the <mt:Entries> listings.
This example assumes that the basenames for your custom fields are "field_a" and "field_b" - just change the <mt:Entries> tags if they are not. It also assumes you have less than 9999 of each type of entry.
For each entry type, create the context for each, and count how many entries:
Set a variable for the number of entries in the entire blog:
Number of A entries (retrieving the variable set earlier):
Number of B entries:
Do some math, and work out what fraction of the A is of the total entries (using the variable set earlier), and then multiplying by 100 to get a percentage, and then finally formatting to 2 decimal places.
And the same for B entries: