Sample plug-ins for LDM to adjust users' downloads according to their behaviour/reputation/posts/etc.

Plugins limitaccess-byhits-plugin.xml and limitaccess-byposts-plugin.xml
add control settings to the LDM admin settings page

Plugins limitaccess-byreputation-plugin.xml and limitaccess-specificusers-plugin.xml
are adjusted by editing the code

Plugin limitaccess-unregistered-plugin.xml has no adjustable parameters


>>> limitaccess-byhits-plugin.xml
---------------------------------

When installed and active, plugin limits download access of users from selected usergroup.
(The plugin does not limit access to links - ie LDM entries that do not have recognised mimetypes.)

Note that the plugin can only count hits when 'hit' records are still stored in your downloads table, so
be careful about how aggressively you archive entries from this table within the LDM admin pages.

To change the error messages given when user is told she cannot access an entry,
modify the phrases ll_access_limited


>>> limitaccess-byposts-plugin.xml
----------------------------------

When installed and active, a user's bandwidth/file access limits are adjusted based on
the number of posts they have made.

To change the error messages given when user is told she cannot access an entry,
modify the phrases ll_access_limited_bypost and ll_access_limited24


>>> limitaccess-byreputation-plugin.xml
---------------------------------------

When installed and active, a user's bandwidth/file access limits are adjusted based on
their reputation.

The sample contains these definitions, which you should edit as required:

// Scaling factors/increments applied at different reputation levels
// Example: require reputation 10 before any allowances are granted, double the u/group allowances at level 50, x10 at level 500
// Be sure to keep the first row in this array
	$reputation_factor = array(
		    0 => array('multiplybytes'=>0, 'multiplyfiles'=>0, 'addbytes'=>0, 'addfiles'=>0),
		   10 => array('multiplybytes'=>1, 'multiplyfiles'=>1, 'addbytes'=>0, 'addfiles'=>0),
		   50 => array('multiplybytes'=>2, 'multiplyfiles'=>2, 'addbytes'=>0, 'addfiles'=>0),
		  500 => array('multiplybytes'=>10, 'multiplyfiles'=>10, 'addbytes'=>0, 'addfiles'=>0),
		);

// --- Exclude these usergroups from the limits
	$exclude_groups = array(
	    6,
	    );

With these settings, all users' download allowances (except for admins) are scaled
according to their reputation, e.g. in this case a user with reputation 75
would have double the standard bytes allowance and double
the standard files allowance.  Users with reputations less than 10 will have
no allowance.


>>> limitaccess-specific-users-plugin.xml
---------------------------------------

When installed and active, specific users are given individual allowances regardless of their usergroup.

Edit the definition of the $override_users array inside the plugin.  Each row of the array has two items:
- the userid in question (an integer value)
- a list of personal allowances
This list can contain one to three items - bytesdaily, filesdaily and uploadlimit

The sample contains these definitions:

'1' => array('bytesdaily' => '10M', 'filesdaily' => 40, 'uploadlimit' => '20M'),
'2' => array('bytesdaily' =>  '5M', 'filesdaily' => 20),
'3' => array('bytesdaily' =>  '5M'),

Userid 1 is limited to 10Mbytes and 40 files downloads a day and 20Mbytes uploads
Userid 2 takes his normal usergroup limits (if any) on uploads, and has 5Mbytes and 20 files downloads
Userid 3 has 5Mybytes downloads a day, and otherwise his usergroup allowances


>>> limitaccess-unregistered-plugin.xml
---------------------------------------

When installed and active, unregistered users collectively share the download limits and bandwidth allowances
for the 'unregistered' usergroup.  (By default, each unregistered user would be given the total allowance,
filtered according to his/her IP address.)
