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. 

Edit the definition of the $reputation_factor 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-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.)
