Path

ez.no / developer / contribs / template plugins / topauthors


topauthors

Author Version Downloads Compatible with
Norman Leutner 1.1 409 3.7 (other should work too)
This template operator returns an array of users with their corresponding number of created
contentobjects of a given class id sorted by the number of objects they created.

Usefull for creating toplists

Description

Input parameters are:

$class_id
$offset
$limit

Installation:

1/ Unzip file in your extension directory

2/ Activate the extension in the admin interface

3/ To use operator in a template :


Usage:

{def $topten = topauthors($class_id,$offset,$limit)}

This one returns the top 10 users with the most created folders:

{def $topten = topauthors('1','0','10')}

Changelog

2006-02-22 fixed against SQL injection / can now be used with $limit, $offset as URL parameters

Comments

Suggestion: add an option to put the class name ?

Instead of the class id would make the maintenance easier and less prone to errors.

SQL injection fixed

Operator is now fixed against SQL injection when using with URL parameters

Thanks Björn for the hint...

SQL injection

don't use

$class_id
$offset
$limit

as as URL parameters. Not save.

log in or create a user account to comment.

Contribution info (stable)

Download