Quote:
Originally Posted by CHIngs
thanx for considering it for future versions. But I was kinda looking for a instant solution. I just need some starters, like database table should be made and some starters. I know its very similar to how the hits work. I tried it and it was saving time and stuff in the database but it was not disallowing downloads if a user click on the links below 60 seconds. I think partly because the hits system works on PER-FILE basis, I was kinda trying making it work globally, for all files.
|
What you've seen in the code is to disallow double recording of a hit in the database if the user clicks the same link twice in quick succession - I found that we were recording multiple hits if people got tired or were trigger happy.
If you're looking to prohibit multiple hits, then you have to put some similar code in another place. Go down to the lines that read
PHP Code:
if ($_REQUEST['action'] == "jump" or $_REQUEST['action'] == "stream") {
$time = TIMENOW;
unset($url);
and add something like:
PHP Code:
$jumplink = $DB_site->query("
SELECT * FROM ".THIS_TABLE."linksdownloads
WHERE userid='$userid'
ORDER BY usertime DESC
LIMIT 1
");
while ($jump=$DB_site->fetch_array($jumplink)) {
if ($time-$jump['usertime']) < YOUR_LIMIT) {
eval(print_standard_error('You will have to wait...',0));
exit;
}
exit;
}