Navigation Menu

Skip to content

jmdeldin/jmd_count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

jmd_count: Count stuff.

Forum thread, git
repo

This plugin counts rows in Textpattern tables and plugin-created tables.

<txp:jmd_count table="table_name" where="where_clause"/>

Attribute Available values Default value
table Existing MySQL table
where Valid WHERE clause

Example: Return the number of pending articles:

<txp:jmd_count table="textpattern" where="Status=3"/>

<txp:jmd_if_count eval="comparison" table="table_name" where="where_clause">

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>

<txp:jmd_count_value/>

No attributes. Returns the value from jmd_if_count.

Example: Site statistics

<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 :).

About

Textpattern plugin: Count stuff. (OLD, UNSUPPORTED)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages