List

Try: ca/tecreations/ViewFile.php


<?php

function getProjectDownloadsCount() { 
    global $demo_db, $DOCROOT, $TEC_PREFIX_DIR;
    require_once $DOCROOT . $TEC_PREFIX_DIR . "demo_site_full_pub/demo_db.php";

    global $demo_DB_NAME, $projectJarPath;
    
    $result = $demo_db->select("SELECT count FROM downloads WHERE abspath='$projectJarPath'");
    if (empty($result['rows'])) {
        $demo_db->issue("REPLACE INTO downloads (count,abspath) VALUES('0','$projectJarPath')");
        return 0;
    } else {
        if ($result['count'] == '1') {
            $row = $result['rows'];
            $count = $row['count'];
            return $count;
        }
    }
}
?>
<script>
function incTec8(referrer) {
    setTimeout(
        function() {
            window.location.href="/ca/tecreations/demo_site_full_pub/incrementProjectDownloads.php?referrer=" + referrer
        }
        ,5000
    );
}

function getDownloadsIdentifer(var count) {
   return "Downloads: " + count;
}

function getLIGHTGREENDownloadsCount(var count) { // additive, so in java, php, shouldn't be any comments, but you tell me.
    return "<span class='LIGHTGREEN'>" + getDownloadsIdentifier(count) + "</span>";
}
</script>
<script>
$('a#tec8_download').attr({target: '_blank', 
                    href  : 'https://tecreations.ca/ca/tecreations/tec8.jar'});
</script>