mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-10 01:59:03 +02:00
dont track range requests
This commit is contained in:
parent
766de1570a
commit
4432e840d1
@ -2,18 +2,21 @@
|
||||
|
||||
function XFastDownload($location, $filename, $mimeType = 'application/octet-stream')
|
||||
{
|
||||
$url = "https://www.google-analytics.com/collect";
|
||||
$payload = "v=1&tid=UA-73200448-1&cid=" . session_id() . "&t=pageview&dh=" . $_SERVER['HTTP_HOST'] . "&dp=" . urlencode($_SERVER['REQUEST_URI']) . "&uip=" . $_SERVER['REMOTE_ADDR'] . "&ua=" . urlencode($_SERVER["HTTP_USER_AGENT"]) . "&dr=" . urlencode($_SERVER["HTTP_REFERER"]);
|
||||
if(!isset($_SERVER["HTTP_RANGE"]))
|
||||
{
|
||||
$url = "https://www.google-analytics.com/collect";
|
||||
$payload = "v=1&tid=UA-73200448-1&cid=" . session_id() . "&t=pageview&dh=" . $_SERVER['HTTP_HOST'] . "&dp=" . urlencode($_SERVER['REQUEST_URI']) . "&uip=" . $_SERVER['REMOTE_ADDR'] . "&ua=" . urlencode($_SERVER["HTTP_USER_AGENT"]) . "&dr=" . urlencode(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "");
|
||||
|
||||
$ch = curl_init();
|
||||
$ch = curl_init();
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_exec($ch);
|
||||
curl_close ($ch);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_exec($ch);
|
||||
curl_close ($ch);
|
||||
}
|
||||
|
||||
$expire = 604800;
|
||||
|
||||
|
@ -13,7 +13,10 @@
|
||||
include_once('download2.php');
|
||||
XFastDownload(_UPLOADDIR . $f->hash160, $f->filename, $f->mime);
|
||||
|
||||
$db->AddView($f->hash160);
|
||||
if(!isset($_SERVER["HTTP_RANGE"]))
|
||||
{
|
||||
$db->AddView($f->hash160);
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
|
@ -57,7 +57,7 @@ function addPasteFunctions()
|
||||
|
||||
function loadHistory(){
|
||||
var hist = localStorage.getItem("history");
|
||||
if(hist.length > 0) {
|
||||
if(hist !== null && hist.length > 0) {
|
||||
hist = JSON.parse(hist);
|
||||
} else {
|
||||
hist = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user