This plugin counts rows in Textpattern tables and plugin-created tables.
Attribute | Available values | Default value |
---|---|---|
table |
Existing MySQL table | — |
where |
Valid WHERE clause |
— |
<txp:jmd_count table="textpattern" where="Status=3"/>
Same attributes as jmd_count
with the addition of eval
.
Attribute | Available values | Default value | Description |
---|---|---|---|
eval |
Comparison operators | — | Compare the counted rows to eval (e.g., eval=">=1" ) |
<txp:jmd_if_count eval=">30" table="txp_form">
Whoah! <txp:jmd_count_value/> forms is ridonkulous.
</txp:jmd_if_count>
No attributes. Returns the value from jmd_if_count
.
<table>
<tr>
<th>Item</th>
<th>Count</th>
</tr>
<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>
</table>
Tip: Combine jmd_count with jmd_dashboard :).