<commit_before><?php

//SHTracker, Copyright <NAME> (http://sidhosting.co.uk/projects/shtracker)

ob_start();

?>
<html>
<head>
<title>SHTracker</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<script type="text/javascript">
$(document).ready(function() { 
    $("#downloadurl").delay(5100).fadeIn("fast");
    $("#downloadurlwait").delay(5000).fadeOut("fast");
});
</script>
<?php

//Connect to database
require_once("config.php");

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$con) {
    die("Could not connect: " . mysql_error());
}

mysql_select_db(DB_NAME, $con);

//Accept POST or GET
if (isset($_GET["id"])) {
    $id = mysql_real_escape_string($_GET["id"]);
} else {
    $id = mysql_real_escape_string($_POST["id"]);
}

//Check ID is not blank
if (empty($id)) {
    die("<h1>SHTracker: Error</h1><p>ID cannot be blank.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
}

//Check if ID exists
$getinfo = mysql_query("SELECT name, url FROM Data WHERE id = \"$id\"");
$getresult = mysql_fetch_assoc($getinfo); 
if ($getresult == 0) { 
    die("<h1>SHTracker: Error</h1><p>ID does not exist.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
}

if (COUNT_UNIQUE_ONLY_STATE == "Enabled") {
    if (!isset($_COOKIE["shtrackerhasdownloaded$id"])) {
        mysql_query("UPDATE Data SET count = count+1 WHERE id = \"$id\"");
        setcookie("shtrackerhasdownloaded$id", "True", time()+3600*COUNT_UNIQUE_ONLY_TIME);
    }
} else {
    mysql_query("UPDATE Data SET count = count+1 WHERE id = \"$id\"");
}

//Check if download is password protected
$checkprotected = mysql_query("SELECT protect, password FROM Data WHERE id = \"$id\"");
$checkprotectedresult = mysql_fetch_assoc($checkprotected); 
if ($checkprotectedresult["protect"] == "1") { 
    if (isset($_POST["password"])) {
        if (sha1($_POST["password"]) != $checkprotectedresult["password"]) {
            die("<h1>SHTracker: Error</h1><p>Incorrect password.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
        }
    } else {
        echo "<h1>Downloading " . $getresult["name"] . "</h1>
        <form method=\"post\">
        <p>To access this download please enter the password you were given.</p>
        <p>Password: <input type=\"password\" name=\"password\" /></p>
        <input type=\"submit\" value=\"Get Download\" /></p></form>
        <hr />
        <p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p>
        </body>
        </html>";
        exit;
    }
}


//Check if we should show ads
$checkifadsshow = mysql_query("SELECT showads FROM Data WHERE id = \"$id\"");
$checkifadsshowresult = mysql_fetch_assoc($checkifadsshow); 
if ($checkifadsshowresult["showads"] == "1") { 
    $adcode = htmlspecialchars_decode(AD_CODE); 
    echo "<h1>Downloading " . $getresult["name"] . "</h1><p>" . $adcode . "</p><hr /><div id=\"downloadurlwait\"><p>Your download will be ready shortly...</p></div><div id=\"downloadurl\" style=\"display: none\"><p><a href=\"" . $getresult["url"] . "\">Start Download</a></p></div></body></html>";
    exit;
}


mysql_close($con);

//Redirect user to the download
header("Location: " . $getresult["url"] . "");
ob_end_flush();
exit;

?>
</body>
</html><commit_msg>Some cool love for get<commit_after><?php

//SHTracker, Copyright <NAME> (http://sidhosting.co.uk/projects/shtracker)

ob_start();

?>
<html>
<head>
<title>SHTracker</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<meta name="robots" content="noindex, nofollow">
</head>
<body>
<script type="text/javascript">
$(document).ready(function() { 
    var count = 5;
    countdown = setInterval(function(){
        $("#counterplacholder").html("<p>Your download will be ready in " + count + " second(s)</p>");
        if (count <= 0) {
            clearInterval(countdown);
            $("#counterplacholder").fadeOut("fast");
            $("#downloadurl").delay(500).fadeIn("fast");
        }
        count--;
    }, 1000);
});
</script>
<?php

//Connect to database
require_once("config.php");

$con = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if (!$con) {
    die("Could not connect: " . mysql_error());
}

mysql_select_db(DB_NAME, $con);

//Accept POST or GET
if (isset($_GET["id"])) {
    $id = mysql_real_escape_string($_GET["id"]);
} else {
    $id = mysql_real_escape_string($_POST["id"]);
}

//Check ID is not blank
if (empty($id)) {
    die("<h1>SHTracker: Error</h1><p>ID cannot be blank.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
}

//Check if ID exists
$getinfo = mysql_query("SELECT name, url FROM Data WHERE id = \"$id\"");
$getresult = mysql_fetch_assoc($getinfo); 
if ($getresult == 0) { 
    die("<h1>SHTracker: Error</h1><p>ID does not exist.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
}

if (COUNT_UNIQUE_ONLY_STATE == "Enabled") {
    if (!isset($_COOKIE["shtrackerhasdownloaded$id"])) {
        mysql_query("UPDATE Data SET count = count+1 WHERE id = \"$id\"");
        setcookie("shtrackerhasdownloaded$id", "True", time()+3600*COUNT_UNIQUE_ONLY_TIME);
    }
} else {
    mysql_query("UPDATE Data SET count = count+1 WHERE id = \"$id\"");
}

//Check if download is password protected
$checkprotected = mysql_query("SELECT protect, password FROM Data WHERE id = \"$id\"");
$checkprotectedresult = mysql_fetch_assoc($checkprotected); 
if ($checkprotectedresult["protect"] == "1") { 
    if (isset($_POST["password"])) {
        if (sha1($_POST["password"]) != $checkprotectedresult["password"]) {
            die("<h1>SHTracker: Error</h1><p>Incorrect password.</p><hr /><p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p></body></html>");
        }
    } else {
        echo "<h1>Downloading " . $getresult["name"] . "</h1>
        <form method=\"post\">
        <p>To access this download please enter the password you were given.</p>
        <p>Password: <input type=\"password\" name=\"password\" /></p>
        <input type=\"submit\" value=\"Get Download\" /></p></form>
        <hr />
        <p><a href=\"javascript:history.go(-1)\">&larr; Go Back</a></p>
        </body>
        </html>";
        exit;
    }
}


//Check if we should show ads
$checkifadsshow = mysql_query("SELECT showads FROM Data WHERE id = \"$id\"");
$checkifadsshowresult = mysql_fetch_assoc($checkifadsshow); 
if ($checkifadsshowresult["showads"] == "1") { 
    $adcode = htmlspecialchars_decode(AD_CODE); 
    echo "<h1>Downloading " . $getresult["name"] . "</h1><p>" . $adcode . "</p><hr /><div id=\"counterplacholder\"></div><div id=\"downloadurl\" style=\"display: none\"><p><a href=\"" . $getresult["url"] . "\">Start Download</a></p></div></body></html>";
    exit;
}


mysql_close($con);

//Redirect user to the download
header("Location: " . $getresult["url"] . "");
ob_end_flush();
exit;

?>
</body>
</html>
{'fraction_non_alphanumeric': 0.22138139790864061, 'fraction_numerical': 0.00976884975233902, 'mean_word_length': 3.9448979591836735, 'pattern_counts': {'":': 0, '<': 174, '<?xml version=': 0, '>': 173, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '25445', 'n_tokens_mistral': 2499, 'n_tokens_neox': 2463, 'n_words': 511}