if your script is based on php session, then you can avoid multiple view count by same user.
in old script even if you refresh the page the view is counted. so by using the below script you can avoid it :)
in old script even if you refresh the page the view is counted. so by using the below script you can avoid it :)
//page views
$pvkey_var = "v_".$id;
if(!isset($_SESSION[$pvkey_var])){
$_SESSION[$pvkey_var] = 0;
}
if (is_valid_id($id) && isset($CURUSER)){
if($_SESSION[$pvkey_var] == 1){ }
else {
SQL_Query_exec("UPDATE torrents SET views = views + 1 WHERE id = $id");
$_SESSION[$pvkey_var] = 1;
}
}
follow the thread for updates
checkout my project: https://bvlist.com/showthread.php?t=12349
checkout my project: https://bvlist.com/showthread.php?t=12349
Last edited by JohnHasher on 2022-01-08 18:16:53
