Home > jmd_count

jmd_count

Jmd_count is a project mainly written in PHP, it's free.

Textpattern plugin: Count stuff. (OLD, UNSUPPORTED)

h1. jmd_count: Count stuff.

"Forum thread":http://forum.textpattern.com/viewtopic.php?pid=180208, "git repo":http://github.com/jmdeldin/jmd_count/

This plugin counts rows in "Textpattern tables(Table reference)":http://textpattern.net/wiki/index.php?title=Database_Schema_Reference and plugin-created tables.

h2. @@

|. Attribute |. Available values |_. Default value | | @table@ | Existing MySQL table | -- | | @where@ | Valid @WHERE@ clause | -- |

h3. Example: Return the number of pending articles:

bc.

h2. @@

Same attributes as @jmd_count@ with the addition of @eval@.

|. Attribute |. Available values |. Default value |. Description | | @eval@ | "Comparison operators":http://php.net/operators.comparison | -- | Compare the counted rows to @eval@ (e.g., @eval=">=1"@) |

bc. Whoah! forms is ridonkulous. </txp:jmd_if_count>

h2. @@

No attributes. Returns the value from @jmd_if_count@.

h2. Example: Site statistics

bc..

<tr>
    <td>Live articles</td>
    <td>
        <txp:jmd_count table="textpattern" where="Status = 4"/>
    </td>
</tr>
<tr>
    <td>Comments</td>
    <td>
        <txp:jmd_count table="txp_discuss" where="visible = 1"/>
    </td>
</tr>
<tr>
    <td>Images</td>
    <td>
        <txp:jmd_count table="txp_image"/>
    </td>
</tr>
<tr>
    <td>Files</td>
    <td>
        <txp:jmd_count table="txp_file"/>
    </td>
</tr>
<tr>
    <td>Site hits</td>
    <td>
        <txp:jmd_count table="txp_log"/>
    </td>
</tr>

Item Count

p. Tip: Combine jmd_count with "jmd_dashboard":http://jmdeldin.com/#txp :).

Previous:ept.github.com