pm_user_info for TXP
January 5th, 2007 by Thomas JosephThis is another Textpattern plugin from PublishMedia.info. It’s in very early stages in development and is poorly designed in some respects, but it does the job it’s supposed to do and that is why I’m making it available to others but not listing it on Textpattern Resources yet.
pm_user_info is a simple plugin which can display certain information about members of your website. It was designed to work in conjunction with other plugins which bring membership of a Textpattern site to the front-end. It can easily be adapted to work with the ign_users database table simply by changing the name of the table in the SQL queries. This plugin has only been tested with Textpattern version 4.0.3.
Encoded plugin: pm_user_info_v01.txt
PHP code: pm_user_info_v01.phpx
Attributes:
info
- mem_count - returns the number of members.
- recent_logins - returns a list of recent logins.
- mem_email - returns a list of user names and email addresses.
wraptag
- [HTML_tag] - If a list is being produced this will be the tag which the list is contained within, e.g. ‘ul’, ‘p’ or ‘ol’. If left unset will default to the paragraph tag.
wraptag_class
- [CSS_class] - the CSS class you want to assign to the wraptag.
breaktag
- [HTML_tag] - If a list is being produced this is the tag which will break up the components, e.g. ‘li’. Defaults to a line break.
limit
- [list_length] - a numerical value which will be the length of any list which is produced, e.g. ‘5′ or ‘200′. The default is unlimited.
Example Usage:
<txp:pm_user_info info="mem_count" />
returns the number of members your site has.
<txp:pm_user_info info="recent_logins" />
returns an list of unlimited length using <br /> as the break tag and <p> as the wrap tag.
Example return:
<p>
<em>Tom</em> last logged in at 2006-12-28 22:21:08<br />
<em>bob</em> last logged in at 2006-12-26 13:51:18<br />
<em>Dave</em> last logged in at 2006-12-10 22:45:33<br />
</p>
<txp:pm_user_info info="mem_email" wraptag="ul" wraptag_class="user_email_list" breaktag="li" limit="2" />
returns an list with a length of 2 using <li> as the break tag, <ul> as the wrap tag with user_email_list as the wrap tag’s class.
Example return:
<ul class="user_email_list">
<li><em>Tom</em> <tom@thistomthattom.tom></li>
<li><em>bob</em> <bob@thisbobthatbob.bob></li>
</ul>
Changelog
- v0.1 - 05 Jan 07 - initial release