OK for a few day I've been trying to work out how to deduct userpoints from users for downloading and the few suggestion floating around are just not workable in my case. I think I may have come up with a half solution but unfortunately I can't code.

The following php is from the userpointsapi documentation

<?php
if (module_exists('userpoints')) {
  // Number of points to give to a user for viewing this page
  $num_of_points = -10;
  userpoints_userpointsapi($num_of_points);
} else {
  echo "<p>Userpoints is disabled!</p>";
}
?>

If included in page, the loading of that page will execute and deduct the points, however I have no idea how to redirect every download link created by the 'Audio module' and even if I did then the new page would need a link to the file and there will be thousands, not practical!

Ok please bear with me here I will try to explain(not a coder). Mysite http://samplesimon.co.uk as you see has listed audio files with download link when the link is clicked it hits(although not shown in browser) a url like http://samplesimon.co.uk/audio/download/54/The_Blues_Project_-_Flute_Thi... which brings up the browsers download dialogue.

Is there away to execute the code at the top of this post when a user clicks the download link or a way that it can be executed at say http://samplesimon.co.uk/audio/download/* (which all downloads should hit I guess). WITHOUT any visable difference to the user i.e no ugly page redirecting?

As I say I'm not a coder but is any of this possible and how to do it, a few people seem to require this exact fuction but the module developer has said that he will not implement any such function, interestingly there are not audio sharing mods on joomla that do this either and they also have people asking for it.

Please advise help if you can.

many thanks in advance